Removed
Link Here
|
1 |
From 2bd73173674843695cb3e44666f233697a64b6a0 Mon Sep 17 00:00:00 2001 |
2 |
From: Renato Botelho <garga@FreeBSD.org> |
3 |
Date: Thu, 22 Mar 2018 11:02:42 -0300 |
4 |
Subject: [PATCH] configure: allow to disable libnss and libnspr |
5 |
|
6 |
Let user chose to disable libnss and libnspr support even if these |
7 |
libraries are installed in the system. Default remains to enable when |
8 |
libraries are found and disable parameter were not used |
9 |
--- |
10 |
configure.ac | 122 ++++++++++++++++++++++++++++++----------------------------- |
11 |
1 file changed, 63 insertions(+), 59 deletions(-) |
12 |
|
13 |
diff --git configure.ac configure.ac |
14 |
index 278f408940..1e3a467406 100644 |
15 |
--- configure.ac |
16 |
+++ configure.ac |
17 |
@@ -1586,15 +1586,8 @@ |
18 |
fi |
19 |
|
20 |
# libnspr |
21 |
- enable_nspr="no" |
22 |
- |
23 |
- # Try pkg-config first: |
24 |
- PKG_CHECK_MODULES([libnspr], nspr,, [with_pkgconfig_nspr=no]) |
25 |
- if test "$with_pkgconfig_nspr" != "no"; then |
26 |
- CPPFLAGS="${CPPFLAGS} ${libnspr_CFLAGS}" |
27 |
- LIBS="${LIBS} ${libnspr_LIBS}" |
28 |
- fi |
29 |
- |
30 |
+ AC_ARG_ENABLE(nspr, |
31 |
+ AS_HELP_STRING([--disable-nspr],[Disable libnspr support])) |
32 |
AC_ARG_WITH(libnspr_includes, |
33 |
[ --with-libnspr-includes=DIR libnspr include directory], |
34 |
[with_libnspr_includes="$withval"],[with_libnspr_includes=no]) |
35 |
@@ -1602,41 +1595,43 @@ |
36 |
[ --with-libnspr-libraries=DIR libnspr library directory], |
37 |
[with_libnspr_libraries="$withval"],[with_libnspr_libraries="no"]) |
38 |
|
39 |
- if test "$with_libnspr_includes" != "no"; then |
40 |
- CPPFLAGS="${CPPFLAGS} -I${with_libnspr_includes}" |
41 |
- fi |
42 |
+ if test "$enable_nspr" != "no"; then |
43 |
+ # Try pkg-config first: |
44 |
+ PKG_CHECK_MODULES([libnspr], nspr,, [with_pkgconfig_nspr=no]) |
45 |
+ if test "$with_pkgconfig_nspr" != "no"; then |
46 |
+ CPPFLAGS="${CPPFLAGS} ${libnspr_CFLAGS}" |
47 |
+ LIBS="${LIBS} ${libnspr_LIBS}" |
48 |
+ fi |
49 |
|
50 |
- AC_CHECK_HEADER(nspr.h,NSPR="yes",NSPR="no") |
51 |
- if test "$NSPR" = "yes"; then |
52 |
- if test "$with_libnspr_libraries" != "no"; then |
53 |
- LDFLAGS="${LDFLAGS} -L${with_libnspr_libraries}" |
54 |
- fi |
55 |
+ if test "$with_libnspr_includes" != "no"; then |
56 |
+ CPPFLAGS="${CPPFLAGS} -I${with_libnspr_includes}" |
57 |
+ fi |
58 |
|
59 |
- AC_CHECK_LIB(nspr4, PR_GetCurrentThread,, NSPR="no") |
60 |
+ AC_CHECK_HEADER(nspr.h,NSPR="yes",NSPR="no") |
61 |
+ if test "$NSPR" = "yes"; then |
62 |
+ if test "$with_libnspr_libraries" != "no"; then |
63 |
+ LDFLAGS="${LDFLAGS} -L${with_libnspr_libraries}" |
64 |
+ fi |
65 |
|
66 |
- if test "$NSPR" = "no"; then |
67 |
- echo |
68 |
- echo " ERROR! libnspr library not found, go get it" |
69 |
- echo " from Mozilla or your distribution:" |
70 |
- echo |
71 |
- echo " Ubuntu: apt-get install libnspr4-dev" |
72 |
- echo " Fedora: yum install nspr-devel" |
73 |
- echo |
74 |
- exit 1 |
75 |
- fi |
76 |
- enable_nspr="yes" |
77 |
+ AC_CHECK_LIB(nspr4, PR_GetCurrentThread,, NSPR="no") |
78 |
+ |
79 |
+ if test "$NSPR" = "no"; then |
80 |
+ echo |
81 |
+ echo " ERROR! libnspr library not found, go get it" |
82 |
+ echo " from Mozilla or your distribution:" |
83 |
+ echo |
84 |
+ echo " Ubuntu: apt-get install libnspr4-dev" |
85 |
+ echo " Fedora: yum install nspr-devel" |
86 |
+ echo |
87 |
+ exit 1 |
88 |
+ fi |
89 |
+ enable_nspr="yes" |
90 |
+ fi |
91 |
fi |
92 |
|
93 |
# libnss |
94 |
- enable_nss="no" |
95 |
- |
96 |
- # Try pkg-config first: |
97 |
- PKG_CHECK_MODULES([libnss], nss,, [with_pkgconfig_nss=no]) |
98 |
- if test "$with_pkgconfig_nss" != "no"; then |
99 |
- CPPFLAGS="${CPPFLAGS} ${libnss_CFLAGS}" |
100 |
- LIBS="${LIBS} ${libnss_LIBS}" |
101 |
- fi |
102 |
- |
103 |
+ AC_ARG_ENABLE(nss, |
104 |
+ AS_HELP_STRING([--disable-nss],[Disable libnss support])) |
105 |
AC_ARG_WITH(libnss_includes, |
106 |
[ --with-libnss-includes=DIR libnss include directory], |
107 |
[with_libnss_includes="$withval"],[with_libnss_includes=no]) |
108 |
@@ -1644,31 +1639,40 @@ |
109 |
[ --with-libnss-libraries=DIR libnss library directory], |
110 |
[with_libnss_libraries="$withval"],[with_libnss_libraries="no"]) |
111 |
|
112 |
- if test "$with_libnss_includes" != "no"; then |
113 |
- CPPFLAGS="${CPPFLAGS} -I${with_libnss_includes}" |
114 |
- fi |
115 |
+ if test "$enable_nss" != "no"; then |
116 |
+ # Try pkg-config first: |
117 |
+ PKG_CHECK_MODULES([libnss], nss,, [with_pkgconfig_nss=no]) |
118 |
+ if test "$with_pkgconfig_nss" != "no"; then |
119 |
+ CPPFLAGS="${CPPFLAGS} ${libnss_CFLAGS}" |
120 |
+ LIBS="${LIBS} ${libnss_LIBS}" |
121 |
+ fi |
122 |
|
123 |
- AC_CHECK_HEADER(sechash.h,NSS="yes",NSS="no") |
124 |
- if test "$NSS" = "yes"; then |
125 |
- if test "$with_libnss_libraries" != "no"; then |
126 |
- LDFLAGS="${LDFLAGS} -L${with_libnss_libraries}" |
127 |
- fi |
128 |
+ if test "$with_libnss_includes" != "no"; then |
129 |
+ CPPFLAGS="${CPPFLAGS} -I${with_libnss_includes}" |
130 |
+ fi |
131 |
|
132 |
- AC_CHECK_LIB(nss3, HASH_Begin,, NSS="no") |
133 |
+ AC_CHECK_HEADER(sechash.h,NSS="yes",NSS="no") |
134 |
+ if test "$NSS" = "yes"; then |
135 |
+ if test "$with_libnss_libraries" != "no"; then |
136 |
+ LDFLAGS="${LDFLAGS} -L${with_libnss_libraries}" |
137 |
+ fi |
138 |
|
139 |
- if test "$NSS" = "no"; then |
140 |
- echo |
141 |
- echo " ERROR! libnss library not found, go get it" |
142 |
- echo " from Mozilla or your distribution:" |
143 |
- echo |
144 |
- echo " Ubuntu: apt-get install libnss3-dev" |
145 |
- echo " Fedora: yum install nss-devel" |
146 |
- echo |
147 |
- exit 1 |
148 |
- fi |
149 |
+ AC_CHECK_LIB(nss3, HASH_Begin,, NSS="no") |
150 |
+ |
151 |
+ if test "$NSS" = "no"; then |
152 |
+ echo |
153 |
+ echo " ERROR! libnss library not found, go get it" |
154 |
+ echo " from Mozilla or your distribution:" |
155 |
+ echo |
156 |
+ echo " Ubuntu: apt-get install libnss3-dev" |
157 |
+ echo " Fedora: yum install nss-devel" |
158 |
+ echo |
159 |
+ exit 1 |
160 |
+ fi |
161 |
|
162 |
- AC_DEFINE([HAVE_NSS],[1],[libnss available for md5]) |
163 |
- enable_nss="yes" |
164 |
+ AC_DEFINE([HAVE_NSS],[1],[libnss available for md5]) |
165 |
+ enable_nss="yes" |
166 |
+ fi |
167 |
fi |
168 |
|
169 |
# libmagic |