build/autoconf/nss.m4

branch
TOR_BUG_9701
changeset 3
141e0f1194b1
equal deleted inserted replaced
-1:000000000000 0:9ab45d514d9d
1 # -*- tab-width: 4; -*-
2 # Configure paths for NSS
3 # Public domain - Chris Seawood <cls@seawood.org> 2001-04-05
4 # Based upon gtk.m4 (also PD) by Owen Taylor
5
6 dnl AM_PATH_NSS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
7 dnl Test for NSS, and define NSS_CFLAGS and NSS_LIBS
8 AC_DEFUN([AM_PATH_NSS],
9 [dnl
10
11 AC_ARG_WITH(nss-prefix,
12 [ --with-nss-prefix=PFX Prefix where NSS is installed],
13 nss_config_prefix="$withval",
14 nss_config_prefix="")
15
16 AC_ARG_WITH(nss-exec-prefix,
17 [ --with-nss-exec-prefix=PFX
18 Exec prefix where NSS is installed],
19 nss_config_exec_prefix="$withval",
20 nss_config_exec_prefix="")
21
22 if test -n "$nss_config_exec_prefix"; then
23 nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
24 if test -z "$NSS_CONFIG"; then
25 NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
26 fi
27 fi
28 if test -n "$nss_config_prefix"; then
29 nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
30 if test -z "$NSS_CONFIG"; then
31 NSS_CONFIG=$nss_config_prefix/bin/nss-config
32 fi
33 fi
34
35 unset ac_cv_path_NSS_CONFIG
36 AC_PATH_PROG(NSS_CONFIG, nss-config, no)
37 min_nss_version=ifelse([$1], ,3.0.0,$1)
38 AC_MSG_CHECKING(for NSS - version >= $min_nss_version)
39
40 no_nss=""
41 if test "$NSS_CONFIG" = "no"; then
42 no_nss="yes"
43 else
44 NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
45 NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
46
47 nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
49 nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
51 nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
52 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
53 min_nss_major_version=`echo $min_nss_version | \
54 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
55 min_nss_minor_version=`echo $min_nss_version | \
56 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
57 min_nss_micro_version=`echo $min_nss_version | \
58 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
59 if test "$nss_config_major_version" -lt "$min_nss_major_version"; then
60 no_nss="yes"
61 elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
62 test "$nss_config_minor_version" -lt "$min_nss_minor_version"; then
63 no_nss="yes"
64 elif test "$nss_config_major_version" -eq "$min_nss_major_version" &&
65 test "$nss_config_minor_version" -eq "$min_nss_minor_version" &&
66 test "$nss_config_micro_version" -lt "$min_nss_micro_version"; then
67 no_nss="yes"
68 fi
69 fi
70
71 if test -z "$no_nss"; then
72 AC_MSG_RESULT(yes)
73 ifelse([$2], , :, [$2])
74 else
75 AC_MSG_RESULT(no)
76 ifelse([$3], , :, [$3])
77 fi
78
79
80 AC_SUBST(NSS_CFLAGS)
81 AC_SUBST(NSS_LIBS)
82
83 ])

mercurial