Fixes in configure.in and aclocal.m4 (J. James):

* AC_TRY_COMPILE and AC_TRY_LINK are obsolete, and have been replaced elsewhere already.
* AC_LANG_PROGRAM already generates a main() function, so the current code generates a main() inside a main().
* AC_ISC_POSIX is obsolete.  The strerror check is its replacement.
* On Linux Fedora 14, the ECL_POSIX_SEMAPHORES and ECL_POSIX_RWLOCK checks look for functionality that is in libpthread which isn't added to LIBS until AFTER the checks have been run, resulting in spurious failures. This fix just moves the addition of THREAD_LIBS to LIBS and THREAD_CFLAGS to CFLAGS to before those tests.
* There is no AC_MSG_RESULT paired with the deleted AC_MSG_CHECKING, resulting in funny-looking output. Plus, it appears that the result of this check is constant, which makes me believe that the message is superfluous.
This commit is contained in:
Juan Jose Garcia Ripoll 2011-01-19 22:29:13 +01:00
parent def35532a6
commit d1441004b7
3 changed files with 19 additions and 28 deletions

25
src/aclocal.m4 vendored
View file

@ -27,7 +27,7 @@ else
if test "$GCC" = yes; then
ac_cv_c_long_long=yes
else
AC_TRY_COMPILE(,[long long int i;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[long long int i;]])],
ac_cv_c_long_long=yes,
ac_cv_c_long_long=no)
fi
@ -446,23 +446,20 @@ AC_SUBST(ECL_FILE_CNT)
if test -z "${ECL_FILE_CNT}"; then
ECL_FILE_CNT=0
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_IO_read_end - (f)->_IO_read_ptr)
return 1;
}]])],[ECL_FILE_CNT=1],[])
]])],[ECL_FILE_CNT=1],[])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_r)
return 1;
}]])],[ECL_FILE_CNT=2],[])
]])],[ECL_FILE_CNT=2],[])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_cnt)
return 1;
}]])],[ECL_FILE_CNT=3],[])
]])],[ECL_FILE_CNT=3],[])
fi
])
@ -761,7 +758,7 @@ dnl Provides a test for the existance of the __thread declaration and
dnl defines WITH___THREAD if it is found
AC_DEFUN([ECL___THREAD],[
AC_CACHE_CHECK(for __thread local data, ac_cv_ecl___thread,
AC_TRY_COMPILE(,[static __thread void *data;],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[static __thread void *data;]])],
ac_cv_ecl___thread=yes,
ac_cv_ecl___thread=no))
dnl We deactivate this test because it seems to slow down ECL A LOT!!!
@ -810,19 +807,19 @@ dnl
AC_DEFUN([ECL_SSE],[
if test "x$with_sse" = xyes; then
AC_MSG_CHECKING([for SSE intrinsics])
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <xmmintrin.h>
#include <emmintrin.h>
],[__m128 value;
_mm_getcsr();],[sse_included=yes],[sse_included=no])
]],[[__m128 value;
_mm_getcsr();]])],[sse_included=yes],[sse_included=no])
if test "$sse_included" = "no"; then
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -msse2"
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <xmmintrin.h>
#include <emmintrin.h>
],[__m128 value;
_mm_getcsr();],[sse_included=yes],[sse_included=no])
]],[[__m128 value;
_mm_getcsr();]])],[sse_included=yes],[sse_included=no])
if test "$sse_included" = "no"; then
CFLAGS="$OLD_CFLAGS"
with_sse=no

15
src/configure vendored
View file

@ -5662,6 +5662,8 @@ if test "${enable_threads}" = "yes" ; then
if test -z "${THREAD_OBJ}"; then
as_fn_error $? "Threads aren't supported on this system." "$LINENO" 5
else
LIBS="${THREAD_LIBS} ${LIBS}"
CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking working sem_init()" >&5
$as_echo_n "checking working sem_init()... " >&6; }
@ -5723,8 +5725,6 @@ THREAD_OBJ="$THREAD_OBJ threads/rwlock"
$as_echo_n "checking for thread object files... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${THREAD_OBJ}" >&5
$as_echo "${THREAD_OBJ}" >&6; }
LIBS="${THREAD_LIBS} ${LIBS}"
CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
$as_echo "#define ECL_THREADS 1" >>confdefs.h
@ -5897,8 +5897,6 @@ else
as_fn_error $? "System Boehm GC library requested but not found." "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to copy GC private headers " >&5
$as_echo_n "checking if we need to copy GC private headers ... " >&6; }
$as_echo "#define GBC_BOEHM 1" >>confdefs.h
@ -7508,11 +7506,10 @@ int
main ()
{
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_IO_read_end - (f)->_IO_read_ptr)
return 1;
}
;
return 0;
}
@ -7528,11 +7525,10 @@ int
main ()
{
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_r)
return 1;
}
;
return 0;
}
@ -7548,11 +7544,10 @@ int
main ()
{
int main() {
FILE *f = fopen("conftestval","w");
if ((f)->_cnt)
return 1;
}
;
return 0;
}

View file

@ -431,7 +431,7 @@ dnl Checks for libraries
LIBS="${LIBS} -lm"
AC_CHECK_LIB(sun, getpwnam) # on IRIX adds -lsun
AC_ISC_POSIX
AC_SEARCH_LIBS([strerror],[cposix])
dnl ----------------------------------------------------------------------
dnl Profiling & debug flags
@ -479,14 +479,14 @@ if test "${enable_threads}" = "yes" ; then
if test -z "${THREAD_OBJ}"; then
AC_MSG_ERROR([Threads aren't supported on this system.])
else
LIBS="${THREAD_LIBS} ${LIBS}"
CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
ECL_POSIX_SEMAPHORES
ECL_POSIX_RWLOCK
boehm_configure_flags="${boehm_configure_flags} ${THREAD_GC_FLAGS}"
for k in $THREAD_OBJ; do EXTRA_OBJS="$EXTRA_OBJS ${k}.${OBJEXT}"; done
AC_MSG_CHECKING([for thread object files])
AC_MSG_RESULT([${THREAD_OBJ}])
LIBS="${THREAD_LIBS} ${LIBS}"
CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
AC_DEFINE( [ECL_THREADS], [1], [Userland threads?])
if test "${with___thread}" = "auto"; then
with___thread=${ac_cv_ecl___thread}
@ -532,7 +532,6 @@ else
AC_CHECK_LIB( [gc], [GC_malloc],
[FASL_LIBS="${FASL_LIBS} -lgc"],
[AC_MSG_ERROR([System Boehm GC library requested but not found.])])
AC_MSG_CHECKING( [if we need to copy GC private headers] )
AC_DEFINE(GBC_BOEHM, [1], [Use Boehm's garbage collector])
else
enable_boehm="included"