diff options
author | cls%seawood.org <devnull@localhost> | 2001-01-19 09:43:44 +0000 |
---|---|---|
committer | cls%seawood.org <devnull@localhost> | 2001-01-19 09:43:44 +0000 |
commit | d303b0f45bc86563e89e266c43afbc910208b126 (patch) | |
tree | 579d284ede4df37a650f7e03cab687bf051eecf7 | |
parent | 51080eda5021a2d978d216cbe7eaa9bb17be12c6 (diff) | |
download | nspr-hg-d303b0f45bc86563e89e266c43afbc910208b126.tar.gz |
Landing changes to use autoconf on win32. Bug #58804
-rwxr-xr-x | build/autoconf/config.guess | 4 | ||||
-rwxr-xr-x | build/autoconf/config.sub | 5 | ||||
-rw-r--r-- | config/autoconf.mk.in | 2 | ||||
-rwxr-xr-x | configure | 796 | ||||
-rw-r--r-- | configure.in | 309 | ||||
-rw-r--r-- | pr/src/md/windows/Makefile.in | 2 | ||||
-rw-r--r-- | pr/src/md/windows/objs.mk | 6 |
7 files changed, 797 insertions, 327 deletions
diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess index 4758b11f..5ce66fdb 100755 --- a/build/autoconf/config.guess +++ b/build/autoconf/config.guess @@ -735,6 +735,10 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; +# Netscape's hacked uname + xx:WINNT:*) + echo i586-pc-msvc + exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; diff --git a/build/autoconf/config.sub b/build/autoconf/config.sub index 1a32872a..1e47930d 100755 --- a/build/autoconf/config.sub +++ b/build/autoconf/config.sub @@ -531,6 +531,10 @@ case $basic_machine in basic_machine=i386-unknown os=-mingw32 ;; + i386-msvc | msvc) + basic_machine=i386-unknown + os=-msvc + ;; i[34567]86-pw32 | pw32) basic_machine=i586-unknown os=-pw32 @@ -1009,6 +1013,7 @@ case $os in | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -msvc* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* | -storm-chaos*) # Remember, each alternative MUST END IN *, to match a version number. ;; diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 8eaf07ed..ae02b0d3 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -59,7 +59,7 @@ HOST_CFLAGS = @HOST_CFLAGS@ DEFINES = @DEFINES@ @DEFS@ MDCPUCFG_H = @MDCPUCFG_H@ -MOZ_TARGET = @MOZ_TARGET@ +MOZ_WIN32_TARGET= @MOZ_WIN32_TARGET@ PR_MD_CSRCS = @PR_MD_CSRCS@ PR_MD_ASFILES = @PR_MD_ASFILES@ PR_MD_ARCH_DIR = @PR_MD_ARCH_DIR@ @@ -21,7 +21,8 @@ ac_help="$ac_help ac_help="$ac_help --disable-shared Do not compile into shared libraries" ac_help="$ac_help - --enable-target=\$t Turn on features for target \$t when build has multiple targets" + --enable-win32-target=\$t + Specify win32 flavor. (WIN95 or WINNT)" ac_help="$ac_help --enable-n32 Enable n32 ABI support (IRIX only)" ac_help="$ac_help @@ -553,12 +554,6 @@ fi -d=`pwd` -if test "${srcdir}" = "$d" || test "${srcdir}" = "." ; then - echo "Do not build in the srcdir as it will override Makefiles used by non-autoconf build." - exit 1; -fi - ac_aux_dir= for ac_dir in ${srcdir}/build/autoconf $srcdir/${srcdir}/build/autoconf; do if test -f $ac_dir/install-sh; then @@ -606,7 +601,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:610: checking host system type" >&5 +echo "configure:605: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -627,7 +622,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:631: checking target system type" >&5 +echo "configure:626: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -645,7 +640,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:649: checking build system type" >&5 +echo "configure:644: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -704,8 +699,30 @@ HOST_LDFLAGS="${HOST_LDFLAGS=}" case "$target" in *-irix6*) USE_N32=1 ;; +*-cygwin*) + # Check to see if we are really running in a msvc environemnt + _WIN32_MSVC= + if test "$CC" = "cl" || test "$CXX" = "cl"; then + _WIN32_MSVC=1 + elif test -z "$CC"; then + echo 'main() { return 0; }' > dummy.c + cl -o dummy dummy.c + if test $? = 0; then + _WIN32_MSVC=1 + fi + rm -f dummy dummy.o dummy.obj dummy.exe dummy.c + fi + ;; +*-msvc*) + _WIN32_MSVC=1 + ;; esac +if test -n "$_WIN32_MSVC"; then + SKIP_COMPILER_CHECKS=1 + SKIP_LIBRARY_CHECKS=1 +fi + # Check whether --with-mozilla or --without-mozilla was given. if test "${with_mozilla+set}" = set; then withval="$with_mozilla" @@ -757,12 +774,12 @@ if test "${enable_shared+set}" = set; then fi -# Check whether --enable-target or --disable-target was given. -if test "${enable_target+set}" = set; then - enableval="$enable_target" - MOZ_TARGET=`echo $enableval | tr a-z A-Z` +# Check whether --enable-win32-target or --disable-win32-target was given. +if test "${enable_win32_target+set}" = set; then + enableval="$enable_win32_target" + MOZ_WIN32_TARGET=`echo $enableval | tr a-z A-Z` else - MOZ_TARGET= + MOZ_WIN32_TARGET= fi @@ -799,7 +816,7 @@ fi # Extract the first word of "whoami", so it can be a program name with args. set dummy whoami; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:803: checking for $ac_word" >&5 +echo "configure:820: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -847,9 +864,10 @@ else #define NDEBUG 1 EOF - DEFINES="$DEFINES -UDEBUG" + DEFINES="$DEFINES -U_DEBUG -UDEBUG" fi +if test -z "$SKIP_COMPILER_CHECKS"; then if test "$target" != "$host"; then echo "cross compiling from $host to $target" cross_compiling=yes @@ -859,14 +877,14 @@ if test "$target" != "$host"; then _SAVE_LDFLAGS="$LDFLAGS" echo $ac_n "checking for $host compiler""... $ac_c" 1>&6 -echo "configure:863: checking for $host compiler" >&5 +echo "configure:881: checking for $host compiler" >&5 if test -z "$HOST_CC"; then for ac_prog in gcc cc /usr/ucb/cc 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:870: checking for $ac_word" >&5 +echo "configure:888: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -913,16 +931,16 @@ test -n "$HOST_CC" || HOST_CC="""" LDFLAGS="$HOST_LDFLAGS" echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:917: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 +echo "configure:935: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 cat > conftest.$ac_ext <<EOF -#line 919 "configure" +#line 937 "configure" #include "confdefs.h" int main() { return(0); ; return 0; } EOF -if { (eval echo configure:926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_prog_host_cc_works=1 echo "$ac_t""yes" 1>&6 else @@ -943,7 +961,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:947: checking for $ac_word" >&5 +echo "configure:965: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -971,14 +989,14 @@ fi test -n "$CC" && break done -test -n "$CC" || CC=":" +test -n "$CC" || CC="echo" fi unset ac_cv_prog_CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:982: checking for $ac_word" >&5 +echo "configure:1000: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1008,7 +1026,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1012: checking for $ac_word" >&5 +echo "configure:1030: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1059,7 +1077,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1063: checking for $ac_word" >&5 +echo "configure:1081: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1091,7 +1109,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1095: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1113: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1102,12 +1120,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1106 "configure" +#line 1124 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1133,12 +1151,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1137: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1155: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1142: checking whether we are using GNU C" >&5 +echo "configure:1160: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1147,7 +1165,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1166,7 +1184,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1170: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1188: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1203,7 +1221,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:1207: checking for $ac_word" >&5 +echo "configure:1225: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1231,7 +1249,7 @@ fi test -n "$CXX" && break done -test -n "$CXX" || CXX=":" +test -n "$CXX" || CXX="echo" fi unset ac_cv_prog_CXX @@ -1240,7 +1258,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:1244: checking for $ac_word" >&5 +echo "configure:1262: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1272,7 +1290,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1276: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1294: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1283,12 +1301,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1287 "configure" +#line 1305 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1314,12 +1332,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1318: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1336: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1323: checking whether we are using GNU C++" >&5 +echo "configure:1341: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1328,7 +1346,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1347,7 +1365,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1351: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1369: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1384,7 +1402,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:1388: checking for $ac_word" >&5 +echo "configure:1406: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1412,7 +1430,7 @@ fi test -n "$RANLIB" && break done -test -n "$RANLIB" || RANLIB=":" +test -n "$RANLIB" || RANLIB="echo" fi if test -z "$AR"; then @@ -1421,7 +1439,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:1425: checking for $ac_word" >&5 +echo "configure:1443: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1449,7 +1467,7 @@ fi test -n "$AR" && break done -test -n "$AR" || AR=":" +test -n "$AR" || AR="echo" fi if test -z "$AS"; then @@ -1458,7 +1476,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:1462: checking for $ac_word" >&5 +echo "configure:1480: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1486,7 +1504,7 @@ fi test -n "$AS" && break done -test -n "$AS" || AS=":" +test -n "$AS" || AS="echo" fi if test -z "$LD"; then @@ -1495,7 +1513,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:1499: checking for $ac_word" >&5 +echo "configure:1517: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1523,7 +1541,7 @@ fi test -n "$LD" && break done -test -n "$LD" || LD=":" +test -n "$LD" || LD="echo" fi if test -z "$STRIP"; then @@ -1532,7 +1550,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:1536: checking for $ac_word" >&5 +echo "configure:1554: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1560,7 +1578,7 @@ fi test -n "$STRIP" && break done -test -n "$STRIP" || STRIP=":" +test -n "$STRIP" || STRIP="echo" fi if test -z "$DLLTOOL"; then @@ -1569,7 +1587,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:1573: checking for $ac_word" >&5 +echo "configure:1591: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1597,7 +1615,7 @@ fi test -n "$DLLTOOL" && break done -test -n "$DLLTOOL" || DLLTOOL=":" +test -n "$DLLTOOL" || DLLTOOL="echo" fi if test -z "$WINDRES"; then @@ -1606,7 +1624,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:1610: checking for $ac_word" >&5 +echo "configure:1628: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1634,15 +1652,161 @@ fi test -n "$WINDRES" && break done -test -n "$WINDRES" || WINDRES=":" +test -n "$WINDRES" || WINDRES="echo" fi else - # Extract the first word of "gcc", so it can be a program name with args. + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +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:1666: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CXX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1698: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&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 << EOF + +#line 1709 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cxx_cross=no + else + ac_cv_prog_cxx_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_works=no +fi +rm -fr 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 + +echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 +if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1740: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 +cross_compiling=$ac_cv_prog_cxx_cross + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:1745: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:1773: checking whether ${CXX-g++} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi + + if test "$CXX" = "cl" -a -z "$CC"; then + CC=$CXX + else + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1646: checking for $ac_word" >&5 +echo "configure:1810: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1672,7 +1836,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1676: checking for $ac_word" >&5 +echo "configure:1840: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1723,7 +1887,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1727: checking for $ac_word" >&5 +echo "configure:1891: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1755,7 +1919,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1923: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1766,12 +1930,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1770 "configure" +#line 1934 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1797,12 +1961,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1801: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1965: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1806: checking whether we are using GNU C" >&5 +echo "configure:1970: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1811,7 +1975,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1830,7 +1994,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1834: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1998: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1861,153 +2025,11 @@ else fi fi - for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl -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:1870: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CXX="$ac_prog" - break fi - done - IFS="$ac_save_ifs" -fi -fi -CXX="$ac_cv_prog_CXX" -if test -n "$CXX"; then - echo "$ac_t""$CXX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$CXX" && break -done -test -n "$CXX" || CXX="gcc" - - -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1902: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&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 << EOF - -#line 1913 "configure" -#include "confdefs.h" - -int main(){return(0);} -EOF -if { (eval echo configure:1918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cxx_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cxx_cross=no - else - ac_cv_prog_cxx_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_works=no -fi -rm -fr 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 - -echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 -if test $ac_cv_prog_cxx_works = no; then - { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1944: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 -cross_compiling=$ac_cv_prog_cxx_cross - -echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1949: checking whether we are using GNU C++" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.C <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gxx=yes -else - ac_cv_prog_gxx=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gxx" 1>&6 - -if test $ac_cv_prog_gxx = yes; then - GXX=yes -else - GXX= -fi - -ac_test_CXXFLAGS="${CXXFLAGS+set}" -ac_save_CXXFLAGS="$CXXFLAGS" -CXXFLAGS= -echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1977: checking whether ${CXX-g++} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then - ac_cv_prog_cxx_g=yes -else - ac_cv_prog_cxx_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS="$ac_save_CXXFLAGS" -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi - # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2011: checking for $ac_word" >&5 +echo "configure:2033: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2039,7 +2061,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:2043: checking for $ac_word" >&5 +echo "configure:2065: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2080,7 +2102,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:2084: checking for $ac_word" >&5 +echo "configure:2106: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2114,14 +2136,14 @@ fi test -n "$AR" && break done -test -n "$AR" || AR=":" +test -n "$AR" || AR="echo not_ar" - for ac_prog in ld + for ac_prog in ld link 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:2125: checking for $ac_word" >&5 +echo "configure:2147: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2155,14 +2177,14 @@ fi test -n "$LD" && break done -test -n "$LD" || LD=":" +test -n "$LD" || LD="echo not_ld" for ac_prog in strip 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:2166: checking for $ac_word" >&5 +echo "configure:2188: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2196,14 +2218,14 @@ fi test -n "$STRIP" && break done -test -n "$STRIP" || STRIP=":" +test -n "$STRIP" || STRIP="echo not_strip" for ac_prog in dlltool 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:2207: checking for $ac_word" >&5 +echo "configure:2229: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2237,14 +2259,14 @@ fi test -n "$DLLTOOL" && break done -test -n "$DLLTOOL" || DLLTOOL=":" +test -n "$DLLTOOL" || DLLTOOL="echo not_dlltool" for ac_prog in windres 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:2248: checking for $ac_word" >&5 +echo "configure:2270: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2278,7 +2300,7 @@ fi test -n "$WINDRES" && break done -test -n "$WINDRES" || WINDRES=":" +test -n "$WINDRES" || WINDRES="echo not_windres" if test -z "$HOST_CC"; then HOST_CC="$CC" @@ -2302,6 +2324,8 @@ else CROSS_COMPILE= fi +fi # SKIP_COMPILER_CHECKS + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2314,7 +2338,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2318: checking for a BSD compatible install" >&5 +echo "configure:2342: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2367,7 +2391,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:2371: checking whether ln -s works" >&5 +echo "configure:2395: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2392,7 +2416,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:2396: checking for $ac_word" >&5 +echo "configure:2420: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2426,7 +2450,7 @@ fi test -n "$PERL" && break done -test -n "$PERL" || PERL=":" +test -n "$PERL" || PERL="echo not_perl" OBJ_SUFFIX=o @@ -2439,22 +2463,132 @@ PR_MD_ARCH_DIR=unix AR_FLAGS='cr $@' AS='$(CC)' -OS_TARGET=`uname -s` OS_ARCH=`uname -s | sed -e 's|/|_|g'` OS_RELEASE=`uname -r` OS_TEST=`uname -m` -if test "${OS_ARCH}" = "IRIX64"; then +if test "$OS_ARCH" = "IRIX64"; then OS_ARCH=IRIX fi -if test "${OS_TARGET}" = "IRIX64"; then - OS_TARGET=IRIX +####################################################################### +# Master "Core Components" macros for getting the OS target # +####################################################################### + +# +# Note: OS_TARGET should be specified on the command line for gmake. +# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built. +# The difference between the Win95 target and the WinNT target is that +# the WinNT target uses Windows NT specific features not available +# in Windows 95. The Win95 target will run on Windows NT, but (supposedly) +# at lesser performance (the Win95 target uses threads; the WinNT target +# uses fibers). +# +# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target +# is built. See: win16_3.11.mk for lots more about the Win16 target. +# +# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no +# cross-compilation. +# + +# +# The following hack allows one to build on a WIN95 machine (as if +# s/he were cross-compiling on a WINNT host for a WIN95 target). +# It also accomodates for MKS's uname.exe. If you never intend +# to do development on a WIN95 machine, you don't need this hack. +# +if test "$OS_ARCH" = "WIN95"; then + OS_ARCH=WINNT + OS_TARGET=WIN95 +elif test "$OS_ARCH" = 'Windows_95'; then + OS_ARCH=Windows_NT + OS_TARGET=WIN95 +elif test "$OS_ARCH" = "CYGWIN_95-4.0"; then + OS_ARCH='CYGWIN_NT-4.0' + OS_TARGET=WIN95 +elif test "$OS_ARCH" = "OS2"; then + OS_ARCH=OS2 + OS_TARGET=OS2 +fi + +# +# On WIN32, we also define the variable CPU_ARCH. +# + +if test "$OS_ARCH" = "WINNT"; then + CPU_ARCH=`uname -p` + if test "$CPU_ARCH" = "I386"; then + CPU_ARCH=x86 + fi +elif test "$OS_ARCH" = "Windows_NT"; then +# +# If uname -s returns "Windows_NT", we assume that we are using +# the uname.exe in MKS toolkit. +# +# The -r option of MKS uname only returns the major version number. +# So we need to use its -v option to get the minor version number. +# Moreover, it doesn't have the -p option, so we need to use uname -m. +# + OS_ARCH=WINNT +# OS_MINOR_RELEASE=`uname -v` + if test "$OS_MINOR_RELEASE" = "00"; then + OS_MINOR_RELEASE=0 + fi + OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}" + CPU_ARCH=`uname -m` + # + # MKS's uname -m returns "586" on a Pentium machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +elif echo "$OS_ARCH" | grep -c CYGWIN_NT >/dev/null; then +# +# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using +# the uname.exe in the Cygwin tools. +# + OS_RELEASE=`echo $OS_ARCH | sed 's|^CYGWIN_NT-||'` + OS_ARCH=WINNT + CPU_ARCH=`uname -m` + # + # Cygwin's uname -m returns "i686" on a Pentium Pro machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +elif test "$OS_ARCH" = "CYGWIN32_NT"; then +# +# Prior to the Beta 20 release, Cygwin was called GNU-Win32. +# If uname -s returns "CYGWIN32/NT", we assume that we are using +# the uname.exe in the GNU-Win32 tools. +# + OS_ARCH=WINNT + CPU_ARCH=`uname -m` + # + # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +fi + +if test -z "$OS_TARGET"; then + OS_TARGET=$OS_ARCH fi +if test "$OS_TARGET" = "WIN95"; then + OS_RELEASE="4.0" +fi +if test "$OS_TARGET" = "WIN16"; then + OS_RELEASE= +fi +if test -z "$MOZ_WIN32_TARGET"; then + MOZ_WIN32_TARGET=$OS_TARGET +fi +OS_CONFIG="${OS_TARGET}${OS_RELEASE}" case "$host" in -*-mingw*) +*-mingw*|*-cygwin*|*-msvc*) ;; *-beos*) HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE" @@ -3130,38 +3264,130 @@ EOF esac ;; -*-mingw*) +*-mingw*|*-cygwin*|*-msvc*) cat >> confdefs.h <<\EOF #define XP_PC 1 EOF cat >> confdefs.h <<\EOF -#define NONAMELESSUNION 1 +#define WIN32 1 EOF PR_MD_ARCH_DIR=windows - if test -z "$GNU_CC"; then + + if test -n "$GNU_CC"; then + cat >> confdefs.h <<\EOF +#define NONAMELESSUNION 1 +EOF + + MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' + else + CC=cl + CXX=cl + LD=link + AR='lib -NOLOGO -OUT:"$@"' + AR_FLAGS= + RANLIB='echo not_ranlib' + NSINSTALL=nsinstall + INSTALL='${NSINSTALL}' + RC=rc.exe + GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb' OBJ_SUFFIX=obj LIB_SUFFIX=lib DLL_SUFFIX=dll + + CFLAGS="$CFLAGS -W3 -nologo -GF -Gy" + _DEBUG_FLAGS= + + if test -n "$MOZ_OPTIMIZE"; then + CFLAGS="$CFLAGS -MD" + OPTIMIZER=-O2 + DLLFLAGS='-OUT:"$@"' + OBJDIR_TAG=_OPT + + if test -n "$MOZ_PROFILE"; then + OPTIMIZER="$OPTIMIZER -Z7" + DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV" + LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV" + fi + else + if test -n "$USE_DEBUG_RTL"; then + CFLAGS="$CFLAGS -MDd" + else + CFLAGS="$CFLAGS -MD" + fi + OPTIMIZER="-Od -Z7" + DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"' + if test -n "$GLOWCODE"; then + DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"' + fi + OBJDIR_TAG=_DBG + LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV" + if test -n "$PROFILE"; then + LDFLAGS="$LDFLAGS -PROFILE -MAP" + DLLFLAGS="$DLLFLAGS -PROFILE -MAP" + fi + fi fi - MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' - case "$MOZ_TARGET" in + if test -n "$USE_STATIC_TLS"; then + cat >> confdefs.h <<\EOF +#define _PR_USE_STATIC_TLS 1 +EOF + + fi + + if test "$OS_TARGET" = "WINNT"; then + if test -z "$GNU_CC"; then + CFLAGS="$CFLAGS -GT" + fi + if test "$CPU_ARCH" = "x86"; then + CFLAGS="$CFLAGS -G5" + fi + cat >> confdefs.h <<\EOF +#define WINNT 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define WIN95 1 +EOF + + cat >> confdefs.h <<\EOF +#define _PR_GLOBAL_THREADS_ONLY 1 +EOF + + fi + + if test "$CPU_ARCH" = "x86"; then + CPU_ARCH_TAG= + else + CPU_ARCH_TAG=$CPU_ARCH + fi + + if test -n "$USE_DEBUG_RTL"; then + OBJDIR_SUFFIX=OBJD + else + OBJDIR_SUFFIX=OBJ + fi + + OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${OBJDIR_TAG}.${OBJDIR_SUFFIX}" + OBJDIR='${OBJDIR_NAME}' + + OS_DLLFLAGS='-nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE' + + case "$MOZ_WIN32_TARGET" in WINNT) - DEFINES="$DEFINES -DWIN32 -DWINNT -DWin32_Winsock" MDCPUCFG_H=_winnt.cfg ;; WIN95) - DEFINES="$DEFINES -UWINNT -DWIN32 -DWIN95 -DWin32_Winsock -D_PR_GLOBAL_THREADS_ONLY" MDCPUCFG_H=_win95.cfg ;; WIN16) - DEFINES="$DEFINES -UWINNT" MDCPUCFG_H=_win16.cfg ;; *) - { echo "configure: error: Missing MOZ_TARGET for ${target}. Use --enable-target to set." 1>&2; exit 1; } + { echo "configure: error: Missing MOZ_WIN32_TARGET for ${target}. Use --enable-win32-target to set." 1>&2; exit 1; } ;; esac @@ -3191,6 +3417,7 @@ EOF ;; esac + ;; *-nto*) @@ -3337,11 +3564,12 @@ if test "$enable_shared" = no; then MKSHLIB= fi +if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3345: checking how to run the C preprocessor" >&5 +echo "configure:3573: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3356,13 +3584,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 3360 "configure" +#line 3588 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3594: \"$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 : @@ -3373,13 +3601,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 3377 "configure" +#line 3605 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3611: \"$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 : @@ -3390,13 +3618,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 3394 "configure" +#line 3622 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3628: \"$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 : @@ -3422,13 +3650,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3426: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3654: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 3432 "configure" +#line 3660 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -3446,7 +3674,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 3450 "configure" +#line 3678 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -3470,12 +3698,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3474: checking for $ac_func" >&5 +echo "configure:3702: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3479 "configure" +#line 3707 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3498,7 +3726,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3526,7 +3754,7 @@ done echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:3530: checking for pthread_attr_init in -lpthreads" >&5 +echo "configure:3758: checking for pthread_attr_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3534,7 +3762,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <<EOF -#line 3538 "configure" +#line 3766 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3545,7 +3773,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3777: \"$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 @@ -3564,7 +3792,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:3568: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:3796: checking for pthread_attr_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3572,7 +3800,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 3576 "configure" +#line 3804 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3583,7 +3811,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3815: \"$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 @@ -3602,7 +3830,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 -echo "configure:3606: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:3834: checking for pthread_attr_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3610,7 +3838,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <<EOF -#line 3614 "configure" +#line 3842 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3621,7 +3849,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3853: \"$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 @@ -3640,7 +3868,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_init in -lc""... $ac_c" 1>&6 -echo "configure:3644: checking for pthread_attr_init in -lc" >&5 +echo "configure:3872: checking for pthread_attr_init in -lc" >&5 ac_lib_var=`echo c'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3648,7 +3876,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <<EOF -#line 3652 "configure" +#line 3880 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3659,7 +3887,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3891: \"$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 @@ -3768,6 +3996,8 @@ fi ;; esac +fi # SKIP_LIBRARY_CHECKS + # Check whether --enable-cplus or --disable-cplus was given. if test "${enable_cplus+set}" = set; then enableval="$enable_cplus" @@ -3790,7 +4020,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:3794: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:4024: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -3806,7 +4036,7 @@ echo "configure:3794: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:3810: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:4040: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -3821,7 +4051,7 @@ echo "configure:3810: checking whether ${CC-cc} accepts -pthreads" >&5 fi case "$target" in - *-mingw*|*-cygwin*|*-uwin*) + *-mingw*|*-cygwin*|*-uwin*|*-msvc*) ;; *-solaris*) cat >> confdefs.h <<\EOF @@ -3928,7 +4158,7 @@ EOF fi ;; -*-mingw*|*-cygwin*|*-uwin*) +*-mingw*|*-cygwin*|*-uwin*|*-msvc*) USE_PTHREADS= _PTHREAD_LDFLAGS= USE_USER_PTHREADS= @@ -3970,13 +4200,14 @@ esac OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS" +if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:3975: checking for dlopen" >&5 +echo "configure:4206: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3980 "configure" +#line 4211 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen(); below. */ @@ -3999,7 +4230,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4018,7 +4249,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4022: checking for dlopen in -ldl" >&5 +echo "configure:4253: 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 @@ -4026,7 +4257,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4030 "configure" +#line 4261 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4037,7 +4268,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4272: \"$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 @@ -4060,6 +4291,7 @@ fi fi +fi if test -n "$_SAVE_OPTIMIZE_FLAGS"; then _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS" @@ -4145,6 +4377,10 @@ fi + + + + MAKEFILES=" Makefile config/Makefile @@ -4381,7 +4617,7 @@ s%@USE_NSPR_THREADS@%$USE_NSPR_THREADS%g s%@NSPR_VERSION@%$NSPR_VERSION%g s%@NSPR_MODNAME@%$NSPR_MODNAME%g s%@MDCPUCFG_H@%$MDCPUCFG_H%g -s%@MOZ_TARGET@%$MOZ_TARGET%g +s%@MOZ_WIN32_TARGET@%$MOZ_WIN32_TARGET%g s%@PR_MD_CSRCS@%$PR_MD_CSRCS%g s%@PR_MD_ASFILES@%$PR_MD_ASFILES%g s%@PR_MD_ARCH_DIR@%$PR_MD_ARCH_DIR%g @@ -4409,6 +4645,10 @@ s%@OBJDIR@%$OBJDIR%g s%@OBJDIR_NAME@%$OBJDIR_NAME%g s%@NSINSTALL@%$NSINSTALL%g s%@OPTIMIZER@%$OPTIMIZER%g +s%@RC@%$RC%g +s%@CPU_ARCH_TAG@%$CPU_ARCH_TAG%g +s%@DLLFLAGS@%$DLLFLAGS%g +s%@OS_DLLFLAGS@%$OS_DLLFLAGS%g CEOF EOF diff --git a/configure.in b/configure.in index 8d6ca466..ac1b61d8 100644 --- a/configure.in +++ b/configure.in @@ -23,12 +23,6 @@ dnl AC_PREREQ(2.12) AC_INIT(config/libc_r.h) -d=`pwd` -if test "${srcdir}" = "$d" || test "${srcdir}" = "." ; then - echo "Do not build in the srcdir as it will override Makefiles used by non-autoconf build." - exit 1; -fi - AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) AC_CANONICAL_SYSTEM AC_PREFIX_DEFAULT(\${MOD_DEPTH}/dist) @@ -80,8 +74,30 @@ dnl ======================================================== case "$target" in *-irix6*) USE_N32=1 ;; +*-cygwin*) + # Check to see if we are really running in a msvc environemnt + _WIN32_MSVC= + if test "$CC" = "cl" || test "$CXX" = "cl"; then + _WIN32_MSVC=1 + elif test -z "$CC"; then + echo 'main() { return 0; }' > dummy.c + cl -o dummy dummy.c + if test $? = 0; then + _WIN32_MSVC=1 + fi + rm -f dummy dummy.o dummy.obj dummy.exe dummy.c + fi + ;; +*-msvc*) + _WIN32_MSVC=1 + ;; esac +if test -n "$_WIN32_MSVC"; then + SKIP_COMPILER_CHECKS=1 + SKIP_LIBRARY_CHECKS=1 +fi + dnl ======================================================== dnl = dnl = Check options that may affect the compiler @@ -121,10 +137,11 @@ AC_ARG_ENABLE(debug, AC_ARG_ENABLE(shared, [ --disable-shared Do not compile into shared libraries]) -AC_ARG_ENABLE(target, - [ --enable-target=\$t Turn on features for target \$t when build has multiple targets], - MOZ_TARGET=`echo $enableval | tr a-z A-Z`, - MOZ_TARGET=) +AC_ARG_ENABLE(win32-target, + [ --enable-win32-target=\$t + Specify win32 flavor. (WIN95 or WINNT)], + MOZ_WIN32_TARGET=`echo $enableval | tr a-z A-Z`, + MOZ_WIN32_TARGET=) AC_ARG_ENABLE(n32, [ --enable-n32 Enable n32 ABI support (IRIX only)], @@ -154,9 +171,10 @@ if test -n "$MOZ_DEBUG"; then DEFINES="$DEFINES -UNDEBUG" else AC_DEFINE(NDEBUG) - DEFINES="$DEFINES -UDEBUG" + DEFINES="$DEFINES -U_DEBUG -UDEBUG" fi +if test -z "$SKIP_COMPILER_CHECKS"; then dnl ======================================================== dnl Checks for compilers. dnl ======================================================== @@ -197,47 +215,51 @@ if test "$target" != "$host"; then LDFLAGS=$_SAVE_LDFLAGS if test -z "$CC"; then - AC_CHECK_PROGS(CC, "${target_alias}-gcc" "${target}-gcc", :) + AC_CHECK_PROGS(CC, "${target_alias}-gcc" "${target}-gcc", echo) fi unset ac_cv_prog_CC AC_PROG_CC if test -z "$CXX"; then - AC_CHECK_PROGS(CXX, "${target_alias}-g++" "${target}-g++", :) + AC_CHECK_PROGS(CXX, "${target_alias}-g++" "${target}-g++", echo) fi unset ac_cv_prog_CXX AC_PROG_CXX if test -z "$RANLIB"; then - AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", :) + AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", echo) fi if test -z "$AR"; then - AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", :) + AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", echo) fi if test -z "$AS"; then - AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", :) + AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", echo) fi if test -z "$LD"; then - AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", :) + AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", echo) fi if test -z "$STRIP"; then - AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", :) + AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", echo) fi if test -z "$DLLTOOL"; then - AC_CHECK_PROGS(DLLTOOL, "${target_alias}-dlltool" "${target}-dlltool", :) + AC_CHECK_PROGS(DLLTOOL, "${target_alias}-dlltool" "${target}-dlltool", echo) fi if test -z "$WINDRES"; then - AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", :) + AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", echo) fi else - AC_PROG_CC AC_PROG_CXX + if test "$CXX" = "cl" -a -z "$CC"; then + CC=$CXX + else + AC_PROG_CC + fi AC_PROG_RANLIB AC_PATH_PROGS(AS, as, $CC) - AC_PATH_PROGS(AR, ar, :) - AC_PATH_PROGS(LD, ld, :) - AC_PATH_PROGS(STRIP, strip, :) - AC_PATH_PROGS(DLLTOOL, dlltool, :) - AC_PATH_PROGS(WINDRES, windres, :) + AC_PATH_PROGS(AR, ar, echo not_ar) + AC_PATH_PROGS(LD, ld link, echo not_ld) + AC_PATH_PROGS(STRIP, strip, echo not_strip) + AC_PATH_PROGS(DLLTOOL, dlltool, echo not_dlltool) + AC_PATH_PROGS(WINDRES, windres, echo not_windres) if test -z "$HOST_CC"; then HOST_CC="$CC" fi @@ -260,12 +282,14 @@ else CROSS_COMPILE= fi +fi # SKIP_COMPILER_CHECKS + dnl ======================================================== dnl Checks for programs. dnl ======================================================== AC_PROG_INSTALL AC_PROG_LN_S -AC_PATH_PROGS(PERL, perl5 perl, :) +AC_PATH_PROGS(PERL, perl5 perl, echo not_perl) dnl ======================================================== dnl Default platform specific options @@ -280,18 +304,128 @@ PR_MD_ARCH_DIR=unix AR_FLAGS='cr $@' AS='$(CC)' -OS_TARGET=`uname -s` OS_ARCH=`uname -s | sed -e 's|/|_|g'` OS_RELEASE=`uname -r` OS_TEST=`uname -m` -if test "${OS_ARCH}" = "IRIX64"; then +if test "$OS_ARCH" = "IRIX64"; then OS_ARCH=IRIX fi -if test "${OS_TARGET}" = "IRIX64"; then - OS_TARGET=IRIX +####################################################################### +# Master "Core Components" macros for getting the OS target # +####################################################################### + +# +# Note: OS_TARGET should be specified on the command line for gmake. +# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built. +# The difference between the Win95 target and the WinNT target is that +# the WinNT target uses Windows NT specific features not available +# in Windows 95. The Win95 target will run on Windows NT, but (supposedly) +# at lesser performance (the Win95 target uses threads; the WinNT target +# uses fibers). +# +# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target +# is built. See: win16_3.11.mk for lots more about the Win16 target. +# +# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no +# cross-compilation. +# + +# +# The following hack allows one to build on a WIN95 machine (as if +# s/he were cross-compiling on a WINNT host for a WIN95 target). +# It also accomodates for MKS's uname.exe. If you never intend +# to do development on a WIN95 machine, you don't need this hack. +# +if test "$OS_ARCH" = "WIN95"; then + OS_ARCH=WINNT + OS_TARGET=WIN95 +elif test "$OS_ARCH" = 'Windows_95'; then + OS_ARCH=Windows_NT + OS_TARGET=WIN95 +elif test "$OS_ARCH" = "CYGWIN_95-4.0"; then + OS_ARCH='CYGWIN_NT-4.0' + OS_TARGET=WIN95 +elif test "$OS_ARCH" = "OS2"; then + OS_ARCH=OS2 + OS_TARGET=OS2 +fi + +# +# On WIN32, we also define the variable CPU_ARCH. +# + +if test "$OS_ARCH" = "WINNT"; then + CPU_ARCH=`uname -p` + if test "$CPU_ARCH" = "I386"; then + CPU_ARCH=x86 + fi +elif test "$OS_ARCH" = "Windows_NT"; then +# +# If uname -s returns "Windows_NT", we assume that we are using +# the uname.exe in MKS toolkit. +# +# The -r option of MKS uname only returns the major version number. +# So we need to use its -v option to get the minor version number. +# Moreover, it doesn't have the -p option, so we need to use uname -m. +# + OS_ARCH=WINNT +# OS_MINOR_RELEASE=`uname -v` + if test "$OS_MINOR_RELEASE" = "00"; then + OS_MINOR_RELEASE=0 + fi + OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}" + CPU_ARCH=`uname -m` + # + # MKS's uname -m returns "586" on a Pentium machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +elif echo "$OS_ARCH" | grep -c CYGWIN_NT >/dev/null; then +# +# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using +# the uname.exe in the Cygwin tools. +# + OS_RELEASE=`echo $OS_ARCH | sed 's|^CYGWIN_NT-||'` + OS_ARCH=WINNT + CPU_ARCH=`uname -m` + # + # Cygwin's uname -m returns "i686" on a Pentium Pro machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +elif test "$OS_ARCH" = "CYGWIN32_NT"; then +# +# Prior to the Beta 20 release, Cygwin was called GNU-Win32. +# If uname -s returns "CYGWIN32/NT", we assume that we are using +# the uname.exe in the GNU-Win32 tools. +# + OS_ARCH=WINNT + CPU_ARCH=`uname -m` + # + # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine. + # + if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then + CPU_ARCH=x86 + fi +fi + +if test -z "$OS_TARGET"; then + OS_TARGET=$OS_ARCH +fi +if test "$OS_TARGET" = "WIN95"; then + OS_RELEASE="4.0" +fi +if test "$OS_TARGET" = "WIN16"; then + OS_RELEASE= fi +if test -z "$MOZ_WIN32_TARGET"; then + MOZ_WIN32_TARGET=$OS_TARGET +fi +OS_CONFIG="${OS_TARGET}${OS_RELEASE}" dnl ======================================================== @@ -299,7 +433,7 @@ dnl ======================================================== dnl Override of system specific host options dnl ======================================================== case "$host" in -*-mingw*) +*-mingw*|*-cygwin*|*-msvc*) ;; *-beos*) HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE" @@ -702,32 +836,109 @@ case "$target" in esac ;; -*-mingw*) +*-mingw*|*-cygwin*|*-msvc*) AC_DEFINE(XP_PC) - AC_DEFINE(NONAMELESSUNION) + AC_DEFINE(WIN32) PR_MD_ARCH_DIR=windows - if test -z "$GNU_CC"; then + + if test -n "$GNU_CC"; then + AC_DEFINE(NONAMELESSUNION) + MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' + else + CC=cl + CXX=cl + LD=link + AR='lib -NOLOGO -OUT:"$@"' + AR_FLAGS= + RANLIB='echo not_ranlib' + NSINSTALL=nsinstall + INSTALL='${NSINSTALL}' + RC=rc.exe + GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb' OBJ_SUFFIX=obj LIB_SUFFIX=lib DLL_SUFFIX=dll + + CFLAGS="$CFLAGS -W3 -nologo -GF -Gy" + _DEBUG_FLAGS= + + if test -n "$MOZ_OPTIMIZE"; then + CFLAGS="$CFLAGS -MD" + OPTIMIZER=-O2 + DLLFLAGS='-OUT:"$@"' + OBJDIR_TAG=_OPT + + if test -n "$MOZ_PROFILE"; then + OPTIMIZER="$OPTIMIZER -Z7" + DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV" + LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV" + fi + else + if test -n "$USE_DEBUG_RTL"; then + CFLAGS="$CFLAGS -MDd" + else + CFLAGS="$CFLAGS -MD" + fi + OPTIMIZER="-Od -Z7" + DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"' + if test -n "$GLOWCODE"; then + DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"' + fi + OBJDIR_TAG=_DBG + LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV" + if test -n "$PROFILE"; then + LDFLAGS="$LDFLAGS -PROFILE -MAP" + DLLFLAGS="$DLLFLAGS -PROFILE -MAP" + fi + fi + fi + + if test -n "$USE_STATIC_TLS"; then + AC_DEFINE(_PR_USE_STATIC_TLS) + fi + + if test "$OS_TARGET" = "WINNT"; then + if test -z "$GNU_CC"; then + CFLAGS="$CFLAGS -GT" + fi + if test "$CPU_ARCH" = "x86"; then + CFLAGS="$CFLAGS -G5" + fi + AC_DEFINE(WINNT) + else + AC_DEFINE(WIN95) + AC_DEFINE(_PR_GLOBAL_THREADS_ONLY) fi - MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@' - case "$MOZ_TARGET" in + if test "$CPU_ARCH" = "x86"; then + CPU_ARCH_TAG= + else + CPU_ARCH_TAG=$CPU_ARCH + fi + + if test -n "$USE_DEBUG_RTL"; then + OBJDIR_SUFFIX=OBJD + else + OBJDIR_SUFFIX=OBJ + fi + + OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${OBJDIR_TAG}.${OBJDIR_SUFFIX}" + OBJDIR='${OBJDIR_NAME}' + + OS_DLLFLAGS='-nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE' + + case "$MOZ_WIN32_TARGET" in WINNT) - DEFINES="$DEFINES -DWIN32 -DWINNT -DWin32_Winsock" MDCPUCFG_H=_winnt.cfg ;; WIN95) - DEFINES="$DEFINES -UWINNT -DWIN32 -DWIN95 -DWin32_Winsock -D_PR_GLOBAL_THREADS_ONLY" MDCPUCFG_H=_win95.cfg ;; WIN16) - DEFINES="$DEFINES -UWINNT" MDCPUCFG_H=_win16.cfg ;; *) - AC_MSG_ERROR([Missing MOZ_TARGET for ${target}. Use --enable-target to set.]) + AC_MSG_ERROR([Missing MOZ_WIN32_TARGET for ${target}. Use --enable-win32-target to set.]) ;; esac @@ -745,6 +956,7 @@ case "$target" in AC_DEFINE(_CPU_ARCH_NOT_DEFINED) ;; esac + ;; *-nto*) @@ -850,6 +1062,7 @@ if test "$enable_shared" = no; then MKSHLIB= fi +if test -z "$SKIP_LIBRARY_CHECKS"; then dnl ======================================================== dnl Check for system libraries dnl ======================================================== @@ -994,6 +1207,8 @@ case "$target" in ;; esac +fi # SKIP_LIBRARY_CHECKS + AC_ARG_ENABLE(cplus, [ --enable-cplus Use cplus for whatever reason], [ if test "$enableval" = "yes"; then @@ -1043,7 +1258,7 @@ if test -n "$USE_PTHREADS"; then fi case "$target" in - *-mingw*|*-cygwin*|*-uwin*) + *-mingw*|*-cygwin*|*-uwin*|*-msvc*) ;; *-solaris*) AC_DEFINE(_REENTRANT) @@ -1111,7 +1326,7 @@ case "$target" in AC_DEFINE(_POSIX_C_SOURCE=199506L) fi ;; -*-mingw*|*-cygwin*|*-uwin*) +*-mingw*|*-cygwin*|*-uwin*|*-msvc*) dnl win32 does not use pthreads USE_PTHREADS= _PTHREAD_LDFLAGS= @@ -1142,9 +1357,11 @@ esac OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS" +if test -z "$SKIP_LIBRARY_CHECKS"; then AC_CHECK_FUNC(dlopen,,[ AC_CHECK_LIB(dl, dlopen, [OS_LIBS="-ldl $OS_LIBS"]) ]) +fi dnl If the user passed in arg to --enable-optimize, dnl make sure that we use it. @@ -1192,7 +1409,7 @@ AC_SUBST(USE_NSPR_THREADS) AC_SUBST(NSPR_VERSION) AC_SUBST(NSPR_MODNAME) AC_SUBST(MDCPUCFG_H) -AC_SUBST(MOZ_TARGET) +AC_SUBST(MOZ_WIN32_TARGET) AC_SUBST(PR_MD_CSRCS) AC_SUBST(PR_MD_ASFILES) AC_SUBST(PR_MD_ARCH_DIR) @@ -1234,6 +1451,10 @@ AC_SUBST(OBJDIR) AC_SUBST(OBJDIR_NAME) AC_SUBST(NSINSTALL) AC_SUBST(OPTIMIZER) +AC_SUBST(RC) +AC_SUBST(CPU_ARCH_TAG) +AC_SUBST(DLLFLAGS) +AC_SUBST(OS_DLLFLAGS) dnl ======================================================== dnl Generate output files. diff --git a/pr/src/md/windows/Makefile.in b/pr/src/md/windows/Makefile.in index 7915381e..1e70dc22 100644 --- a/pr/src/md/windows/Makefile.in +++ b/pr/src/md/windows/Makefile.in @@ -27,7 +27,7 @@ include $(MOD_DEPTH)/config/autoconf.mk include $(topsrcdir)/config/config.mk ifdef USE_AUTOCONF -OS_TARGET=$(MOZ_TARGET) +OS_TARGET=$(MOZ_WIN32_TARGET) endif ifeq ($(OS_TARGET), WIN16) diff --git a/pr/src/md/windows/objs.mk b/pr/src/md/windows/objs.mk index ecb51f6d..3820da67 100644 --- a/pr/src/md/windows/objs.mk +++ b/pr/src/md/windows/objs.mk @@ -14,7 +14,7 @@ # Copyright (C) 1999 Christopher Seawood. All Rights Reserved. # -ifeq (WINNT,$(MOZ_TARGET)) +ifeq (WINNT,$(MOZ_WIN32_TARGET)) CSRCS = ntmisc.c \ ntsec.c \ ntsem.c \ @@ -29,7 +29,7 @@ CSRCS = ntmisc.c \ w32rng.c \ w32shm.c else -ifeq (WIN95,$(MOZ_TARGET)) +ifeq (WIN95,$(MOZ_WIN32_TARGET)) CSRCS = ntmisc.c \ ntsec.c \ ntsem.c \ @@ -46,7 +46,7 @@ CSRCS = ntmisc.c \ w32shm.c \ w95dllmain.c else -ifeq (WIN16,$(MOZ_TARGET)) +ifeq (WIN16,$(MOZ_WIN32_TARGET)) CSRCS = w16null.c \ w16thred.c \ w16proc.c \ |