autoconf
[Top][All Lists]
Advanced

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

Re: HOWTO get content of config.h into a userdefined header (for distrib


From: Guido Draheim
Subject: Re: HOWTO get content of config.h into a userdefined header (for distribution)
Date: Sun, 7 Jan 2001 16:18:46 +0100 (MET)

I develop libraries quite a lot, and the installed headers do often
have dependencies on other system headers that may or may not be
installed there. It would be a nuisiance to write a series of
common.h.in headers if the library starts to get a little bigger.

Therefore I created the AC_PREFIX_CONFIG_H macro that will take
the generated config.h and spit out a file that has all the 
defines, ifdef'd and with a prefix. Assume your package is
called `boo`, a call to AC_PREFIX_CONFIG_H without args (of
course you can override the defaults) will produce a file
boo-config.h containing sth. like this:

#ifndef BOO_HAVE_UNISTD_H
#define BOO_HAVE_UNISTD_H
#endif

/* #undef BOO_HAVE_WINDOWS_H */

Just install this boo-config.h along with your other library
headers. Well, this one is still not finished, there are some 
problems involved that I hope someone can fix ;-)

you can find the macro in the autoconf-archive.tar.gz at
http://research.cys.de/autoconf-archive
and the latest (bugfixed?) version is inside aclocals-0.3.1.tar.gz at
http://download.sourceforge.net/pfe

have fun,
-- guido                                Edel sei der Mensch, hilfreich und
gut
31:GCS/E/S/P C++$++++ ULHS L++w- N++@  d(+-) s+a- h.r(*@)>+++ y++ PS++PE
5++X-

Uwe Hermann wrote:
> 
> On Sun, Jan 07, 2001 at 11:55:36AM +0100, Oliver wrote:
> > Hi,
> >
> > I've made a litle library-project with GNU-autoconf/make/libtool. My
library
> > depends on the content of config.h which tests for some header files.
If some
> > other project (which uses autoconf) would use my library ithe config.h
> > files would collide. So I want the content of config.h into my header
common.h
> > which I can reference in the headers of my lib. I tried following in
config.in:
> >
> > AC_CHECK_HEADERS(signal.h)
> > AC_OUTPUT_COMMANDS(
> > if test x$ac_cv_header_signal_h = xyes; then
> >       echo '#include <signal.h>'  >> libdir/comon.h
> > fi)
> >
> > This should create a file common.h which contains someting depended of
what
> > configure has found. But this doesn't work.
> > Please, can you give me some help?
> 
> You could add
> 
> #ifdef HAVE_SIGNAL_H
> # include <signal.h>
> #endif
> 
> in your libdir/comon.h. The HAVE_SIGNAL_H macro is only set to 1 if
> AC_CHECK_HEADERS(signal.h) finds a signal.h.
> 
> HTH.
> 
> Uwe.
> --
> Uwe Hermann <address@hidden>
> http://www.hermann-uwe.de/
> -----------------------------------
> :wq

-- 
Sent through GMX FreeMail - http://www.gmx.net




reply via email to

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