autoconf
[Top][All Lists]
Advanced

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

Re: Handling PACKAGE, PACKAGE_VERSION, etc. with multiple libraries


From: Balint Joo
Subject: Re: Handling PACKAGE, PACKAGE_VERSION, etc. with multiple libraries
Date: Thu, 05 Aug 2004 08:01:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

This is a big annoyance. When I asked this question mostly what I got was
people telling me to RTFM.

What I ended up doing is to get configure to #define things in something
like a config_internal.h

I would then have a config.h which would look like:


#ifndef QDP_CONFIG_H
#define QDP_CONFIG_H


/* Undef the unwanted from the environment -- eg the compiler command line */
#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef VERSION

/* Include the stuff generated by autoconf */
#include "qdp_config_internal.h"

/* Prefix everything with QDP_ */
#define QDP_PACKAGE PACKAGE
#define QDP_PACKAGE_BUGREPORT PACKAGE_BUGREPORT
#define QDP_PACKAGE_NAME PACKAGE_NAME
#define QDP_PACKAGE_STRING PACKAGE_STRING
#define QDP_PACKAGE_TARNAME PACKAGE_TARNAME
#define QDP_PACKAGE_VERSION PACKAGE_VERSION


/* Undef the unwanted */
#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef VERSION

#endif  /* Close starting ifnded */

It is a kludge... but it seems to shut the warnings up.

        With best wishes,
                Balint


J.T. Conklin wrote:
I am in the process of autoconfiscating TAO (The ACE ORB), an open
source CORBA implementation built atop the ACE C++ framework.

Both ACE and TAO create config.h files which are used in compiling the
respective libraries.  The config.h files are also installed and are
referenced by library headers, as the macros defined within are needed
in the implementation of inline functions, etc.

The ACE and TAO macros do not conflict, since they use ACE_ and TAO_
prefixes.  The system macros like SIZEOF_DOUBLE and HAVE_UNISTD_H do
not conflict, since they are defined with the same values.  But the
PACKAGE macros defined by autoconf (PACKAGE, PACKAGE_NAME, PACKAGE_-
VERSION, etc.) do.

Fortunately these macros aren't used by either ACE or TAO, so all
there is are annoying compiler warnings. Is there any better way to handle this so that the PACKAGE macros aren't defined in config.h? I'm afraid this will only get worse as I go beyond ACE and TAO and start autoconfiscating more of the related libraries.

      --jtc



--
-------------------------------------------------------------------
Dr Balint Joo                         Post Doctoral Research Fellow
School of Physics
University of Edinburgh
Mayfield Road, Edinburgh EH9 3JZ
Scotland UK
Tel: 0131 650 6469 (from UK) +44-131-650-6469 (from outwith UK)
Fax: 0131 650 5902 (from UK) +44-131-650-5902 (from outwith UK)
email: address@hidden           address@hidden
WWW  : http://www.ph.ed.ac.uk/~bj
-------------------------------------------------------------------






reply via email to

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