📄 configure.in
字号:
_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])MOZ_CHECK_PTHREADS(pthreads, _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", MOZ_CHECK_PTHREADS(pthread, _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", MOZ_CHECK_PTHREADS(c_r, _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", MOZ_CHECK_PTHREADS(c, _HAVE_PTHREADS=1 ) ) )) AC_ARG_WITH(pthreads, [ --with-pthreads Use system pthreads library as thread subsystem], [ if test "$withval" = "yes"; then if test -n "$_HAVE_PTHREADS"; then USE_PTHREADS=1 USE_USER_PTHREADS= USE_NSPR_THREADS= else AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]); fi else USE_PTHREADS= _PTHREAD_LDFLAGS= fi], [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 USE_USER_PTHREADS= USE_NSPR_THREADS= fi])AC_ARG_ENABLE(user-pthreads, [ --enable-user-pthreads Build using userland pthreads], [ if test "$enableval" = "yes"; then if test -n "$_HAVE_PTHREADS"; then USE_PTHREADS= USE_USER_PTHREADS=1 USE_NSPR_THREADS= else AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]); fi fi])AC_ARG_ENABLE(nspr-threads, [ --enable-nspr-threads Build using classic nspr threads], [ if test "$enableval" = "yes"; then USE_PTHREADS= USE_USER_PTHREADS= USE_NSPR_THREADS=1 fi])case "$target" in*-beos*) AC_ARG_WITH(bthreads, [ --with-bthreads Use system bthreads library as thread subsystem (BeOS only)], [ if test "$withval" = "yes"; then USE_BTHREADS=1 USE_USER_PTHREADS= USE_PTHREADS= fi]) ;;*-solaris*) AC_ARG_WITH(native-threads, [ --with-native-threads Use native system threads as thread subsystem (Solaris only)], [ if test "$withval" = "yes"; then USE_NATIVE_THREADS=1 USE_USER_PTHREADS= USE_PTHREADS= fi]) ;;esacfi # SKIP_LIBRARY_CHECKSAC_ARG_ENABLE(cplus, [ --enable-cplus Enable some c++ api routines], [ if test "$enableval" = "yes"; then USE_CPLUS=1 fi]) AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Compile ipv6 support], [ if test "$enableval" = "yes"; then USE_IPV6=1 else USE_IPV6= fi])AC_ARG_ENABLE(boehm, [ --enable-boehm Enable the Boehm Garbage Collector], [ if test "$enableval" = "yes"; then AC_DEFINE(GC_LEAK_DETECTOR) GC_LEAK_DETECTOR=1 fi])if test -n "$USE_PTHREADS"; then dnl See if -pthread is supported. rm -f conftest* ac_cv_have_dash_pthread=no AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread) echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthread=yes case "$target_os" in freebsd*)# Freebsd doesn't use -pthread for compiles, it uses them for linking ;; *) CFLAGS="$CFLAGS -pthread" CXXFLAGS="$CXXFLAGS -pthread" ;; esac fi fi rm -f conftest* AC_MSG_RESULT($ac_cv_have_dash_pthread) dnl dnl See if -pthreads is supported. dnl ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads) echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthreads=yes CFLAGS="$CFLAGS -pthreads" CXXFLAGS="$CXXFLAGS -pthreads" fi fi rm -f conftest* AC_MSG_RESULT($ac_cv_have_dash_pthreads) fi case "$target" in *-solaris*) if test "$ac_cv_have_dash_pthreads" = "yes"; then _PTHREAD_LDFLAGS= fi ;; *-freebsd*) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) dnl -pthread links in -lc_r, so don't specify it explicitly. if test "$ac_cv_have_dash_pthread" = "yes"; then _PTHREAD_LDFLAGS="-pthread" else _PTHREAD_LDFLAGS="-lc_r" fi ;; *-openbsd*|*-bsdi*|*-netbsd*) AC_DEFINE(_THREAD_SAFE) dnl -pthread links in -lc_r, so don't specify it explicitly. if test "$ac_cv_have_dash_pthread" = "yes"; then _PTHREAD_LDFLAGS= fi ;; *-linux*) AC_DEFINE(_REENTRANT) ;; esacelse if test -n "$USE_USER_PTHREADS"; then USE_PTHREADS= USE_NSPR_THREADS= else _PTHREAD_LDFLAGS= fifidnl Special thread exceptionscase "$target" in*-aix*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi case "$target_os" in aix4.1*) if test -z "$USE_PTHREADS"; then AC_DEFINE(AIX_RENAME_SELECT) fi ;; aix4.2*) if test -z "$USE_NSPR_THREADS"; then AC_DEFINE(HAVE_POINTER_LOCALTIME_R) fi ;; aix4.3*) if test -z "$USE_NSPR_THREADS"; then AC_DEFINE(HAVE_POINTER_LOCALTIME_R) fi if test -n "$USE_PTHREADS"; then AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) fi ;; esac ;;*-bsdi*) if test -n "$USE_PTHREADS"; then AC_DEFINE(_PR_NEED_PTHREAD_INIT) fi ;;*-freebsd*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi ;;*-hpux*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi if test "$USE_PTHREADS"; then if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then AC_DEFINE(_REENTRANT) AC_DEFINE(_PR_DCETHREADS) else AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L) AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) fi fi if test "$USE_USER_PTHREADS"; then AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L) fi ;;*-irix*) if test "${target_os}" = "irix6.5"; then if test -n "$USE_PTHREADS"; then AC_DEFINE(_PR_HAVE_GETHOST_R) AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER) fi fi ;;*-linux*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi ;;*-mingw*|*-cygwin*|*-msvc*|*-mksnt*) dnl win32 does not use pthreads USE_PTHREADS= _PTHREAD_LDFLAGS= USE_USER_PTHREADS= ;;*-netbsd*|*-openbsd*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi ;;*-osf*) if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi if test -n "$USE_PTHREADS"; then if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then : else AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) fi fi ;;*-solaris*) if test -n "$USE_NATIVE_THREADS"; then AC_DEFINE(_PR_GLOBAL_THREADS_ONLY) else if test -n "$USE_NSPR_THREADS"; then AC_DEFINE(_PR_LOCAL_THREADS_ONLY) fi fi if test -z "$USE_NSPR_THREADS"; then AC_DEFINE(_REENTRANT) AC_DEFINE(HAVE_POINTER_LOCALTIME_R) if test "$OS_TEST" = "i86pc"; then PR_MD_ASFILES=os_SunOS_x86.s else PR_MD_ASFILES=os_SunOS.s if test -n "$USE_64"; then PR_MD_ASFILES="$PR_MD_ASFILES os_SunOS_sparcv9.s" fi fi fi ;;*-nto*) if test -n "$USE_PTHREADS"; then AC_DEFINE(_PR_HAVE_GETHOST_R) AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER) fi ;;esacOS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"dnl If the user passed in arg to --enable-optimize,dnl make sure that we use it.if test -n "$_SAVE_OPTIMIZE_FLAGS"; then _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"fiif test -n "$MOZ_OPTIMIZE"; then CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS" CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"fiif test -n "$MOZ_DEBUG"; then CFLAGS="$CFLAGS $_DEBUG_FLAGS" CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"fiif test -n "$MOZ_OPTIMIZE"; then OBJDIR_TAG=_OPTelse OBJDIR_TAG=_DBGfiif test -n "$USE_64"; then COMPILER_TAG=_64fiRELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"dnl ========================================================dnl Substitution of found variables.dnl ========================================================AC_SUBST(SHELL_OVERRIDE)AC_SUBST(MOZILLA_CLIENT)AC_SUBST(CC)AC_SUBST(CXX)AC_SUBST(CFLAGS)AC_SUBST(CXXFLAGS)AC_SUBST(CPPFLAGS)AC_SUBST(HOST_CC)AC_SUBST(HOST_CFLAGS)AC_SUBST(LDFLAGS)AC_SUBST(GNU_CC)AC_SUBST(CROSS_COMPILE)AC_SUBST(MOZ_OPTIMIZE)AC_SUBST(USE_CPLUS)AC_SUBST(USE_IPV6)AC_SUBST(USE_N32)AC_SUBST(USE_64)AC_SUBST(OBJECT_MODE)AC_SUBST(GC_LEAK_DETECTOR)AC_SUBST(ENABLE_STRIP)AC_SUBST(USE_PTHREADS)AC_SUBST(USE_BTHREADS)AC_SUBST(USE_USER_PTHREADS)AC_SUBST(USE_NATIVE_THREADS)AC_SUBST(USE_NSPR_THREADS)AC_SUBST(LIBNSPR)AC_SUBST(LIBPLC)AC_SUBST(MOD_MAJOR_VERSION)AC_SUBST(MOD_MINOR_VERSION)AC_SUBST(MOD_REVISION_VERSION)AC_SUBST(NSPR_MODNAME)AC_SUBST(MDCPUCFG_H)AC_SUBST(PR_MD_CSRCS)AC_SUBST(PR_MD_ASFILES)AC_SUBST(PR_MD_ARCH_DIR)AC_SUBST(CPU_ARCH)AC_SUBST(OBJ_SUFFIX)AC_SUBST(LIB_SUFFIX)AC_SUBST(DLL_SUFFIX)AC_SUBST(ASM_SUFFIX)AC_SUBST(MKSHLIB)AC_SUBST(DSO_CFLAGS)AC_SUBST(DSO_LDOPTS)AC_SUBST(OS_TARGET)AC_SUBST(OS_ARCH)AC_SUBST(OS_RELEASE)AC_SUBST(OS_TEST)AC_SUBST(DEFINES)AC_SUBST(DEFS)AC_SUBST(AR)AC_SUBST(AR_FLAGS)AC_SUBST(AS)AC_SUBST(ASFLAGS)AC_SUBST(LD)AC_SUBST(DLLTOOL)AC_SUBST(WINDRES)AC_SUBST(RANLIB)AC_SUBST(PERL)AC_SUBST(STRIP)AC_SUBST(FILTER)AC_SUBST(IMPLIB)AC_SUBST(OS_LIBS)AC_SUBST(RESOLVE_LINK_SYMBOLS)AC_SUBST(AIX_LINK_OPTS)AC_SUBST(NOSUCHFILE)AC_SUBST(MOZ_OBJFORMAT)AC_SUBST(ULTRASPARC_LIBRARY)AC_SUBST(ULTRASPARC_FILTER_LIBRARY)AC_SUBST(OBJDIR)AC_SUBST(OBJDIR_NAME)AC_SUBST(RELEASE_OBJDIR_NAME)AC_SUBST(NSINSTALL)AC_SUBST(OPTIMIZER)AC_SUBST(RC)AC_SUBST(DLLFLAGS)AC_SUBST(EXEFLAGS)AC_SUBST(OS_DLLFLAGS)AC_SUBST(CYGWIN_WRAPPER)dnl ========================================================dnl Generate output files.dnl ========================================================MAKEFILES="Makefile config/Makefileconfig/autoconf.mkconfig/nsprincl.mkconfig/nsprincl.shconfig/nspr-configlib/Makefile lib/ds/Makefile lib/libc/Makefile lib/libc/include/Makefile lib/libc/src/Makefile lib/tests/Makefilepr/Makefile pr/include/Makefile pr/include/md/Makefile pr/include/obsolete/Makefile pr/include/private/Makefile pr/src/Makefile pr/src/io/Makefile pr/src/linking/Makefile pr/src/malloc/Makefile pr/src/md/Makefile pr/src/md/${PR_MD_ARCH_DIR}/Makefile pr/src/memory/Makefile pr/src/misc/Makefile pr/src/threads/Makefile pr/tests/Makefile pr/tests/dll/Makefile "dnl lib/tests/Makefilednl pr/tests/w16gui/Makefilednl tools/Makefileif test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"elif test -n "$USE_PTHREADS"; then MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"elif test -n "$USE_BTHREADS"; then MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"fiif test -n "$USE_CPLUS"; then MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"fiAC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -