first attempt at new build system
authorMorgan Deters <mdeters@gmail.com>
Thu, 3 Dec 2009 19:43:54 +0000 (19:43 +0000)
committerMorgan Deters <mdeters@gmail.com>
Thu, 3 Dec 2009 19:43:54 +0000 (19:43 +0000)
Makefile [new file with mode: 0644]
Makefile.builds [new file with mode: 0644]
configure.ac
contrib/update-copyright.pl

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..efc532a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+.PHONY: default
+default:
+       @if test -e builds; then \
+               echo cd builds; \
+               cd builds; \
+               echo $(MAKE); \
+               $(MAKE); \
+       else \
+               echo; \
+               echo 'Run configure first, or type "make" in a configured build directory.'; \
+               echo; \
+       fi
diff --git a/Makefile.builds b/Makefile.builds
new file mode 100644 (file)
index 0000000..f7390bb
--- /dev/null
@@ -0,0 +1,4 @@
+include current
+
+.PHONY: default
+default:; cd "$(CURRENT_BUILD)" && $(MAKE)
index 168f80320a3171f400b0dfeec52848fe6ae728af..0eb38ce5f851c54d700a328f31541f412dbe5f62 100644 (file)
@@ -1,29 +1,15 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_PREREQ([2.63])
+AC_PREREQ([2.59])
 AC_INIT([src/include/cvc4.h])
 AC_CONFIG_AUX_DIR([config])
 #AC_CONFIG_LIBOBJ_DIR([lib])
 AC_CONFIG_MACRO_DIR([config])
-AM_INIT_AUTOMAKE(cvc4, prerelease)
-AC_CONFIG_HEADERS([config.h])
 
-# keep track of whether the user set these (check here, because
-# autoconf might set a default later)
-AC_MSG_CHECKING([for user CPPFLAGS])
-if test -z "${CPPFLAGS+set}"; then user_cppflags=no; else user_cppflags=yes; fi
-AC_MSG_RESULT([${CPPFLAGS-none}])
-AC_MSG_CHECKING([for user CXXFLAGS])
-if test -z "${CXXFLAGS+set}"; then user_cxxflags=no; else user_cxxflags=yes; fi
-AC_MSG_RESULT([${CXXFLAGS-none}])
-AC_MSG_CHECKING([for user LDFLAGS])
-if test -z "${LDFLAGS+set}" ; then user_ldflags=no ; else user_ldflags=yes ; fi
-AC_MSG_RESULT([${LDFLAGS-none}])
-
-LT_INIT
-
-AC_LIBTOOL_WIN32_DLL
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 
 # Features requested by the user
 AC_MSG_CHECKING([for requested build profile])
@@ -36,6 +22,38 @@ if test "$user_cppflags" = no -a "$user_cxxflags" = no -a "$user_ldflags" = no -
 else
   non_standard_build_profile=yes
 fi
+build=
+if test -n "${enable_optimized+set}"; then build=$build-opt; fi
+if test -n "${enable_debug_symbols+set}"; then build=$build-dsy; fi
+if test -n "${enable_assertions+set}"; then build=$build-ass; fi
+if test -n "${enable_tracing+set}"; then build=$build-trc; fi
+if test -n "${enable_muzzle+set}"; then build=$build-mzl; fi
+if test -n "${enable_coverage+set}"; then build=$build-cvg; fi
+if test -n "${enable_profiling+set}"; then build=$build-prf; fi
+AC_MSG_RESULT([$with_build])
+
+AC_MSG_CHECKING([for appropriate build string])
+build_type=$with_build$build_type_suffix
+AC_MSG_RESULT($build_type)
+
+# require building in target and build-specific build directory
+if test -e src/include/cvc4.h; then
+  if test "$non_standard_build_profile" = yes; then
+    if test "$with_build" = default; then
+      build_type=custom$build_type_suffix
+    fi
+  fi
+  rm -f config.log config.status confdefs.h
+  mkdir -p "builds/$target/$build_type"
+  test -e builds/Makefile || cp  Makefile.builds builds/Makefile
+  echo "CURRENT_BUILD = $target/$build_type" > builds/current
+  echo
+  echo cd "builds/$target/$build_type"
+  cd "builds/$target/$build_type"
+  echo ../../../configure "$@"
+  exec ../../../configure "$@"
+fi
+
 case "$with_build" in
   production)
     CVC4CPPFLAGS=
@@ -73,7 +91,6 @@ case "$with_build" in
     AC_MSG_FAILURE([unknown build profile: $with_build])
     ;;
 esac
-AC_MSG_RESULT([$with_build])
 
 AC_MSG_CHECKING([whether to optimize libcvc4])
 AC_ARG_ENABLE([optimized],       [AS_HELP_STRING([--enable-optimized],       [optimize the build])])
@@ -147,12 +164,33 @@ if test "$enable_profiling" = yes; then
   CVC4LDFLAGS="$CVC4LDFLAGS -pg"
 fi
 
+AM_INIT_AUTOMAKE(cvc4, prerelease)
+AC_CONFIG_HEADERS([config.h])
+
+# keep track of whether the user set these (check here, because
+# autoconf might set a default later)
+AC_MSG_CHECKING([for user CPPFLAGS])
+if test -z "${CPPFLAGS+set}"; then user_cppflags=no; else user_cppflags=yes; fi
+AC_MSG_RESULT([${CPPFLAGS-none}])
+AC_MSG_CHECKING([for user CXXFLAGS])
+if test -z "${CXXFLAGS+set}"; then user_cxxflags=no; else user_cxxflags=yes; fi
+AC_MSG_RESULT([${CXXFLAGS-none}])
+AC_MSG_CHECKING([for user LDFLAGS])
+if test -z "${LDFLAGS+set}" ; then user_ldflags=no ; else user_ldflags=yes ; fi
+AC_MSG_RESULT([${LDFLAGS-none}])
+
+LT_INIT
+
+AC_LIBTOOL_WIN32_DLL
+
+
 
 
 
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CXX
+
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
 AM_PROG_LEX
index 5c1f605c9719188007b3d29085162784f202323b..72bc006d70fc70497e6d14bf75ad43d03ba79e45 100755 (executable)
@@ -64,8 +64,9 @@ source files to match the template in the script, attempting to retain file-spec
 comments, but this isn't guaranteed.  You should run this in an svn working directory
 and run "svn diff" after to ensure everything was correctly rewritten.
 
-The directory to search for and change sources is:
+The directories in which to search for and change sources is:
   $pwd/src
+  $pwd/test
 
 Continue? y or n:
 EOF
@@ -74,6 +75,7 @@ EOF
   die 'aborting operation' if !( $_ eq 'y' || $_ eq 'yes' || $_ eq 'Y' || $_ eq 'YES' );
 
   $searchdirs[0] = 'src';
+  $searchdirs[1] = 'test';
 } else {
   @searchdirs = @ARGV;
 }