enable_win32_target
enable_symbian_target
enable_debug_rtl
+enable_static_rtl
enable_n32
enable_x32
enable_64bit
--enable-symbian-target=\$t
Specify symbian flavor. (WINSCW or GCCE)
--enable-debug-rtl Use the MSVC debug runtime library
+ --enable-static-rtl Use the MSVC static runtime library
--enable-n32 Enable n32 ABI support (IRIX only)
--enable-x32 Enable x32 ABI support (x86_64 only)
--enable-64bit Enable 64-bit support (on certain platforms)
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=6
+MOD_PATCH_VERSION=7
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
test -n "$CC" && break
done
- if test "$CC" = "cl"; then
- echo 'main() { return 0; }' > dummy.c
- ${CC} -o dummy dummy.c >/dev/null 2>&1
- if test $? = 0; then
- _WIN32_MSVC=1
- CXX=$CC
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $(CC) test failed. Using normal feature tests" >&5
-$as_echo "$as_me: WARNING: $(CC) test failed. Using normal feature tests" >&2;}
- fi
- rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
+ cat > conftest.c <<EOF
+#ifdef _MSC_VER
+COMPILER IS MSVC
+#endif
+EOF
+ read dummy <<EOF
+$($CC -E conftest.c 2>/dev/null | grep COMPILER)
+EOF
+ if test -n "$dummy"; then
+ _WIN32_MSVC=1
+ CXX=$CC
fi
+ rm -f conftest.c
;;
*-mks*)
_WIN32_MSVC=1
fi
+# Check whether --enable-static-rtl was given.
+if test "${enable_static_rtl+set}" = set; then :
+ enableval=$enable_static_rtl; if test "$enableval" = "yes"; then
+ USE_STATIC_RTL=1
+ fi
+fi
+
+
# Check whether --enable-n32 was given.
if test "${enable_n32+set}" = set; then :
enableval=$enable_n32; if test "$enableval" = "yes"; then
# Use temp file for windres (bug 213281)
RCFLAGS='-O coff --use-temp-file'
else
- CC=cl
- CXX=cl
LD=link
AR='lib -NOLOGO -OUT:"$@"'
AR_FLAGS=
fi
if test "$USE_DEBUG_RTL" = 1; then
- CFLAGS="$CFLAGS -MDd"
+ if test -n "$USE_STATIC_RTL"; then
+ CFLAGS="$CFLAGS -MTd"
+ else
+ CFLAGS="$CFLAGS -MDd"
+ fi
else
- CFLAGS="$CFLAGS -MD"
+ if test -n "$USE_STATIC_RTL"; then
+ CFLAGS="$CFLAGS -MT"
+ else
+ CFLAGS="$CFLAGS -MD"
+ fi
fi
if test -n "$MOZ_DEBUG"; then
else
$as_echo "#define _X86_ 1" >>confdefs.h
+ if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
+ CFLAGS="$CFLAGS -arch:IA32"
+ fi
fi
;;
x86_64)
;;
esac
-
-
case "$target_os" in
darwin*)
_HAVE_PTHREADS=1
;;
*)
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5
$as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
-echo "
- #include <pthread.h>
- void *foo(void *v) { return v; }
- int main() {
- pthread_t t;
- if (!pthread_create(&t, 0, &foo, 0)) {
- pthread_join(t, 0);
- }
- return 0;
- }" > dummy.c ;
- echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS" 1>&5;
- ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthreads $LDFLAGS $LIBS 2>&5;
- _res=$? ;
- rm -f dummy.c dummy${ac_exeext} ;
- if test "$_res" = "0"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthreads_pthread_create=yes
+else
+ ac_cv_lib_pthreads_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
+ _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-echo "
- #include <pthread.h>
- void *foo(void *v) { return v; }
- int main() {
- pthread_t t;
- if (!pthread_create(&t, 0, &foo, 0)) {
- pthread_join(t, 0);
- }
- return 0;
- }" > dummy.c ;
- echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS" 1>&5;
- ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lpthread $LDFLAGS $LIBS 2>&5;
- _res=$? ;
- rm -f dummy.c dummy${ac_exeext} ;
- if test "$_res" = "0"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+ _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5
$as_echo_n "checking for pthread_create in -lc_r... " >&6; }
-echo "
- #include <pthread.h>
- void *foo(void *v) { return v; }
- int main() {
- pthread_t t;
- if (!pthread_create(&t, 0, &foo, 0)) {
- pthread_join(t, 0);
- }
- return 0;
- }" > dummy.c ;
- echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS" 1>&5;
- ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc_r $LDFLAGS $LIBS 2>&5;
- _res=$? ;
- rm -f dummy.c dummy${ac_exeext} ;
- if test "$_res" = "0"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+if ${ac_cv_lib_c_r_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc" >&5
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_create=yes
+else
+ ac_cv_lib_c_r_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
+ _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc" >&5
$as_echo_n "checking for pthread_create in -lc... " >&6; }
-echo "
- #include <pthread.h>
- void *foo(void *v) { return v; }
- int main() {
- pthread_t t;
- if (!pthread_create(&t, 0, &foo, 0)) {
- pthread_join(t, 0);
- }
- return 0;
- }" > dummy.c ;
- echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS" 1>&5;
- ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -lc $LDFLAGS $LIBS 2>&5;
- _res=$? ;
- rm -f dummy.c dummy${ac_exeext} ;
- if test "$_res" = "0"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- _HAVE_PTHREADS=1
+if ${ac_cv_lib_c_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_pthread_create=yes
+else
+ ac_cv_lib_c_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_create" >&5
+$as_echo "$ac_cv_lib_c_pthread_create" >&6; }
+if test "x$ac_cv_lib_c_pthread_create" = xyes; then :
+ _HAVE_PTHREADS=1
- fi
+fi
- fi
+fi
- fi
+fi
- fi
+fi
;;
esac
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=6
+MOD_PATCH_VERSION=7
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
# Check to see if we are really running in a msvc environemnt
_WIN32_MSVC=
AC_CHECK_PROGS(CC, cl)
- if test "$CC" = "cl"; then
- echo 'main() { return 0; }' > dummy.c
- ${CC} -o dummy dummy.c >/dev/null 2>&1
- if test $? = 0; then
- _WIN32_MSVC=1
- CXX=$CC
- else
- AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
- fi
- rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
+ cat > conftest.c <<EOF
+#ifdef _MSC_VER
+COMPILER IS MSVC
+#endif
+EOF
+ read dummy <<EOF
+$($CC -E conftest.c 2>/dev/null | grep COMPILER)
+EOF
+ if test -n "$dummy"; then
+ _WIN32_MSVC=1
+ CXX=$CC
fi
+ rm -f conftest.c
;;
*-mks*)
_WIN32_MSVC=1
USE_DEBUG_RTL=0
fi ])
+AC_ARG_ENABLE(static-rtl,
+ [ --enable-static-rtl Use the MSVC static runtime library],
+ [ if test "$enableval" = "yes"; then
+ USE_STATIC_RTL=1
+ fi ])
+
AC_ARG_ENABLE(n32,
[ --enable-n32 Enable n32 ABI support (IRIX only)],
[ if test "$enableval" = "yes"; then
# Use temp file for windres (bug 213281)
RCFLAGS='-O coff --use-temp-file'
else
- CC=cl
- CXX=cl
LD=link
AR='lib -NOLOGO -OUT:"$@"'
AR_FLAGS=
fi
if test "$USE_DEBUG_RTL" = 1; then
- CFLAGS="$CFLAGS -MDd"
+ if test -n "$USE_STATIC_RTL"; then
+ CFLAGS="$CFLAGS -MTd"
+ else
+ CFLAGS="$CFLAGS -MDd"
+ fi
else
- CFLAGS="$CFLAGS -MD"
+ if test -n "$USE_STATIC_RTL"; then
+ CFLAGS="$CFLAGS -MT"
+ else
+ CFLAGS="$CFLAGS -MD"
+ fi
fi
if test -n "$MOZ_DEBUG"; then
AC_DEFINE(_AMD64_)
else
AC_DEFINE(_X86_)
+ if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
+ dnl Visual C++ 2012 defaults to -arch:SSE2. Use -arch:IA32
+ dnl to avoid requiring SSE2.
+ CFLAGS="$CFLAGS -arch:IA32"
+ fi
fi
;;
x86_64)
;;
esac
-dnl
-dnl Apparently, some systems cannot properly check for the pthread
-dnl library unless <pthread.h> is included so we need to test
-dnl using it
-dnl
-dnl MOZ_CHECK_PTHREADS(lib, success, failure)
-AC_DEFUN(MOZ_CHECK_PTHREADS,
-[
-AC_MSG_CHECKING([for pthread_create in -l$1])
-echo "
- #include <pthread.h>
- void *foo(void *v) { return v; }
- int main() {
- pthread_t t;
- if (!pthread_create(&t, 0, &foo, 0)) {
- pthread_join(t, 0);
- }
- return 0;
- }" > dummy.c ;
- echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
- ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
- _res=$? ;
- rm -f dummy.c dummy${ac_exeext} ;
- if test "$_res" = "0"; then
- AC_MSG_RESULT([yes])
- [$2]
- else
- AC_MSG_RESULT([no])
- [$3]
- fi
-])
-
case "$target_os" in
darwin*)
_HAVE_PTHREADS=1
;;
*)
- MOZ_CHECK_PTHREADS(pthreads,
+ AC_CHECK_LIB(pthreads, pthread_create,
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
- MOZ_CHECK_PTHREADS(pthread,
+ AC_CHECK_LIB(pthread, pthread_create,
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
- MOZ_CHECK_PTHREADS(c_r,
+ AC_CHECK_LIB(c_r, pthread_create,
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
- MOZ_CHECK_PTHREADS(c,
+ AC_CHECK_LIB(c, pthread_create,
_HAVE_PTHREADS=1
)
)