summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-13 13:51:57 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-13 13:51:57 (GMT)
commit26aeeee8857a340c6a8e59de796a21bb74e41592 (patch)
tree3cfad37115083cd124f4d922cd000cf7eb5ed632 /configure.in
parente18a53698e7a79988b8d7d5888cd363c0bdd1426 (diff)
downloadCMake-26aeeee8857a340c6a8e59de796a21bb74e41592.zip
CMake-26aeeee8857a340c6a8e59de796a21bb74e41592.tar.gz
CMake-26aeeee8857a340c6a8e59de796a21bb74e41592.tar.bz2
Improve bootstrapping on Unix, so that it bootstraps in the subdirectory. This prevents from compiler files being reused and you can do make clean...
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in42
1 files changed, 34 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index 0f7b385..8a95c98 100644
--- a/configure.in
+++ b/configure.in
@@ -3,7 +3,13 @@ AC_INIT()
AC_CONFIG_HEADER(Source/cmConfigure.h)
+# find make to use to build cmake, prefer gmake
+AC_PATH_PROGS(RUNMAKE, gmake make)
+
+fullSrcDir=`cd $srcdir; pwd`
+CMAKE_ROOT_DIR=$fullSrcDir
+if test "x$BUILD_CMAKE_IN_SUBDIR" = "xtrue"; then
#
# check for some programs we use
@@ -22,8 +28,6 @@ AC_PROG_CXX
CFLAGS=$save_CFLAGS
CXXFLAGS=$save_CXXFLAGS
-fullSrcDir=`cd $srcdir; pwd`
-CMAKE_ROOT_DIR=$fullSrcDir
AC_SUBST(CMAKE_ROOT_DIR)
@@ -190,13 +194,35 @@ if test $ac_cv_prog_gxx = no; then
CXXFLAGS="$CXXFLAGS_ORIG"
fi
-# find make to use to build cmake, prefer gmake
-AC_PATH_PROGS(RUNMAKE, gmake make)
AC_OUTPUT(Source/InitialConfigureFlags.cmake Makefile Source/Makefile)
# build cmake
$RUNMAKE
-# run cmake
-./Source/cmake $fullSrcDir
-# run cmake depends
-$RUNMAKE depend
+
+else
+ PRGNAME=configure # Should be `basename $0`
+ DIRNAME=Bootstrap
+
+ # Check if the bootstrap directory already exists.
+ if test -d Bootstrap; then
+ :
+ else
+ # if it does not create one
+ mkdir Bootstrap
+ fi
+ if (
+ # Build bootstrap cmake
+ cd Bootstrap
+ echo "Bootstrapping to directory `pwd`"
+ BUILD_CMAKE_IN_SUBDIR=true $CMAKE_ROOT_DIR/$PRGNAME $ac_configure_args
+ ); then
+ # run cmake
+ Bootstrap/Source/cmake $fullSrcDir
+
+ # run cmake depends
+ $RUNMAKE depend
+ else
+ echo "Problem bootstrapping CMake"
+ exit 1
+ fi
+fi \ No newline at end of file