build/autoconf/nss.m4

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 # -*- tab-width: 4; -*-
michael@0 2 # Configure paths for NSS
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_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
michael@0 7 dnl Test for NSS, and define NSS_CFLAGS and NSS_LIBS
michael@0 8 AC_DEFUN([AM_PATH_NSS],
michael@0 9 [dnl
michael@0 10
michael@0 11 AC_ARG_WITH(nss-prefix,
michael@0 12 [ --with-nss-prefix=PFX Prefix where NSS is installed],
michael@0 13 nss_config_prefix="$withval",
michael@0 14 nss_config_prefix="")
michael@0 15
michael@0 16 AC_ARG_WITH(nss-exec-prefix,
michael@0 17 [ --with-nss-exec-prefix=PFX
michael@0 18 Exec prefix where NSS is installed],
michael@0 19 nss_config_exec_prefix="$withval",
michael@0 20 nss_config_exec_prefix="")
michael@0 21
michael@0 22 if test -n "$nss_config_exec_prefix"; then
michael@0 23 nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
michael@0 24 if test -z "$NSS_CONFIG"; then
michael@0 25 NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
michael@0 26 fi
michael@0 27 fi
michael@0 28 if test -n "$nss_config_prefix"; then
michael@0 29 nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
michael@0 30 if test -z "$NSS_CONFIG"; then
michael@0 31 NSS_CONFIG=$nss_config_prefix/bin/nss-config
michael@0 32 fi
michael@0 33 fi
michael@0 34
michael@0 35 unset ac_cv_path_NSS_CONFIG
michael@0 36 AC_PATH_PROG(NSS_CONFIG, nss-config, no)
michael@0 37 min_nss_version=ifelse([$1], ,3.0.0,$1)
michael@0 38 AC_MSG_CHECKING(for NSS - version >= $min_nss_version)
michael@0 39
michael@0 40 no_nss=""
michael@0 41 if test "$NSS_CONFIG" = "no"; then
michael@0 42 no_nss="yes"
michael@0 43 else
michael@0 44 NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
michael@0 45 NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
michael@0 46
michael@0 47 nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
michael@0 48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
michael@0 49 nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
michael@0 50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
michael@0 51 nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
michael@0 52 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
michael@0 53 min_nss_major_version=`echo $min_nss_version | \
michael@0 54 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
michael@0 55 min_nss_minor_version=`echo $min_nss_version | \
michael@0 56 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
michael@0 57 min_nss_micro_version=`echo $min_nss_version | \
michael@0 58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
michael@0 59 if test "$nss_config_major_version" -lt "$min_nss_major_version"; then
michael@0 60 no_nss="yes"
michael@0 61 elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
michael@0 62 test "$nss_config_minor_version" -lt "$min_nss_minor_version"; then
michael@0 63 no_nss="yes"
michael@0 64 elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
michael@0 65 test "$nss_config_minor_version" -eq "$min_nss_minor_version" &&
michael@0 66 test "$nss_config_micro_version" -lt "$min_nss_micro_version"; then
michael@0 67 no_nss="yes"
michael@0 68 fi
michael@0 69 fi
michael@0 70
michael@0 71 if test -z "$no_nss"; 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 ifelse([$3], , :, [$3])
michael@0 77 fi
michael@0 78
michael@0 79
michael@0 80 AC_SUBST(NSS_CFLAGS)
michael@0 81 AC_SUBST(NSS_LIBS)
michael@0 82
michael@0 83 ])

mercurial