1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/config/nspr.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,82 @@ 1.4 +# -*- tab-width: 4; -*- 1.5 +# Configure paths for NSPR 1.6 +# Public domain - Chris Seawood <cls@seawood.org> 2001-04-05 1.7 +# Based upon gtk.m4 (also PD) by Owen Taylor 1.8 + 1.9 +dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) 1.10 +dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS 1.11 +AC_DEFUN([AM_PATH_NSPR], 1.12 +[dnl 1.13 + 1.14 +AC_ARG_WITH(nspr-prefix, 1.15 + [ --with-nspr-prefix=PFX Prefix where NSPR is installed], 1.16 + nspr_config_prefix="$withval", 1.17 + nspr_config_prefix="") 1.18 + 1.19 +AC_ARG_WITH(nspr-exec-prefix, 1.20 + [ --with-nspr-exec-prefix=PFX 1.21 + Exec prefix where NSPR is installed], 1.22 + nspr_config_exec_prefix="$withval", 1.23 + nspr_config_exec_prefix="") 1.24 + 1.25 + if test -n "$nspr_config_exec_prefix"; then 1.26 + nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix" 1.27 + if test -z "$NSPR_CONFIG"; then 1.28 + NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config 1.29 + fi 1.30 + fi 1.31 + if test -n "$nspr_config_prefix"; then 1.32 + nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix" 1.33 + if test -z "$NSPR_CONFIG"; then 1.34 + NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config 1.35 + fi 1.36 + fi 1.37 + 1.38 + unset ac_cv_path_NSPR_CONFIG 1.39 + AC_PATH_PROG(NSPR_CONFIG, nspr-config, no) 1.40 + min_nspr_version=ifelse([$1], ,4.0.0,$1) 1.41 + AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version) 1.42 + 1.43 + no_nspr="" 1.44 + if test "$NSPR_CONFIG" = "no"; then 1.45 + no_nspr="yes" 1.46 + else 1.47 + NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags` 1.48 + NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs` 1.49 + 1.50 + nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \ 1.51 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 1.52 + nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \ 1.53 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 1.54 + nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \ 1.55 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 1.56 + min_nspr_major_version=`echo $min_nspr_version | \ 1.57 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 1.58 + min_nspr_minor_version=`echo $min_nspr_version | \ 1.59 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 1.60 + min_nspr_micro_version=`echo $min_nspr_version | \ 1.61 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 1.62 + if test "$nspr_config_major_version" -ne "$min_nspr_major_version"; then 1.63 + no_nspr="yes" 1.64 + elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" && 1.65 + test "$nspr_config_minor_version" -lt "$min_nspr_minor_version"; then 1.66 + no_nspr="yes" 1.67 + elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" && 1.68 + test "$nspr_config_minor_version" -eq "$min_nspr_minor_version" && 1.69 + test "$nspr_config_micro_version" -lt "$min_nspr_micro_version"; then 1.70 + no_nspr="yes" 1.71 + fi 1.72 + fi 1.73 + 1.74 + if test -z "$no_nspr"; then 1.75 + AC_MSG_RESULT(yes) 1.76 + ifelse([$2], , :, [$2]) 1.77 + else 1.78 + AC_MSG_RESULT(no) 1.79 + fi 1.80 + 1.81 + 1.82 + AC_SUBST(NSPR_CFLAGS) 1.83 + AC_SUBST(NSPR_LIBS) 1.84 + 1.85 +])