autoconf
[Top][All Lists]
Advanced

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

Re: Location of declarations in Linux vs FreeBSD, etc.


From: Philip Kovacs
Subject: Re: Location of declarations in Linux vs FreeBSD, etc.
Date: Wed, 07 Mar 2007 21:28:27 -0500
User-agent: Thunderbird 1.5.0.10 (X11/20070303)

On Monday 05 March 2007 22:47:45 Philip Kovacs wrote:

I think the thing to do is a) include both headers and be done with it or
b) code a small daemon function myself given that some unices may not have
it.

Why not use AC_LIBOBJ for option b ?

Davide Bolcioni

Yes, that is a great way to do it.

I added AC_CONFIG_LIBOBJ_DIR([lib]) to configure.ac, along with AC_REPLACE_FUNCS([daemon setsid ...]). Then I created a subdir
lib/ in my project and a lib/Makefile.am:

----Makefile.am
noinst_LTLIBRARIES = libreplace.la

libreplace_la_SOURCES =
libreplace_la_LIBADD = @LTLIBOBJS@
-----

along with source files daemon.c, setsid.c etc.

Then I added $(top_builddir)/lib/libreplace.la to the _LDFLAGS
of all Makefile.am's that need these functions.

What's cool is when you cd lib/ and issue make, it builds a libreplace.la containing *only* the functions that are not seen
during configure.

Very nice.  Thanks for the tip.

Phil




reply via email to

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