mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Don't require C++ support at configure time.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32739 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
abd420a3be
commit
e4aa34680d
4 changed files with 36 additions and 16 deletions
|
@ -1,3 +1,12 @@
|
|||
2011-03-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.ac:
|
||||
* gnustep-config.in:
|
||||
* TestFramework/gnustep-tests.in:
|
||||
Change to only require ObjC++ support (for the test framework).
|
||||
Assume C++ is supported even if it actually isn't, since we usually
|
||||
don't care.
|
||||
|
||||
2011-03-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.ac: work around the fact that AC_PROG_CXX is buggy and
|
||||
|
|
|
@ -119,17 +119,22 @@ export GSTESTLOG
|
|||
GSTESTSUM=$GSTESTDIR/tests.sum
|
||||
export GSTESTSUM
|
||||
|
||||
# We assume that the C compiler supports ObjC
|
||||
if test x"$CC" = x
|
||||
then
|
||||
CC=`gnustep-config --variable=CC`
|
||||
export CC
|
||||
fi
|
||||
|
||||
if test x"$CXX" = x
|
||||
# We only suport C++ and ObjC++ code if ObjC++ is available ... so having
|
||||
# a C++ compiler is not sufficient, it has to support ObjC++ too.
|
||||
if test x"$OBJCXX" = x
|
||||
then
|
||||
CXX=`gnustep-config --variable=CXX`
|
||||
export CXX
|
||||
CXX=`gnustep-config --variable=OBJCXX`
|
||||
else
|
||||
CXX=
|
||||
fi
|
||||
export CXX
|
||||
|
||||
GSTESTFLAGS=
|
||||
if test "$GSTESTMODE" = "failfast"
|
||||
|
@ -293,7 +298,7 @@ build_and_run ()
|
|||
tmp=`basename $TESTFILE .m`
|
||||
if test x"$tmp" = x"$TESTFILE"
|
||||
then
|
||||
BUILD_CMD="$CXX -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
BUILD_CMD="$OBJCXX -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
else
|
||||
BUILD_CMD="$CC -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
fi
|
||||
|
@ -429,7 +434,7 @@ do
|
|||
if test x"$TESTS" = x
|
||||
then
|
||||
# Get the names of all subdirectories containing source files.
|
||||
if test x"$CXX" = x
|
||||
if test x"$OBJCXX" = x
|
||||
then
|
||||
# Only Objective-C (and C)
|
||||
SRCDIRS=`find $TESTDIR -name "*.m" | sed -e 's;/[^/]*$;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
|
@ -498,7 +503,7 @@ do
|
|||
# Get the names of all the source files in the current directory.
|
||||
if test x"$TESTS" = x
|
||||
then
|
||||
if test x"$CXX" = x
|
||||
if test x"$OBJCXX" = x
|
||||
then
|
||||
# Only Objective-C (and C)
|
||||
TESTS=`find . \( -name . -o -prune \) -name "*.m" | sed -e 's;^.*/;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
|
|
23
configure.ac
23
configure.ac
|
@ -37,6 +37,9 @@ AC_PROG_CPP
|
|||
# compile/link C++ code. :-)
|
||||
AC_PROG_CXX
|
||||
|
||||
# Similarly for the ObjC++ compiler
|
||||
AC_PROG_OBJCXX
|
||||
|
||||
AC_CANONICAL_TARGET([])
|
||||
|
||||
|
||||
|
@ -1246,11 +1249,11 @@ AC_SUBST(objc_threaded)
|
|||
AC_SUBST(ac_cv_objc_threaded)
|
||||
|
||||
AC_MSG_CHECKING(whether Objective-C++ is supported)
|
||||
AC_LANG_PUSH(C++)
|
||||
CXXFLAGS_saved="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -x objective-c++"
|
||||
CPPFLAGS_saved="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -x objective-c++"
|
||||
AC_LANG_PUSH(Objective C++)
|
||||
OBJCXXFLAGS_saved="$OBJCXXFLAGS"
|
||||
OBJCXXFLAGS="$OBJCXXFLAGS -x objective-c++"
|
||||
OBJCXXPPFLAGS_saved="$OBJCXXPPFLAGS"
|
||||
OBJCXXPPFLAGS="$OBJCXXPPFLAGS -x objective-c++"
|
||||
AC_RUN_IFELSE([[
|
||||
|
||||
@interface ObjCClass
|
||||
|
@ -1272,12 +1275,12 @@ main()
|
|||
]], objcc=yes, objcc=no)
|
||||
AC_MSG_RESULT($objcc)
|
||||
if test x"$objcc" = x"no"; then
|
||||
CXX=
|
||||
OBJCXX=
|
||||
fi
|
||||
AC_SUBST(CXX)
|
||||
CXXFLAGS="$CXXFLAGS_saved"
|
||||
CPPFLAGS="$CPPFLAGS_saved"
|
||||
AC_LANG_POP(C++)
|
||||
AC_SUBST(OBJCXX)
|
||||
OBJCXXFLAGS="$OBJCXXFLAGS_saved"
|
||||
OBJCXXPPFLAGS="$OBJCXXPPFLAGS_saved"
|
||||
AC_LANG_POP(Objective C++)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Check if GCC supports -fobjc-nonfragile-abi, and if so, turn it on!
|
||||
|
|
|
@ -62,6 +62,7 @@ if [ "$1" = "--help" ]; then
|
|||
echo
|
||||
echo " --variable=CC"
|
||||
echo " --variable=CXX"
|
||||
echo " --variable=OBJCXX"
|
||||
echo " --variable=GNUMAKE"
|
||||
echo " --variable=GNUSTEP_MAKEFILES"
|
||||
echo " --variable=GNUSTEP_USER_DEFAULTS_DIR"
|
||||
|
@ -160,6 +161,8 @@ case "$1" in
|
|||
exit 0;;
|
||||
--variable=CXX) echo "@CXX@"
|
||||
exit 0;;
|
||||
--variable=OBJCXX) echo "@OBJCXX@"
|
||||
exit 0;;
|
||||
--variable=GNUSTEP_MAKEFILES) echo "$GNUSTEP_MAKEFILES"
|
||||
exit 0;;
|
||||
--variable=GNUMAKE) echo "@GNUMAKE@"
|
||||
|
|
Loading…
Reference in a new issue