Added automatic configuration test setting AUTO_DEPENDENCIES to yes if

we are running under GCC => 3.x


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@11481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-11-22 13:31:51 +00:00
parent 295791311d
commit 482cf3b62b
3 changed files with 76 additions and 1 deletions

View file

@ -90,6 +90,13 @@ CONFIG_SYSTEM_INCL = @CPPFLAGS@
CONFIG_SYSTEM_LIBS = @LIBS@
CONFIG_SYSTEM_DEFS =
#
# Whether the C/ObjC/C++ compiler supports auto-dependencies
# (generating dependencies of the object files from the include files
# used to compile them) via -MMD -MP flags
#
AUTO_DEPENDENCIES = @AUTO_DEPENDENCIES@
## Local variables:
## mode: makefile
## End:

36
configure vendored
View file

@ -2102,11 +2102,44 @@ ac_cv_objc_threaded="$objc_threaded"
#--------------------------------------------------------------------
# Check compiler version... turn on autodep flags only for gcc => 3.x
#--------------------------------------------------------------------
echo $ac_n "checking if the compiler supports autodependencies""... $ac_c" 1>&6
echo "configure:2111: checking if the compiler supports autodependencies" >&5
if test ! ${GCC} = "yes" ; then
AUTO_DEPENDENCIES=""
echo "$ac_t""no: it's not gcc" 1>&6
else
# Running gcc --version we get something like 2.95.4 or
# egcs-2.91.66 or 3.0.2 or 3.1 20011211
# We want to discard anything but the major number.
# Explanation of the regexp -
# \(^[^0-9]*\) matches beginning of line and following non numeric chars
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 2^nd
# subpattern)
# \([^0-9].*\) matches a non numeric char followed by anything
# /\2/ replace the whole lot with the 2^nd subpattern
gs_cv_gcc_major_version=`${CC} --version | sed "s/\(^[^0-9]*\)\([0-9][0-9]*\)\([^0-9].*\)/\2/"`;
if test "${gs_cv_gcc_major_version}" -ge "3" ; then
AUTO_DEPENDENCIES=yes
echo "$ac_t""yes: gcc major version is ${gs_cv_gcc_major_version}" 1>&6
else
AUTO_DEPENDENCIES=""
echo "$ac_t""no: gcc major version is ${gs_cv_gcc_major_version}" 1>&6
fi
fi
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------
echo $ac_n "checking for the version of gnustep-make we are compiling""... $ac_c" 1>&6
echo "configure:2110: checking for the version of gnustep-make we are compiling" >&5
echo "configure:2143: checking for the version of gnustep-make we are compiling" >&5
. ./Version
if test -f "../Version"; then
. ../Version
@ -2298,6 +2331,7 @@ s%@FORCE_CPPFLAGS@%$FORCE_CPPFLAGS%g
s%@GCC_SO_DIR@%$GCC_SO_DIR%g
s%@objc_threaded@%$objc_threaded%g
s%@ac_cv_objc_threaded@%$ac_cv_objc_threaded%g
s%@AUTO_DEPENDENCIES@%$AUTO_DEPENDENCIES%g
s%@GNUSTEP_MAKE_VERSION@%$GNUSTEP_MAKE_VERSION%g
s%@GNUSTEP_MAKE_MAJOR_VERSION@%$GNUSTEP_MAKE_MAJOR_VERSION%g
s%@GNUSTEP_MAKE_MINOR_VERSION@%$GNUSTEP_MAKE_MINOR_VERSION%g

View file

@ -369,6 +369,40 @@ ac_cv_objc_threaded="$objc_threaded"
AC_SUBST(objc_threaded)
AC_SUBST(ac_cv_objc_threaded)
#--------------------------------------------------------------------
# Check if compiler supports -MMD -MP to generate %.d files ...
#--------------------------------------------------------------------
AC_MSG_CHECKING(if the compiler supports autodependencies)
# What we want to do: set AUTO_DEPENDENCIES to yes if gcc => 3.x
if test ! ${GCC} = "yes" ; then
AUTO_DEPENDENCIES=""
AC_MSG_RESULT(no: it's not gcc)
else
# Running gcc --version we get something like 2.95.4 or
# egcs-2.91.66 or 3.0.2 or 3.1 20011211
# We want to discard anything but the major number.
# Explanation of the regexp -
# \(^[^0-9]*\) matches beginning of line and following non numeric chars
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 2^nd
# subpattern)
# \([^0-9].*\) matches a non numeric char followed by anything
# /\2/ replace the whole lot with the 2^nd subpattern
gs_cv_gcc_major_version=`${CC} --version | sed "s/\(^[[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]].*\)/\2/"`;
if test "${gs_cv_gcc_major_version}" -ge "3" ; then
AUTO_DEPENDENCIES=yes
AC_MSG_RESULT(yes: gcc major version is ${gs_cv_gcc_major_version})
else
AUTO_DEPENDENCIES=""
AC_MSG_RESULT(no: gcc major version is ${gs_cv_gcc_major_version})
fi
fi
AC_SUBST(AUTO_DEPENDENCIES)
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------