From: Morgan Deters Date: Thu, 3 Dec 2009 19:43:54 +0000 (+0000) Subject: first attempt at new build system X-Git-Tag: cvc5-1.0.0~9400 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6dc57783d39ccc967e1e784d4cd50a8fd820c60c;p=cvc5.git first attempt at new build system --- diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..efc532a23 --- /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 index 000000000..f7390bb05 --- /dev/null +++ b/Makefile.builds @@ -0,0 +1,4 @@ +include current + +.PHONY: default +default:; cd "$(CURRENT_BUILD)" && $(MAKE) diff --git a/configure.ac b/configure.ac index 168f80320..0eb38ce5f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/contrib/update-copyright.pl b/contrib/update-copyright.pl index 5c1f605c9..72bc006d7 100755 --- a/contrib/update-copyright.pl +++ b/contrib/update-copyright.pl @@ -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; }