autoconf
[Top][All Lists]
Advanced

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

What's wrong with my AC_CHECK_FUNC?


From: Bernd Jendrissek
Subject: What's wrong with my AC_CHECK_FUNC?
Date: Wed, 26 Feb 2003 18:47:32 +0200

First, an extract from my ./configure output:

checking for stdint.h... no
checking for unistd.h... no
checking dlfcn.h usability... no
checking dlfcn.h presence... yes
configure: WARNING: dlfcn.h: present but cannot be compiled
configure: WARNING: dlfcn.h: check for missing prerequisite headers?
configure: WARNING: dlfcn.h: proceeding with the preprocessor's result
configure: WARNING:     ## ------------------------------------ ##
configure: WARNING:     ## Report this to address@hidden ##
configure: WARNING:     ## ------------------------------------ ##
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
...
checking for strspn... yes
checking for strtoul... yes
configure: error: conditional "AMDEP" was never defined.
Usually this means the macro was only invoked conditionally.

This comes and goes away depending on whether I place AC_CHECK_FUNC inside
an if or outside.  (Above failure is when it's inside.)

AC_MSG_CHECKING([whether to profile memory usage with mtrace/muntrace])
if test "x$enable_mtrace" = "xyes"; then
        AC_CHECK_FUNC(mtrace,
                      [AC_DEFINE(ENABLE_MTRACE)
                      AC_MSG_RESULT(yes)],
                      [AC_MSG_RESULT(no)
                      AC_MSG_WARN([You asked for mtrace memory profiling but 
mtrace doesn't seem to be supported.])])
else
        AC_MSG_RESULT(no)
fi

Now if I put that AC_CHECK_FUNC just above the "if", I seem to have a working
configure script.  (That is, I move AC_CHECK_FUNC up and put a ":" as the
stuff to execute in the "if".)

ISTR that AC_CHECK_* should *always* be run, so that the HAVE_* #defines
are properly set.  (Or do they default to #undefined?)

Now the weird thing is, ac_objext flipflops with this change.  With
AC_CHECK_FUNC *inside*, ac_objext seems to be empty!

configure:3533: /mnt/disk2/src/gcc-inst/usr/bin/gcc -c   conftest.c >&5
configure:3533: $? = 0
configure:3533: test -s conftest.
configure:3533: $? = 1

BTW this is autoconf-2.57

WTF???




reply via email to

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