diff options
author | cls%seawood.org <devnull@localhost> | 2005-06-01 15:30:48 +0000 |
---|---|---|
committer | cls%seawood.org <devnull@localhost> | 2005-06-01 15:30:48 +0000 |
commit | 57178d8feb032c86ac02fbf76db50d85a6393a6e (patch) | |
tree | 189bb007686b7146828db8086a1d45120c35f1a2 | |
parent | 04ef5ed1589473bfe0cdc1a6a727cfc2dbf3dd97 (diff) | |
download | nspr-hg-57178d8feb032c86ac02fbf76db50d85a6393a6e.tar.gz |
Add support for msys uname & cleanup OS_ARCH checks.
Thanks to Howard Chu <hyc@symas.com> for the patch.
Bug #294122 r=cls sr=wtc a=shaver
-rwxr-xr-x | configure | 107 | ||||
-rw-r--r-- | configure.in | 52 |
2 files changed, 85 insertions, 74 deletions
@@ -2874,33 +2874,45 @@ fi # 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 +case "$OS_ARCH" in +WIN95) OS_ARCH=WINNT OS_TARGET=WIN95 -elif test "$OS_ARCH" = 'Windows_95'; then + ;; +Windows_95) OS_ARCH=Windows_NT OS_TARGET=WIN95 -elif test "$OS_ARCH" = 'Windows_98'; then + ;; +Windows_98) OS_ARCH=Windows_NT OS_TARGET=WIN95 -elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then + ;; +CYGWIN_9*|CYGWIN_ME*) OS_ARCH='CYGWIN_NT-4.0' OS_TARGET=WIN95 -elif test "$OS_ARCH" = "OS_2"; then + ;; +OS_2) OS_ARCH=OS2 OS_TARGET=OS2 -fi + ;; +WINCE) + OS_ARCH=WINCE + OS_TARGET=WINCE + ;; +esac # # On WIN32, we also define the variable CPU_ARCH. # -if test "$OS_ARCH" = "WINNT"; then +case "$OS_ARCH" in +WINNT) CPU_ARCH=`uname -p` if test "$CPU_ARCH" = "I386"; then CPU_ARCH=x86 fi -elif test "$OS_ARCH" = "Windows_NT"; then + ;; +Windows_NT) # # If uname -s returns "Windows_NT", we assume that we are using # the uname.exe in MKS toolkit. @@ -2922,35 +2934,28 @@ elif test "$OS_ARCH" = "Windows_NT"; then 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 + ;; +CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*) # # 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. +# If uname -s returns MINGW32_NT-5.1, we assume that we are using +# the uname.exe in the MSYS tools. # + OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'` OS_ARCH=WINNT CPU_ARCH=`uname -m` # - # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine. + # 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 -fi + ;; +esac if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then OS_TARGET=WIN95 @@ -3005,17 +3010,17 @@ EOF DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib' ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6 -echo "configure:3009: checking for sys/atomic_op.h" >&5 +echo "configure:3014: checking for sys/atomic_op.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 -#line 3014 "configure" +#line 3019 "configure" #include "confdefs.h" #include <sys/atomic_op.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3024: \"$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* @@ -3172,7 +3177,7 @@ EOF _DEBUG_FLAGS='-gdwarf-2 -O0' MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6 -echo "configure:3176: checking for gethostbyaddr in -lbind" >&5 +echo "configure:3181: checking for gethostbyaddr in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3180,7 +3185,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <<EOF -#line 3184 "configure" +#line 3189 "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 @@ -3191,7 +3196,7 @@ int main() { gethostbyaddr() ; return 0; } EOF -if { (eval echo configure:3195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3200: \"$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 @@ -4422,17 +4427,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4426: checking for machine/builtins.h" >&5 +echo "configure:4431: checking for machine/builtins.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 -#line 4431 "configure" +#line 4436 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4441: \"$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* @@ -4974,7 +4979,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4978: checking for dlopen in -ldl" >&5 +echo "configure:4983: 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 @@ -4982,7 +4987,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4986 "configure" +#line 4991 "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 @@ -4993,7 +4998,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5002: \"$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 @@ -5010,17 +5015,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5014: checking for dlfcn.h" >&5 +echo "configure:5019: checking for dlfcn.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 -#line 5019 "configure" +#line 5024 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5029: \"$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* @@ -5053,13 +5058,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5057: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5062: 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 5063 "configure" +#line 5068 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -5077,7 +5082,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 5081 "configure" +#line 5086 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -5101,12 +5106,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5105: checking for $ac_func" >&5 +echo "configure:5110: 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 5110 "configure" +#line 5115 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5129,7 +5134,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5138: \"$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 @@ -5170,7 +5175,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5174: checking for +Olit support" >&5 +echo "configure:5179: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5204,7 +5209,7 @@ esac echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5208: checking for pthread_create in -lpthreads" >&5 +echo "configure:5213: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5226,7 +5231,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5230: checking for pthread_create in -lpthread" >&5 +echo "configure:5235: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5248,7 +5253,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5252: checking for pthread_create in -lc_r" >&5 +echo "configure:5257: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5270,7 +5275,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5274: checking for pthread_create in -lc" >&5 +echo "configure:5279: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5422,7 +5427,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:5426: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5431: 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 @@ -5445,7 +5450,7 @@ echo "configure:5426: 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:5449: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5454: 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 diff --git a/configure.in b/configure.in index 04862258..b6d03db6 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,7 @@ dnl Rights Reserved. dnl dnl Contributor(s): dnl Christopher Seawood <cls@seawood.org> +dnl Howard Chu <hyc@symas.com> dnl dnl Alternatively, the contents of this file may be used under the dnl terms of the GNU General Public License Version 2 or later (the @@ -634,33 +635,45 @@ fi # 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 +case "$OS_ARCH" in +WIN95) OS_ARCH=WINNT OS_TARGET=WIN95 -elif test "$OS_ARCH" = 'Windows_95'; then + ;; +Windows_95) OS_ARCH=Windows_NT OS_TARGET=WIN95 -elif test "$OS_ARCH" = 'Windows_98'; then + ;; +Windows_98) OS_ARCH=Windows_NT OS_TARGET=WIN95 -elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then + ;; +CYGWIN_9*|CYGWIN_ME*) OS_ARCH='CYGWIN_NT-4.0' OS_TARGET=WIN95 -elif test "$OS_ARCH" = "OS_2"; then + ;; +OS_2) OS_ARCH=OS2 OS_TARGET=OS2 -fi + ;; +WINCE) + OS_ARCH=WINCE + OS_TARGET=WINCE + ;; +esac # # On WIN32, we also define the variable CPU_ARCH. # -if test "$OS_ARCH" = "WINNT"; then +case "$OS_ARCH" in +WINNT) CPU_ARCH=`uname -p` if test "$CPU_ARCH" = "I386"; then CPU_ARCH=x86 fi -elif test "$OS_ARCH" = "Windows_NT"; then + ;; +Windows_NT) # # If uname -s returns "Windows_NT", we assume that we are using # the uname.exe in MKS toolkit. @@ -682,35 +695,28 @@ elif test "$OS_ARCH" = "Windows_NT"; then 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 + ;; +CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*) # # 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. +# If uname -s returns MINGW32_NT-5.1, we assume that we are using +# the uname.exe in the MSYS tools. # + OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'` OS_ARCH=WINNT CPU_ARCH=`uname -m` # - # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine. + # 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 -fi + ;; +esac if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then OS_TARGET=WIN95 |