Skip to content

Commit

Permalink
Don't require C++ support at configure time.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32739 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
rfm committed Mar 29, 2011
1 parent 134e155 commit 27c47b3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2011-03-22 Richard Frith-Macdonald <[email protected]>

* 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 <[email protected]>

* configure.ac: work around the fact that AC_PROG_CXX is buggy and
Expand Down
17 changes: 11 additions & 6 deletions TestFramework/gnustep-tests.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'`
Expand Down Expand Up @@ -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'`
Expand Down
23 changes: 13 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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([])


Expand Down Expand Up @@ -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
Expand All @@ -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!
Expand Down
3 changes: 3 additions & 0 deletions gnustep-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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@"
Expand Down

0 comments on commit 27c47b3

Please sign in to comment.