diff --git a/Templates/cconfigure b/Templates/cconfigure index 15c9f10a8..08c51994d 100755 --- a/Templates/cconfigure +++ b/Templates/cconfigure @@ -889,6 +889,7 @@ else #line 890 "configure" #include "confdefs.h" #include +#include main() { FILE *f=fopen("conftestval", "w"); @@ -897,7 +898,7 @@ main() exit(0); } EOF -if { (eval echo configure:901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -919,7 +920,7 @@ EOF CMAKE_SIZEOF_INT=$ac_cv_sizeof_int echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:923: checking size of long" >&5 +echo "configure:924: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -927,9 +928,10 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -938,7 +940,7 @@ main() exit(0); } EOF -if { (eval echo configure:942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -960,7 +962,7 @@ EOF CMAKE_SIZEOF_LONG=$ac_cv_sizeof_long echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:964: checking size of void *" >&5 +echo "configure:966: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -968,9 +970,10 @@ else ac_cv_sizeof_void_p=4 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -979,7 +982,7 @@ main() exit(0); } EOF -if { (eval echo configure:983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_void_p=`cat conftestval` else @@ -1001,7 +1004,7 @@ EOF CMAKE_SIZEOF_VOID_P=$ac_cv_sizeof_void_p echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:1005: checking size of char" >&5 +echo "configure:1008: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1009,9 +1012,10 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1020,7 +1024,7 @@ main() exit(0); } EOF -if { (eval echo configure:1024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -1042,7 +1046,7 @@ EOF CMAKE_SIZEOF_CHAR=$ac_cv_sizeof_char echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1046: checking size of short" >&5 +echo "configure:1050: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1050,9 +1054,10 @@ else ac_cv_sizeof_short=2 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1061,7 +1066,7 @@ main() exit(0); } EOF -if { (eval echo configure:1065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -1083,7 +1088,7 @@ EOF CMAKE_SIZEOF_SHORT=$ac_cv_sizeof_short echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1087: checking size of float" >&5 +echo "configure:1092: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1091,9 +1096,10 @@ else ac_cv_sizeof_float=4 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1102,7 +1108,7 @@ main() exit(0); } EOF -if { (eval echo configure:1106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -1124,7 +1130,7 @@ EOF CMAKE_SIZEOF_FLOAT=$ac_cv_sizeof_float echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1128: checking size of double" >&5 +echo "configure:1134: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1132,9 +1138,10 @@ else ac_cv_sizeof_double=8 else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1143,7 +1150,7 @@ main() exit(0); } EOF -if { (eval echo configure:1147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -1167,7 +1174,7 @@ CMAKE_SIZEOF_DOUBLE=$ac_cv_sizeof_double # check for X11 support echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1171: checking how to run the C preprocessor" >&5 +echo "configure:1178: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1182,13 +1189,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1199,13 +1206,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1216,13 +1223,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1251,7 +1258,7 @@ echo "$ac_t""$CPP" 1>&6 # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1255: checking for X" >&5 +echo "configure:1262: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1313,12 +1320,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1387,14 +1394,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1500,17 +1507,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1504: checking whether -R must be followed by a space" >&5 +echo "configure:1511: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -1526,14 +1533,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -1565,7 +1572,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:1569: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:1576: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1573,7 +1580,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1606,7 +1613,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:1610: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:1617: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1614,7 +1621,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1654,12 +1661,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1658: checking for gethostbyname" >&5 +echo "configure:1665: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1703,7 +1710,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1707: checking for gethostbyname in -lnsl" >&5 +echo "configure:1714: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1711,7 +1718,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1752,12 +1759,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1756: checking for connect" >&5 +echo "configure:1763: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1801,7 +1808,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1805: checking for connect in -lsocket" >&5 +echo "configure:1812: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1809,7 +1816,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1844,12 +1851,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:1848: checking for remove" >&5 +echo "configure:1855: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -1893,7 +1900,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:1897: checking for remove in -lposix" >&5 +echo "configure:1904: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1901,7 +1908,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1936,12 +1943,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:1940: checking for shmat" >&5 +echo "configure:1947: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -1985,7 +1992,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:1989: checking for shmat in -lipc" >&5 +echo "configure:1996: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1993,7 +2000,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2037,7 +2044,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:2041: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:2048: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2045,7 +2052,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2088,14 +2095,14 @@ fi # get byte swapping info echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2092: checking whether byte ordering is bigendian" >&5 +echo "configure:2099: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2106,11 +2113,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2121,7 +2128,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2141,7 +2148,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2187,17 +2194,17 @@ fi # ac_safe=`echo "limits.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for limits.h""... $ac_c" 1>&6 -echo "configure:2191: checking for limits.h" >&5 +echo "configure:2198: checking for limits.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2224,17 +2231,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2228: checking for $ac_hdr" >&5 +echo "configure:2235: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2268,7 +2275,7 @@ done # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:2272: checking system version (for dynamic loading)" >&5 +echo "configure:2279: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -2338,7 +2345,7 @@ CMAKE_shared_ok="yes" # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2342: checking for dlopen in -ldl" >&5 +echo "configure:2349: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2346,7 +2353,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2394,7 +2401,7 @@ case $system in CMAKE_MODULE_SUFFIX="..o" CMAKE_DL_LIBS="" echo $ac_n "checking for printf in -lld""... $ac_c" 1>&6 -echo "configure:2398: checking for printf in -lld" >&5 +echo "configure:2405: checking for printf in -lld" >&5 ac_lib_var=`echo ld'_'printf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2402,7 +2409,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2521,17 +2528,17 @@ fi else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2525: checking for dld.h" >&5 +echo "configure:2532: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2843,17 +2850,17 @@ for ac_hdr in sys/prctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2847: checking for $ac_hdr" >&5 +echo "configure:2854: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2898,17 +2905,17 @@ for ac_hdr in pthread.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2902: checking for $ac_hdr" >&5 +echo "configure:2909: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2937,7 +2944,7 @@ done if test "$use_pthreads" = "yes"; then if test "$use_sproc" = "no"; then echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:2941: checking for pthread_create in -lpthreads" >&5 +echo "configure:2948: checking for pthread_create in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2945,7 +2952,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2977,7 +2984,7 @@ else fi echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2981: checking for pthread_create in -lpthread" >&5 +echo "configure:2988: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2985,7 +2992,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3019,7 +3026,7 @@ fi # Work around Solaris 5.6 and 5.7 bug: if test "`uname -s -r`" = "SunOS 5.6"; then echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 -echo "configure:3023: checking for thr_create in -lthread" >&5 +echo "configure:3030: checking for thr_create in -lthread" >&5 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3027,7 +3034,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3061,7 +3068,7 @@ fi fi if test "`uname -s -r`" = "SunOS 5.7"; then echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 -echo "configure:3065: checking for thr_create in -lthread" >&5 +echo "configure:3072: checking for thr_create in -lthread" >&5 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3069,7 +3076,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3142,22 +3149,67 @@ CMAKE_ANSI_CFLAGS="" if test $ac_cv_prog_gcc = no; then case $system in HP-UX-*) + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Aa $CFLAGS" echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" - else - echo "$ac_t""no" 1>&6 - fi +echo "configure:3156: checking whether ${CC} accepts -Aa" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + CFLAGS="$CFLAGS_ORIG" + + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Ae $CFLAGS" echo $ac_n "checking whether ${CC} accepts -Ae""... $ac_c" 1>&6 - if test -z "`${CC} -Ae -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Ae" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* +echo "configure:3187: checking whether ${CC} accepts -Ae" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Ae" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + CFLAGS="$CFLAGS_ORIG" ;; esac fi @@ -3174,7 +3226,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:3178: checking for $ac_word" >&5 +echo "configure:3230: 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 diff --git a/Templates/cconfigure.in b/Templates/cconfigure.in index 6edc469e0..f8f23d172 100644 --- a/Templates/cconfigure.in +++ b/Templates/cconfigure.in @@ -595,22 +595,31 @@ CMAKE_ANSI_CFLAGS="" if test $ac_cv_prog_gcc = no; then case $system in HP-UX-*) - echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" - else - echo "$ac_t""no" 1>&6 - fi - echo $ac_n "checking whether ${CC} accepts -Ae""... $ac_c" 1>&6 - if test -z "`${CC} -Ae -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Ae" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Aa $CFLAGS" + AC_MSG_CHECKING([whether ${CC} accepts -Aa]) + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" + ],[ + AC_MSG_RESULT(no) + ]) + CFLAGS="$CFLAGS_ORIG" + + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Ae $CFLAGS" + AC_MSG_CHECKING([whether ${CC} accepts -Ae]) + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Ae" + ],[ + AC_MSG_RESULT(no) + ]) + CFLAGS="$CFLAGS_ORIG" ;; esac fi diff --git a/Templates/cxxconfigure b/Templates/cxxconfigure index 7b23fb5ea..9e3aac1ee 100755 --- a/Templates/cxxconfigure +++ b/Templates/cxxconfigure @@ -705,16 +705,53 @@ CXXFLAGS=$save_CXXFLAGS CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION="" if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking whether ${CXX} supports explicit instantiation""... $ac_c" 1>&6 - echo 'templateclass x{};template class x;' > conftest.cc - if test -z "`${CXX} -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - echo "$ac_t""no" 1>&6 - CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION="1" - fi - rm -f conftest* + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + echo $ac_n "checking whether ${CXX} supports explicit instantiation""... $ac_c" 1>&6 +echo "configure:712: checking whether ${CXX} supports explicit instantiation" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <class x{};template class x; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION=1 + echo "$ac_t""no" 1>&6 + fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" +fi + # if running on darwin no explicit template instantiations even though # syntax is supported. case $system in @@ -729,27 +766,100 @@ CMAKE_ANSI_CXXFLAGS="" if test $ac_cv_prog_gxx = no; then case $system in IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-LANG:std $CXXFLAGS" echo $ac_n "checking whether ${CXX} accepts -LANG:std""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -LANG:std -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-LANG:std" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* +echo "configure:773: checking whether ${CXX} accepts -LANG:std" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CXXFLAGS="-LANG:std" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" ;; OSF1-*) + + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-std strict_ansi -nopure_cname $CXXFLAGS" echo $ac_n "checking whether ${CXX} accepts -std strict_ansi -nopure_cname""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -std strict_ansi -nopure_cname -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; +echo "configure:821: checking whether ${CXX} accepts -std strict_ansi -nopure_cname" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" + ;; esac fi @@ -758,15 +868,51 @@ fi # to get the templates compiled correctly CMAKE_TEMPLATE_FLAGS="" if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS -ptused -no_prelink" + echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6 +echo "configure:875: checking whether ${CXX} accepts -ptused -no_prelink" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi @@ -774,68 +920,200 @@ fi # check non-g++ compilers to see if they have the standard # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6 -echo "configure:779: checking ansi standard C++ stream headers " >&5 - rm -rf conftest.* - cat > conftest.cc < -! - if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_ANSI_STREAM_HEADERS="1" - echo "$ac_t""no" 1>&6 - fi +echo "configure:927: checking ansi standard C++ stream headers " >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext < + +int main() { + +; return 0; } +EOF +if { (eval echo configure:946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_ANSI_STREAM_HEADERS=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi # check compilers to see if they have std::stringstream -echo $ac_n "checking for ansi standard C++ stringstream ""... $ac_c" 1>&6 -echo "configure:795: checking for ansi standard C++ stringstream " >&5 -rm -rf conftest.* -cat > conftest.cc <&6 +echo "configure:976: checking for ansi standard C++ stringstream" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext < -! -if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 + +int main() { + +; return 0; } +EOF +if { (eval echo configure:995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + +echo "$ac_t""yes" 1>&6 + else - CMAKE_NO_ANSI_STRING_STREAM="1" - echo "$ac_t""no" 1>&6 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +CMAKE_NO_ANSI_STRING_STREAM=1 +echo "$ac_t""no" 1>&6 + fi +rm -f conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +CXXFLAGS="$CXXFLAGS_ORIG" # 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:811: checking ansi standard namespace support " >&5 - rm -rf conftest.* - cat > conftest.cc < -void foo() { std::list l; } -! - if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_STD_NAMESPACE="1" - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + echo $ac_n "checking whether the std namespace is supported""... $ac_c" 1>&6 +echo "configure:1025: checking whether the std namespace is supported" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext < + void foo() { std::list(); } + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_STD_NAMESPACE=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi # check to see if for scoping is supported if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking ansi for scope support ""... $ac_c" 1>&6 -echo "configure:829: checking ansi for scope support " >&5 - rm -rf conftest.* - cat > conftest.cc <&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_ANSI_FOR_SCOPE="1" - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + echo $ac_n "checking ansi for scope support""... $ac_c" 1>&6 +echo "configure:1076: checking ansi for scope support" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_ANSI_FOR_SCOPE=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi @@ -846,7 +1124,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:850: checking for $ac_word" >&5 +echo "configure:1128: 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 diff --git a/Templates/cxxconfigure.in b/Templates/cxxconfigure.in index 3e1f5b108..168ca7b6a 100644 --- a/Templates/cxxconfigure.in +++ b/Templates/cxxconfigure.in @@ -41,16 +41,23 @@ CXXFLAGS=$save_CXXFLAGS CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION="" if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking whether ${CXX} supports explicit instantiation""... $ac_c" 1>&6 - echo 'templateclass x{};template class x;' > conftest.cc - if test -z "`${CXX} -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - echo "$ac_t""no" 1>&6 - CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION="1" - fi - rm -f conftest* + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + AC_MSG_CHECKING([whether ${CXX} supports explicit instantiation]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + templateclass x{};template class x; + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi + # if running on darwin no explicit template instantiations even though # syntax is supported. case $system in @@ -65,27 +72,40 @@ CMAKE_ANSI_CXXFLAGS="" if test $ac_cv_prog_gxx = no; then case $system in IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) - echo $ac_n "checking whether ${CXX} accepts -LANG:std""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -LANG:std -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-LANG:std" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-LANG:std $CXXFLAGS" + AC_MSG_CHECKING([whether ${CXX} accepts -LANG:std]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CXXFLAGS="-LANG:std" + ],[ + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" ;; OSF1-*) - echo $ac_n "checking whether ${CXX} accepts -std strict_ansi -nopure_cname""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -std strict_ansi -nopure_cname -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; + + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-std strict_ansi -nopure_cname $CXXFLAGS" + AC_MSG_CHECKING([whether ${CXX} accepts -std strict_ansi -nopure_cname]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" + ],[ + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" + ;; esac fi AC_SUBST(CMAKE_ANSI_CXXFLAGS) @@ -94,15 +114,21 @@ AC_SUBST(CMAKE_ANSI_CXXFLAGS) # to get the templates compiled correctly CMAKE_TEMPLATE_FLAGS="" if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking whether ${CXX} accepts -ptused -no_prelink""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.cc - if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS -ptused -no_prelink" + AC_MSG_CHECKING([whether ${CXX} accepts -ptused -no_prelink]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_TEMPLATE_FLAGS="-ptused -no_prelink" + ],[ + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi AC_SUBST(CMAKE_TEMPLATE_FLAGS) @@ -110,64 +136,80 @@ AC_SUBST(CMAKE_TEMPLATE_FLAGS) # check non-g++ compilers to see if they have the standard # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" AC_MSG_CHECKING( ansi standard C++ stream headers ) - rm -rf conftest.* - cat > conftest.cc < -! - if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_ANSI_STREAM_HEADERS="1" - echo "$ac_t""no" 1>&6 - fi + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_ANSI_STREAM_HEADERS=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi AC_SUBST(CMAKE_NO_ANSI_STREAM_HEADERS) # check compilers to see if they have std::stringstream -AC_MSG_CHECKING( for ansi standard C++ stringstream ) -rm -rf conftest.* -cat > conftest.cc < -! -if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 -else - CMAKE_NO_ANSI_STRING_STREAM="1" - echo "$ac_t""no" 1>&6 -fi +],,[ +AC_MSG_RESULT(yes) +],[ +CMAKE_NO_ANSI_STRING_STREAM=1 +AC_MSG_RESULT(no) +]) +AC_LANG_RESTORE +CXXFLAGS="$CXXFLAGS_ORIG" AC_SUBST(CMAKE_NO_ANSI_STRING_STREAM) # check to see if stl is in the std namespace if test $ac_cv_prog_gxx = no; then - AC_MSG_CHECKING( ansi standard namespace support ) - rm -rf conftest.* - cat > conftest.cc < -void foo() { std::list l; } -! - if test -z "`${CXX} ${CMAKE_ANSI_CXXFLAGS} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_STD_NAMESPACE="1" - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + AC_MSG_CHECKING([whether the std namespace is supported]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + void foo() { std::list(); } + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_STD_NAMESPACE=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi AC_SUBST(CMAKE_NO_STD_NAMESPACE) # check to see if for scoping is supported if test $ac_cv_prog_gxx = no; then - AC_MSG_CHECKING( ansi for scope support ) - rm -rf conftest.* - cat > conftest.cc <&1`"; then - echo "$ac_t""yes" 1>&6 - else - CMAKE_NO_ANSI_FOR_SCOPE="1" - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + AC_MSG_CHECKING([ansi for scope support]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() { for(int i;;); for(int i;;); } + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_ANSI_FOR_SCOPE=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi AC_SUBST(CMAKE_NO_ANSI_FOR_SCOPE) diff --git a/configure b/configure index bd4c27deb..5b1c6b348 100755 --- a/configure +++ b/configure @@ -952,39 +952,132 @@ CMAKE_ANSI_CXXFLAGS="" if test $ac_cv_prog_gxx = no; then case $system in HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Aa $CFLAGS" echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="-Aa" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; - IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) - echo $ac_n "checking whether ${CXX} accepts -LANG:std""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -LANG:std -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-LANG:std" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; - OSF1-*) - echo $ac_n "checking whether ${CXX} accepts -std strict_ansi -nopure_cname""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -std strict_ansi -nopure_cname -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; +echo "configure:959: checking whether ${CC} accepts -Aa" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + CFLAGS="$CFLAGS_ORIG" + ;; + IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-LANG:std $CXXFLAGS" + echo $ac_n "checking whether ${CXX} accepts -LANG:std""... $ac_c" 1>&6 +echo "configure:991: checking whether ${CXX} accepts -LANG:std" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CXXFLAGS="-LANG:std" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" + ;; + OSF1-*) + + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-std strict_ansi -nopure_cname $CXXFLAGS" + echo $ac_n "checking whether ${CXX} accepts -std strict_ansi -nopure_cname""... $ac_c" 1>&6 +echo "configure:1039: checking whether ${CXX} accepts -std strict_ansi -nopure_cname" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" + ;; esac fi @@ -993,77 +1086,197 @@ fi # check non-g++ compilers to see if they have the standard # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" echo $ac_n "checking ansi standard C++ stream headers ""... $ac_c" 1>&6 -echo "configure:998: checking ansi standard C++ stream headers " >&5 - rm -rf conftest.* - cat > conftest.cc < -! - if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - cat >> confdefs.h <<\EOF -#define CMAKE_NO_ANSI_STREAM_HEADERS 1 -EOF +echo "configure:1093: checking ansi standard C++ stream headers " >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross - echo "$ac_t""no" 1>&6 - fi + cat > conftest.$ac_ext < + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_ANSI_STREAM_HEADERS=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi # check non-g++ compilers to see if they have std::stringstream -echo $ac_n "checking for ansi standard C++ stringstream ""... $ac_c" 1>&6 -echo "configure:1016: checking for ansi standard C++ stringstream " >&5 -rm -rf conftest.* -cat > conftest.cc < -! -if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 -else - cat >> confdefs.h <<\EOF -#define CMAKE_NO_ANSI_STRING_STREAM 1 -EOF +CXXFLAGS_ORIG="$CXXFLAGS" +CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" +echo $ac_n "checking for ansi standard C++ stringstream""... $ac_c" 1>&6 +echo "configure:1141: checking for ansi standard C++ stringstream" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext < + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + +echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + +CMAKE_NO_ANSI_STRING_STREAM=1 +echo "$ac_t""no" 1>&6 - echo "$ac_t""no" 1>&6 fi +rm -f conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +CXXFLAGS="$CXXFLAGS_ORIG" # 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:1034: checking ansi standard namespace support " >&5 - rm -rf conftest.* - cat > conftest.cc < -void foo() { std::list l; } -! - if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - cat >> confdefs.h <<\EOF -#define CMAKE_NO_STD_NAMESPACE 1 -EOF + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + echo $ac_n "checking whether the std namespace is supported""... $ac_c" 1>&6 +echo "configure:1189: checking whether the std namespace is supported" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross - echo "$ac_t""no" 1>&6 - fi + cat > conftest.$ac_ext < + void foo() { std::list(); } + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_STD_NAMESPACE=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi # check to see if for scoping is supported if test $ac_cv_prog_gxx = no; then - echo $ac_n "checking ansi for scope support ""... $ac_c" 1>&6 -echo "configure:1054: checking ansi for scope support " >&5 - rm -rf conftest.* - cat > conftest.cc <&1`"; then - echo "$ac_t""yes" 1>&6 - else - cat >> confdefs.h <<\EOF -#define CMAKE_NO_ANSI_FOR_SCOPE 1 -EOF + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + echo $ac_n "checking ansi for scope support""... $ac_c" 1>&6 +echo "configure:1239: checking ansi for scope support" >&5 + + ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross - echo "$ac_t""no" 1>&6 - fi + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + CMAKE_NO_ANSI_FOR_SCOPE=1 + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + CXXFLAGS="$CXXFLAGS_ORIG" fi # find make to use to build cmake, prefer gmake @@ -1072,7 +1285,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:1076: checking for $ac_word" >&5 +echo "configure:1289: 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 diff --git a/configure.in b/configure.in index 6961574be..30e5cd2b3 100644 --- a/configure.in +++ b/configure.in @@ -67,39 +67,54 @@ CMAKE_ANSI_CXXFLAGS="" if test $ac_cv_prog_gxx = no; then case $system in HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) - echo $ac_n "checking whether ${CC} accepts -Aa""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CC} -Aa -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CFLAGS="-Aa" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* + CFLAGS_ORIG="$FLAGS" + CFLAGS="-Aa $CFLAGS" + AC_MSG_CHECKING([whether ${CC} accepts -Aa]) + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CFLAGS="$CMAKE_ANSI_CFLAGS -Aa" + ],[ + AC_MSG_RESULT(no) + ]) + CFLAGS="$CFLAGS_ORIG" ;; - IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) - echo $ac_n "checking whether ${CXX} accepts -LANG:std""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -LANG:std -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-LANG:std" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; + IRIX-5* | IRIX-6* | IRIX64-6* | IRIX-64-6*) + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-LANG:std $CXXFLAGS" + AC_MSG_CHECKING([whether ${CXX} accepts -LANG:std]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CXXFLAGS="-LANG:std" + ],[ + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" + ;; OSF1-*) - echo $ac_n "checking whether ${CXX} accepts -std strict_ansi -nopure_cname""... $ac_c" 1>&6 - echo 'void f(){}' > conftest.c - if test -z "`${CXX} -std strict_ansi -nopure_cname -c conftest.c 2>&1`"; then - echo "$ac_t""yes" 1>&6 - CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" - else - echo "$ac_t""no" 1>&6 - fi - rm -f conftest* - ;; + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="-std strict_ansi -nopure_cname $CXXFLAGS" + AC_MSG_CHECKING([whether ${CXX} accepts -std strict_ansi -nopure_cname]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() {} + ],,[ + AC_MSG_RESULT(yes) + CMAKE_ANSI_CXXFLAGS="-std strict_ansi -nopure_cname" + ],[ + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" + ;; esac fi AC_SUBST(CMAKE_ANSI_CFLAGS) @@ -108,61 +123,77 @@ AC_SUBST(CMAKE_ANSI_CXXFLAGS) # check non-g++ compilers to see if they have the standard # ansi stream files (without the .h) if test $ac_cv_prog_gxx = no; then + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" AC_MSG_CHECKING( ansi standard C++ stream headers ) - rm -rf conftest.* - cat > conftest.cc < -! - if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - AC_DEFINE(CMAKE_NO_ANSI_STREAM_HEADERS) - echo "$ac_t""no" 1>&6 - fi + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_ANSI_STREAM_HEADERS=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi # check non-g++ compilers to see if they have std::stringstream -AC_MSG_CHECKING( for ansi standard C++ stringstream ) -rm -rf conftest.* -cat > conftest.cc < -! -if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 -else - AC_DEFINE(CMAKE_NO_ANSI_STRING_STREAM) - echo "$ac_t""no" 1>&6 -fi +],,[ +AC_MSG_RESULT(yes) +],[ +CMAKE_NO_ANSI_STRING_STREAM=1 +AC_MSG_RESULT(no) +]) +AC_LANG_RESTORE +CXXFLAGS="$CXXFLAGS_ORIG" # check to see if stl is in the std namespace if test $ac_cv_prog_gxx = no; then - AC_MSG_CHECKING( ansi standard namespace support ) - rm -rf conftest.* - cat > conftest.cc < -void foo() { std::list l; } -! - if test -z "`${CXX} $CMAKE_ANSI_CXXFLAGS $CXXFLAGS $CPPFLAGS -c conftest.cc 2>&1`"; then - echo "$ac_t""yes" 1>&6 - else - AC_DEFINE(CMAKE_NO_STD_NAMESPACE) - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + AC_MSG_CHECKING([whether the std namespace is supported]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + void foo() { std::list(); } + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_STD_NAMESPACE=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi # check to see if for scoping is supported if test $ac_cv_prog_gxx = no; then - AC_MSG_CHECKING( ansi for scope support ) - rm -rf conftest.* - cat > conftest.cc <&1`"; then - echo "$ac_t""yes" 1>&6 - else - AC_DEFINE(CMAKE_NO_ANSI_FOR_SCOPE) - echo "$ac_t""no" 1>&6 - fi + CXXFLAGS_ORIG="$CXXFLAGS" + CXXFLAGS="$CMAKE_ANSI_CXXFLAGS $CXXFLAGS" + AC_MSG_CHECKING([ansi for scope support]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + void foo() { for(int i;;); for(int i;;); } + ],,[ + AC_MSG_RESULT(yes) + ],[ + CMAKE_NO_ANSI_FOR_SCOPE=1 + AC_MSG_RESULT(no) + ]) + AC_LANG_RESTORE + CXXFLAGS="$CXXFLAGS_ORIG" fi # find make to use to build cmake, prefer gmake