mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Fixed configuring gnustep-make in a separate directory; config-precomp-test was still writing to the source directory
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@25742 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6f86b3f4a7
commit
30f0891a32
7 changed files with 2981 additions and 2257 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,5 +1,21 @@
|
|||
2007-12-15 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
Rewritten config-precomp-test to work when the build directory is
|
||||
separate from the source directory.
|
||||
* config-precomp-test/run-test.sh: Updated to allow a separate
|
||||
build directory; more pervasive quoting of paths and filenames.
|
||||
* config-precomp-test/config-precomp-test.h: Renamed from
|
||||
gs_precomp_test.h.
|
||||
* config-precomp-test/config-precomp-test.m: Renamed from
|
||||
gs_precomp_test.m. Updated include for header filename change.
|
||||
* GNUmakefile.in (distclean): Updated deleting config-precomp-test
|
||||
files.
|
||||
* configure.ac: Updated the way config-precomp-test/run-test.sh is
|
||||
executed.
|
||||
* configure: Regenerated.
|
||||
|
||||
2007-12-15 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* GNUmakefile.in (distclean): Remove
|
||||
config-precomp-test/gs_precomp_test.h.gch and
|
||||
config-precomp-test/a.out.
|
||||
|
|
|
@ -247,8 +247,7 @@ distclean: clean
|
|||
rm -f GNUstep.sh GNUstep.csh fixpath.sh gnustep-config
|
||||
rm -f filesystem.make filesystem.sh filesystem.csh
|
||||
rm -f gnustep-make.spec GNUstep.conf
|
||||
rm -f config-precomp-test.log
|
||||
rm -f config-precomp-test/gs_precomp_test.h.gch config-precomp-test/a.out
|
||||
rm -f config-precomp-test.out config-precomp-test.h.gch config-precomp-test.log
|
||||
|
||||
svn-tag:
|
||||
svn copy $(SVNPREFIX)/trunk $(SVNPREFIX)/tags/make-$(VERTAG) \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "gs_precomp_test.h"
|
||||
#include "config-precomp-test.h"
|
||||
|
||||
@implementation TestClass
|
||||
+ (int) test
|
|
@ -33,80 +33,82 @@
|
|||
# return 0 if gcc supports ObjC precompiled headers
|
||||
# return 1 if gcc does not
|
||||
|
||||
# It will also log everything it does to a log file that can be
|
||||
# specified as the first argument to the script. If there is
|
||||
# no log file specified, ./log will be used.
|
||||
# The script takes a single argument, which is the directory where
|
||||
# the temporary files and the log file will be written. If there
|
||||
# is no argument specified, ./ will be used.
|
||||
|
||||
# This is the file where everything will be logged
|
||||
gs_logfile="$1"
|
||||
gs_builddir="$1"
|
||||
|
||||
if test "$gs_logfile" = ""; then
|
||||
gs_logfile="./log"
|
||||
if test "$gs_builddir" = ""; then
|
||||
gs_builddir="."
|
||||
fi
|
||||
|
||||
gs_logfile="$gs_builddir/config-precomp-test.log"
|
||||
|
||||
# Clear logs
|
||||
rm -f $gs_logfile
|
||||
rm -f "$gs_logfile"
|
||||
|
||||
# Clear compilation results
|
||||
rm -f gs_precomp_test.h.gch a.out *~
|
||||
rm -f "$gs_builddir/config-precomp-test.h.gch" "$gs_builddir/config-precomp-test.out"
|
||||
|
||||
echo "** Environment" >>$gs_logfile 2>&1
|
||||
echo " CC: $CC" >>$gs_logfile 2>&1
|
||||
echo " CFLAGS: $CFLAGS" >>$gs_logfile 2>&1
|
||||
echo " CPPFLAGS: $CPPFLAGS" >>$gs_logfile 2>&1
|
||||
echo " LDFLAGS: $LDFLAGS" >>$gs_logfile 2>&1
|
||||
echo " LIBS: $LIBS" >>$gs_logfile 2>&1
|
||||
echo "" >>$gs_logfile 2>&1
|
||||
echo " current directory: `pwd`" >>$gs_logfile 2>&1
|
||||
echo " log file: $gs_logfile" >>$gs_logfile 2>&1
|
||||
echo "" >>$gs_logfile 2>&1
|
||||
echo "** Environment" >>"$gs_logfile" 2>&1
|
||||
echo " CC: $CC" >>"$gs_logfile" 2>&1
|
||||
echo " CFLAGS: $CFLAGS" >>"$gs_logfile" 2>&1
|
||||
echo " CPPFLAGS: $CPPFLAGS" >>"$gs_logfile" 2>&1
|
||||
echo " LDFLAGS: $LDFLAGS" >>"$gs_logfile" 2>&1
|
||||
echo " LIBS: $LIBS" >>"$gs_logfile" 2>&1
|
||||
echo "" >>"$gs_logfile" 2>&1
|
||||
echo " current directory: `pwd`" >>"$gs_logfile" 2>&1
|
||||
echo " log file: $gs_logfile" >>"$gs_logfile" 2>&1
|
||||
echo "" >>"$gs_logfile" 2>&1
|
||||
|
||||
# Get rid of '-x objective-c' in CFLAGS that we don't need and would
|
||||
# prevent our '-x objective-c-headers' flag from working.
|
||||
CFLAGS=`echo $CFLAGS | sed -e 's/-x objective-c//'`
|
||||
echo " CFLAGS without -x objective-c: $CFLAGS" >>$gs_logfile 2>&1
|
||||
echo " CFLAGS without -x objective-c: $CFLAGS" >>"$gs_logfile" 2>&1
|
||||
|
||||
echo "" >>$gs_logfile 2>&1
|
||||
echo "" >>"$gs_logfile" 2>&1
|
||||
|
||||
if test "$CC" = ""; then
|
||||
echo "CC is not set: failure" >>$gs_logfile 2>&1
|
||||
echo "CC is not set: failure" >>"$gs_logfile" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Try to compile the file first
|
||||
echo "** Compile the file without precompiled headers" >>$gs_logfile 2>&1
|
||||
echo "$CC -o a.out $CFLAGS $CPPFLAGS $LDFLAGS $LIBS gs_precomp_test.m" >>$gs_logfile 2>&1
|
||||
$CC -o a.out $CFLAGS $CPPFLAGS $LDFLAGS $LIBS gs_precomp_test.m >>$gs_logfile 2>&1
|
||||
# Try to compile the file first.
|
||||
echo "** Compile the file without precompiled headers" >>"$gs_logfile" 2>&1
|
||||
echo "$CC -o \"$gs_builddir/config-precomp-test.out\" $CFLAGS $CPPFLAGS $LDFLAGS $LIBS config-precomp-test.m" >>"$gs_logfile" 2>&1
|
||||
$CC -o "$gs_builddir/config-precomp-test.out" $CFLAGS $CPPFLAGS $LDFLAGS $LIBS config-precomp-test.m >>"$gs_logfile" 2>&1
|
||||
if test ! "$?" = "0"; then
|
||||
echo "Failure" >>$gs_logfile 2>&1
|
||||
rm -f a.out
|
||||
echo "Failure" >>"$gs_logfile" 2>&1
|
||||
rm -f "$gs_builddir/config-precomp-test.out"
|
||||
exit 1
|
||||
fi
|
||||
echo "Success" >>$gs_logfile 2>&1
|
||||
echo "" >>$gs_logfile 2>&1
|
||||
echo "Success" >>"$gs_logfile" 2>&1
|
||||
echo "" >>"$gs_logfile" 2>&1
|
||||
|
||||
# Now try to preprocess the header
|
||||
echo "** Preprocess the header" >>$gs_logfile 2>&1
|
||||
echo "$CC -c -x objective-c-header $CFLAGS $CPPFLAGS $LDFLAGS gs_precomp_test.h" >>$gs_logfile 2>&1
|
||||
$CC -x objective-c-header $CFLAGS $CPPFLAGS $LDFLAGS gs_precomp_test.h >>$gs_logfile 2>&1
|
||||
echo "** Preprocess the header" >>"$gs_logfile" 2>&1
|
||||
echo "$CC -o \"$gs_builddir/config-precomp-test.h.gch\" -c -x objective-c-header $CFLAGS $CPPFLAGS $LDFLAGS config-precomp-test.h" >>"$gs_logfile" 2>&1
|
||||
$CC -o "$gs_builddir/config-precomp-test.h.gch" -c -x objective-c-header $CFLAGS $CPPFLAGS $LDFLAGS config-precomp-test.h >>"$gs_logfile" 2>&1
|
||||
if test ! "$?" = "0"; then
|
||||
echo "Failure" >>$gs_logfile 2>&1
|
||||
rm -f a.out gs_precomp_test.h.gch
|
||||
echo "Failure" >>"$gs_logfile" 2>&1
|
||||
rm -f "$gs_builddir/config-precomp-test.out" "$gs_builddir/config-precomp-test.h.gch"
|
||||
exit 1
|
||||
fi
|
||||
echo "Success" >>$gs_logfile 2>&1
|
||||
echo "" >>$gs_logfile 2>&1
|
||||
echo "Success" >>"$gs_logfile" 2>&1
|
||||
echo "" >>"$gs_logfile" 2>&1
|
||||
|
||||
# Now try to compile again with the preprocessed header
|
||||
echo "** Compile the file with precompiled headers" >>$gs_logfile 2>&1
|
||||
echo "$CC -o a.out $CFLAGS $CPPFLAGS $LDFLAGS $LIBS gs_precomp_test.m" >>$gs_logfile 2>&1
|
||||
$CC -o a.out $CFLAGS $CPPFLAGS $LDFLAGS $LIBS gs_precomp_test.m >>$gs_logfile 2>&1
|
||||
# Now try to compile again with the preprocessed header. It might get ignored - which is fine.
|
||||
echo "** Compile the file with precompiled headers" >>"$gs_logfile" 2>&1
|
||||
echo "$CC -o \"$gs_builddir/config-precomp-test.out\" $CFLAGS $CPPFLAGS $LDFLAGS $LIBS -I\"$gs_builddir\" config-precomp-test.m" >>"$gs_logfile" 2>&1
|
||||
$CC -o "$gs_builddir/config-precomp-test.out" $CFLAGS $CPPFLAGS $LDFLAGS $LIBS -I"$gs_builddir" config-precomp-test.m >>"$gs_logfile" 2>&1
|
||||
if test ! "$?" = "0"; then
|
||||
echo "Failure" >>$gs_logfile 2>&1
|
||||
rm -f a.out gs_precomp_test.h.gch
|
||||
echo "Failure" >>"$gs_logfile" 2>&1
|
||||
rm -f "$gs_builddir/config-precomp-test.out" "$gs_builddir/config-precomp-test.h.gch"
|
||||
exit 1
|
||||
fi
|
||||
echo "Success" >>$gs_logfile 2>&1
|
||||
echo "Success" >>"$gs_logfile" 2>&1
|
||||
|
||||
# Everything looks OK.
|
||||
exit 0
|
||||
|
|
|
@ -1208,8 +1208,8 @@ GCC_WITH_PRECOMPILED_HEADERS="no"
|
|||
if test ! "${GCC}" = "yes" ; then
|
||||
AC_MSG_RESULT(no: it's not gcc)
|
||||
else
|
||||
gs_precomp_test_log_file="`pwd`/config-precomp-test.log"
|
||||
gs_precomp_test_results=`(CC="$CC"; export CC; CFLAGS="$CFLAGS"; export CFLAGS; CPPLAGS="$CPPFLAGS"; export CPPFLAGS; LDFLAGS="$LDFLAGS"; export LDFLAGS; LIBS="$LIBS"; export LIBS; cd "$srcdir/config-precomp-test/"; ./run-test.sh "$gs_precomp_test_log_file"; echo $?) 2>&5`
|
||||
gs_precomp_test_builddir="`pwd`"
|
||||
gs_precomp_test_results=`(CC="$CC"; export CC; CFLAGS="$CFLAGS"; export CFLAGS; CPPLAGS="$CPPFLAGS"; export CPPFLAGS; LDFLAGS="$LDFLAGS"; export LDFLAGS; LIBS="$LIBS"; export LIBS; cd "$srcdir/config-precomp-test/"; ./run-test.sh "$gs_precomp_test_builddir"; echo $?) 2>&5`
|
||||
if test "$gs_precomp_test_results" = "0"; then
|
||||
GCC_WITH_PRECOMPILED_HEADERS="yes"
|
||||
AC_MSG_RESULT(yes)
|
||||
|
|
Loading…
Reference in a new issue