diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2009-11-14 15:17:38 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2009-11-14 15:17:38 +0000 |
commit | a53cfbe58781e8f967d298d937e34efa3db93c1d (patch) | |
tree | 8aa46fd5982fc66cc1073d9677a7441045979756 /configure | |
parent | 603f5979461a6524340d8010eb088abc89655664 (diff) | |
download | emacs-a53cfbe58781e8f967d298d937e34efa3db93c1d.tar.gz |
Use gcc-generated dependency files if we can (GNU Make and gcc required).
* Makefile.in: If AUTO_DEPEND is defined, make gcc generate
dependency files in deps/. Include those files into Makefile.
* config.in: Generated (AUTO_DEPEND).
* configure.in: --enable-autodepend is new. Check for GNU Make
and that gcc supports -MMD -MF. Define AUTO_DEPEND if we can use
gcc and GNU make to generate dependencies.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/configure b/configure index d2cdc493658..01dd6f1cfbc 100755 --- a/configure +++ b/configure @@ -802,6 +802,7 @@ enable_maintainer_mode enable_locallisppath enable_checking enable_profiling +enable_autodepend enable_largefile with_x ' @@ -1465,6 +1466,9 @@ Optional Features: stringfreelist, xmallocoverrun, conslist --enable-profiling build emacs with profiling support. This might not work on all platforms + --enable-autodepend automatically generate dependencies to .h-files. + Requires GNU Make and Gcc. Enabled if GNU Make and + Gcc is found --disable-largefile omit support for large files Optional Packages: @@ -2424,6 +2428,14 @@ else PROFILING_LDFLAGS= fi +# Check whether --enable-autodepend was given. +if test "${enable_autodepend+set}" = set; then + enableval=$enable_autodepend; ac_enable_autodepend="${enableval}" +else + ac_enable_autodepend=yes +fi + + #### Make srcdir absolute, if it isn't already. It's important to #### avoid running the path through pwd unnecessarily, since pwd can #### give you automounter prefixes, which can go away. We do all this @@ -9124,6 +9136,80 @@ $as_echo "no" >&6; } fi +if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then + { $as_echo "$as_me:$LINENO: checking whether we are using GNU Make" >&5 +$as_echo_n "checking whether we are using GNU Make... " >&6; } + HAVE_GNU_MAKE=no + testval=`make --version 2>/dev/null | grep 'GNU Make'` + if test "x$testval" != x; then + HAVE_GNU_MAKE=yes + else + ac_enable_autodepend=no + fi + { $as_echo "$as_me:$LINENO: result: $HAVE_GNU_MAKE" >&5 +$as_echo "$HAVE_GNU_MAKE" >&6; } + if test $HAVE_GNU_MAKE = yes; then + { $as_echo "$as_me:$LINENO: checking whether gcc understands -MMD -MF" >&5 +$as_echo_n "checking whether gcc understands -MMD -MF... " >&6; } + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -MMD -MF deps.d" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_enable_autodepend=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$SAVE_CFLAGS" + test -f deps.d || ac_enable_autodepend=no + rm -rf deps.d + { $as_echo "$as_me:$LINENO: result: $ac_enable_autodepend" >&5 +$as_echo "$ac_enable_autodepend" >&6; } + fi + if test $ac_enable_autodepend = yes; then + +cat >>confdefs.h <<\_ACEOF +#define AUTO_DEPEND 1 +_ACEOF + + fi +fi + { $as_echo "$as_me:$LINENO: checking for long file names" >&5 $as_echo_n "checking for long file names... " >&6; } if test "${ac_cv_sys_long_file_names+set}" = set; then |