diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 455c5ef0f..8f20ec5f4 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -748,7 +748,7 @@ bool cmSystemTools::IsOn(const char* val) bool cmSystemTools::IsOff(const char* val) { - if (!val) + if (!val || strlen(val) == 0) { return true; } diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index d007868ae..dc7993ab6 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -501,7 +501,7 @@ void cmUnixMakefileGenerator::OutputTargets(std::ostream& fout) fout << "#\n"; fout << m_LibraryOutputPath << "lib" << l->first << ".a: ${" << l->first << "_SRC_OBJS} \n"; - fout << "\t${CMAKE_AR} cr " + fout << "\t${CMAKE_AR} " << m_LibraryOutputPath << "lib" << l->first << ".a ${" << l->first << "_SRC_OBJS} \n"; fout << "\t${CMAKE_RANLIB} " diff --git a/Templates/configure b/Templates/configure index 681a30d3a..ff3784d98 100755 --- a/Templates/configure +++ b/Templates/configure @@ -2920,14 +2920,6 @@ if test $ac_cv_prog_gxx = no; then echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking whether ${CXX} accepts -instances=semiexplicit""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_TEMPLATE_FLAGS="-instances=static" - else - echo "$ac_t""no" 1>&6 - fi fi @@ -2935,7 +2927,7 @@ fi # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6 -echo "configure:2939: checking ansi standard C++ stream headers " >&5 +echo "configure:2931: checking ansi standard C++ stream headers " >&5 rm -rf conftest.* cat > conftest.cc < @@ -2952,7 +2944,7 @@ fi # check to see if stl is in the std namespace if test $ac_cv_prog_gxx = no; then echo $ac_n "checking ansi standard namespace support ""... $ac_c" 1>&6 -echo "configure:2956: checking ansi standard namespace support " >&5 +echo "configure:2948: checking ansi standard namespace support " >&5 rm -rf conftest.* cat > conftest.cc < @@ -2978,7 +2970,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2982: checking for $ac_word" >&5 +echo "configure:2974: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RUNMAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3018,16 +3010,16 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3022: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR'+set}'`\" = set"; then +echo "configure:3014: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CMAKE_AR_TMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$CMAKE_AR" in + case "$CMAKE_AR_TMP" in /*) - ac_cv_path_CMAKE_AR="$CMAKE_AR" # Let the user override the test with a path. + ac_cv_path_CMAKE_AR_TMP="$CMAKE_AR_TMP" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_CMAKE_AR="$CMAKE_AR" # Let the user override the test with a dos path. + ac_cv_path_CMAKE_AR_TMP="$CMAKE_AR_TMP" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -3035,7 +3027,7 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_CMAKE_AR="$ac_dir/$ac_word" + ac_cv_path_CMAKE_AR_TMP="$ac_dir/$ac_word" break fi done @@ -3043,16 +3035,27 @@ else ;; esac fi -CMAKE_AR="$ac_cv_path_CMAKE_AR" -if test -n "$CMAKE_AR"; then - echo "$ac_t""$CMAKE_AR" 1>&6 +CMAKE_AR_TMP="$ac_cv_path_CMAKE_AR_TMP" +if test -n "$CMAKE_AR_TMP"; then + echo "$ac_t""$CMAKE_AR_TMP" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$CMAKE_AR" && break +test -n "$CMAKE_AR_TMP" && break done +CMAKE_AR="$CMAKE_AR_TMP cr" +# if on SunOS and not using gXX then use the compiler to make .a libs +case $system in + SunOS-5*) + if test $ac_cv_prog_gxx = yes; then + : + else + echo "Using $CXX -xar -o for creating .a libraries" + CMAKE_AR="$CXX -xar -o" + fi +esac # generate output files. @@ -3238,6 +3241,7 @@ s%@CMAKE_TEMPLATE_FLAGS@%$CMAKE_TEMPLATE_FLAGS%g s%@CMAKE_NO_STD_NAMESPACE@%$CMAKE_NO_STD_NAMESPACE%g s%@CMAKE_NO_ANSI_STREAM_HEADERS@%$CMAKE_NO_ANSI_STREAM_HEADERS%g s%@RUNMAKE@%$RUNMAKE%g +s%@CMAKE_AR_TMP@%$CMAKE_AR_TMP%g s%@CMAKE_AR@%$CMAKE_AR%g CEOF diff --git a/Templates/configure.in b/Templates/configure.in index 9237325db..f75b573f4 100644 --- a/Templates/configure.in +++ b/Templates/configure.in @@ -497,14 +497,6 @@ if test $ac_cv_prog_gxx = no; then echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking whether ${CXX} accepts -instances=semiexplicit""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_TEMPLATE_FLAGS="-instances=static" - else - echo "$ac_t""no" 1>&6 - fi fi AC_SUBST(CMAKE_TEMPLATE_FLAGS) @@ -549,7 +541,18 @@ fi # find make to use to build cmake, prefer gmake AC_PATH_PROGS(RUNMAKE, gmake make) -AC_PATH_PROGS(CMAKE_AR, ar) +AC_PATH_PROGS(CMAKE_AR_TMP, ar) +CMAKE_AR="$CMAKE_AR_TMP cr" +# if on SunOS and not using gXX then use the compiler to make .a libs +case $system in + SunOS-5*) + if test $ac_cv_prog_gxx = yes; then + : + else + echo "Using $CXX -xar -o for creating .a libraries" + CMAKE_AR="$CXX -xar -o" + fi +esac AC_SUBST(CMAKE_AR) # generate output files. diff --git a/configure b/configure index 90e25556a..fb2670a81 100755 --- a/configure +++ b/configure @@ -1386,3 +1386,5 @@ $RUNMAKE + + diff --git a/configure.in b/configure.in index 721509841..a4e74fff7 100644 --- a/configure.in +++ b/configure.in @@ -103,3 +103,5 @@ $RUNMAKE + +