[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with library on macos X

From: Ralf Wildenhues
Subject: Re: Problems with library on macos X
Date: Fri, 22 Aug 2008 18:10:52 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]