mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Add checks for Objective-C++ and C++ support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32664 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d1c754c69f
commit
aaf363c92e
3 changed files with 42 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-03-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* gnustep-config.in: allow checking of the CXX variable to see what
|
||||
compiler (if any) was found to support building Objective-C++ code.
|
||||
* TestFramework/gnustep-tests.in: Check the value of CXX to correctly
|
||||
build Objective-C++ tests and to refrain from running Objective-C++
|
||||
tests on systems which don't have a compiler.
|
||||
|
||||
2011-03-18 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* Instance/Documentation/texi.make (internal-textdoc-install_):
|
||||
|
|
|
@ -125,6 +125,12 @@ then
|
|||
export CC
|
||||
fi
|
||||
|
||||
if test x"$CXX" = x
|
||||
then
|
||||
CXX=`gnustep-config --variable=CXX`
|
||||
export CXX
|
||||
fi
|
||||
|
||||
GSTESTFLAGS=
|
||||
if test "$GSTESTMODE" = "failfast"
|
||||
then
|
||||
|
@ -281,9 +287,16 @@ build_and_run ()
|
|||
then
|
||||
# The very simple case, we just need to compile a single file
|
||||
# putting the executable in the obj subdirectory.
|
||||
# We test for a .mm extension to see which compiler to use.
|
||||
rm -rf ./obj
|
||||
mkdir ./obj
|
||||
BUILD_CMD="$CC -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
tmp=`basename $TESTFILE .m`
|
||||
if test x"$tmp" = x"$TESTFILE"
|
||||
then
|
||||
BUILD_CMD="$CC -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
else
|
||||
BUILD_CMD="$CXX -o ./obj/$TESTNAME $TESTFILE $GSTESTFLAGS $GSTESTLIBS"
|
||||
fi
|
||||
else
|
||||
BUILD_CMD="$MAKE_CMD $MAKEFLAGS debug=yes $TESTNAME"
|
||||
fi
|
||||
|
@ -416,7 +429,14 @@ do
|
|||
if test x"$TESTS" = x
|
||||
then
|
||||
# Get the names of all subdirectories containing source files.
|
||||
SRCDIRS=`find $TESTDIR \( -name "*.m" -o -name "*.mm" \) | sed -e 's;/[^/]*$;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
if test x"$CXX" = x
|
||||
then
|
||||
# Only Objective-C (and C)
|
||||
SRCDIRS=`find $TESTDIR -name "*.m" | sed -e 's;/[^/]*$;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
else
|
||||
# Objective-C and Objective-C++ (implicitly C and C++ too)
|
||||
SRCDIRS=`find $TESTDIR \( -name "*.m" -o -name "*.mm" \) | sed -e 's;/[^/]*$;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
fi
|
||||
else
|
||||
SRCDIRS="$TESTDIRS"
|
||||
fi
|
||||
|
@ -475,10 +495,17 @@ do
|
|||
./Start.sh
|
||||
fi
|
||||
|
||||
# Get the names of all the .m and .mm files in the current directory.
|
||||
# Get the names of all the source files in the current directory.
|
||||
if test x"$TESTS" = x
|
||||
then
|
||||
TESTS=`find . \( -name . -o -prune \) \( -name "*.m" -o -name "*.mm" \) | sed -e 's;^.*/;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
if test x"$CXX" = x
|
||||
then
|
||||
# Only Objective-C (and C)
|
||||
TESTS=`find . \( -name . -o -prune \) -name "*.m" | sed -e 's;^.*/;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
else
|
||||
# Objective-C and Objective-C++ (implicitly C and C++ too)
|
||||
TESTS=`find . \( -name . -o -prune \) \( -name "*.m" -o -name "*.mm" \) | sed -e 's;^.*/;;' | sort -u | sed -e 's/\(^\| \)X[^ ]*//g'`
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -r GNUmakefile.tests
|
||||
|
|
|
@ -61,6 +61,7 @@ if [ "$1" = "--help" ]; then
|
|||
echo " variables:"
|
||||
echo
|
||||
echo " --variable=CC"
|
||||
echo " --variable=CXX"
|
||||
echo " --variable=GNUMAKE"
|
||||
echo " --variable=GNUSTEP_MAKEFILES"
|
||||
echo " --variable=GNUSTEP_USER_DEFAULTS_DIR"
|
||||
|
@ -157,6 +158,8 @@ export GNUSTEP_MAKEFILES
|
|||
case "$1" in
|
||||
--variable=CC) echo "@CC@"
|
||||
exit 0;;
|
||||
--variable=CXX) echo "@CXX@"
|
||||
exit 0;;
|
||||
--variable=GNUSTEP_MAKEFILES) echo "$GNUSTEP_MAKEFILES"
|
||||
exit 0;;
|
||||
--variable=GNUMAKE) echo "@GNUMAKE@"
|
||||
|
|
Loading…
Reference in a new issue