bug-autoconf
[Top][All Lists]
Advanced

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

AC_CHECK_FUNC and C++


From: Werner LEMBERG
Subject: AC_CHECK_FUNC and C++
Date: Thu, 20 Sep 2001 15:28:28 +0200 (CEST)

I never got a reply to the message below.  May I ask again for help?


    Werner


======================================================================


It should be noted in the documentation that it *is* possible to make
AC_CHECK_FUNC use a C++ compiler (this is autoconf 2.52):

  AC_LANG_PUSH(C++)
  AC_LIBSOURCE(mkstemp.cc)
  AC_CHECK_FUNC(mkstemp,
                [AC_DEFINE(HAVE_MKSTEMP, 1,
                           [Define if you have mkstemp().])],
                [_AC_LIBOBJ(mkstemp)])
  AC_LANG_POP(C++)

Nevertheless, this approach causes problems.  A user got the following
error message (omitting the `configure:xxxx' prefix):

  checking for mkstemp
  g++ -o conftest -O2  -s conftest.cc  >&5
  declaration of C function `char mkstemp()' conflicts with
  /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0.1/include/stdlib.h:246:
    previous declaration `int mkstemp(char*)' here
  $? = 1

For C++, I need a proper way to specify the prototype.  What is the
best way in autoconf to do that?


    Werner



reply via email to

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