Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | # -*- tab-width: 4; -*- |
michael@0 | 2 | # Configure paths for NSPR |
michael@0 | 3 | # Public domain - Chris Seawood <cls@seawood.org> 2001-04-05 |
michael@0 | 4 | # Based upon gtk.m4 (also PD) by Owen Taylor |
michael@0 | 5 | |
michael@0 | 6 | dnl AM_PATH_NSPR([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
michael@0 | 7 | dnl Test for NSPR, and define NSPR_CFLAGS and NSPR_LIBS |
michael@0 | 8 | AC_DEFUN([AM_PATH_NSPR], |
michael@0 | 9 | [dnl |
michael@0 | 10 | |
michael@0 | 11 | AC_ARG_WITH(nspr-prefix, |
michael@0 | 12 | [ --with-nspr-prefix=PFX Prefix where NSPR is installed], |
michael@0 | 13 | nspr_config_prefix="$withval", |
michael@0 | 14 | nspr_config_prefix="") |
michael@0 | 15 | |
michael@0 | 16 | AC_ARG_WITH(nspr-exec-prefix, |
michael@0 | 17 | [ --with-nspr-exec-prefix=PFX |
michael@0 | 18 | Exec prefix where NSPR is installed], |
michael@0 | 19 | nspr_config_exec_prefix="$withval", |
michael@0 | 20 | nspr_config_exec_prefix="") |
michael@0 | 21 | |
michael@0 | 22 | if test -n "$nspr_config_exec_prefix"; then |
michael@0 | 23 | nspr_config_args="$nspr_config_args --exec-prefix=$nspr_config_exec_prefix" |
michael@0 | 24 | if test -z "$NSPR_CONFIG"; then |
michael@0 | 25 | NSPR_CONFIG=$nspr_config_exec_prefix/bin/nspr-config |
michael@0 | 26 | fi |
michael@0 | 27 | fi |
michael@0 | 28 | if test -n "$nspr_config_prefix"; then |
michael@0 | 29 | nspr_config_args="$nspr_config_args --prefix=$nspr_config_prefix" |
michael@0 | 30 | if test -z "$NSPR_CONFIG"; then |
michael@0 | 31 | NSPR_CONFIG=$nspr_config_prefix/bin/nspr-config |
michael@0 | 32 | fi |
michael@0 | 33 | fi |
michael@0 | 34 | |
michael@0 | 35 | unset ac_cv_path_NSPR_CONFIG |
michael@0 | 36 | AC_PATH_PROG(NSPR_CONFIG, nspr-config, no) |
michael@0 | 37 | min_nspr_version=ifelse([$1], ,4.0.0,$1) |
michael@0 | 38 | AC_MSG_CHECKING(for NSPR - version >= $min_nspr_version) |
michael@0 | 39 | |
michael@0 | 40 | no_nspr="" |
michael@0 | 41 | if test "$NSPR_CONFIG" = "no"; then |
michael@0 | 42 | no_nspr="yes" |
michael@0 | 43 | else |
michael@0 | 44 | NSPR_CFLAGS=`$NSPR_CONFIG $nspr_config_args --cflags` |
michael@0 | 45 | NSPR_LIBS=`$NSPR_CONFIG $nspr_config_args --libs` |
michael@0 | 46 | |
michael@0 | 47 | nspr_config_major_version=`$NSPR_CONFIG $nspr_config_args --version | \ |
michael@0 | 48 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
michael@0 | 49 | nspr_config_minor_version=`$NSPR_CONFIG $nspr_config_args --version | \ |
michael@0 | 50 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
michael@0 | 51 | nspr_config_micro_version=`$NSPR_CONFIG $nspr_config_args --version | \ |
michael@0 | 52 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
michael@0 | 53 | min_nspr_major_version=`echo $min_nspr_version | \ |
michael@0 | 54 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
michael@0 | 55 | min_nspr_minor_version=`echo $min_nspr_version | \ |
michael@0 | 56 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
michael@0 | 57 | min_nspr_micro_version=`echo $min_nspr_version | \ |
michael@0 | 58 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
michael@0 | 59 | if test "$nspr_config_major_version" -ne "$min_nspr_major_version"; then |
michael@0 | 60 | no_nspr="yes" |
michael@0 | 61 | elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" && |
michael@0 | 62 | test "$nspr_config_minor_version" -lt "$min_nspr_minor_version"; then |
michael@0 | 63 | no_nspr="yes" |
michael@0 | 64 | elif test "$nspr_config_major_version" -eq "$min_nspr_major_version" && |
michael@0 | 65 | test "$nspr_config_minor_version" -eq "$min_nspr_minor_version" && |
michael@0 | 66 | test "$nspr_config_micro_version" -lt "$min_nspr_micro_version"; then |
michael@0 | 67 | no_nspr="yes" |
michael@0 | 68 | fi |
michael@0 | 69 | fi |
michael@0 | 70 | |
michael@0 | 71 | if test -z "$no_nspr"; then |
michael@0 | 72 | AC_MSG_RESULT(yes) |
michael@0 | 73 | ifelse([$2], , :, [$2]) |
michael@0 | 74 | else |
michael@0 | 75 | AC_MSG_RESULT(no) |
michael@0 | 76 | fi |
michael@0 | 77 | |
michael@0 | 78 | |
michael@0 | 79 | AC_SUBST(NSPR_CFLAGS) |
michael@0 | 80 | AC_SUBST(NSPR_LIBS) |
michael@0 | 81 | |
michael@0 | 82 | ]) |