• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Makefile for the gettext-runtime/intl and gettext-tools/intl subdirectories
2## of GNU gettext.
3## Copyright (C) 1995-1998, 2000-2007, 2009-2020 Free Software Foundation, Inc.
4##
5## This program is free software: you can redistribute it and/or modify
6## it under the terms of the GNU Lesser General Public License as published by
7## the Free Software Foundation; either version 2.1 of the License, or
8## (at your option) any later version.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13## GNU Lesser General Public License for more details.
14##
15## You should have received a copy of the GNU Lesser General Public License
16## along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
18## Process this file with automake to produce Makefile.in.
19
20AUTOMAKE_OPTIONS = 1.10 gnu no-dependencies
21EXTRA_DIST =
22BUILT_SOURCES =
23MOSTLYCLEANFILES = core *.stackdump
24CLEANFILES =
25DISTCLEANFILES =
26MAINTAINERCLEANFILES =
27SUFFIXES =
28
29# The VPATH variable allows builds with $builddir != $srcdir, assuming a
30# 'make' program that supports VPATH (such as GNU make). The VPATH definition
31# is removed by autoconf automatically when "$(srcdir)" = ".".
32# In this directory, the VPATH handling is particular:
33# 1. The .c -> .lo rule carefully uses $(srcdir), so that VPATH can be omitted.
34# 2. If PACKAGE = gettext-tools, VPATH _must_ be omitted, because otherwise
35#    'make' does the wrong thing if GNU gettext was configured with
36#    "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
37#    files it finds in srcdir = ../../gettext-runtime/intl.
38origsrcdir = @srcdir@
39# In gettext-tools/intl/, distribute the right Makefile.in.
40dist-hook:
41if PACKAGE_IS_GETTEXT_TOOLS
42	for file in Makefile.am Makefile.in; do \
43	  cp -p $(origsrcdir)/$$file $(distdir)/$$file || exit 1; \
44	done
45else
46	@:
47endif
48
49# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
50# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
51AM_CPPFLAGS = \
52  -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
53  -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL
54
55if WOE32
56# On mingw, disable the declarations of *printf functions as aliases to the
57# corresponding __mingw_*printf functions, because
58# - these functions are useless for i18n purposes (not POSIX/XSI compliant),
59# - they pull in a dependency to the libgcc_s_sjlj DLL (through the symbols
60#   __udivdi3, __umoddi3).
61AM_CPPFLAGS += -D__USE_MINGW_ANSI_STDIO=0
62endif
63
64# Parametrization of the 'relocatable-lib-lgpl' module.
65AM_CPPFLAGS += \
66  -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
67  -Dset_relocation_prefix=libintl_set_relocation_prefix \
68  -Drelocate=libintl_relocate \
69  -Drelocate2=libintl_relocate2 \
70  -DDEPENDS_ON_LIBICONV=1
71
72BISON = @INTLBISON@
73YACC = $(BISON) -d
74BISONFLAGS = --name-prefix=__gettext
75
76# Tell the ELF linker which symbols to export.
77AM_CFLAGS = @CFLAG_VISIBILITY@
78# Tell the mingw or Cygwin linker which symbols to export.
79if WOE32DLL
80AM_LDFLAGS = -Wl,--export-all-symbols
81endif
82
83
84# Library include file and code.
85
86EXTRA_DIST += \
87  gmo.h \
88  gettextP.h \
89  hash-string.h \
90  loadinfo.h \
91  plural-exp.h \
92  eval-plural.h \
93  localcharset.h \
94  lock.h windows-mutex.h windows-rwlock.h windows-recmutex.h windows-once.h windows-initguard.h \
95  relocatable.h \
96  arg-nonnull.h \
97  attribute.h \
98  filename.h \
99  flexmember.h \
100  localename-table.in.h \
101  setlocale_null.h \
102  tsearch.h tsearch.c \
103  verify.h \
104  xsize.h \
105  printf-args.h printf-args.c \
106  printf-parse.h wprintf-parse.h printf-parse.c \
107  vasnprintf.h vasnwprintf.h vasnprintf.c \
108  intl-exports.c os2compat.h os2compat.c \
109  libgnuintl.in.h
110
111# Overview of the code
112# --------------------
113#
114# The following files implement public API, declared in libgnuintl.in.h:
115#   version.c:          libintl_version
116#   gettext.c:          libintl_gettext
117#   dgettext.c:         libintl_dgettext
118#   dcgettext.c:        libintl_dcgettext
119#   ngettext.c:         libintl_ngettext
120#   dngettext.c:        libintl_dngettext
121#   dcngettext.c:       libintl_dcngettext
122#   textdomain.c:       libintl_textdomain
123#   bindtextdom.c:      libintl_bindtextdomain
124#                       libintl_bind_textdomain_codeset
125#   printf.c:           libintl_fprintf
126#                       libintl_vfprintf
127#                       libintl_printf
128#                       libintl_vprintf
129#                       libintl_sprintf
130#                       libintl_vsprintf
131#                       libintl_snprintf
132#                       libintl_vsnprintf
133#                       libintl_asprintf
134#                       libintl_vasprintf
135#                       libintl_fwprintf
136#                       libintl_vfwprintf
137#                       libintl_wprintf
138#                       libintl_vwprintf
139#                       libintl_swprintf
140#                       libintl_vswprintf
141#   localename.c:       libintl_newlocale
142#                       libintl_duplocale
143#                       libintl_freelocale
144#   setlocale.c:        libintl_newlocale
145#                       libintl_setlocale
146#   relocatable.c:      libintl_set_relocation_prefix
147#
148# The following files implement private API.
149#   gettextP.h:     dcigettext.c:       libintl_dcigettext
150#                                       _nl_find_msg
151#                                       libintl_nl_default_dirname
152#                                       libintl_nl_domain_bindings
153#                                       libintl_nl_default_default_domain
154#                                       libintl_nl_current_default_domain
155#                   localename.c:       _nl_locale_name_canonicalize
156#                                       _nl_locale_name_from_win32_LANGID
157#                                       _nl_locale_name_from_win32_LCID
158#                                       _nl_locale_name_thread_unsafe
159#                                       _nl_locale_name_thread
160#                                       _nl_locale_name_posix
161#                                       _nl_locale_name_environ
162#                                       _nl_locale_name_default
163#                                       _nl_locale_name
164#                   langprefs.c:        _nl_language_preferences_default
165#                   finddomain.c:       _nl_find_domain
166#                   loadmsgcat.c:       _nl_load_domain
167#                                       _nl_msg_cat_cntr
168#   loadinfo.h:     l10nflist.c:        _nl_make_l10nflist
169#                                       _nl_normalize_codeset
170#                   localealias.c:      _nl_expand_alias
171#                   explodename.c:      _nl_explode_name
172#   plural-exp.h:   plural.y:           libintl_gettext_free_exp
173#                                       libintl_gettextparse
174#                   plural-exp.c:       libintl_gettext_germanic_plural
175#                                       libintl_gettext_extract_plural
176#                   eval-plural.h:      plural_eval
177#
178# Other files:
179#   gmo.h:          Describes the GNU MO file format.
180#   hash-string.h:  hash-string.c:      libintl_hash_string
181#
182# Some other files are borrowed from gnulib, some with small modifications.
183#
184# Overview of invocation hierarchy
185# --------------------------------
186#
187# The main general translation lookup function is libintl_dcigettext.
188# libintl_dcigettext
189#   \-> guess_category_value
190#         \-> _nl_locale_name_thread_unsafe
191#         \-> _nl_locale_name_posix
192#         \-> _nl_locale_name_default
193#         \-> _nl_language_preferences_default
194#   \-> _nl_find_domain
195#         \-> _nl_make_l10nflist
196#         \-> _nl_load_domain
197#         \-> _nl_expand_alias
198#         \-> _nl_explode_name
199#               \-> _nl_normalize_codeset
200#   \-> _nl_find_msg
201#         \-> _nl_load_domain
202#         \-> get_output_charset
203#   \-> plural_lookup
204#         \-> plural_eval
205#
206# _nl_load_domain loads a MO file into memory.
207# _nl_load_domain
208#   \-> _nl_find_msg (for the header entry only)
209#   \-> libintl_gettext_extract_plural
210
211LIBINTLSOURCES = \
212  bindtextdom.c \
213  dcgettext.c \
214  dgettext.c \
215  gettext.c \
216  finddomain.c \
217  hash-string.c \
218  loadmsgcat.c \
219  localealias.c \
220  textdomain.c \
221  l10nflist.c \
222  explodename.c \
223  dcigettext.c \
224  dcngettext.c \
225  dngettext.c \
226  ngettext.c \
227  plural.y \
228  plural-exp.c \
229  localcharset.c \
230  threadlib.c \
231  lock.c \
232  relocatable.c \
233  langprefs.c \
234  localename.c \
235  localename-table.c \
236  log.c \
237  printf.c \
238  setlocale.c \
239  setlocale-lock.c \
240  setlocale_null.c \
241  version.c \
242  xsize.c \
243  osdep.c \
244  intl-compat.c
245if WINDOWS_NATIVE
246LIBINTLSOURCES += \
247  windows-mutex.c \
248  windows-rwlock.c \
249  windows-recmutex.c \
250  windows-once.c
251endif
252
253# We must not install the libintl.h/libintl.la files if we are on a
254# system which has the GNU gettext() function in its C library or in a
255# separate library.
256if USE_INCLUDED_LIBINTL
257nodist_include_HEADERS = libintl.h
258# Note: libintl.la actually gets installed in $(libdir). See below.
259noinst_LTLIBRARIES = libintl.la
260libintl_la_SOURCES = $(LIBINTLSOURCES)
261else
262if BUILD_INCLUDED_LIBINTL
263noinst_LTLIBRARIES = libgnuintl.la
264libgnuintl_la_SOURCES = $(LIBINTLSOURCES)
265endif
266endif
267
268# export.h is an auxiliary file used in constructing the .h files.
269EXTRA_DIST += export.h
270
271libgnuintl.h: $(srcdir)/libgnuintl.in.h $(srcdir)/export.h
272	sed -e '/IN_LIBGLOCALE/d' \
273	    -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
274	    -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
275	    -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
276	    -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
277	    -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \
278	    -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
279	  < $(srcdir)/libgnuintl.in.h \
280	| if test '@WOE32DLL@' = yes; then \
281	    sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
282	  else \
283	    cat; \
284	  fi \
285	| sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
286	      -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \
287	| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
288	  > libgnuintl.h
289MOSTLYCLEANFILES += libgnuintl.h
290
291libintl.h: $(srcdir)/libgnuintl.in.h
292	sed -e '/IN_LIBGLOCALE/d' \
293	    -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
294	    -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
295	    -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
296	    -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
297	    -e 's,@''HAVE_NAMELESS_LOCALES''@,@HAVE_NAMELESS_LOCALES@,g' \
298	    -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
299	  < $(srcdir)/libgnuintl.in.h > libintl.h
300MOSTLYCLEANFILES += libintl.h
301
302localename-table.h: $(srcdir)/localename-table.in.h $(srcdir)/export.h
303	sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
304	    -e 's/extern,/extern LIBINTL_DLL_EXPORTED,/' \
305	    -e "/#if HAVE_WORKING_USELOCALE/r $(srcdir)/export.h" \
306	  < $(srcdir)/localename-table.in.h \
307	| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
308	  > localename-table.h
309MOSTLYCLEANFILES += localename-table.h
310
311# The Automake generated .y.c rule is broken: When executed in a VPATH build,
312#   - The .c file gets generated in the build directory. But since it requires
313#     special tools to rebuild it, we need to distribute it in the tarballs,
314#     and by the GNU Coding Standards
315#     <https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html>
316#     the file should be generated in the source directory.
317#   - The #line numbers in the .c file refer to a nonexistent file once it
318#     has been moved from the build directory to the source directory. This
319#     leads to error if 'lcov' is used later.
320# Additionally, here we assume GNU Bison and therefore don't need the ylwrap
321# script.
322# Additionally, here we need a rule that works even without a VPATH variable.
323# Therefore we override this rule.
324
325$(srcdir)/plural.c: $(srcdir)/plural.y
326	$(AM_V_YACC)$(YACC) $(BISONFLAGS) --output plural.c $(srcdir)/plural.y \
327	&& test ':' = '$(BISON)' || { \
328	  sed -e 's|".*/plural.y"|"plural.y"|' < plural.c > plural.c-tmp \
329	  && rm -f plural.c plural.h \
330	  && mv plural.c-tmp $(srcdir)/plural.c; \
331	}
332# Don't put plural.c into BUILT_SOURCES. Since plural.c is in the source
333# directory, 'make' does not find it without a VPATH variable.
334MOSTLYCLEANFILES     += plural.c-tmp
335MAINTAINERCLEANFILES += plural.c
336EXTRA_DIST           += plural.c
337
338# Rules for compiling a .c file, that work even without a VPATH variable.
339bindtextdom.lo: $(srcdir)/bindtextdom.c
340	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/bindtextdom.c
341dcgettext.lo: $(srcdir)/dcgettext.c
342	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/dcgettext.c
343dgettext.lo: $(srcdir)/dgettext.c
344	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/dgettext.c
345gettext.lo: $(srcdir)/gettext.c
346	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/gettext.c
347finddomain.lo: $(srcdir)/finddomain.c
348	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/finddomain.c
349hash-string.lo: $(srcdir)/hash-string.c
350	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/hash-string.c
351loadmsgcat.lo: $(srcdir)/loadmsgcat.c
352	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/loadmsgcat.c
353localealias.lo: $(srcdir)/localealias.c
354	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/localealias.c
355textdomain.lo: $(srcdir)/textdomain.c
356	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/textdomain.c
357l10nflist.lo: $(srcdir)/l10nflist.c
358	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/l10nflist.c
359explodename.lo: $(srcdir)/explodename.c
360	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/explodename.c
361dcigettext.lo: $(srcdir)/dcigettext.c
362	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/dcigettext.c
363dcngettext.lo: $(srcdir)/dcngettext.c
364	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/dcngettext.c
365dngettext.lo: $(srcdir)/dngettext.c
366	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/dngettext.c
367ngettext.lo: $(srcdir)/ngettext.c
368	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/ngettext.c
369plural.lo: $(srcdir)/plural.c
370	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/plural.c
371plural-exp.lo: $(srcdir)/plural-exp.c
372	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/plural-exp.c
373localcharset.lo: $(srcdir)/localcharset.c
374	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/localcharset.c
375threadlib.lo: $(srcdir)/threadlib.c
376	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/threadlib.c
377lock.lo: $(srcdir)/lock.c
378	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/lock.c
379relocatable.lo: $(srcdir)/relocatable.c
380	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/relocatable.c
381langprefs.lo: $(srcdir)/langprefs.c
382	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/langprefs.c
383localename.lo: $(srcdir)/localename.c
384	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/localename.c
385localename-table.lo: $(srcdir)/localename-table.c
386	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/localename-table.c
387log.lo: $(srcdir)/log.c
388	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/log.c
389printf.lo: $(srcdir)/printf.c
390	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/printf.c
391setlocale.lo: $(srcdir)/setlocale.c
392	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/setlocale.c
393setlocale-lock.lo: $(srcdir)/setlocale-lock.c
394	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/setlocale-lock.c
395setlocale_null.lo: $(srcdir)/setlocale_null.c
396	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/setlocale_null.c
397version.lo: $(srcdir)/version.c
398	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/version.c
399xsize.lo: $(srcdir)/xsize.c
400	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/xsize.c
401osdep.lo: $(srcdir)/osdep.c
402	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/osdep.c
403intl-compat.lo: $(srcdir)/intl-compat.c
404	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/intl-compat.c
405windows-mutex.lo: $(srcdir)/windows-mutex.c
406	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/windows-mutex.c
407windows-rwlock.lo: $(srcdir)/windows-rwlock.c
408	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/windows-rwlock.c
409windows-recmutex.lo: $(srcdir)/windows-recmutex.c
410	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/windows-recmutex.c
411windows-once.lo: $(srcdir)/windows-once.c
412	$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/windows-once.c
413
414# Dependencies.
415
416PLURAL_DEPS =
417if USE_INCLUDED_LIBINTL
418# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
419PLURAL_DEPS += libintl.h
420endif
421
422bindtextdom.lo:      ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
423dcgettext.lo:        ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
424dgettext.lo:         ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
425gettext.lo:          ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
426finddomain.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
427hash-string.lo:      ../config.h $(srcdir)/hash-string.h
428loadmsgcat.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/hash-string.h $(srcdir)/plural-exp.h
429localealias.lo:      ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/relocatable.h
430textdomain.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
431l10nflist.lo:        ../config.h $(srcdir)/loadinfo.h $(srcdir)/filename.h
432explodename.lo:      ../config.h $(srcdir)/loadinfo.h
433dcigettext.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/localcharset.h $(srcdir)/plural-exp.h $(srcdir)/hash-string.h $(srcdir)/tsearch.h $(srcdir)/tsearch.c $(srcdir)/eval-plural.h $(srcdir)/filename.h
434dcngettext.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
435dngettext.lo:        ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
436ngettext.lo:         ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
437plural.lo:           ../config.h $(srcdir)/plural-exp.h $(PLURAL_DEPS)
438plural-exp.lo:       ../config.h $(srcdir)/plural-exp.h
439localcharset.lo:     ../config.h $(srcdir)/localcharset.h
440threadlib.lo:        ../config.h
441lock.lo:             ../config.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
442relocatable.lo:      ../config.h $(srcdir)/relocatable.h
443langprefs.lo:        ../config.h
444localename.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/flexmember.h $(srcdir)/setlocale_null.h $(srcdir)/arg-nonnull.h localename-table.h
445localename-table.lo: ../config.h localename-table.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
446log.lo:              ../config.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
447printf.lo:           ../config.h $(srcdir)/printf-args.c $(srcdir)/printf-args.h $(srcdir)/printf-parse.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/vasnprintf.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/verify.h
448setlocale.lo:        ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
449setlocale-lock.lo:   ../config.h $(srcdir)/windows-initguard.h
450setlocale_null.lo:   ../config.h $(srcdir)/setlocale_null.h $(srcdir)/arg-nonnull.h
451version.lo:          ../config.h libgnuintl.h
452xsize.lo:            ../config.h $(srcdir)/xsize.h
453osdep.lo:            ../config.h $(srcdir)/intl-exports.c $(srcdir)/os2compat.c
454intl-compat.lo:      ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
455windows-mutex.lo:    ../config.h $(srcdir)/windows-mutex.h $(srcdir)/windows-initguard.h
456windows-rwlock.lo:   ../config.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-initguard.h
457windows-recmutex.lo: ../config.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-initguard.h
458windows-once.lo:     ../config.h $(srcdir)/windows-once.h
459
460# Version information according to Woe32 conventions.
461EXTRA_DIST += libintl.rc
462if WOE32
463WOE32_LIBADD = libintl.res.lo
464# This rule is executed only on Woe32 systems.
465# Use $(RC) with libtool, $(WINDRES) when not using libtool.
466# The following sed expressions come from the windres-options script. They are
467# inlined here, so that they can be written in a Makefile without requiring a
468# temporary file. They must contain literal newlines rather than semicolons,
469# so that they work with the sed-3.02 that is shipped with MSYS.
470libintl.res.lo: $(srcdir)/libintl.rc
471	nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
472	sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
473	sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
474	sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
475	$(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \
476	  "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
477	  "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
478	  "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
479	  "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
480	  -i $(srcdir)/libintl.rc -o libintl.res.lo --output-format=coff
481MOSTLYCLEANFILES += libintl.res.lo
482else
483WOE32_LIBADD =
484endif
485libintl_la_LIBADD          = $(WOE32_LIBADD)
486libintl_la_DEPENDENCIES    = $(WOE32_LIBADD)
487libgnuintl_la_LIBADD       = $(WOE32_LIBADD)
488libgnuintl_la_DEPENDENCIES = $(WOE32_LIBADD)
489
490# langprefs.c (_nl_language_preferences_win32_95) uses functions from
491# advapi32.dll.
492if WINDOWS_NATIVE
493INTL_WINDOWS_LIBS = -ladvapi32
494else
495INTL_WINDOWS_LIBS =
496endif
497
498# Libtool's library version information for libintl.
499# Before making a gettext release, you must change this according to the
500# libtool documentation, section "Library interface versions".
501LTV_CURRENT=10
502LTV_REVISION=0
503LTV_AGE=2
504
505# How to build libintl.la and libgnuintl.la.
506# Limit the exported symbols: Don't export glwthread* (from gnulib modules).
507OTHER_LDFLAGS = \
508  @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(INTL_WINDOWS_LIBS) @LTLIBTHREAD@ \
509  -no-undefined \
510  -export-symbols-regex '^([^g]|g[^l]|gl[^w]|glw[^t]|glwt[^h]|glwth[^r]|glwthr[^e]|glwthre[^a]|glwthrea[^d]).*' \
511  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
512  -rpath $(libdir)
513libintl_la_LDFLAGS    = $(AM_LDFLAGS) $(OTHER_LDFLAGS)
514libgnuintl_la_LDFLAGS = $(AM_LDFLAGS) $(OTHER_LDFLAGS)
515
516
517# Installation of libintl.la.
518
519if USE_INCLUDED_LIBINTL
520
521install-exec-local: install-exec-libintl
522install-exec-libintl: libintl.la
523	$(mkdir_p) $(DESTDIR)$(libdir)
524	$(LIBTOOL) --mode=install \
525	  $(INSTALL_DATA) libintl.la $(DESTDIR)$(libdir)/libintl.la; \
526	if test "@RELOCATABLE@" = yes; then \
527	  dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
528	  if test -n "$$dependencies"; then \
529	    rm -f $(DESTDIR)$(libdir)/libintl.la; \
530	  fi; \
531	fi
532
533installdirs-local: installdirs-libintl
534installdirs-libintl:
535	$(mkdir_p) $(DESTDIR)$(libdir)
536
537uninstall-local: uninstall-libintl
538uninstall-libintl:
539	$(LIBTOOL) --mode=uninstall \
540	  rm -f $(DESTDIR)$(libdir)/libintl.la
541
542endif
543
544
545# Installation of preloadable_libintl.so.
546
547if PRELOADABLE_LIBINTL
548
549install-exec-local: install-exec-preloadable
550install-exec-preloadable: libgnuintl.la
551	$(mkdir_p) $(DESTDIR)$(libdir)
552	$(LIBTOOL) --mode=install \
553	  $(INSTALL_DATA) libgnuintl.la $(DESTDIR)$(libdir)/libgnuintl.la
554	rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so
555	$(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so
556	$(LIBTOOL) --mode=uninstall \
557	  rm -f $(DESTDIR)$(libdir)/libgnuintl.la
558
559installdirs-local: installdirs-preloadable
560installdirs-preloadable:
561	$(mkdir_p) $(DESTDIR)$(libdir)
562
563uninstall-local: uninstall-preloadable
564uninstall-preloadable:
565	rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so
566
567endif
568
569
570# Installation of locale.alias.
571
572EXTRA_DIST += locale.alias ref-add.sin ref-del.sin
573
574if USE_INCLUDED_LIBINTL
575
576all-local: ref-add.sed ref-del.sed
577
578ref-add.sed: $(srcdir)/ref-add.sin
579	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
580	mv t-ref-add.sed ref-add.sed
581MOSTLYCLEANFILES += ref-add.sed
582
583ref-del.sed: $(srcdir)/ref-del.sin
584	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
585	mv t-ref-del.sed ref-del.sed
586MOSTLYCLEANFILES += ref-del.sed
587
588install-data-local: install-data-aliasfile
589install-data-aliasfile: ref-add.sed
590	$(mkdir_p) $(DESTDIR)$(localedir)
591	test -f $(DESTDIR)$(localedir)/locale.alias \
592	  && orig=$(DESTDIR)$(localedir)/locale.alias \
593	  || orig=$(srcdir)/locale.alias; \
594	temp=$(DESTDIR)$(localedir)/t-locale.alias; \
595	dest=$(DESTDIR)$(localedir)/locale.alias; \
596	sed -f ref-add.sed $$orig > $$temp; \
597	$(INSTALL_DATA) $$temp $$dest; \
598	rm -f $$temp
599
600installdirs-local: installdirs-aliasfile
601installdirs-aliasfile:
602	$(mkdir_p) $(DESTDIR)$(localedir)
603
604uninstall-local: uninstall-aliasfile
605uninstall-aliasfile: ref-del.sed
606	if test -f $(DESTDIR)$(localedir)/locale.alias; then \
607	  temp=$(DESTDIR)$(localedir)/t-locale.alias; \
608	  dest=$(DESTDIR)$(localedir)/locale.alias; \
609	  sed -f ref-del.sed $$dest > $$temp; \
610	  if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
611	    rm -f $$dest; \
612	  else \
613	    $(INSTALL_DATA) $$temp $$dest; \
614	  fi; \
615	  rm -f $$temp; \
616	fi
617
618endif
619
620
621# We don't install the source code any more.
622
623if PACKAGE_IS_GETTEXT_TOOLS
624
625install-data-local: uninstall-sources
626uninstall-local: uninstall-sources
627uninstall-sources:
628	rm -rf $(DESTDIR)$(datadir)/gettext/intl
629
630endif
631
632
633# Clean up after Solaris cc.
634clean-local:
635	rm -rf SunWS_cache
636
637
638# Windows support.
639
640EXTRA_DIST += INSTALL.windows
641
642
643# Miscellaneous files.
644
645EXTRA_DIST += COPYING.LIB libintl.glibc
646