Re: Problems with library on macos X
Hello, Sorry for my english, but what I meant was that with this piece of text in Makefile.am : lib_LIBRARIES = libliquidsurfaces.a libliquidsurfaces_a_SOURCES = LiquidSurfaces.cp LiquidSurfacesPriv.h #libliquidsurfaces_a_LIBADD = LiquidSurfaces.o include_HEADERS = LiquidSurfaces.h The generated Makefile has no object files, and that causes the error : ar cru libliquidsurfaces.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... with the empty file list on the ar command. Then I tried using the _LIBADD line. If public symbols aren't required in the resulting library, what are they anyway ? On Aug 22, 2008, at 5:10 PM, Ralf Wildenhues wrote: Hello Daniel, * Daniel Luis dos Santos wrote on Fri, Aug 22, 2008 at 12:34:23AM CEST: I am trying to build a library on a leopard machine with autoconf 2.61 and automake 10.1 from mac ports. The generated makefile has no object files and then the ar command fails with : ar cru libliquidsurfaces.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... Yep, unfortunately passing no files to 'ar cru $lib' is not portable, besides the fact that POSIX requires you to pass at least one file. You can add a dummy object with source containing static int foo; lib_LIBRARIES = libliquidsurfaces.a libliquidsurfaces_a_SOURCES = LiquidSurfaces.cp LiquidSurfacesPriv.h #libliquidsurfaces_a_LIBADD = LiquidSurfaces.o include_HEADERS = LiquidSurfaces.h I have included the .o in the commented _LIBADD but probably that won't work because no public symbols are put in the library file. I don't think anybody minds if there are no public symbols (but my memory is a bit vague here, might want to search the list archives on this). How can I tell in the makefile what are the names of the object files, instead of being derived from the Sources ? Object file names generally are an internal Automake detail, which you should have no knowledge of. (They might be renamed in the presence of per-target compile flags.) Just listing sources in lib*_SOURCES should get the objects compiled from those sources into the archive. Hope that helps. Cheers, Ralf
Re: Problems with library on macos X
Daniel Luis dos Santos wrote: Hello, Sorry for my english, but what I meant was that with this piece of text in Makefile.am : lib_LIBRARIES = libliquidsurfaces.a libliquidsurfaces_a_SOURCES = LiquidSurfaces.cp LiquidSurfacesPriv.h automake does not understand the .cp extension, try .cc, .cxx or .cpp Peter -- Peter O'Gorman http://pogma.com
Re: Problems with library on macos X
Hello Daniel, * Daniel Luis dos Santos wrote on Fri, Aug 22, 2008 at 12:34:23AM CEST: I am trying to build a library on a leopard machine with autoconf 2.61 and automake 10.1 from mac ports. The generated makefile has no object files and then the ar command fails with : ar cru libliquidsurfaces.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... Yep, unfortunately passing no files to 'ar cru $lib' is not portable, besides the fact that POSIX requires you to pass at least one file. You can add a dummy object with source containing static int foo; lib_LIBRARIES = libliquidsurfaces.a libliquidsurfaces_a_SOURCES = LiquidSurfaces.cp LiquidSurfacesPriv.h #libliquidsurfaces_a_LIBADD = LiquidSurfaces.o include_HEADERS = LiquidSurfaces.h I have included the .o in the commented _LIBADD but probably that won't work because no public symbols are put in the library file. I don't think anybody minds if there are no public symbols (but my memory is a bit vague here, might want to search the list archives on this). How can I tell in the makefile what are the names of the object files, instead of being derived from the Sources ? Object file names generally are an internal Automake detail, which you should have no knowledge of. (They might be renamed in the presence of per-target compile flags.) Just listing sources in lib*_SOURCES should get the objects compiled from those sources into the archive. Hope that helps. Cheers, Ralf
Problems with library on macos X
I am trying to build a library on a leopard machine with autoconf 2.61 and automake 10.1 from mac ports. The generated makefile has no object files and then the ar command fails with : ar cru libliquidsurfaces.a ar: no archive members specified usage: ar -d [-TLsv] archive file ... ar -m [-TLsv] archive file ... ar -m [-abiTLsv] position archive file ... ar -p [-TLsv] archive [file ...] ar -q [-cTLsv] archive file ... ar -r [-cuTLsv] archive file ... ar -r [-abciuTLsv] position archive file ... ar -t [-TLsv] archive [file ...] ar -x [-ouTLsv] archive [file ...] make[1]: *** [libliquidsurfaces.a] Error 1 make: *** [all-recursive] Error 1 The source Makefile.am is srcdir = . #bindir = $(BINDIR) lib_LIBRARIES = libliquidsurfaces.a libliquidsurfaces_a_SOURCES = LiquidSurfaces.cp LiquidSurfacesPriv.h #libliquidsurfaces_a_LIBADD = LiquidSurfaces.o include_HEADERS = LiquidSurfaces.h I have included the .o in the commented _LIBADD but probably that won't work because no public symbols are put in the library file. How can I tell in the makefile what are the names of the object files, instead of being derived from the Sources ? Help ! -- View this message in context: http://www.nabble.com/Problems-with-library-on-macos-X-tp19098289p19098289.html Sent from the Gnu - Automake - General mailing list archive at Nabble.com.