Package: 389-ds-base / 1.4.0.21-1

icu_pkg-config.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Description: Use pkg-config to detect icu, since icu-config is deprecated 
 and will be removed from Debian
Bug: https://pagure.io/389-ds-base/issue/50067
Bug-Debian: https://bugs.debian.org/916115
Forwarded: https://pagure.io/389-ds-base/pull-request/50111
Author: Hugh McMaster <hugh.mcmaster@outlook.com>
Last-Update: 2018-12-28

--- a/Makefile.am
+++ b/Makefile.am
@@ -172,7 +172,6 @@
 
 DB_LINK = @db_lib@ -ldb-@db_libver@
 SASL_LINK = @sasl_lib@ -lsasl2
-ICU_LINK = @icu_lib@ -licui18n -licuuc -licudata
 PCRE_LINK = @pcre_lib@ -lpcre
 NETSNMP_LINK = @netsnmp_lib@ @netsnmp_link@
 PAM_LINK = -lpam
@@ -1616,8 +1615,8 @@
         ldap/servers/plugins/collation/config.c \
         ldap/servers/plugins/collation/orfilter.c
 
-libcollation_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) @icu_inc@
-libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LINK) $(LIBCSTD) $(LIBCRUN)
+libcollation_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) $(ICU_CFLAGS)
+libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LIBS) $(LIBCSTD) $(LIBCRUN)
 libcollation_plugin_la_DEPENDENCIES = libslapd.la
 libcollation_plugin_la_LDFLAGS = -avoid-version
 # libcollation_plugin_la_LINK = $(CXXLINK) -avoid-version
@@ -1859,8 +1858,8 @@
 	ldap/servers/plugins/replication/windows_protocol_util.c \
 	ldap/servers/plugins/replication/windows_tot_protocol.c
 
-libreplication_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) @icu_inc@ @db_inc@
-libreplication_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSS_LINK) $(NSPR_LINK) $(ICU_LINK) $(DB_LINK)
+libreplication_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(DSPLUGIN_CPPFLAGS) $(ICU_CFLAGS) @db_inc@
+libreplication_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSS_LINK) $(NSPR_LINK) $(ICU_LIBS) $(DB_LINK)
 libreplication_plugin_la_DEPENDENCIES = libslapd.la
 libreplication_plugin_la_LDFLAGS = -avoid-version
 
--- a/configure.ac
+++ b/configure.ac
@@ -34,6 +34,7 @@
 AM_PROG_CC_C_O
 AM_PROG_AS
 AC_PROG_CC_STDC
+PKG_PROG_PKG_CONFIG
 
 # disable static libs by default - we only use a couple
 AC_DISABLE_STATIC
--- a/m4/icu.m4
+++ b/m4/icu.m4
@@ -6,95 +6,22 @@
 # See LICENSE for details. 
 # END COPYRIGHT BLOCK
 
-AC_CHECKING(for LIBICU)
-
-# check for --with-icu
-AC_MSG_CHECKING(for --with-icu)
-AC_ARG_WITH(icu, AS_HELP_STRING([--with-icu@<:@=PATH@:>@],[ICU directory]),
-[
-  if test "$withval" = "yes"
-  then
-    AC_MSG_RESULT(yes)
-  elif test "$withval" = "no"
-  then
-    AC_MSG_RESULT(no)
-    AC_MSG_ERROR([ICU is required.])
-  elif test -d "$withval"/lib
-  then
-    AC_MSG_RESULT([using $withval])
-    ICUDIR=$withval
-    icu_lib="-L$ICUDIR/lib"
-    icu_inc="-I$withval/include"
-    icu_bin="$withval/bin"
-  else
-    echo
-    AC_MSG_ERROR([$withval not found])
-  fi
-],
-AC_MSG_RESULT(yes))
-
-# check for --with-icu-inc
-AC_MSG_CHECKING(for --with-icu-inc)
-AC_ARG_WITH(icu-inc, AS_HELP_STRING([--with-icu-inc=PATH],[ICU include directory]),
+# check for --enable-icu
+AC_MSG_CHECKING([whether to enable internationalization support])
+AC_ARG_ENABLE(icu, AS_HELP_STRING([--enable-icu], [Enable internationalization support]),
 [
-  if test -d "$withval"
-  then
-    AC_MSG_RESULT([using $withval])
-    icu_inc="-I$withval"
-  else
-    echo
-    AC_MSG_ERROR([$withval not found])
-  fi
-],
-AC_MSG_RESULT(no))
-
-# check for --with-icu-lib
-AC_MSG_CHECKING(for --with-icu-lib)
-AC_ARG_WITH(icu-lib, AS_HELP_STRING([--with-icu-lib=PATH],[ICU library directory]),
-[
-  if test -d "$withval"
-  then
-    AC_MSG_RESULT([using $withval])
-    icu_lib="-L$withval"
-  else
-    echo
-    AC_MSG_ERROR([$withval not found])
-  fi
-],
-AC_MSG_RESULT(no))
-
-# check for --with-icu-bin
-AC_MSG_CHECKING(for --with-icu-bin)
-AC_ARG_WITH(icu-bin, AS_HELP_STRING([--with-icu-bin=PATH],[ICU binary directory]),
-[
-  if test -d "$withval"
-  then
-    AC_MSG_RESULT([using $withval])
-    icu_bin="$withval"
-  else
-    echo
-    AC_MSG_ERROR([$withval not found])
-  fi
-],
-AC_MSG_RESULT(no))
-# if ICU is not found yet, try pkg-config
-
-# last resort
-if test -z "$icu_lib"; then
-  AC_PATH_PROG(ICU_CONFIG, icu-config)
-  AC_MSG_CHECKING(for icu with icu-config)
-  if test -n "$ICU_CONFIG"; then
-    icu_lib=`$ICU_CONFIG --ldflags-searchpath`
-    icu_inc=`$ICU_CONFIG --cppflags-searchpath`
-    icu_bin=`$ICU_CONFIG --bindir`
-    AC_MSG_RESULT([using system ICU])
-  else
-    AC_MSG_ERROR([ICU not found, specify with --with-icu.])
-  fi
+  case "${enableval}" in
+    yes) enable_icu=true ;;
+    no)  enable_icu=false ;;
+    *)   AC_MSG_ERROR([unknown option '${enableval}' for --enable-icu]) ;;
+  esac
+], [
+  enable_icu=false
+])
+
+if test "$enable_icu" = true; then
+  AC_MSG_RESULT([yes])
+  PKG_CHECK_MODULES([ICU], [icu-i18n])
+else
+  AC_MSG_RESULT([no])
 fi
-
-
-AC_SUBST(icu_lib)
-AC_SUBST(icu_inc)
-AC_SUBST(icu_bin)
-