Make threading configure test more robust

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@31292 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2010-09-10 11:33:49 +00:00
parent 49e3f2a43e
commit 349d50e31d
3 changed files with 133 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2010-09-10 Nicola Pero <nicola@nicola.brainstorm.co.uk>
* configure.ac: When threading tests fail with all expected
threading flags/libs, do a last attempt with no explicit threading
flags/libs at all.
* configure: Regenerated.
2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
* config.make.in (CC): Ignore the default CC=cc used by GNU make

108
configure vendored
View file

@ -4919,6 +4919,42 @@ objc_threaded=""
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
if test "$cross_compiling" = yes; then
objc_threaded="works"
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "config_thread.m"
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
objc_threaded="works"
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
objc_threaded=""
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
elif test "`echo $host_os|sed 's/[0-9].*//'|sed s/elf//`" = freebsd; then
LIBS="-pthread $OBJCRT"
if test "$cross_compiling" = yes; then
@ -5020,6 +5056,42 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
objc_threaded=""
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
if test "$cross_compiling" = yes; then
objc_threaded="works"
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "config_thread.m"
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
objc_threaded="works"
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
objc_threaded=""
fi
@ -5236,6 +5308,42 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
objc_threaded=""
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
if test "$cross_compiling" = yes; then
objc_threaded="works"
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "config_thread.m"
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
objc_threaded="works"
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
objc_threaded=""
fi

View file

@ -1216,6 +1216,12 @@ elif test "$host_os" = linux-gnu; then
LIBS="$OBJCRT -lpthread"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lpthread",
objc_threaded="", objc_threaded="-lpthread")
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
AC_TRY_RUN([#include "config_thread.m"],
objc_threaded="works",
objc_threaded="", objc_threaded="works")
fi
elif test "`echo $host_os|sed 's/[[0-9]].*//'|sed s/elf//`" = freebsd; then
LIBS="-pthread $OBJCRT"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-pthread",
@ -1230,6 +1236,12 @@ elif test "`echo $host_os|sed 's/[[0-9]].*//'|sed s/elf//`" = freebsd; then
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lpcthread",
objc_threaded="", objc_threaded="-lpcthread")
fi
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
AC_TRY_RUN([#include "config_thread.m"],
objc_threaded="works",
objc_threaded="", objc_threaded="works")
fi
elif test "$MINGW32" = yes; then
# Mingw doesn't need anything extra for threads
LIBS="$OBJCRT $LIBS"
@ -1266,6 +1278,12 @@ else
objc_threaded="-lthread",
objc_threaded="", objc_threaded="")
fi
if test x"$objc_threaded" = x""; then
LIBS="$OBJCRT"
AC_TRY_RUN([#include "config_thread.m"],
objc_threaded="works",
objc_threaded="", objc_threaded="works")
fi
fi
if test x"$objc_threaded" = x""; then
AC_MSG_RESULT(no)