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: Mon, 10 Sep 2001 21:57:16 +0200 (CEST)

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

  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]