From a73aa283e27c6d756f87dcd30432b68a7c201a16 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 5 Apr 2010 04:02:40 +0000 Subject: Fix some final objdir != src problems. - PR4269. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@100396 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.common | 2 +- autoconf/configure.ac | 24 +++++++------- configure | 72 ++++++++++++++++++++++++++++++----------- include/klee/Config/config.h.in | 3 -- tools/klee-stats/Makefile | 4 +-- tools/ktest-tool/Makefile | 4 +-- 6 files changed, 69 insertions(+), 40 deletions(-) diff --git a/Makefile.common b/Makefile.common index c54f1142..f3a8f8be 100644 --- a/Makefile.common +++ b/Makefile.common @@ -28,7 +28,7 @@ endif LD.Flags += -L$(PROJ_SRC_ROOT)/stp/lib CXX.Flags += -I$(PROJ_SRC_ROOT)/stp/include -CXX.Flags += -DKLEE_DIR=\"$(PROJ_SRC_ROOT)\" +CXX.Flags += -DKLEE_DIR=\"$(PROJ_OBJ_ROOT)\" # For STP. CXX.Flags += -DEXT_HASH_MAP diff --git a/autoconf/configure.ac b/autoconf/configure.ac index ceeffe05..4266ac47 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -262,22 +262,20 @@ AC_CHECK_HEADERS([selinux/selinux.h], AC_SUBST(HAVE_SELINUX, 1), AC_SUBST(HAVE_SELINUX, 0)) -dnl User option to use stplog. - -AC_ARG_ENABLE(stplog, - AS_HELP_STRING([--enable-stplog], - [Compile with the stplog library [[disabled]]]), - ,enableval=no) -if test ${enableval} = "yes" ; then - AC_SUBST(ENABLE_STPLOG,[[1]]) -else - AC_SUBST(ENABLE_STPLOG,[[0]]) -fi -AC_DEFINE_UNQUOTED([ENABLE_STPLOG],$ENABLE_STPLOG,[Define if stplog enabled]) - dnl ************************************************************************** dnl * Create the output files dnl ************************************************************************** +dnl Do special configuration of Makefiles +AC_CONFIG_MAKEFILE(Makefile) +AC_CONFIG_MAKEFILE(Makefile.common) +AC_CONFIG_MAKEFILE(lib/Makefile) +AC_CONFIG_MAKEFILE(runtime/Makefile) +AC_CONFIG_MAKEFILE(stp/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile.tests) +AC_CONFIG_MAKEFILE(tools/Makefile) +AC_CONFIG_MAKEFILE(unittests/Makefile) + dnl This must be last AC_OUTPUT diff --git a/configure b/configure index 644ee3e9..4f24a6b6 100755 --- a/configure +++ b/configure @@ -674,7 +674,6 @@ CXX CXXFLAGS ac_ct_CXX CXXCPP -ENABLE_STPLOG LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1266,7 +1265,6 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-posix-runtime Enable the POSIX runtime - --enable-stplog Compile with the stplog library [disabled] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -4954,24 +4952,31 @@ done -# Check whether --enable-stplog was given. -if test "${enable_stplog+set}" = set; then - enableval=$enable_stplog; -else - enableval=no -fi +ac_config_commands="$ac_config_commands Makefile" -if test ${enableval} = "yes" ; then - ENABLE_STPLOG=1 -else - ENABLE_STPLOG=0 +ac_config_commands="$ac_config_commands Makefile.common" -fi -cat >>confdefs.h <<_ACEOF -#define ENABLE_STPLOG $ENABLE_STPLOG -_ACEOF +ac_config_commands="$ac_config_commands lib/Makefile" + + +ac_config_commands="$ac_config_commands runtime/Makefile" + + +ac_config_commands="$ac_config_commands stp/Makefile" + + +ac_config_commands="$ac_config_commands test/Makefile" + + +ac_config_commands="$ac_config_commands test/Makefile.tests" + + +ac_config_commands="$ac_config_commands tools/Makefile" + + +ac_config_commands="$ac_config_commands unittests/Makefile" @@ -5525,8 +5530,16 @@ do case $ac_config_target in "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; - "stp/Makefile.common") CONFIG_FILES="$CONFIG_FILES stp/Makefile.common" ;; "include/klee/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/klee/Config/config.h" ;; + "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "Makefile.common") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; + "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; + "runtime/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/Makefile" ;; + "stp/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS stp/Makefile" ;; + "test/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;; + "test/Makefile.tests") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile.tests" ;; + "tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; + "unittests/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS unittests/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -5663,12 +5676,11 @@ CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXCPP!$CXXCPP$ac_delim -ENABLE_STPLOG!$ENABLE_STPLOG$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -6064,6 +6076,28 @@ echo "$as_me: executing $ac_file commands" >&6;} ;; esac + + case $ac_file$ac_mode in + "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile Makefile ;; + "Makefile.common":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile.common Makefile.common ;; + "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/lib/Makefile lib/Makefile ;; + "runtime/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname runtime/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/runtime/Makefile runtime/Makefile ;; + "stp/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname stp/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/stp/Makefile stp/Makefile ;; + "test/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile test/Makefile ;; + "test/Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile.tests` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile.tests test/Makefile.tests ;; + "tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/tools/Makefile tools/Makefile ;; + "unittests/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname unittests/Makefile` + ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/unittests/Makefile unittests/Makefile ;; + + esac done # for ac_tag diff --git a/include/klee/Config/config.h.in b/include/klee/Config/config.h.in index 6d690d24..88f92d96 100644 --- a/include/klee/Config/config.h.in +++ b/include/klee/Config/config.h.in @@ -1,8 +1,5 @@ /* include/klee/Config/config.h.in. Generated from autoconf/configure.tmp.ac by autoheader. */ -/* Define if stplog enabled */ -#undef ENABLE_STPLOG - /* Does the platform use __ctype_b_loc, etc. */ #undef HAVE_CTYPE_EXTERNALS diff --git a/tools/klee-stats/Makefile b/tools/klee-stats/Makefile index a1eba234..0b35fa51 100644 --- a/tools/klee-stats/Makefile +++ b/tools/klee-stats/Makefile @@ -21,9 +21,9 @@ all-local:: $(ToolBuildPath) $(ToolBuildPath): $(ToolDir)/.dir -$(ToolBuildPath): $(TOOLSCRIPTNAME) +$(ToolBuildPath): $(PROJ_SRC_DIR)/$(TOOLSCRIPTNAME) $(Echo) Copying $(BuildMode) script $(TOOLSCRIPTNAME) - $(Verb) $(CP) -f $(TOOLSCRIPTNAME) "$@" + $(Verb) $(CP) -f $(PROJ_SRC_DIR)/$(TOOLSCRIPTNAME) "$@" $(Verb) chmod 0755 "$@" ifdef NO_INSTALL diff --git a/tools/ktest-tool/Makefile b/tools/ktest-tool/Makefile index 7f80f0b1..69d7324c 100644 --- a/tools/ktest-tool/Makefile +++ b/tools/ktest-tool/Makefile @@ -21,9 +21,9 @@ all-local:: $(ToolBuildPath) $(ToolBuildPath): $(ToolDir)/.dir -$(ToolBuildPath): $(TOOLSCRIPTNAME) +$(ToolBuildPath): $(PROJ_SRC_DIR)/$(TOOLSCRIPTNAME) $(Echo) Copying $(BuildMode) script $(TOOLSCRIPTNAME) - $(Verb) $(CP) -f $(TOOLSCRIPTNAME) "$@" + $(Verb) $(CP) -f $(PROJ_SRC_DIR)/$(TOOLSCRIPTNAME) "$@" $(Verb) chmod 0755 "$@" ifdef NO_INSTALL -- cgit 1.4.1