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

Re: autoconf macros and C++

On Thu, 15 Feb 2001, Richard Braakman wrote:

> You could probably use the unmangled name if you convince autoconf
> to compile the program fragment as a C++ program.  Adding "-x c++"
> to the general CFLAGS might work, though that means you can't have
> any normal C files in your package.

Well, my program is already in c++ as is libapt-pkg.

Here is the config log:

configure:557: checking for a BSD compatible install
configure:610: checking whether build environment is sane
configure:667: checking whether make sets ${MAKE}
configure:713: checking for working aclocal
configure:726: checking for working autoconf
configure:739: checking for working automake
configure:752: checking for working autoheader
configure:765: checking for working makeinfo
configure:788: checking host system type
configure:821: checking for a BSD compatible install
configure:878: checking for c++
configure:910: checking whether the C++ compiler (c++  ) works
configure:926: c++ -o conftest    conftest.C  1>&5
configure:952: checking whether the C++ compiler (c++  ) is a
configure:957: checking whether we are using GNU C++
configure:966: c++ -E conftest.C
configure:985: checking whether c++ accepts -g
configure:1026: checking for pkgInitialize__FR13Configuration in -lapt-pkg
configure:1048: c++ -o conftest -g -O2   conftest.C -lapt-pkg   1>&5

It does seem to be doing the test as c++ not c.

> The best solution is probably to have an autoconf macro specifically
> for testing for C++ functions.

How would I go about doing that?

> Note that using C++ kind of defeats the whole purpose of using
> autoconf :-)  Autoconf is not even very happy about using ANSI C,
> because it's not available everywhere.

But atleast if your'e on one of those evil platforms, autoconf will tell
you you can't use my program!

Jaldhar H. Vyas <jaldhar@debian.org>

Reply to: