From c1d09252d4b39e25bc13f3c1bbfa5187f14358f7 Mon Sep 17 00:00:00 2001 From: "richm%stanfordalumni.org" Date: Fri, 10 Feb 2006 23:08:16 +0000 Subject: [PATCH] bug 325625 This fix allows the trunk ldap c sdk build to be used to build the mozilla client. I was able to use this to build the mozilla 1_8 branch of thunderbird on Fedora Core 4. Addressbook and typedown addressing work fine. The gist of the fix is to completely ignore svrcore if not specified, and to imply --with-nspr if --with-mozilla is specified. If not specified, the client build uses $(DIST)/include/nspr and $(DIST)/lib for the locations of the NSPR files. --- directory/c-sdk/build.mk | 5 + directory/c-sdk/config/autoconf.mk.in | 2 + directory/c-sdk/config/autoconf/nspr.m4 | 42 +- directory/c-sdk/config/autoconf/nss.m4 | 4 +- directory/c-sdk/config/autoconf/svrcore.m4 | 125 +- directory/c-sdk/configure | 1688 ++++++++------------ directory/c-sdk/configure.in | 242 +-- 7 files changed, 936 insertions(+), 1172 deletions(-) diff --git a/directory/c-sdk/build.mk b/directory/c-sdk/build.mk index 2c927b077b95..097f71fd7fdd 100644 --- a/directory/c-sdk/build.mk +++ b/directory/c-sdk/build.mk @@ -175,7 +175,12 @@ DYNAMICNSPR = -l$(PLCBASE) -l$(PLDSBASE) -l$(NSPRBASE) endif # use the NSPRLINK macro in other makefiles to define the linker command line +# the mozilla client build likes to set the makefile macro directly +ifdef LIBS_ALREADY_SET +NSPRLINK = $(NSPR_LIBS) +else NSPRLINK = $(NSPR_LIBS) $(DYNAMICNSPR) +endif # why the redundant definitions? apparently, all of these basename/libname macros are so that # the ldapsdk can create a package containing all of the nspr shared libs/dlls - I don't think diff --git a/directory/c-sdk/config/autoconf.mk.in b/directory/c-sdk/config/autoconf.mk.in index 0480c281ff5a..27fda2bf98f8 100644 --- a/directory/c-sdk/config/autoconf.mk.in +++ b/directory/c-sdk/config/autoconf.mk.in @@ -139,6 +139,8 @@ ifdef OBJECT_MODE export OBJECT_MODE endif +LIBS_ALREADY_SET=@LIBS_ALREADY_SET@ + # ldap-specific code (up to here, all the code came from # mozilla/nsprpub/config/autoconf.mk.in) # diff --git a/directory/c-sdk/config/autoconf/nspr.m4 b/directory/c-sdk/config/autoconf/nspr.m4 index 9138b2e50120..003254a00717 100644 --- a/directory/c-sdk/config/autoconf/nspr.m4 +++ b/directory/c-sdk/config/autoconf/nspr.m4 @@ -53,7 +53,7 @@ AC_ARG_WITH(nspr-exec-prefix, NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nspr` NSPR_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nspr` else - AC_MSG_ERROR([system NSPR not found]) + AC_MSG_CHECKING([system NSPR not found]) no_nspr="yes" fi else @@ -88,28 +88,36 @@ AC_ARG_WITH(nspr-exec-prefix, dnl AM_PATH_INTREE_NSPR([ROOTPATH, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for in-tree NSPR, and define NSPR_CFLAGS and NSPR_LIBS +dnl First look for path/*.OBJ/include, then look for path/include +dnl Use the cut in case there is more than one path that matches *.OBJ - just +dnl take the first one AC_DEFUN(AM_PATH_INTREE_NSPR, [ - nsprpath=`echo $1/*.OBJ | cut -f1 -d' '` - savedir=`pwd` - cd $nsprpath - abs_nsprpath=`pwd` - cd $savedir - if test -f "$abs_nsprpath/include/nspr.h" ; then - NSPR_CFLAGS="-I$abs_nsprpath/include" - fi - if test -d "$abs_nsprpath/lib" ; then - NSPR_LIBS="-L$abs_nsprpath/lib" - fi + AC_MSG_CHECKING(checking for in-tree NSPR from $1) + for nsprpath in "$1" "$1"/*.OBJ ; do + savedir=`pwd` + cd $nsprpath + abs_nsprpath=`pwd` + cd $savedir + if test -f "$abs_nsprpath/include/nspr/nspr.h" ; then + NSPR_CFLAGS="-I$abs_nsprpath/include/nspr" + elif test -f "$abs_nsprpath/include/nspr.h" ; then + NSPR_CFLAGS="-I$abs_nsprpath/include" + fi + if test -d "$abs_nsprpath/lib" ; then + NSPR_LIBS="-L$abs_nsprpath/lib" + fi + if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then + break + fi + done if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then - AC_MSG_CHECKING(using in-tree NSPR from $nsprpath) AC_SUBST(NSPR_CFLAGS) AC_SUBST(NSPR_LIBS) AC_MSG_RESULT(yes) else - AC_MSG_CHECKING(could not find in-tree NSPR in $nsprpath) AC_MSG_RESULT(no) - fi + fi ]) dnl AM_PATH_GIVEN_NSPR(no args) @@ -123,7 +131,11 @@ AC_DEFUN(AM_PATH_GIVEN_NSPR, AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory], [ if test "$withval" = "no" ; then + AC_MSG_RESULT(no) no_nspr="yes" + elif test "$withval" = "yes" ; then + AC_MSG_RESULT(yes) + no_nspr="no" elif test -e "$withval"/include/nspr.h -a -d "$withval"/lib then AC_MSG_RESULT([using $withval]) diff --git a/directory/c-sdk/config/autoconf/nss.m4 b/directory/c-sdk/config/autoconf/nss.m4 index e10290d00bee..f3110a81327c 100644 --- a/directory/c-sdk/config/autoconf/nss.m4 +++ b/directory/c-sdk/config/autoconf/nss.m4 @@ -140,8 +140,10 @@ AC_DEFUN(AM_PATH_GIVEN_NSS, NSS_CFLAGS="-I$withval/include" NSS_LIBS="-L$withval/lib" else + AC_MSG_RESULT(no) USE_NSS= - fi]) + fi], + AC_MSG_RESULT(no)) # check for --with-nss-inc AC_MSG_CHECKING(for --with-nss-inc) diff --git a/directory/c-sdk/config/autoconf/svrcore.m4 b/directory/c-sdk/config/autoconf/svrcore.m4 index fe61f5c49fdf..1bca55b76957 100644 --- a/directory/c-sdk/config/autoconf/svrcore.m4 +++ b/directory/c-sdk/config/autoconf/svrcore.m4 @@ -7,30 +7,35 @@ dnl AM_PATH_INTREE_SVRCORE([ROOTPATH, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]] dnl Test for in-tree SVRCORE, and define SVRCORE_CFLAGS and SVRCORE_LIBS AC_DEFUN(AM_PATH_INTREE_SVRCORE, [ - svrcorelibpath=`echo $1/*.OBJ/lib | cut -f1 -d' '` - savedir=`pwd` - cd $svrcorelibpath - abs_svrcorelibpath=`pwd` - cd $savedir - svrcoreincpath=$1/public/svrcore - savedir=`pwd` - cd $svrcoreincpath - abs_svrcoreincpath=`pwd` - cd $savedir - if test -f "$abs_svrcoreincpath/svrcore.h" ; then - SVRCORE_CFLAGS="-I$abs_svrcoreincpath" - fi - if test -d "$abs_svrcorelibpath" ; then - SVRCORE_LIBS="-L$abs_svrcorelibpath" - fi - if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then - AC_MSG_CHECKING(using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath) - AC_SUBST(SVRCORE_CFLAGS) - AC_SUBST(SVRCORE_LIBS) - AC_MSG_RESULT(yes) - else - AC_MSG_CHECKING(could not find in-tree SVRCORE in $1) - AC_MSG_RESULT(no) + if test -n "$HAVE_SVRCORE" ; then + svrcorelibpath=`echo $1/*.OBJ/lib | cut -f1 -d' '` + savedir=`pwd` + cd $svrcorelibpath + abs_svrcorelibpath=`pwd` + cd $savedir + svrcoreincpath=$1/public/svrcore + savedir=`pwd` + cd $svrcoreincpath + abs_svrcoreincpath=`pwd` + cd $savedir + if test -f "$abs_svrcoreincpath/svrcore.h" ; then + SVRCORE_CFLAGS="-I$abs_svrcoreincpath" + fi + if test -d "$abs_svrcorelibpath" ; then + SVRCORE_LIBS="-L$abs_svrcorelibpath -lsvrcore" + fi + if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then + AC_MSG_CHECKING(using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath) + AC_SUBST(SVRCORE_CFLAGS) + AC_SUBST(SVRCORE_LIBS) + AC_MSG_RESULT(yes) + elif test -n "$HAVE_SVRCORE" ; then + AC_MSG_CHECKING(could not find in-tree SVRCORE in $1) + AC_MSG_RESULT(no) + else + # If user didn't ask for it, don't complain (really!) + AC_MSG_RESULT(no) + fi fi ]) @@ -44,21 +49,19 @@ AC_DEFUN(AM_PATH_GIVEN_SVRCORE, AC_ARG_WITH(svrcore, [[ --with-svrcore[=PATH] Use svrcore - optional PATH is path to svrcore lib and include dirs]], [ if test "$withval" = "yes"; then + HAVE_SVRCORE=1 AC_MSG_RESULT(yes) - elif test -d "$withval" -a -d "$withval/lib" -a -f "$withval/include/svrcore.h" ; then + elif test -n "$withval" -a -d "$withval" -a -d "$withval/lib" -a -f "$withval/include/svrcore.h" ; then HAVE_SVRCORE=1 AC_MSG_RESULT([using $withval]) SVRCORE_CFLAGS="-I$withval/include" SVRCORE_LIB_PATH="-L$withval/lib" - else - HAVE_SVRCORE= fi], HAVE_SVRCORE=) # check for --with-svrcore-inc - AC_MSG_CHECKING(for --with-svrcore-inc) AC_ARG_WITH(svrcore-inc, [ --with-svrcore-inc=PATH svrcore include file directory], [ - if test -e "$withval"/svrcore.h + if test -n "$withval" -a -e "$withval"/svrcore.h then AC_MSG_RESULT([using $withval]) SVRCORE_CFLAGS="-I$withval" @@ -67,13 +70,12 @@ AC_DEFUN(AM_PATH_GIVEN_SVRCORE, AC_MSG_ERROR([$withval not found]) fi ], - AC_MSG_RESULT(no)) + ) # check for --with-svrcore-lib - AC_MSG_CHECKING(for --with-svrcore-lib) AC_ARG_WITH(svrcore-lib, [ --with-svrcore-lib=PATH svrcore library directory], [ - if test -d "$withval" + if test -n "$withval" -a -d "$withval" then AC_MSG_RESULT([using $withval]) SVRCORE_LIBS="-L$withval" @@ -82,12 +84,13 @@ AC_DEFUN(AM_PATH_GIVEN_SVRCORE, AC_MSG_ERROR([$withval not found]) fi ], - AC_MSG_RESULT(no)) + ) -dnl if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then -dnl AC_SUBST(SVRCORE_CFLAGS) -dnl AC_SUBST(SVRCORE_LIBS) -dnl fi + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS" ; then + AC_MSG_RESULT(no) + else + HAVE_SVRCORE=1 + fi ]) dnl AM_PATH_SVRCORE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) @@ -95,30 +98,32 @@ dnl Test for system SVRCORE, and define SVRCORE_CFLAGS and SVRCORE_LIBS AC_DEFUN(AM_PATH_SVRCORE, [dnl - no_svrcore="" - AC_MSG_CHECKING(Trying pkg-config svrcore) - AC_PATH_PROG(PKG_CONFIG, pkg-config) - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists svrcore; then - AC_MSG_CHECKING(using SVRCORE from package svrcore) - SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` - SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` + if test -n "$HAVE_SVRCORE" ; then + no_svrcore="" + AC_MSG_CHECKING(Trying pkg-config svrcore) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists svrcore; then + AC_MSG_CHECKING(using SVRCORE from package svrcore) + SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` + SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` + else +# AC_MSG_NOTICE([system SVRCORE not found]) + no_svrcore="yes" + fi else - AC_MSG_ERROR([system SVRCORE not found]) - no_svrcore="yes" + no_svrcore="yes" fi - else - no_svrcore="yes" + + if test -z "$no_svrcore"; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + fi + + + AC_SUBST(SVRCORE_CFLAGS) + AC_SUBST(SVRCORE_LIBS) fi - - if test -z "$no_svrcore"; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - fi - - - AC_SUBST(SVRCORE_CFLAGS) - AC_SUBST(SVRCORE_LIBS) ]) diff --git a/directory/c-sdk/configure b/directory/c-sdk/configure index dd30e13f3fdb..75b9e077fecd 100755 --- a/directory/c-sdk/configure +++ b/directory/c-sdk/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC dist_prefix dist_bindir dist_libdir NSPR_CONFIG PKG_CONFIG NSPR_CFLAGS NSPR_LIBS NSS_CONFIG NSS_CFLAGS NSS_LIBS SVRCORE_LIBS SVRCORE_CFLAGS WHOAMI CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CFLAGS ac_ct_CC CPP RANLIB ac_ct_RANLIB AS AR LD STRIP WINDRES HOST_CC PERL EGREP HAVE_MSVC_LIB SHELL_OVERRIDE MOZILLA_CLIENT HOST_CFLAGS GNU_CC CROSS_COMPILE MOZ_OPTIMIZE USE_CPLUS USE_IPV6 USE_N32 USE_64 OBJECT_MODE GC_LEAK_DETECTOR ENABLE_STRIP USE_PTHREADS USE_BTHREADS USE_USER_PTHREADS USE_NATIVE_THREADS USE_NSPR_THREADS USE_NSS CPU_ARCH OBJ_SUFFIX LIB_SUFFIX LIB_PREFIX DLL_SUFFIX ASM_SUFFIX PROG_SUFFIX MKSHLIB DSO_CFLAGS DSO_LDOPTS OS_TARGET OS_ARCH OS_RELEASE OS_TEST DEFINES AR_FLAGS ASFLAGS FILTER IMPLIB OS_LIBS RESOLVE_LINK_SYMBOLS NOSUCHFILE MOZ_OBJFORMAT ULTRASPARC_LIBRARY ULTRASPARC_FILTER_LIBRARY OBJDIR OBJDIR_NAME NSINSTALL OPTIMIZER RC DLLFLAGS EXEFLAGS OS_DLLFLAGS CYGWIN_WRAPPER WIN_TOP_SRC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC dist_prefix dist_bindir dist_libdir SVRCORE_LIBS PKG_CONFIG SVRCORE_CFLAGS NSS_CFLAGS NSS_LIBS NSS_CONFIG NSPR_CFLAGS NSPR_LIBS NSPR_CONFIG LIBS_ALREADY_SET WHOAMI CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CFLAGS ac_ct_CC CPP RANLIB ac_ct_RANLIB AS AR LD STRIP WINDRES HOST_CC PERL EGREP HAVE_MSVC_LIB SHELL_OVERRIDE MOZILLA_CLIENT HOST_CFLAGS GNU_CC CROSS_COMPILE MOZ_OPTIMIZE USE_CPLUS USE_IPV6 USE_N32 USE_64 OBJECT_MODE GC_LEAK_DETECTOR ENABLE_STRIP USE_PTHREADS USE_BTHREADS USE_USER_PTHREADS USE_NATIVE_THREADS USE_NSPR_THREADS USE_NSS CPU_ARCH OBJ_SUFFIX LIB_SUFFIX LIB_PREFIX DLL_SUFFIX ASM_SUFFIX PROG_SUFFIX MKSHLIB DSO_CFLAGS DSO_LDOPTS OS_TARGET OS_ARCH OS_RELEASE OS_TEST DEFINES AR_FLAGS ASFLAGS FILTER IMPLIB OS_LIBS RESOLVE_LINK_SYMBOLS NOSUCHFILE MOZ_OBJFORMAT ULTRASPARC_LIBRARY ULTRASPARC_FILTER_LIBRARY OBJDIR OBJDIR_NAME NSINSTALL OPTIMIZER RC DLLFLAGS EXEFLAGS OS_DLLFLAGS CYGWIN_WRAPPER WIN_TOP_SRC LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -876,13 +876,10 @@ Optional Packages: --with-dist-bindir=DIR build execuatables in DIR DIST_PREFIX/bin --with-dist-libdir=DIR build library files in DIR DIST_PREFIX/lib --with-mozilla Compile LDAP with Mozilla support - --with-system-nspr Use system installed NSPR - --with-nspr=PATH Netscape Portable Runtime (NSPR) directory - --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory - --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory - --with-nspr-prefix=PFX Prefix where NSPR is installed - --with-nspr-exec-prefix=PFX - Exec prefix where NSPR is installed + --with-system-svrcore Use system installed SVRCORE + --with-svrcore[=PATH] Use svrcore - optional PATH is path to svrcore lib and include dirs + --with-svrcore-inc=PATH svrcore include file directory + --with-svrcore-lib=PATH svrcore library directory --with-system-nss Use system installed NSS --with-nss[=PATH] Build libssldap, using NSS for crypto - optional PATH is path to NSS package --with-nss-inc=PATH Netscape Portable Runtime (NSS) include file directory @@ -890,10 +887,13 @@ Optional Packages: --with-nss-prefix=PFX Prefix where NSS is installed --with-nss-exec-prefix=PFX Exec prefix where NSS is installed - --with-system-svrcore Use system installed SVRCORE - --with-svrcore[=PATH] Use svrcore - optional PATH is path to svrcore lib and include dirs - --with-svrcore-inc=PATH svrcore include file directory - --with-svrcore-lib=PATH svrcore library directory + --with-system-nspr Use system installed NSPR + --with-nspr=PATH Netscape Portable Runtime (NSPR) directory + --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory + --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory + --with-nspr-prefix=PFX Prefix where NSPR is installed + --with-nspr-exec-prefix=PFX + Exec prefix where NSPR is installed --with-pthreads Use system pthreads library as thread subsystem --with-bthreads Use system bthreads library as thread subsystem (BeOS only) --with-native-threads Use native system threads as thread subsystem (Solaris only) @@ -1659,15 +1659,19 @@ if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" if test "$enableval" = "yes"; then USE_64=1 ; export USE_64 - elif test "$enableval" = "no"; then - USE_64= - else - # if the user specified nothing, just guess based on machine type + fi +else + arch=`uname -m` case $arch in x86_64|ppc64|ia64|s390x) USE_64=1 ; export USE_64 ;; + sun4u) instr_set=`optisa \`isalist\`` + case $instr_set in + sparcv9*) USE_64=1 ; export USE_64 ;; + esac + ;; esac - fi + fi; # Check whether --enable-mdupdate or --disable-mdupdate was given. @@ -1679,23 +1683,631 @@ if test "${enable_mdupdate+set}" = set; then fi; +# Check whether --with-system-svrcore or --without-system-svrcore was given. +if test "${with_system_svrcore+set}" = set; then + withval="$with_system_svrcore" + if test "$withval" = "yes"; then + _SYSTEM_SVRCORE=1 + HAVE_SVRCORE=1 + SVRCORE_LIBS=-lsvrcore + + USE_NSS=1 + no_nspr=no + else + _SYSTEM_SVRCORE= + fi +else + _SYSTEM_SVRCORE= +fi; + +if test -z "$_SYSTEM_SVRCORE" ; then + + echo "$as_me:$LINENO: checking for --with-svrcore" >&5 +echo $ECHO_N "checking for --with-svrcore... $ECHO_C" >&6 + +# Check whether --with-svrcore or --without-svrcore was given. +if test "${with_svrcore+set}" = set; then + withval="$with_svrcore" + if test "$withval" = "yes"; then + HAVE_SVRCORE=1 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + elif test -n "$withval" -a -d "$withval" -a -d "$withval/lib" -a -f "$withval/include/svrcore.h" ; then + HAVE_SVRCORE=1 + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + SVRCORE_CFLAGS="-I$withval/include" + SVRCORE_LIB_PATH="-L$withval/lib" + fi +else + HAVE_SVRCORE= +fi; + + # check for --with-svrcore-inc + +# Check whether --with-svrcore-inc or --without-svrcore-inc was given. +if test "${with_svrcore_inc+set}" = set; then + withval="$with_svrcore_inc" + + if test -n "$withval" -a -e "$withval"/svrcore.h + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + SVRCORE_CFLAGS="-I$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +fi; + + # check for --with-svrcore-lib + +# Check whether --with-svrcore-lib or --without-svrcore-lib was given. +if test "${with_svrcore_lib+set}" = set; then + withval="$with_svrcore_lib" + + if test -n "$withval" -a -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + SVRCORE_LIBS="-L$withval" + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +fi; + + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + HAVE_SVRCORE=1 + fi + + + if test -n "$HAVE_SVRCORE" ; then + USE_NSS=1 + no_nspr=no + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS" ; then + if test -n "$_SYSTEM_SVRCORE"; then + + if test -n "$HAVE_SVRCORE" ; then + no_svrcore="" + echo "$as_me:$LINENO: checking Trying pkg-config svrcore" >&5 +echo $ECHO_N "checking Trying pkg-config svrcore... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists svrcore; then + echo "$as_me:$LINENO: checking using SVRCORE from package svrcore" >&5 +echo $ECHO_N "checking using SVRCORE from package svrcore... $ECHO_C" >&6 + SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` + SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` + else +# AC_MSG_NOTICE([system SVRCORE not found]) + no_svrcore="yes" + fi + else + no_svrcore="yes" + fi + + if test -z "$no_svrcore"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + MOZ_NATIVE_SVRCORE=1 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + + + + + fi + + else + + if test -n "$HAVE_SVRCORE" ; then + svrcorelibpath=`echo ../../dist/*.OBJ/lib | cut -f1 -d' '` + savedir=`pwd` + cd $svrcorelibpath + abs_svrcorelibpath=`pwd` + cd $savedir + svrcoreincpath=../../dist/public/svrcore + savedir=`pwd` + cd $svrcoreincpath + abs_svrcoreincpath=`pwd` + cd $savedir + if test -f "$abs_svrcoreincpath/svrcore.h" ; then + SVRCORE_CFLAGS="-I$abs_svrcoreincpath" + fi + if test -d "$abs_svrcorelibpath" ; then + SVRCORE_LIBS="-L$abs_svrcorelibpath -lsvrcore" + fi + if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then + echo "$as_me:$LINENO: checking using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath" >&5 +echo $ECHO_N "checking using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath... $ECHO_C" >&6 + + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + elif test -n "$HAVE_SVRCORE" ; then + echo "$as_me:$LINENO: checking could not find in-tree SVRCORE in ../../dist" >&5 +echo $ECHO_N "checking could not find in-tree SVRCORE in ../../dist... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + # If user didn't ask for it, don't complain (really!) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + fi + + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then + + if test -n "$HAVE_SVRCORE" ; then + no_svrcore="" + echo "$as_me:$LINENO: checking Trying pkg-config svrcore" >&5 +echo $ECHO_N "checking Trying pkg-config svrcore... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists svrcore; then + echo "$as_me:$LINENO: checking using SVRCORE from package svrcore" >&5 +echo $ECHO_N "checking using SVRCORE from package svrcore... $ECHO_C" >&6 + SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` + SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` + else +# AC_MSG_NOTICE([system SVRCORE not found]) + no_svrcore="yes" + fi + else + no_svrcore="yes" + fi + + if test -z "$no_svrcore"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + MOZ_NATIVE_SVRCORE=1 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + + + + + fi + + fi + fi + fi + fi +fi + +if test -n "$HAVE_SVRCORE" ; then + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then + { { echo "$as_me:$LINENO: error: --with-svrcore specified, but no svrcore could be found" >&5 +echo "$as_me: error: --with-svrcore specified, but no svrcore could be found" >&2;} + { (exit 1); exit 1; }; } + fi +fi + + +# Check whether --with-system-nss or --without-system-nss was given. +if test "${with_system_nss+set}" = set; then + withval="$with_system_nss" + if test "$withval" = "yes"; then + _SYSTEM_NSS=1 + USE_NSS=1 + no_nspr=no + elif test "$withval" = "no" ; then + _SYSTEM_NSS=no + fi +else + _SYSTEM_NSS= +fi; + +if test "$_WIN32_MSVC"; then + _SYSTEM_NSS= +fi + +if test -z "$_SYSTEM_NSS" -o "$_SYSTEM_NSS" = "no" ; then + + echo "$as_me:$LINENO: checking for --with-nss" >&5 +echo $ECHO_N "checking for --with-nss... $ECHO_C" >&6 + +# Check whether --with-nss or --without-nss was given. +if test "${with_nss+set}" = set; then + withval="$with_nss" + if test "$withval" = "yes"; then + USE_NSS=1 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then + USE_NSS=1 + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + NSS_CFLAGS="-I$withval/include" + NSS_LIBS="-L$withval/lib" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + USE_NSS= + fi +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + + # check for --with-nss-inc + echo "$as_me:$LINENO: checking for --with-nss-inc" >&5 +echo $ECHO_N "checking for --with-nss-inc... $ECHO_C" >&6 + +# Check whether --with-nss-inc or --without-nss-inc was given. +if test "${with_nss_inc+set}" = set; then + withval="$with_nss_inc" + + if test -e "$withval"/nss.h + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + NSS_CFLAGS="-I$withval" + USE_NSS=1 + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + + # check for --with-nss-lib + echo "$as_me:$LINENO: checking for --with-nss-lib" >&5 +echo $ECHO_N "checking for --with-nss-lib... $ECHO_C" >&6 + +# Check whether --with-nss-lib or --without-nss-lib was given. +if test "${with_nss_lib+set}" = set; then + withval="$with_nss_lib" + + if test -d "$withval" + then + echo "$as_me:$LINENO: result: using $withval" >&5 +echo "${ECHO_T}using $withval" >&6 + NSS_LIBS="-L$withval" + USE_NSS=1 + else + echo + { { echo "$as_me:$LINENO: error: $withval not found" >&5 +echo "$as_me: error: $withval not found" >&2;} + { (exit 1); exit 1; }; } + fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + +fi + +if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then + no_nspr=no + if test -z "$_SYSTEM_NSS" -o "$_SYSTEM_NSS" = "no" ; then + + nsslibpath=`echo ../../dist/*.OBJ/lib | cut -f1 -d' '` + savedir=`pwd` + cd $nsslibpath + abs_nsslibpath=`pwd` + cd $savedir + nssincpath=../../dist/public/nss + savedir=`pwd` + cd $nssincpath + abs_nssincpath=`pwd` + cd $savedir + if test -f "$abs_nssincpath/nss.h" ; then + NSS_CFLAGS="-I$abs_nssincpath" + fi + if test -d "$abs_nsslibpath" ; then + NSS_LIBS="-L$abs_nsslibpath" + fi + if test -n "$NSS_CFLAGS" -a -n "$NSS_LIBS" ; then + echo "$as_me:$LINENO: checking using in-tree NSS from $nssincpath $nsslibpath" >&5 +echo $ECHO_N "checking using in-tree NSS from $nssincpath $nsslibpath... $ECHO_C" >&6 + + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: checking could not find in-tree NSS in ../../dist" >&5 +echo $ECHO_N "checking could not find in-tree NSS in ../../dist... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + + fi + if test -z "$NSS_CFLAGS" -a "$_SYSTEM_NSS" != "no" ; then + + +# Check whether --with-nss-prefix or --without-nss-prefix was given. +if test "${with_nss_prefix+set}" = set; then + withval="$with_nss_prefix" + nss_config_prefix="$withval" +else + nss_config_prefix="" +fi; + + +# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given. +if test "${with_nss_exec_prefix+set}" = set; then + withval="$with_nss_exec_prefix" + nss_config_exec_prefix="$withval" +else + nss_config_exec_prefix="" +fi; + + if test -n "$nss_config_exec_prefix"; then + nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix" + if test -z "$NSS_CONFIG"; then + NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config + fi + fi + if test -n "$nss_config_prefix"; then + nss_config_args="$nss_config_args --prefix=$nss_config_prefix" + if test -z "$NSS_CONFIG"; then + NSS_CONFIG=$nss_config_prefix/bin/nss-config + fi + fi + + if test -z "$NSS_CONFIG" ; then + unset ac_cv_path_NSS_CONFIG + # Extract the first word of "nss-config", so it can be a program name with args. +set dummy nss-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NSS_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NSS_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NSS_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no" + ;; +esac +fi +NSS_CONFIG=$ac_cv_path_NSS_CONFIG + +if test -n "$NSS_CONFIG"; then + echo "$as_me:$LINENO: result: $NSS_CONFIG" >&5 +echo "${ECHO_T}$NSS_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + min_nss_version=3.9.0 + echo "$as_me:$LINENO: checking for NSS - version >= $min_nss_version (skipping)" >&5 +echo $ECHO_N "checking for NSS - version >= $min_nss_version (skipping)... $ECHO_C" >&6 + fi + + no_nss="" + if test "$NSS_CONFIG" = "no"; then + echo "$as_me:$LINENO: checking nss-config not found" >&5 +echo $ECHO_N "checking nss-config not found... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nss; then + echo "$as_me:$LINENO: checking using NSS from package nss" >&5 +echo $ECHO_N "checking using NSS from package nss... $ECHO_C" >&6 + NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I nss` + NSS_LIBS=`$PKG_CONFIG --libs-only-L nss` + elif $PKG_CONFIG --exists mozilla-nss; then + echo "$as_me:$LINENO: checking using NSS from package mozilla-nss" >&5 +echo $ECHO_N "checking using NSS from package mozilla-nss... $ECHO_C" >&6 + NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nss` + NSS_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nss` + else + { { echo "$as_me:$LINENO: error: system NSS not found" >&5 +echo "$as_me: error: system NSS not found" >&2;} + { (exit 1); exit 1; }; } + no_nss="yes" + fi + else + no_nss="yes" + fi + else + echo "$as_me:$LINENO: checking using NSS from $NSS_CONFIG" >&5 +echo $ECHO_N "checking using NSS from $NSS_CONFIG... $ECHO_C" >&6 + NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags` + NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs` + + nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + fi + + if test -z "$no_nss"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + MOZ_NATIVE_NSS=1 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + + + + + + + fi +fi + +if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then + { { echo "$as_me:$LINENO: error: Need to use NSS but no NSS was found" >&5 +echo "$as_me: error: Need to use NSS but no NSS was found" >&2;} + { (exit 1); exit 1; }; } +fi + + # Check whether --with-system-nspr or --without-system-nspr was given. if test "${with_system_nspr+set}" = set; then withval="$with_system_nspr" if test "$withval" = "yes"; then _SYSTEM_NSPR=1 - else - _SYSTEM_NSPR= + no_nspr=no + elif test "$withval" = "no"; then + _SYSTEM_NSPR=no fi else _SYSTEM_NSPR= fi; if test "$_WIN32_MSVC"; then - _SYSTEM_NSPR= + _SYSTEM_NSPR=no fi -# first, see if user has specified explicit NSPR include and lib paths +if test -z "$_SYSTEM_NSPR" -o "$_SYSTEM_NSPR" = "no" ; then # check for --with-nspr echo "$as_me:$LINENO: checking for --with-nspr" >&5 @@ -1706,7 +2318,13 @@ if test "${with_nspr+set}" = set; then withval="$with_nspr" if test "$withval" = "no" ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 no_nspr="yes" + elif test "$withval" = "yes" ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + no_nspr="no" elif test -e "$withval"/include/nspr.h -a -d "$withval"/lib then echo "$as_me:$LINENO: result: using $withval" >&5 @@ -1775,210 +2393,42 @@ else echo "${ECHO_T}no" >&6 fi; - -# next, see if user explicitly said to use system nspr -if test -z "$no_nspr" -a -z "$NSPR_CFLAGS" -a -z "$NSPR_LIBS" ; then - if test -n "$_SYSTEM_NSPR"; then - - -# Check whether --with-nspr-prefix or --without-nspr-prefix was given. -if test "${with_nspr_prefix+set}" = set; then - withval="$with_nspr_prefix" - nspr_config_prefix="$withval" -else - nspr_config_prefix="" -fi; - - -# Check whether --with-nspr-exec-prefix or --without-nspr-exec-prefix was given. -if test "${with_nspr_exec_prefix+set}" = set; then - withval="$with_nspr_exec_prefix" - nspr_config_exec_prefix="$withval" -else - nspr_config_exec_prefix="" -fi; - - if test -n "$nspr_config_exec_prefix"; then - nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix" - if test -z "$NSPR_CONFIG"; then - NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config - fi - fi - if test -n "$nspr_config_prefix"; then - nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix" - if test -z "$NSPR_CONFIG"; then - NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config - fi - fi - - if test -z "$NSPR_CONFIG" ; then - unset ac_cv_path_NSPR_CONFIG - # Extract the first word of "nspr-config", so it can be a program name with args. -set dummy nspr-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NSPR_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NSPR_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NSPR_CONFIG="$NSPR_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NSPR_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_NSPR_CONFIG" && ac_cv_path_NSPR_CONFIG="no" - ;; -esac -fi -NSPR_CONFIG=$ac_cv_path_NSPR_CONFIG - -if test -n "$NSPR_CONFIG"; then - echo "$as_me:$LINENO: result: $NSPR_CONFIG" >&5 -echo "${ECHO_T}$NSPR_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi - min_nspr_version=4.0.0 - echo "$as_me:$LINENO: checking for NSPR - version >= $min_nspr_version (skipping)" >&5 -echo $ECHO_N "checking for NSPR - version >= $min_nspr_version (skipping)... $ECHO_C" >&6 - fi +if test "$no_nspr" == "no" -a -z "$NSPR_CFLAGS" -a -z "$NSPR_LIBS" ; then + if test -z "$_SYSTEM_NSPR" -o "$_SYSTEM_NSPR" = "no" ; then - no_nspr="" - if test "$NSPR_CONFIG" = "no"; then - echo "$as_me:$LINENO: checking nspr-config not found" >&5 -echo $ECHO_N "checking nspr-config not found... $ECHO_C" >&6 - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists nspr; then - echo "$as_me:$LINENO: checking using NSPR from package nspr" >&5 -echo $ECHO_N "checking using NSPR from package nspr... $ECHO_C" >&6 - NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I nspr` - NSPR_LIBS=`$PKG_CONFIG --libs-only-L nspr` - elif $PKG_CONFIG --exists mozilla-nspr; then - echo "$as_me:$LINENO: checking using NSPR from package mozilla-nspr" >&5 -echo $ECHO_N "checking using NSPR from package mozilla-nspr... $ECHO_C" >&6 - NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nspr` - NSPR_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nspr` - else - { { echo "$as_me:$LINENO: error: system NSPR not found" >&5 -echo "$as_me: error: system NSPR not found" >&2;} - { (exit 1); exit 1; }; } - no_nspr="yes" - fi - else - no_nspr="yes" + echo "$as_me:$LINENO: checking checking for in-tree NSPR from ../../dist" >&5 +echo $ECHO_N "checking checking for in-tree NSPR from ../../dist... $ECHO_C" >&6 + for nsprpath in "../../dist" "../../dist"/*.OBJ ; do + savedir=`pwd` + cd $nsprpath + abs_nsprpath=`pwd` + cd $savedir + if test -f "$abs_nsprpath/include/nspr/nspr.h" ; then + NSPR_CFLAGS="-I$abs_nsprpath/include/nspr" + elif test -f "$abs_nsprpath/include/nspr.h" ; then + NSPR_CFLAGS="-I$abs_nsprpath/include" fi - else - echo "$as_me:$LINENO: checking using NSPR from $NSPR_CONFIG" >&5 -echo $ECHO_N "checking using NSPR from $NSPR_CONFIG... $ECHO_C" >&6 - NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags` - NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs` - - nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - fi - - if test -z "$no_nspr"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - MOZ_NATIVE_NSPR=1 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - - - - - - else -# see if we are being built in the same build tree as nspr - - nsprpath=`echo ../../dist/*.OBJ | cut -f1 -d' '` - savedir=`pwd` - cd $nsprpath - abs_nsprpath=`pwd` - cd $savedir - if test -f "$abs_nsprpath/include/nspr.h" ; then - NSPR_CFLAGS="-I$abs_nsprpath/include" - fi - if test -d "$abs_nsprpath/lib" ; then - NSPR_LIBS="-L$abs_nsprpath/lib" - fi + if test -d "$abs_nsprpath/lib" ; then + NSPR_LIBS="-L$abs_nsprpath/lib" + fi + if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then + break + fi + done if test -n "$NSPR_CFLAGS" -a -n "$NSPR_LIBS" ; then - echo "$as_me:$LINENO: checking using in-tree NSPR from $nsprpath" >&5 -echo $ECHO_N "checking using in-tree NSPR from $nsprpath... $ECHO_C" >&6 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:$LINENO: checking could not find in-tree NSPR in $nsprpath" >&5 -echo $ECHO_N "checking could not find in-tree NSPR in $nsprpath... $ECHO_C" >&6 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi -# failing that, see if we can find nspr-config or pkg-config nspr - if test -z "$NSPR_CFLAGS" ; then + fi + if test -z "$NSPR_CFLAGS" -a "$_SYSTEM_NSPR" != "no" ; then # Check whether --with-nspr-prefix or --without-nspr-prefix was given. @@ -2113,9 +2563,8 @@ echo $ECHO_N "checking using NSPR from package mozilla-nspr... $ECHO_C" >&6 NSPR_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nspr` NSPR_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nspr` else - { { echo "$as_me:$LINENO: error: system NSPR not found" >&5 -echo "$as_me: error: system NSPR not found" >&2;} - { (exit 1); exit 1; }; } + echo "$as_me:$LINENO: checking system NSPR not found" >&5 +echo $ECHO_N "checking system NSPR not found... $ECHO_C" >&6 no_nspr="yes" fi else @@ -2149,778 +2598,26 @@ echo "${ECHO_T}no" >&6 - fi - fi + fi fi -if test -n "$_SYSTEM_NSPR" -a -z "$MOZ_NATIVE_NSPR"; then - NSPR_CFLAGS='-I$(DIST)/include/nspr' - NSPR_LIBS='-L$(DIST)/lib '"-lplds$NSPR_VERSION -lplc$NSPR_VERSION -lnspr$NSPR_VERSION" - # explicitly set libs for Visual Age C++ for OS/2 - if test "$VACPP" = "yes"; then - NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS'' - elif test "$_WIN32_MSVC"; then - NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib ' - fi -fi - - -# Check whether --with-system-nss or --without-system-nss was given. -if test "${with_system_nss+set}" = set; then - withval="$with_system_nss" - if test "$withval" = "yes"; then - _SYSTEM_NSS=1 - USE_NSS=1 - else - _SYSTEM_NSS= - fi -else - _SYSTEM_NSS= -fi; - -if test "$_WIN32_MSVC"; then - _SYSTEM_NSS= -fi - -# first, see if user has specified explicit NSS include and lib paths - - echo "$as_me:$LINENO: checking for --with-nss" >&5 -echo $ECHO_N "checking for --with-nss... $ECHO_C" >&6 - -# Check whether --with-nss or --without-nss was given. -if test "${with_nss+set}" = set; then - withval="$with_nss" - if test "$withval" = "yes"; then - USE_NSS=1 - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then - USE_NSS=1 - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - NSS_CFLAGS="-I$withval/include" - NSS_LIBS="-L$withval/lib" - else - USE_NSS= - fi -fi; - - # check for --with-nss-inc - echo "$as_me:$LINENO: checking for --with-nss-inc" >&5 -echo $ECHO_N "checking for --with-nss-inc... $ECHO_C" >&6 - -# Check whether --with-nss-inc or --without-nss-inc was given. -if test "${with_nss_inc+set}" = set; then - withval="$with_nss_inc" - - if test -e "$withval"/nss.h - then - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - NSS_CFLAGS="-I$withval" - USE_NSS=1 - else - echo - { { echo "$as_me:$LINENO: error: $withval not found" >&5 -echo "$as_me: error: $withval not found" >&2;} - { (exit 1); exit 1; }; } - fi - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi; - - # check for --with-nss-lib - echo "$as_me:$LINENO: checking for --with-nss-lib" >&5 -echo $ECHO_N "checking for --with-nss-lib... $ECHO_C" >&6 - -# Check whether --with-nss-lib or --without-nss-lib was given. -if test "${with_nss_lib+set}" = set; then - withval="$with_nss_lib" - - if test -d "$withval" - then - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - NSS_LIBS="-L$withval" - USE_NSS=1 - else - echo - { { echo "$as_me:$LINENO: error: $withval not found" >&5 -echo "$as_me: error: $withval not found" >&2;} - { (exit 1); exit 1; }; } - fi - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi; - - -# next, see if user explicitly said to use system nss -if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then - if test -n "$_SYSTEM_NSS"; then - - -# Check whether --with-nss-prefix or --without-nss-prefix was given. -if test "${with_nss_prefix+set}" = set; then - withval="$with_nss_prefix" - nss_config_prefix="$withval" -else - nss_config_prefix="" -fi; - - -# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given. -if test "${with_nss_exec_prefix+set}" = set; then - withval="$with_nss_exec_prefix" - nss_config_exec_prefix="$withval" -else - nss_config_exec_prefix="" -fi; - - if test -n "$nss_config_exec_prefix"; then - nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix" - if test -z "$NSS_CONFIG"; then - NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config - fi - fi - if test -n "$nss_config_prefix"; then - nss_config_args="$nss_config_args --prefix=$nss_config_prefix" - if test -z "$NSS_CONFIG"; then - NSS_CONFIG=$nss_config_prefix/bin/nss-config - fi - fi - - if test -z "$NSS_CONFIG" ; then - unset ac_cv_path_NSS_CONFIG - # Extract the first word of "nss-config", so it can be a program name with args. -set dummy nss-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NSS_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NSS_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NSS_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no" - ;; -esac -fi -NSS_CONFIG=$ac_cv_path_NSS_CONFIG - -if test -n "$NSS_CONFIG"; then - echo "$as_me:$LINENO: result: $NSS_CONFIG" >&5 -echo "${ECHO_T}$NSS_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - min_nss_version=3.9.0 - echo "$as_me:$LINENO: checking for NSS - version >= $min_nss_version (skipping)" >&5 -echo $ECHO_N "checking for NSS - version >= $min_nss_version (skipping)... $ECHO_C" >&6 - fi - - no_nss="" - if test "$NSS_CONFIG" = "no"; then - echo "$as_me:$LINENO: checking nss-config not found" >&5 -echo $ECHO_N "checking nss-config not found... $ECHO_C" >&6 - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists nss; then - echo "$as_me:$LINENO: checking using NSS from package nss" >&5 -echo $ECHO_N "checking using NSS from package nss... $ECHO_C" >&6 - NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I nss` - NSS_LIBS=`$PKG_CONFIG --libs-only-L nss` - elif $PKG_CONFIG --exists mozilla-nss; then - echo "$as_me:$LINENO: checking using NSS from package mozilla-nss" >&5 -echo $ECHO_N "checking using NSS from package mozilla-nss... $ECHO_C" >&6 - NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nss` - NSS_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nss` - else - { { echo "$as_me:$LINENO: error: system NSS not found" >&5 -echo "$as_me: error: system NSS not found" >&2;} - { (exit 1); exit 1; }; } - no_nss="yes" - fi - else - no_nss="yes" - fi - else - echo "$as_me:$LINENO: checking using NSS from $NSS_CONFIG" >&5 -echo $ECHO_N "checking using NSS from $NSS_CONFIG... $ECHO_C" >&6 - NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags` - NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs` - - nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - fi - - if test -z "$no_nss"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - MOZ_NATIVE_NSS=1 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - - - - - - else -# see if we are being built in the same build tree as nss - - nsslibpath=`echo ../../dist/*.OBJ/lib | cut -f1 -d' '` - savedir=`pwd` - cd $nsslibpath - abs_nsslibpath=`pwd` - cd $savedir - nssincpath=../../dist/public/nss - savedir=`pwd` - cd $nssincpath - abs_nssincpath=`pwd` - cd $savedir - if test -f "$abs_nssincpath/nss.h" ; then - NSS_CFLAGS="-I$abs_nssincpath" - fi - if test -d "$abs_nsslibpath" ; then - NSS_LIBS="-L$abs_nsslibpath" - fi - if test -n "$NSS_CFLAGS" -a -n "$NSS_LIBS" ; then - echo "$as_me:$LINENO: checking using in-tree NSS from $nssincpath $nsslibpath" >&5 -echo $ECHO_N "checking using in-tree NSS from $nssincpath $nsslibpath... $ECHO_C" >&6 - - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: checking could not find in-tree NSS in ../../dist" >&5 -echo $ECHO_N "checking could not find in-tree NSS in ../../dist... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - -# failing that, see if we can find nss-config or pkg-config nss - if test -z "$NSS_CFLAGS" ; then - - -# Check whether --with-nss-prefix or --without-nss-prefix was given. -if test "${with_nss_prefix+set}" = set; then - withval="$with_nss_prefix" - nss_config_prefix="$withval" -else - nss_config_prefix="" -fi; - - -# Check whether --with-nss-exec-prefix or --without-nss-exec-prefix was given. -if test "${with_nss_exec_prefix+set}" = set; then - withval="$with_nss_exec_prefix" - nss_config_exec_prefix="$withval" -else - nss_config_exec_prefix="" -fi; - - if test -n "$nss_config_exec_prefix"; then - nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix" - if test -z "$NSS_CONFIG"; then - NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config - fi - fi - if test -n "$nss_config_prefix"; then - nss_config_args="$nss_config_args --prefix=$nss_config_prefix" - if test -z "$NSS_CONFIG"; then - NSS_CONFIG=$nss_config_prefix/bin/nss-config - fi - fi - - if test -z "$NSS_CONFIG" ; then - unset ac_cv_path_NSS_CONFIG - # Extract the first word of "nss-config", so it can be a program name with args. -set dummy nss-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NSS_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NSS_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NSS_CONFIG="$NSS_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NSS_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_NSS_CONFIG" && ac_cv_path_NSS_CONFIG="no" - ;; -esac -fi -NSS_CONFIG=$ac_cv_path_NSS_CONFIG - -if test -n "$NSS_CONFIG"; then - echo "$as_me:$LINENO: result: $NSS_CONFIG" >&5 -echo "${ECHO_T}$NSS_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - min_nss_version=3.9.0 - echo "$as_me:$LINENO: checking for NSS - version >= $min_nss_version (skipping)" >&5 -echo $ECHO_N "checking for NSS - version >= $min_nss_version (skipping)... $ECHO_C" >&6 - fi - - no_nss="" - if test "$NSS_CONFIG" = "no"; then - echo "$as_me:$LINENO: checking nss-config not found" >&5 -echo $ECHO_N "checking nss-config not found... $ECHO_C" >&6 - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists nss; then - echo "$as_me:$LINENO: checking using NSS from package nss" >&5 -echo $ECHO_N "checking using NSS from package nss... $ECHO_C" >&6 - NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I nss` - NSS_LIBS=`$PKG_CONFIG --libs-only-L nss` - elif $PKG_CONFIG --exists mozilla-nss; then - echo "$as_me:$LINENO: checking using NSS from package mozilla-nss" >&5 -echo $ECHO_N "checking using NSS from package mozilla-nss... $ECHO_C" >&6 - NSS_CFLAGS=`$PKG_CONFIG --cflags-only-I mozilla-nss` - NSS_LIBS=`$PKG_CONFIG --libs-only-L mozilla-nss` - else - { { echo "$as_me:$LINENO: error: system NSS not found" >&5 -echo "$as_me: error: system NSS not found" >&2;} - { (exit 1); exit 1; }; } - no_nss="yes" - fi - else - no_nss="yes" - fi - else - echo "$as_me:$LINENO: checking using NSS from $NSS_CONFIG" >&5 -echo $ECHO_N "checking using NSS from $NSS_CONFIG... $ECHO_C" >&6 - NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags` - NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs` - - nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - fi - - if test -z "$no_nss"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - MOZ_NATIVE_NSS=1 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - - - - - - fi - fi -fi - - - -# Check whether --with-system-svrcore or --without-system-svrcore was given. -if test "${with_system_svrcore+set}" = set; then - withval="$with_system_svrcore" - if test "$withval" = "yes"; then - _SYSTEM_SVRCORE=1 - HAVE_SVRCORE=1 - SVRCORE_LIBS=-lsvrcore - - else - _SYSTEM_SVRCORE= - fi -else - _SYSTEM_SVRCORE= -fi; - -# _SYSTEM_SVRCORE means /usr/lib and /usr/include so no need to add additional -# include or lib paths -if test -z "$_SYSTEM_SVRCORE" ; then - # first, see if user has specified explicit SVRCORE include and lib paths - - echo "$as_me:$LINENO: checking for --with-svrcore" >&5 -echo $ECHO_N "checking for --with-svrcore... $ECHO_C" >&6 - -# Check whether --with-svrcore or --without-svrcore was given. -if test "${with_svrcore+set}" = set; then - withval="$with_svrcore" - if test "$withval" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - elif test -d "$withval" -a -d "$withval/lib" -a -f "$withval/include/svrcore.h" ; then - HAVE_SVRCORE=1 - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - SVRCORE_CFLAGS="-I$withval/include" - SVRCORE_LIB_PATH="-L$withval/lib" - else - HAVE_SVRCORE= - fi -else - HAVE_SVRCORE= -fi; - - # check for --with-svrcore-inc - echo "$as_me:$LINENO: checking for --with-svrcore-inc" >&5 -echo $ECHO_N "checking for --with-svrcore-inc... $ECHO_C" >&6 - -# Check whether --with-svrcore-inc or --without-svrcore-inc was given. -if test "${with_svrcore_inc+set}" = set; then - withval="$with_svrcore_inc" - - if test -e "$withval"/svrcore.h - then - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - SVRCORE_CFLAGS="-I$withval" - else - echo - { { echo "$as_me:$LINENO: error: $withval not found" >&5 -echo "$as_me: error: $withval not found" >&2;} - { (exit 1); exit 1; }; } - fi - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi; - - # check for --with-svrcore-lib - echo "$as_me:$LINENO: checking for --with-svrcore-lib" >&5 -echo $ECHO_N "checking for --with-svrcore-lib... $ECHO_C" >&6 - -# Check whether --with-svrcore-lib or --without-svrcore-lib was given. -if test "${with_svrcore_lib+set}" = set; then - withval="$with_svrcore_lib" - - if test -d "$withval" - then - echo "$as_me:$LINENO: result: using $withval" >&5 -echo "${ECHO_T}using $withval" >&6 - SVRCORE_LIBS="-L$withval" - else - echo - { { echo "$as_me:$LINENO: error: $withval not found" >&5 -echo "$as_me: error: $withval not found" >&2;} - { (exit 1); exit 1; }; } - fi - -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi; - - - - # next, see if user explicitly said to use system svrcore - if test -z "$SVRCORE_CFLAGS" -a -z "$SVRCORE_LIBS" ; then - if test -n "$_SYSTEM_SVRCORE"; then - - no_svrcore="" - echo "$as_me:$LINENO: checking Trying pkg-config svrcore" >&5 -echo $ECHO_N "checking Trying pkg-config svrcore... $ECHO_C" >&6 - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists svrcore; then - echo "$as_me:$LINENO: checking using SVRCORE from package svrcore" >&5 -echo $ECHO_N "checking using SVRCORE from package svrcore... $ECHO_C" >&6 - SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` - SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` - else - { { echo "$as_me:$LINENO: error: system SVRCORE not found" >&5 -echo "$as_me: error: system SVRCORE not found" >&2;} - { (exit 1); exit 1; }; } - no_svrcore="yes" - fi - else - no_svrcore="yes" - fi - - if test -z "$no_svrcore"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - MOZ_NATIVE_SVRCORE=1 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - - - - - else - # see if we are being built in the same build tree as svrcore - - svrcorelibpath=`echo ../../dist/*.OBJ/lib | cut -f1 -d' '` - savedir=`pwd` - cd $svrcorelibpath - abs_svrcorelibpath=`pwd` - cd $savedir - svrcoreincpath=../../dist/public/svrcore - savedir=`pwd` - cd $svrcoreincpath - abs_svrcoreincpath=`pwd` - cd $savedir - if test -f "$abs_svrcoreincpath/svrcore.h" ; then - SVRCORE_CFLAGS="-I$abs_svrcoreincpath" - fi - if test -d "$abs_svrcorelibpath" ; then - SVRCORE_LIBS="-L$abs_svrcorelibpath" - fi - if test -n "$SVRCORE_CFLAGS" -a -n "$SVRCORE_LIBS" ; then - echo "$as_me:$LINENO: checking using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath" >&5 -echo $ECHO_N "checking using in-tree SVRCORE from $svrcoreincpath $svrcorelibpath... $ECHO_C" >&6 - - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: checking could not find in-tree SVRCORE in ../../dist" >&5 -echo $ECHO_N "checking could not find in-tree SVRCORE in ../../dist... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - # failing that, see if we can find svrcore-config or pkg-config svrcore - if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then - - no_svrcore="" - echo "$as_me:$LINENO: checking Trying pkg-config svrcore" >&5 -echo $ECHO_N "checking Trying pkg-config svrcore... $ECHO_C" >&6 - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists svrcore; then - echo "$as_me:$LINENO: checking using SVRCORE from package svrcore" >&5 -echo $ECHO_N "checking using SVRCORE from package svrcore... $ECHO_C" >&6 - SVRCORE_CFLAGS=`$PKG_CONFIG --cflags-only-I svrcore` - SVRCORE_LIBS=`$PKG_CONFIG --libs-only-L svrcore` - else - { { echo "$as_me:$LINENO: error: system SVRCORE not found" >&5 -echo "$as_me: error: system SVRCORE not found" >&2;} - { (exit 1); exit 1; }; } - no_svrcore="yes" - fi - else - no_svrcore="yes" - fi - - if test -z "$no_svrcore"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - MOZ_NATIVE_SVRCORE=1 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - fi - - - - - - fi +if test -z "$NSPR_CFLAGS" -o -z "$NSPR_LIBS" ; then + if test -n "$MOZILLA_CLIENT" ; then + NSPR_CFLAGS='-I$(DIST)/include/nspr' + NSPR_LIBS='-L$(DIST)/lib '"-lplds$NSPR_VERSION -lplc$NSPR_VERSION -lnspr$NSPR_VERSION" + if test "$VACPP" = "yes"; then + NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS'' + elif test "$_WIN32_MSVC"; then + NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib ' fi - fi + SKIP_CYGWIN_FIXUP=1 + LIBS_ALREADY_SET=1 + + elif test "$no_nspr" = "no" ; then + { { echo "$as_me:$LINENO: error: Need to use NSPR but no NSPR was found" >&5 +echo "$as_me: error: Need to use NSPR but no NSPR was found" >&2;} + { (exit 1); exit 1; }; } + fi fi @@ -2929,12 +2626,12 @@ case "$target" in esac if test -n "$_WIN32_MSVC" -a -n "$USE_WINDOWS_PATHS" ; then - if test -n "$NSPR_CFLAGS" ; then + if test -n "$NSPR_CFLAGS" -a -z "$SKIP_CYGWIN_FIXUP" ; then path=`echo $NSPR_CFLAGS | sed -e 's/^-I//'` path=`cygpath -m $path` NSPR_CFLAGS="/I$path" fi - if test -n "$NSPR_LIBS" ; then + if test -n "$NSPR_LIBS" -a -z "$SKIP_CYGWIN_FIXUP" ; then path=`echo $NSPR_LIBS | sed -e 's/^-L//'` path=`cygpath -m $path` NSPR_LIBS="/LIBPATH:$path" @@ -3118,7 +2815,6 @@ _ACEOF DEFINES="$DEFINES -UDEBUG" fi -# Use mozilla's nsinstall if test -n "$MOZILLA_CLIENT"; then NSINSTALL='$(dist_bindir)/nsinstall' fi @@ -10184,10 +9880,9 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -10722,15 +10417,16 @@ s,@CC@,$CC,;t t s,@dist_prefix@,$dist_prefix,;t t s,@dist_bindir@,$dist_bindir,;t t s,@dist_libdir@,$dist_libdir,;t t -s,@NSPR_CONFIG@,$NSPR_CONFIG,;t t +s,@SVRCORE_LIBS@,$SVRCORE_LIBS,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t -s,@NSPR_CFLAGS@,$NSPR_CFLAGS,;t t -s,@NSPR_LIBS@,$NSPR_LIBS,;t t -s,@NSS_CONFIG@,$NSS_CONFIG,;t t +s,@SVRCORE_CFLAGS@,$SVRCORE_CFLAGS,;t t s,@NSS_CFLAGS@,$NSS_CFLAGS,;t t s,@NSS_LIBS@,$NSS_LIBS,;t t -s,@SVRCORE_LIBS@,$SVRCORE_LIBS,;t t -s,@SVRCORE_CFLAGS@,$SVRCORE_CFLAGS,;t t +s,@NSS_CONFIG@,$NSS_CONFIG,;t t +s,@NSPR_CFLAGS@,$NSPR_CFLAGS,;t t +s,@NSPR_LIBS@,$NSPR_LIBS,;t t +s,@NSPR_CONFIG@,$NSPR_CONFIG,;t t +s,@LIBS_ALREADY_SET@,$LIBS_ALREADY_SET,;t t s,@WHOAMI@,$WHOAMI,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t diff --git a/directory/c-sdk/configure.in b/directory/c-sdk/configure.in index 26c89bd141a3..eac5b5cc918a 100644 --- a/directory/c-sdk/configure.in +++ b/directory/c-sdk/configure.in @@ -199,15 +199,19 @@ AC_ARG_ENABLE(64bit, [ --enable-64bit Enable 64-bit support (on certain platforms)], [ if test "$enableval" = "yes"; then USE_64=1 ; export USE_64 - elif test "$enableval" = "no"; then - USE_64= - else - # if the user specified nothing, just guess based on machine type + fi ], + [ +dnl if the user specified nothing, just guess based on machine type arch=`uname -m` case $arch in x86_64|ppc64|ia64|s390x) USE_64=1 ; export USE_64 ;; + sun4u) instr_set=`optisa \`isalist\`` + case $instr_set in + sparcv9*) USE_64=1 ; export USE_64 ;; + esac + ;; esac - fi ]) + ]) AC_ARG_ENABLE(mdupdate, [ --enable-mdupdate Enable use of certain compilers' mdupdate feature], @@ -215,85 +219,6 @@ AC_ARG_ENABLE(mdupdate, USE_MDUPDATE=1 fi ]) -dnl ======================================================== -dnl = Use the NSPR copy in the system (assuming it exists) -dnl = rather than the one in the source tree (mozilla/nsprpub) -dnl ======================================================== -AC_ARG_WITH(system-nspr, - [ --with-system-nspr Use system installed NSPR], - [ if test "$withval" = "yes"; then - _SYSTEM_NSPR=1 - else - _SYSTEM_NSPR= - fi], _SYSTEM_NSPR= ) - -if test "$_WIN32_MSVC"; then - _SYSTEM_NSPR= -fi - -# first, see if user has specified explicit NSPR include and lib paths -AM_PATH_GIVEN_NSPR() - -# next, see if user explicitly said to use system nspr -if test -z "$no_nspr" -a -z "$NSPR_CFLAGS" -a -z "$NSPR_LIBS" ; then - if test -n "$_SYSTEM_NSPR"; then - AM_PATH_NSPR(4.0.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=]) - else -# see if we are being built in the same build tree as nspr - AM_PATH_INTREE_NSPR(../../dist) -# failing that, see if we can find nspr-config or pkg-config nspr - if test -z "$NSPR_CFLAGS" ; then - AM_PATH_NSPR(4.0.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=]) - fi - fi -fi - -if test -n "$_SYSTEM_NSPR" -a -z "$MOZ_NATIVE_NSPR"; then - NSPR_CFLAGS='-I$(DIST)/include/nspr' - NSPR_LIBS='-L$(DIST)/lib '"-lplds$NSPR_VERSION -lplc$NSPR_VERSION -lnspr$NSPR_VERSION" - # explicitly set libs for Visual Age C++ for OS/2 - if test "$VACPP" = "yes"; then - NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS'' - elif test "$_WIN32_MSVC"; then - NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib ' - fi -fi - -dnl ======================================================== -dnl = Use the NSS copy in the system (assuming it exists) -dnl = rather than the one in the source tree (mozilla/security) -dnl ======================================================== -AC_ARG_WITH(system-nss, - [ --with-system-nss Use system installed NSS], - [ if test "$withval" = "yes"; then - _SYSTEM_NSS=1 - USE_NSS=1 - else - _SYSTEM_NSS= - fi], _SYSTEM_NSS= ) - -if test "$_WIN32_MSVC"; then - _SYSTEM_NSS= -fi - -# first, see if user has specified explicit NSS include and lib paths -AM_PATH_GIVEN_NSS() - -# next, see if user explicitly said to use system nss -if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then - if test -n "$_SYSTEM_NSS"; then - AM_PATH_NSS(3.9.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=]) - else -# see if we are being built in the same build tree as nss - AM_PATH_INTREE_NSS(../../dist) -# failing that, see if we can find nss-config or pkg-config nss - if test -z "$NSS_CFLAGS" ; then - AM_PATH_NSS(3.9.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=]) - fi - fi -fi - - dnl ======================================================== dnl = svrcore gives the command line tools secure PIN management dnl = for client cert based authentication @@ -309,29 +234,146 @@ AC_ARG_WITH(system-svrcore, HAVE_SVRCORE=1 SVRCORE_LIBS=-lsvrcore AC_SUBST(SVRCORE_LIBS) +dnl svrcore implies both nspr and nss + USE_NSS=1 + no_nspr=no else _SYSTEM_SVRCORE= fi], _SYSTEM_SVRCORE= ) -# _SYSTEM_SVRCORE means /usr/lib and /usr/include so no need to add additional -# include or lib paths +dnl _SYSTEM_SVRCORE means /usr/lib and /usr/include so no need to add additional +dnl include or lib paths if test -z "$_SYSTEM_SVRCORE" ; then - # first, see if user has specified explicit SVRCORE include and lib paths + dnl first, see if user has specified explicit SVRCORE include and lib paths AM_PATH_GIVEN_SVRCORE() - # next, see if user explicitly said to use system svrcore - if test -z "$SVRCORE_CFLAGS" -a -z "$SVRCORE_LIBS" ; then - if test -n "$_SYSTEM_SVRCORE"; then - AM_PATH_SVRCORE(4.0.1, [MOZ_NATIVE_SVRCORE=1], [MOZ_NATIVE_SVRCORE=]) - else - # see if we are being built in the same build tree as svrcore - AM_PATH_INTREE_SVRCORE(../../dist) - # failing that, see if we can find svrcore-config or pkg-config svrcore - if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then + dnl next, see if user explicitly said to use system svrcore + if test -n "$HAVE_SVRCORE" ; then +dnl svrcore implies both nspr and nss + USE_NSS=1 + no_nspr=no + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS" ; then + if test -n "$_SYSTEM_SVRCORE"; then AM_PATH_SVRCORE(4.0.1, [MOZ_NATIVE_SVRCORE=1], [MOZ_NATIVE_SVRCORE=]) + else + dnl see if we are being built in the same build tree as svrcore + AM_PATH_INTREE_SVRCORE(../../dist) + dnl failing that, see if we can find svrcore-config or pkg-config svrcore + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then + AM_PATH_SVRCORE(4.0.1, [MOZ_NATIVE_SVRCORE=1], [MOZ_NATIVE_SVRCORE=]) + fi fi fi - fi + fi +fi + +if test -n "$HAVE_SVRCORE" ; then + if test -z "$SVRCORE_CFLAGS" -o -z "$SVRCORE_LIBS"; then + AC_MSG_ERROR([--with-svrcore specified, but no svrcore could be found]) + fi +fi + +dnl ======================================================== +dnl = Use the NSS copy in the system (assuming it exists) +dnl = rather than the one in the source tree (mozilla/security) +dnl ======================================================== +AC_ARG_WITH(system-nss, + [ --with-system-nss Use system installed NSS], + [ if test "$withval" = "yes"; then + _SYSTEM_NSS=1 + USE_NSS=1 +dnl nss requires nspr + no_nspr=no + elif test "$withval" = "no" ; then + _SYSTEM_NSS=no + fi], _SYSTEM_NSS= ) + +if test "$_WIN32_MSVC"; then + _SYSTEM_NSS= +fi + +dnl first, see if user has specified explicit NSPR include and lib paths, +dnl of if the user has explicitly disabled the use of nss +if test -z "$_SYSTEM_NSS" -o "$_SYSTEM_NSS" = "no" ; then + AM_PATH_GIVEN_NSS() +fi + +dnl next, see if user explicitly said to use system nss +if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then +dnl nss requires nspr + no_nspr=no + if test -z "$_SYSTEM_NSS" -o "$_SYSTEM_NSS" = "no" ; then +dnl see if we are being built in the same build tree as nss + AM_PATH_INTREE_NSS(../../dist) + fi +dnl failing that, see if we can find nss-config or pkg-config nss + if test -z "$NSS_CFLAGS" -a "$_SYSTEM_NSS" != "no" ; then + AM_PATH_NSS(3.9.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=]) + fi +fi + +dnl bomb out if nss not found +if test -n "$USE_NSS" -a -z "$NSS_CFLAGS" -a -z "$NSS_LIBS" ; then + AC_MSG_ERROR(Need to use NSS but no NSS was found) +fi + +dnl ======================================================== +dnl = Use the NSPR copy in the system (assuming it exists) +dnl = rather than the one in the source tree (mozilla/nsprpub) +dnl ======================================================== +AC_ARG_WITH(system-nspr, + [ --with-system-nspr Use system installed NSPR], + [ if test "$withval" = "yes"; then + _SYSTEM_NSPR=1 + no_nspr=no + elif test "$withval" = "no"; then + _SYSTEM_NSPR=no + fi], _SYSTEM_NSPR= ) + +if test "$_WIN32_MSVC"; then + _SYSTEM_NSPR=no +fi + +dnl first, see if user has specified explicit NSPR include and lib paths, +dnl of if the user has explicitly disabled the use of nspr +if test -z "$_SYSTEM_NSPR" -o "$_SYSTEM_NSPR" = "no" ; then + AM_PATH_GIVEN_NSPR() +fi + +dnl next, look for in-tree nspr if user did not specify explicit system nspr +if test "$no_nspr" == "no" -a -z "$NSPR_CFLAGS" -a -z "$NSPR_LIBS" ; then + if test -z "$_SYSTEM_NSPR" -o "$_SYSTEM_NSPR" = "no" ; then +dnl see if we are being built in the same build tree as nspr + AM_PATH_INTREE_NSPR(../../dist) + fi +dnl failing that, see if we can find nspr-config or pkg-config nspr + if test -z "$NSPR_CFLAGS" -a "$_SYSTEM_NSPR" != "no" ; then + AM_PATH_NSPR(4.0.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=]) + fi +fi + +dnl if we are being built as part of the mozilla client, and we could not +dnl find NSPR by any other method, just default to the default values +dnl used by the client build - NOTE that this sets the libpaths and the +dnl library link commands directly, so we don't need to muck with any +dnl cygwin path conversion stuff. The client build also uses --with-dist-prefix +dnl which sets $(DIST) in the makefiles +if test -z "$NSPR_CFLAGS" -o -z "$NSPR_LIBS" ; then + if test -n "$MOZILLA_CLIENT" ; then + NSPR_CFLAGS='-I$(DIST)/include/nspr' + NSPR_LIBS='-L$(DIST)/lib '"-lplds$NSPR_VERSION -lplc$NSPR_VERSION -lnspr$NSPR_VERSION" + dnl explicitly set libs for Visual Age C++ for OS/2 + if test "$VACPP" = "yes"; then + NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS'' + elif test "$_WIN32_MSVC"; then + NSPR_LIBS='$(DIST)/lib/nspr'$NSPR_VERSION'.lib $(DIST)/lib/plc'$NSPR_VERSION'.lib $(DIST)/lib/plds'$NSPR_VERSION'.lib ' + fi + SKIP_CYGWIN_FIXUP=1 + LIBS_ALREADY_SET=1 + AC_SUBST(LIBS_ALREADY_SET) + elif test "$no_nspr" = "no" ; then + AC_MSG_ERROR(Need to use NSPR but no NSPR was found) + fi fi dnl ======================================================== @@ -349,12 +391,12 @@ case "$target" in esac if test -n "$_WIN32_MSVC" -a -n "$USE_WINDOWS_PATHS" ; then - if test -n "$NSPR_CFLAGS" ; then + if test -n "$NSPR_CFLAGS" -a -z "$SKIP_CYGWIN_FIXUP" ; then path=`echo $NSPR_CFLAGS | sed -e 's/^-I//'` path=`cygpath -m $path` NSPR_CFLAGS="/I$path" fi - if test -n "$NSPR_LIBS" ; then + if test -n "$NSPR_LIBS" -a -z "$SKIP_CYGWIN_FIXUP" ; then path=`echo $NSPR_LIBS | sed -e 's/^-L//'` path=`cygpath -m $path` NSPR_LIBS="/LIBPATH:$path" @@ -508,7 +550,7 @@ else DEFINES="$DEFINES -UDEBUG" fi -# Use mozilla's nsinstall +dnl Use mozilla's nsinstall if test -n "$MOZILLA_CLIENT"; then NSINSTALL='$(dist_bindir)/nsinstall' fi