nsprpub/config/nspr.m4

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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

mercurial