diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-12-03 18:23:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-12-03 18:23:51 +0000 |
commit | db2e4d67e775a2f96ae3e122885a3495da7c9c25 (patch) | |
tree | bcc25f62b342d59fe9bae1adc82615fdd1767f0a /sim/common | |
parent | 1d41d75cb6f1e78eedf871801a351e8be761daff (diff) | |
download | gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.zip gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.tar.gz gdb-db2e4d67e775a2f96ae3e122885a3495da7c9c25.tar.bz2 |
sim: generate build dependencies on the fly
Lift the code that GDB is using to generate dependencies on the fly and
port it over to the sim. Now people shouldn't have to manually maintain
these in their Makefile's.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 13 | ||||
-rw-r--r-- | sim/common/Make-common.in | 254 | ||||
-rw-r--r-- | sim/common/acinclude.m4 | 15 | ||||
-rw-r--r-- | sim/common/aclocal.m4 | 76 | ||||
-rwxr-xr-x | sim/common/configure | 187 |
5 files changed, 346 insertions, 199 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index b1c7f85..405888f 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,16 @@ +2011-12-03 Mike Frysinger <vapier@gentoo.org> + + * Make-common.in (VPATH): Add $(srccom). + (DEP): Delete. + (DEPMODE, DEPDIR, depcomp, COMPILE.pre, COMPILE.post, COMPILE, + POSTCOMPILE): New variables. + (.c.o): Replace recipe with call to $(COMPILE) and $(POSTCOMPILE). + Include dependency files, when using GNU Make. Delete all + dependency-only rules. + * aclocal.m4: Include ../../config/depstand.m4. Call + ZW_CREATE_DEPDIR and ZW_PROG_COMPILER_DEPENDENCIES. + (MAKE, GMAKE): New substs. + 2011-11-07 Mike Frysinger <vapier@gentoo.org> PR sim/13161 diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 42e3192..c12d155 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -35,7 +35,7 @@ ## COMMON_PRE_CONFIG_FRAG -VPATH = @srcdir@ +VPATH = @srcdir@:$(srccom) srcdir = @srcdir@ srccom = $(srcdir)/../common srcroot = $(srcdir)/../.. @@ -109,7 +109,17 @@ AR_FLAGS = rc RANLIB = @RANLIB@ MAKEINFO = makeinfo -DEP = $(srcroot)/mkdep +# Dependency tracking information. +DEPMODE = @CCDEPMODE@ +DEPDIR = @DEPDIR@ +depcomp = $(SHELL) $(srcroot)/depcomp + +# Note that these are overridden by GNU make-specific code below if +# GNU make is used. The overrides implement dependency tracking. +COMPILE.pre = $(CC) +COMPILE.post = -c -o $@ +COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post) +POSTCOMPILE = @true # Each simulator's Makefile.in defines one or more of these variables # to override our settings as necessary. There is no need to define these @@ -272,22 +282,11 @@ run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \ $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS) -run.o: $(srccom)/run.c config.h tconfig.h $(remote_sim_h) $(callback_h) - $(CC) -c $(srccom)/run.c $(ALL_CFLAGS) - # FIXME: Ideally, callback.o and friends live in a library outside of # both the gdb and simulator source trees (e.g. devo/remote. Not # devo/libremote because this directory would contain more than just # a library). -callback.o: $(srccom)/callback.c config.h tconfig.h $(callback_h) targ-vals.h - $(CC) -c $(srccom)/callback.c $(ALL_CFLAGS) - -syscall.o: $(srccom)/syscall.c config.h tconfig.h $(callback_h) targ-vals.h - $(CC) -c $(srccom)/syscall.c $(ALL_CFLAGS) - -targ-map.o: targ-map.c targ-vals.h - gentmap: Makefile $(srccom)/gentmap.c targ-vals.def $(CC_FOR_BUILD) $(srccom)/gentmap.c -o gentmap $(BUILD_CFLAGS) $(NL_TARGET) @@ -305,7 +304,6 @@ version.c: Makefile ../../gdb/version.in echo '#include "version.h"' >> version.c-tmp echo 'const char version[] = "'"`sed q ${srcdir}/../../gdb/version.in`"'";' >> version.c-tmp mv version.c-tmp version.c -version.o: version.c $(version_h) # @@ -409,128 +407,57 @@ hw_main_headers = \ $(hw-ports_h) \ $(hw-properties_h) \ -# FIXME: If this complicated way of building .o files from ../common is -# necessary, the reason should be documented here. +# +# Dependency tracking. Most of this is conditional on GNU Make being +# found by configure; if GNU Make is not found, we fall back to a +# simpler scheme. +# + +@GMAKE_TRUE@ifeq ($(DEPMODE),depmode=gcc3) +# Note that we put the dependencies into a .Tpo file, then move them +# into place if the compile succeeds. We need this because gcc does +# not atomically write the dependency output file. +@GMAKE_TRUE@override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \ +@GMAKE_TRUE@ -MF $(DEPDIR)/$(basename $(@F)).Tpo +@GMAKE_TRUE@override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \ +@GMAKE_TRUE@ $(DEPDIR)/$(basename $(@F)).Po +@GMAKE_TRUE@else +@GMAKE_TRUE@override COMPILE.pre = source='$<' object='$@' libtool=no \ +@GMAKE_TRUE@ DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC) +# depcomp handles atomicity for us, so we don't need a postcompile +# step. +@GMAKE_TRUE@override POSTCOMPILE = +@GMAKE_TRUE@endif + +all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS) +generated_files = \ + $(SIM_EXTRA_DEPS) \ + hw-config.h \ + targ-map.c \ + targ-vals.h \ + version.c + +# Ensure that generated files are created early. Use order-only +# dependencies if available. They require GNU make 3.80 or newer, +# and the .VARIABLES variable was introduced at the same time. +@GMAKE_TRUE@ifdef .VARIABLES +@GMAKE_TRUE@$(all_object_files): | $(generated_files) +@GMAKE_TRUE@else +$(all_object_files) : $(generated_files) +@GMAKE_TRUE@endif + +# Dependencies. +@GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) BUILT_SRC_FROM_COMMON= \ sim-inline.c -sim-abort.o: $(srccom)/sim-abort.c \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-abort.c $(ALL_CFLAGS) - -sim-arange.o: $(srccom)/sim-arange.c $(sim-arange_h) $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-arange.c $(ALL_CFLAGS) - -sim-bits.o: $(srccom)/sim-bits.c $(sim-bits_h) $(sim-n-bits_h) \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-bits.c $(ALL_CFLAGS) - -sim-command.o: $(srccom)/sim-command.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-command.c $(ALL_CFLAGS) - -sim-config.o: $(srccom)/sim-config.c $(sim-config_h) sim-main.h \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-config.c $(ALL_CFLAGS) - -sim-core.o: $(srccom)/sim-core.c $(sim_main_headers) \ - $(sim-core_h) $(sim-n-core_h) - $(CC) -c $(srccom)/sim-core.c $(ALL_CFLAGS) - -sim-cpu.o: $(srccom)/sim-cpu.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-cpu.c $(ALL_CFLAGS) - -sim-endian.o: $(srccom)/sim-endian.c $(sim-endian_h) $(sim-n-endian_h) - $(CC) -c $(srccom)/sim-endian.c $(ALL_CFLAGS) - -sim-engine.o: $(srccom)/sim-engine.c $(sim_main_headers) $(sim-engine_h) - $(CC) -c $(srccom)/sim-engine.c $(ALL_CFLAGS) - -sim-events.o: $(srccom)/sim-events.c $(sim-events_h) sim-main.h \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-events.c $(ALL_CFLAGS) - -sim-fpu.o: $(srccom)/sim-fpu.c $(sim-fpu_h) \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-fpu.c $(ALL_CFLAGS) - -sim-hload.o: $(srccom)/sim-hload.c $(sim-assert_h) $(remote_sim_h) \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-hload.c $(ALL_CFLAGS) - -sim-hrw.o: $(srccom)/sim-hrw.c $(sim-assert_h) $(sim_core_h) $(remote_sim_h) \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-hrw.c $(ALL_CFLAGS) - -sim-hw.o: $(srccom)/sim-hw.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-hw.c $(ALL_CFLAGS) - -sim-info.o: $(srccom)/sim-info.c $(sim-assert_h) $(remote_sim_h) \ - $(SIM_EXTRA_DEPS) - $(CC) -c $(srccom)/sim-info.c $(ALL_CFLAGS) - sim-inline.c: $(srccom)/sim-inline.c rm -f $@ tmp-$@ echo "# 1 \"$(srccom)/$@\"" > tmp-$@ cat $(srccom)/$@ >> tmp-$@ $(SHELL) $(srcdir)/../../move-if-change tmp-$@ $@ -sim-io.o: $(srccom)/sim-io.c $(sim_main_headers) $(sim-io_h) $(remote_sim_h) \ - targ-vals.h - $(CC) -c $(srccom)/sim-io.c $(ALL_CFLAGS) - -sim-memopt.o: $(srccom)/sim-memopt.c $(sim_main_headers) \ - $(sim-io_h) - $(CC) -c $(srccom)/sim-memopt.c $(ALL_CFLAGS) - -sim-module.o: $(srccom)/sim-module.c $(sim_main_headers) \ - $(sim-io_h) - $(CC) -c $(srccom)/sim-module.c $(ALL_CFLAGS) - -sim-options.o: $(srccom)/sim-options.c $(sim_main_headers) \ - $(sim-options_h) $(sim-io_h) - $(CC) -c $(srccom)/sim-options.c $(ALL_CFLAGS) - -sim-reason.o: $(srccom)/sim-reason.c $(sim_main_headers) $(remote_sim_h) - $(CC) -c $(srccom)/sim-reason.c $(ALL_CFLAGS) - -sim-reg.o: $(srccom)/sim-reg.c $(sim_main_headers) $(remote_sim_h) - $(CC) -c $(srccom)/sim-reg.c $(ALL_CFLAGS) - -sim-resume.o: $(srccom)/sim-resume.c $(sim_main_headers) $(remote_sim_h) - $(CC) -c $(srccom)/sim-resume.c $(ALL_CFLAGS) - -sim-run.o: $(srccom)/sim-run.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-run.c $(ALL_CFLAGS) - -sim-signal.o: $(srccom)/sim-signal.c $(sim_main_headers) $(sim-signal_h) - $(CC) -c $(srccom)/sim-signal.c $(ALL_CFLAGS) - -sim-stop.o: $(srccom)/sim-stop.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-stop.c $(ALL_CFLAGS) - -sim-trace.o: $(srccom)/sim-trace.c $(sim_main_headers) \ - $(sim-options_h) $(sim-io_h) - $(CC) -c $(srccom)/sim-trace.c $(ALL_CFLAGS) - -sim-profile.o: $(srccom)/sim-profile.c $(sim_main_headers) \ - $(sim-options_h) $(sim-io_h) - $(CC) -c $(srccom)/sim-profile.c $(ALL_CFLAGS) - -sim-model.o: $(srccom)/sim-model.c $(sim_main_headers) \ - $(sim-io_h) - $(CC) -c $(srccom)/sim-model.c $(ALL_CFLAGS) - -sim-utils.o: $(srccom)/sim-utils.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-utils.c $(ALL_CFLAGS) - -sim-watch.o: $(srccom)/sim-watch.c $(sim_main_headers) - $(CC) -c $(srccom)/sim-watch.c $(ALL_CFLAGS) - -sim-load.o: $(srccom)/sim-load.c $(callback_h) $(sim-basics_h) $(remote_sim_h) - $(CC) -c $(srccom)/sim-load.c $(ALL_CFLAGS) - - # FIXME This is one very simple-minded way of generating the file hw-config.h hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile rm -f tmp-hw.h @@ -546,59 +473,10 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile echo "};" >> tmp-hw.h mv tmp-hw.h hw-config.h -hw-alloc.o: $(srccom)/hw-alloc.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-alloc.c $(ALL_CFLAGS) - -hw-base.o: $(srccom)/hw-base.c $(hw_main_headers) hw-config.h - $(CC) -c $(srccom)/hw-base.c $(ALL_CFLAGS) - -hw-device.o: $(srccom)/hw-device.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-device.c $(ALL_CFLAGS) - -hw-events.o: $(srccom)/hw-events.c $(hw_main_headers) $(sim_main_headers) - $(CC) -c $(srccom)/hw-events.c $(ALL_CFLAGS) - test-hw-events: $(srccom)/hw-events.c libsim.a $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \ $(srccom)/hw-events.c libsim.a $(EXTRA_LIBS) -hw-instances.o: $(srccom)/hw-instances.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-instances.c $(ALL_CFLAGS) - -hw-handles.o: $(srccom)/hw-handles.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-handles.c $(ALL_CFLAGS) - -hw-ports.o: $(srccom)/hw-ports.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-ports.c $(ALL_CFLAGS) - -hw-properties.o: $(srccom)/hw-properties.c $(hw_main_headers) - $(CC) -c $(srccom)/hw-properties.c $(ALL_CFLAGS) - -hw-tree.o: $(srccom)/hw-tree.c $(hw_main_headers) $(hw-tree_h) - $(CC) -c $(srccom)/hw-tree.c $(ALL_CFLAGS) - -# Devices. - -dv-cfi.o: $(srccom)/dv-cfi.c $(hw_main_headers) $(sim_main_headers) - $(CC) -c $(srccom)/dv-cfi.c $(ALL_CFLAGS) - -dv-core.o: $(srccom)/dv-core.c $(hw_main_headers) $(sim_main_headers) - $(CC) -c $(srccom)/dv-core.c $(ALL_CFLAGS) - -dv-glue.o: $(srccom)/dv-glue.c $(hw_main_headers) $(sim_main_headers) - $(CC) -c $(srccom)/dv-glue.c $(ALL_CFLAGS) - -dv-pal.o: $(srccom)/dv-pal.c $(hw_main_headers) $(sim_main_headers) - $(CC) -c $(srccom)/dv-pal.c $(ALL_CFLAGS) - -dv-sockser.o: $(srccom)/dv-sockser.h $(sim_main_headers) - $(CC) -c $(srccom)/dv-sockser.c $(ALL_CFLAGS) - - -nrun.o: $(srccom)/nrun.c config.h tconfig.h $(remote_sim_h) $(callback_h) \ - $(sim_main_headers) - $(CC) -c $(srccom)/nrun.c $(ALL_CFLAGS) - # CGEN support. # For use in Makefile.in for cpu-specific files. @@ -607,29 +485,6 @@ CGEN_MAIN_CPU_DEPS = \ $(srccom)/cgen-ops.h \ $(srccom)/cgen-mem.h -cgen-run.o: $(srccom)/cgen-run.c $(sim_main_headers) - $(CC) -c $(srccom)/cgen-run.c $(ALL_CFLAGS) - -cgen-scache.o: $(srccom)/cgen-scache.c $(sim_main_headers) - $(CC) -c $(srccom)/cgen-scache.c $(ALL_CFLAGS) - -cgen-trace.o: $(srccom)/cgen-trace.c $(sim_main_headers) - $(CC) -c $(srccom)/cgen-trace.c $(ALL_CFLAGS) - -cgen-fpu.o: $(srccom)/cgen-fpu.c $(sim_main_headers) $(sim-fpu_h) - $(CC) -c $(srccom)/cgen-fpu.c $(ALL_CFLAGS) - -cgen-accfp.o: $(srccom)/cgen-accfp.c $(sim_main_headers) $(sim-fpu_h) - $(CC) -c $(srccom)/cgen-accfp.c $(ALL_CFLAGS) - -cgen-utils.o: $(srccom)/cgen-utils.c $(sim_main_headers) \ - $(srccom)/cgen-mem.h $(srccom)/cgen-ops.h $(srccom)/cgen-engine.h - $(CC) -c $(srccom)/cgen-utils.c $(ALL_CFLAGS) - -cgen-par.o: $(srccom)/cgen-par.c $(sim_main_headers) \ - $(srccom)/cgen-mem.h $(srccom)/cgen-par.h - $(CC) -c $(srccom)/cgen-par.c $(ALL_CFLAGS) - # Support targets. install: install-common $(SIM_EXTRA_INSTALL) @@ -680,7 +535,8 @@ distclean mostlyclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN) rm -f targ-vals.def .c.o: - $(CC) -c $(ALL_CFLAGS) $< + $(COMPILE) $< + $(POSTCOMPILE) # Dummy target to force execution of dependent targets. force: diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index 9979746..efb1a29 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -21,6 +21,7 @@ # Include global overrides and fixes for Autoconf. m4_include(../../config/override.m4) sinclude([../../config/zlib.m4]) +sinclude([../../config/depstand.m4]) AC_DEFUN([SIM_AC_COMMON], [ @@ -45,6 +46,20 @@ AR=${AR-ar} AC_SUBST(AR) AC_PROG_RANLIB +# Dependency checking. +ZW_CREATE_DEPDIR +ZW_PROG_COMPILER_DEPENDENCIES([CC]) + +# Check for the 'make' the user wants to use. +AC_CHECK_PROGS(MAKE, make) +MAKE_IS_GNU= +case "`$MAKE --version 2>&1 | sed 1q`" in + *GNU*) + MAKE_IS_GNU=yes + ;; +esac +AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes) + dnl We don't use gettext, but bfd does. So we do the appropriate checks dnl to see if there are intl libraries we should link against. ALL_LINGUAS= diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4 index cdae6e7..cd3c9dc 100644 --- a/sim/common/aclocal.m4 +++ b/sim/common/aclocal.m4 @@ -11,4 +11,80 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + m4_include([acinclude.m4]) diff --git a/sim/common/configure b/sim/common/configure index a8148bd..d48f709 100755 --- a/sim/common/configure +++ b/sim/common/configure @@ -617,6 +617,12 @@ INCINTL LIBINTL_DEP LIBINTL USE_NLS +GMAKE_FALSE +GMAKE_TRUE +MAKE +CCDEPMODE +DEPDIR +am__leading_dot RANLIB AR HDEFINES @@ -3262,6 +3268,17 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3775,6 +3792,165 @@ else fi +# Dependency checking. +ac_config_commands="$ac_config_commands depdir" + + +depcc="$CC" am_compiler_list= + +am_depcomp=$ac_aux_dir/depcomp +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + if test $depmode = none; then break; fi + + $as_echo "$as_me:$LINENO: trying $depmode" >&5 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "include sub/conftest.Po" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + depcmd="depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c" + echo "| $depcmd" | sed -e 's/ */ /g' >&5 + if env $depcmd > conftest.err 2>&1 && + grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 && + ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + $as_echo "$as_me:$LINENO: success" >&5 + break + fi + fi + $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5 + sed -e 's/^/| /' < conftest.err >&5 + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +if test x${am_cv_CC_dependencies_compiler_type-none} = xnone +then as_fn_error "no usable dependency style found" "$LINENO" 5 +else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +fi + + +# Check for the 'make' the user wants to use. +for ac_prog in make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MAKE"; then + ac_cv_prog_MAKE="$MAKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MAKE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MAKE=$ac_cv_prog_MAKE +if test -n "$MAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 +$as_echo "$MAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$MAKE" && break +done + +MAKE_IS_GNU= +case "`$MAKE --version 2>&1 | sed 1q`" in + *GNU*) + MAKE_IS_GNU=yes + ;; +esac + if test "$MAKE_IS_GNU" = yes; then + GMAKE_TRUE= + GMAKE_FALSE='#' +else + GMAKE_TRUE='#' + GMAKE_FALSE= +fi + + ALL_LINGUAS= # If we haven't got the data from the intl directory, # assume NLS is disabled. @@ -4717,6 +4893,10 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then + as_fn_error "conditional \"GMAKE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 @@ -5295,6 +5475,11 @@ _ASBOX _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR + _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -5304,6 +5489,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "cconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS cconfig.h:config.in" ;; + "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; @@ -5850,6 +6036,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in + "depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;; "default":C) case x$CONFIG_HEADERS in xcconfig.h:config.in) echo > stamp-h ;; esac ;; esac |