[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Forcing the linking language
From: |
Alien |
Subject: |
Re: Forcing the linking language |
Date: |
Sun, 17 Oct 2004 22:28:19 +0200 |
User-agent: |
KMail/1.6.1 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
i have a similar problem with my project,
I have to link with libode.la which holds C++ things, and it should contain C
prototypes,... but, if i do manually compile with gcc, it fails to link, but
with g++ it works, i'd like to make this go automatically with autotools, but
i don't know how...
thanks in advance,
Alien
Op vrijdag 15 oktober 2004 23:19, schreef Norman Gray:
> Greetings.
>
> Is there any way of indicating to automake which language to use when
> linking a library?
>
> I'm assembling a (shared) library using convenience libraries:
>
> lib_LTLIBRARIES = libfoo.la
> libfoo_la_SOURCES =
> libfoo_la_LIBADD = stuff/libconvenience.la
>
> Now, libconvenience.la is a convenience library of objects built from
> _Fortran_ sources. This means that the libfoo shared library should be
> assembled using the F77 or FC languages (this matters on OSX: this
> situation requires libtool's Fortran magic, since the OSX linker has a
> big downer on common blocks, and needs to be told to chill out a bit).
>
> However automake doesn't know this, so it tries to use gcc to link the
> library, which fails. Is there any way of giving it a hint, here?
>
> Using libfoo_la_LINK isn't the solution, since that would require me to
> copy the long LIBTOOL definition that automake generates (which I
> oughtn't to have to know about); manually adding --tag=F77 to the
> libtool line works, but there's no way of inserting that from within
> Makefile.am without redefining LIBTOOL (again using internals).
> There's no mechanism that seems obvious from automake.in, though I
> confess I have only a fairly sketchy idea of how it is that
> handle_single_transform_list (yes?) determines the language to use for
> the link.
>
> I've managed to get this to work by setting
>
> libfoo_la_SOURCES = dummy.f
>
> where dummy.f is a trivial Fortran routine. That tells automake that
> Fortran is involved somewhere, and it consequently does The Right
> Thing. But this seems like a bit of a hack.
>
> There's nothing leaps out from the list archives. Does anyone have any
> advice?
>
> Best wishes,
>
> Norman
>
>
> --
> ----------------------------------------------------------------------
> Norman Gray : Physics & Astronomy, Glasgow University, UK
> http://www.astro.gla.ac.uk/users/norman/ : www.starlink.ac.uk
- --
AL13N is my name and head-biting is my game
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBctXsuBWKXETrtdcRAkrHAJ4zC0EUBi1T2g6Pzqmk/HYJNlSnTQCg8CUN
+UNMAhXODZRyPm0RMltVxI0=
=7lF3
-----END PGP SIGNATURE-----