autoconf
[Top][All Lists]
Advanced

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

Re: confdefs.h not being included by AC_LANG_SOURCE()


From: Brian J. Murrell
Subject: Re: confdefs.h not being included by AC_LANG_SOURCE()
Date: Tue, 02 Mar 2010 15:51:08 -0500

On Tue, 2010-03-02 at 07:00 +0100, Ralf Wildenhues wrote: 
> When you have fixed the issue (as described in the other mail)
> and then can reproduce your bug, please also try adding
>    AC_PROG_CC

Sure.

> to your configure.ac before the use of LB_LINUX_COMPILE_IFELSE
> and see whether your problem goes away that way.

Here's my reproducer:

AC_INIT([pkg], [1.0])

AC_PROG_CC

#
# LB_LINUX_CONFTEST
#
# create a conftest.c file
#
AC_DEFUN([LB_LINUX_CONFTEST],
[cat >conftest.c <<_ACEOF
$1
_ACEOF
])

#
# LB_LINUX_COMPILE_IFELSE
#
# like AC_COMPILE_IFELSE
#
AC_DEFUN([LB_LINUX_COMPILE_IFELSE],
[m4_ifvaln([$1], [LB_LINUX_CONFTEST([$1])])dnl
rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} 
CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG 
LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 
's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include 
-I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -include 
include/linux/autoconf.h" -o tmp_include_depends -o scripts -o 
include/config/MARKER -C $LINUX_OBJ 
EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM 
$MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
m4_ifvaln([$5],[$5])dnl])
rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o 
build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl
])

LB_LINUX_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <linux/thread_info.h>
        #if THREAD_SIZE < 8192
        #error "stack size < 8192"
        #endif
]],[],[echo foo])])

Which results in:

#
# LB_LINUX_CONFTEST
#
# create a conftest.c file
#


#
# LB_LINUX_COMPILE_IFELSE
#
# like AC_COMPILE_IFELSE
#


cat >conftest.c <<_ACEOF
#include <linux/thread_info.h>
        #if THREAD_SIZE < 8192
        #error "stack size < 8192"
        #endif

_ACEOF

rm -f build/conftest.o build/conftest.mod.c build/conftest.ko
if { ac_try='cp conftest.c build && make -d  ${LD:+"LD=$LD"} CC="$CC" -f 
$PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG 
LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 
's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include 
-I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -include 
include/linux/autoconf.h" -o tmp_include_depends -o scripts -o 
include/config/MARKER -C $LINUX_OBJ 
EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM 
$MODULE_TARGET=$PWD/build'
  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; } >/dev/null && { ac_try=''
  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then :

else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o 
build/conftest.ko build/conftest.c conftest.c

Cheers,
b.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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