Add -lm dependency for gettextlib to fix LTO build
[platform/upstream/gettext.git] / gettext-tools / libgrep / gnulib-m4 / gnulib-comp.m4
1 # DO NOT EDIT! GENERATED AUTOMATICALLY!
2 # Copyright (C) 2002-2015 Free Software Foundation, Inc.
3 #
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This file is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
16 #
17 # As a special exception to the GNU General Public License,
18 # this file may be distributed as part of a program that
19 # contains a configuration script generated by Autoconf, under
20 # the same distribution terms as the rest of that program.
21 #
22 # Generated by gnulib-tool.
23 #
24 # This file represents the compiled summary of the specification in
25 # gnulib-cache.m4. It lists the computed macro invocations that need
26 # to be invoked from configure.ac.
27 # In projects that use version control, this file can be treated like
28 # other built files.
29
30
31 # This macro should be invoked from gettext-tools/configure.ac, in the section
32 # "Checks for programs", right after AC_PROG_CC, and certainly before
33 # any checks for libraries, header files, types and library functions.
34 AC_DEFUN([grgl_EARLY],
35 [
36   m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
37   m4_pattern_allow([^gl_ES$])dnl a valid locale name
38   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
39   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
40
41   # Pre-early section.
42   AC_REQUIRE([gl_PROG_AR_RANLIB])
43
44   AC_REQUIRE([AM_PROG_CC_C_O])
45   # Code from module btowc:
46   # Code from module havelib:
47   # Code from module langinfo:
48   # Code from module localeconv:
49   # Code from module lock:
50   # Code from module mbrlen:
51   # Code from module mbtowc:
52   # Code from module nl_langinfo:
53   # Code from module regex:
54   # Code from module snippet/c++defs:
55   # Code from module snippet/warn-on-use:
56   # Code from module threadlib:
57   gl_THREADLIB_EARLY
58   # Code from module wcrtomb:
59 ])
60
61 # This macro should be invoked from gettext-tools/configure.ac, in the section
62 # "Check for header files, types and library functions".
63 AC_DEFUN([grgl_INIT],
64 [
65   AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
66   gl_cond_libtool=false
67   gl_libdeps=
68   gl_ltlibdeps=
69   gl_m4_base='libgrep/gnulib-m4'
70   m4_pushdef([AC_LIBOBJ], m4_defn([grgl_LIBOBJ]))
71   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([grgl_REPLACE_FUNCS]))
72   m4_pushdef([AC_LIBSOURCES], m4_defn([grgl_LIBSOURCES]))
73   m4_pushdef([grgl_LIBSOURCES_LIST], [])
74   m4_pushdef([grgl_LIBSOURCES_DIR], [])
75   gl_COMMON
76   gl_source_base='libgrep'
77   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [IN_GETTEXT_TOOLS_LIBGREP])
78   gl_FUNC_BTOWC
79   if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
80     AC_LIBOBJ([btowc])
81     gl_PREREQ_BTOWC
82   fi
83   gl_WCHAR_MODULE_INDICATOR([btowc])
84   gl_LANGINFO_H
85   gl_FUNC_LOCALECONV
86   if test $REPLACE_LOCALECONV = 1; then
87     AC_LIBOBJ([localeconv])
88     gl_PREREQ_LOCALECONV
89   fi
90   gl_LOCALE_MODULE_INDICATOR([localeconv])
91   gl_LOCK
92   gl_MODULE_INDICATOR([lock])
93   gl_FUNC_MBRLEN
94   if test $HAVE_MBRLEN = 0 || test $REPLACE_MBRLEN = 1; then
95     AC_LIBOBJ([mbrlen])
96     gl_PREREQ_MBRLEN
97   fi
98   gl_WCHAR_MODULE_INDICATOR([mbrlen])
99   gl_FUNC_MBTOWC
100   if test $REPLACE_MBTOWC = 1; then
101     AC_LIBOBJ([mbtowc])
102     gl_PREREQ_MBTOWC
103   fi
104   gl_STDLIB_MODULE_INDICATOR([mbtowc])
105   gl_FUNC_NL_LANGINFO
106   if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
107     AC_LIBOBJ([nl_langinfo])
108   fi
109   gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
110   gl_REGEX
111   if test $ac_use_included_regex = yes; then
112     AC_LIBOBJ([regex])
113     gl_PREREQ_REGEX
114   fi
115   gl_THREADLIB
116   gl_FUNC_WCRTOMB
117   if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
118     AC_LIBOBJ([wcrtomb])
119     gl_PREREQ_WCRTOMB
120   fi
121   gl_WCHAR_MODULE_INDICATOR([wcrtomb])
122   m4_popdef([gl_MODULE_INDICATOR_CONDITION])
123   # End of code from modules
124   m4_ifval(grgl_LIBSOURCES_LIST, [
125     m4_syscmd([test ! -d ]m4_defn([grgl_LIBSOURCES_DIR])[ ||
126       for gl_file in ]grgl_LIBSOURCES_LIST[ ; do
127         if test ! -r ]m4_defn([grgl_LIBSOURCES_DIR])[/$gl_file ; then
128           echo "missing file ]m4_defn([grgl_LIBSOURCES_DIR])[/$gl_file" >&2
129           exit 1
130         fi
131       done])dnl
132       m4_if(m4_sysval, [0], [],
133         [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
134   ])
135   m4_popdef([grgl_LIBSOURCES_DIR])
136   m4_popdef([grgl_LIBSOURCES_LIST])
137   m4_popdef([AC_LIBSOURCES])
138   m4_popdef([AC_REPLACE_FUNCS])
139   m4_popdef([AC_LIBOBJ])
140   AC_CONFIG_COMMANDS_PRE([
141     grgl_libobjs=
142     grgl_ltlibobjs=
143     if test -n "$grgl_LIBOBJS"; then
144       # Remove the extension.
145       sed_drop_objext='s/\.o$//;s/\.obj$//'
146       for i in `for i in $grgl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
147         grgl_libobjs="$grgl_libobjs $i.$ac_objext"
148         grgl_ltlibobjs="$grgl_ltlibobjs $i.lo"
149       done
150     fi
151     AC_SUBST([grgl_LIBOBJS], [$grgl_libobjs])
152     AC_SUBST([grgl_LTLIBOBJS], [$grgl_ltlibobjs])
153   ])
154   gltests_libdeps=
155   gltests_ltlibdeps=
156   m4_pushdef([AC_LIBOBJ], m4_defn([grgltests_LIBOBJ]))
157   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([grgltests_REPLACE_FUNCS]))
158   m4_pushdef([AC_LIBSOURCES], m4_defn([grgltests_LIBSOURCES]))
159   m4_pushdef([grgltests_LIBSOURCES_LIST], [])
160   m4_pushdef([grgltests_LIBSOURCES_DIR], [])
161   gl_COMMON
162   gl_source_base='tests'
163 changequote(,)dnl
164   grgltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
165 changequote([, ])dnl
166   AC_SUBST([grgltests_WITNESS])
167   gl_module_indicator_condition=$grgltests_WITNESS
168   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
169   m4_popdef([gl_MODULE_INDICATOR_CONDITION])
170   m4_ifval(grgltests_LIBSOURCES_LIST, [
171     m4_syscmd([test ! -d ]m4_defn([grgltests_LIBSOURCES_DIR])[ ||
172       for gl_file in ]grgltests_LIBSOURCES_LIST[ ; do
173         if test ! -r ]m4_defn([grgltests_LIBSOURCES_DIR])[/$gl_file ; then
174           echo "missing file ]m4_defn([grgltests_LIBSOURCES_DIR])[/$gl_file" >&2
175           exit 1
176         fi
177       done])dnl
178       m4_if(m4_sysval, [0], [],
179         [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
180   ])
181   m4_popdef([grgltests_LIBSOURCES_DIR])
182   m4_popdef([grgltests_LIBSOURCES_LIST])
183   m4_popdef([AC_LIBSOURCES])
184   m4_popdef([AC_REPLACE_FUNCS])
185   m4_popdef([AC_LIBOBJ])
186   AC_CONFIG_COMMANDS_PRE([
187     grgltests_libobjs=
188     grgltests_ltlibobjs=
189     if test -n "$grgltests_LIBOBJS"; then
190       # Remove the extension.
191       sed_drop_objext='s/\.o$//;s/\.obj$//'
192       for i in `for i in $grgltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
193         grgltests_libobjs="$grgltests_libobjs $i.$ac_objext"
194         grgltests_ltlibobjs="$grgltests_ltlibobjs $i.lo"
195       done
196     fi
197     AC_SUBST([grgltests_LIBOBJS], [$grgltests_libobjs])
198     AC_SUBST([grgltests_LTLIBOBJS], [$grgltests_ltlibobjs])
199   ])
200   LIBGREP_LIBDEPS="$gl_libdeps"
201   AC_SUBST([LIBGREP_LIBDEPS])
202   LIBGREP_LTLIBDEPS="$gl_ltlibdeps"
203   AC_SUBST([LIBGREP_LTLIBDEPS])
204 ])
205
206 # Like AC_LIBOBJ, except that the module name goes
207 # into grgl_LIBOBJS instead of into LIBOBJS.
208 AC_DEFUN([grgl_LIBOBJ], [
209   AS_LITERAL_IF([$1], [grgl_LIBSOURCES([$1.c])])dnl
210   grgl_LIBOBJS="$grgl_LIBOBJS $1.$ac_objext"
211 ])
212
213 # Like AC_REPLACE_FUNCS, except that the module name goes
214 # into grgl_LIBOBJS instead of into LIBOBJS.
215 AC_DEFUN([grgl_REPLACE_FUNCS], [
216   m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
217   AC_CHECK_FUNCS([$1], , [grgl_LIBOBJ($ac_func)])
218 ])
219
220 # Like AC_LIBSOURCES, except the directory where the source file is
221 # expected is derived from the gnulib-tool parameterization,
222 # and alloca is special cased (for the alloca-opt module).
223 # We could also entirely rely on EXTRA_lib..._SOURCES.
224 AC_DEFUN([grgl_LIBSOURCES], [
225   m4_foreach([_gl_NAME], [$1], [
226     m4_if(_gl_NAME, [alloca.c], [], [
227       m4_define([grgl_LIBSOURCES_DIR], [libgrep])
228       m4_append([grgl_LIBSOURCES_LIST], _gl_NAME, [ ])
229     ])
230   ])
231 ])
232
233 # Like AC_LIBOBJ, except that the module name goes
234 # into grgltests_LIBOBJS instead of into LIBOBJS.
235 AC_DEFUN([grgltests_LIBOBJ], [
236   AS_LITERAL_IF([$1], [grgltests_LIBSOURCES([$1.c])])dnl
237   grgltests_LIBOBJS="$grgltests_LIBOBJS $1.$ac_objext"
238 ])
239
240 # Like AC_REPLACE_FUNCS, except that the module name goes
241 # into grgltests_LIBOBJS instead of into LIBOBJS.
242 AC_DEFUN([grgltests_REPLACE_FUNCS], [
243   m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
244   AC_CHECK_FUNCS([$1], , [grgltests_LIBOBJ($ac_func)])
245 ])
246
247 # Like AC_LIBSOURCES, except the directory where the source file is
248 # expected is derived from the gnulib-tool parameterization,
249 # and alloca is special cased (for the alloca-opt module).
250 # We could also entirely rely on EXTRA_lib..._SOURCES.
251 AC_DEFUN([grgltests_LIBSOURCES], [
252   m4_foreach([_gl_NAME], [$1], [
253     m4_if(_gl_NAME, [alloca.c], [], [
254       m4_define([grgltests_LIBSOURCES_DIR], [tests])
255       m4_append([grgltests_LIBSOURCES_LIST], _gl_NAME, [ ])
256     ])
257   ])
258 ])
259
260 # This macro records the list of files which have been installed by
261 # gnulib-tool and may be removed by future gnulib-tool invocations.
262 AC_DEFUN([grgl_FILE_LIST], [
263   build-aux/config.rpath
264   build-aux/snippet/c++defs.h
265   build-aux/snippet/warn-on-use.h
266   lib/btowc.c
267   lib/glthread/lock.c
268   lib/glthread/lock.h
269   lib/glthread/threadlib.c
270   lib/langinfo.in.h
271   lib/localeconv.c
272   lib/mbrlen.c
273   lib/mbtowc-impl.h
274   lib/mbtowc.c
275   lib/nl_langinfo.c
276   lib/regcomp.c
277   lib/regex.c
278   lib/regex.h
279   lib/regex_internal.c
280   lib/regex_internal.h
281   lib/regexec.c
282   lib/wcrtomb.c
283   m4/00gnulib.m4
284   m4/btowc.m4
285   m4/codeset.m4
286   m4/eealloc.m4
287   m4/gnulib-common.m4
288   m4/langinfo_h.m4
289   m4/lib-ld.m4
290   m4/lib-link.m4
291   m4/lib-prefix.m4
292   m4/locale-fr.m4
293   m4/locale-ja.m4
294   m4/locale-zh.m4
295   m4/localeconv.m4
296   m4/lock.m4
297   m4/mbrlen.m4
298   m4/mbrtowc.m4
299   m4/mbstate_t.m4
300   m4/mbtowc.m4
301   m4/nl_langinfo.m4
302   m4/regex.m4
303   m4/threadlib.m4
304   m4/warn-on-use.m4
305   m4/wcrtomb.m4
306 ])