1 ## Makefile for the gettext-tools/lib subdirectory of GNU gettext
2 ## Copyright (C) 1995-1998, 2000-2005 Free Software Foundation, Inc.
4 ## This program 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 2, or (at your option)
9 ## This program 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.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; if not, write to the Free Software
16 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 ## Process this file with automake to produce Makefile.in.
20 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
30 lib_LTLIBRARIES = libgettextlib.la
32 # Sources that are compiled on all platforms.
34 libgettextlib_la_SOURCES = \
36 argmatch.h argmatch.c \
37 backupfile.h backupfile.c addext.c \
38 basename.h basename.c \
41 c-strcase.h c-strcasecmp.c c-strncasecmp.c \
42 classpath.h classpath.c \
43 closeout.h closeout.c \
44 copy-file.h copy-file.c \
45 csharpcomp.h csharpcomp.c \
46 csharpexec.h csharpexec.c \
47 error-progname.h error-progname.c \
48 execute.h execute.c w32spawn.h \
50 exitfail.h exitfail.c \
51 fatal-signal.h fatal-signal.c \
52 findprog.h findprog.c \
54 full-write.h full-write.c \
55 fwriteerror.h fwriteerror.c \
58 javacomp.h javacomp.c \
59 javaexec.h javaexec.c \
60 linebreak.h linebreak.c lbrkprop.h utf8-ucs4.h utf16-ucs4.h \
61 mbswidth.h mbswidth.c \
65 pathname.h concatpath.c \
66 pipe.h pipe.c w32spawn.h \
67 progname.h progname.c progreloc.c \
69 quotearg.h quotearg.c \
70 safe-read.h safe-read.c \
71 safe-write.h safe-write.c \
72 sh-quote.h sh-quote.c \
74 ucs4-utf8.h ucs4-utf16.h \
76 wait-process.h wait-process.c \
77 xalloc.h xmalloc.c xstrdup.c \
78 xallocsa.h xallocsa.c \
80 xreadlink.h xreadlink.c \
84 # Sources that are compiled only on platforms that lack the functions.
88 canonicalize.h canonicalize.c \
92 getndelim2.h getndelim2.c \
93 getopt.c getopt1.c getopt_int.h \
98 relocatable.h relocatable.c \
99 setenv.h setenv.c unsetenv.c \
101 stpncpy.h stpncpy.c \
102 strcase.h strcasecmp.c strncasecmp.c \
105 strpbrk.h strpbrk.c \
109 vasprintf.h vasprintf.c
116 # How to build libgettextlib.la.
118 libgettextlib_la_LIBADD = @LTLIBOBJS@
120 # Need @LTLIBINTL@ because many source files use gettext().
121 # Need @LTLIBICONV@ because linebreak.c uses iconv().
122 libgettextlib_la_LDFLAGS = \
124 @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
126 # No need to install libgettextlib.a, except on AIX.
127 install-exec-local: install-libLTLIBRARIES install-exec-clean
129 case "@host_os@" in \
131 *) $(RM) $(DESTDIR)$(libdir)/libgettextlib.a ;; \
134 # Extra files to be installed.
136 gettextsrcdir = $(datadir)/gettext
137 gettextsrc_DATA = gettext.h
139 # Files installed for the examples.
142 examplesbuildauxdir = $(docdir)/examples/build-aux
143 examplesbuildaux_DATA = \
144 javacomp.sh.in javaexec.sh.in \
145 csharpcomp.sh.in csharpexec.sh.in
147 # List of files to be distributed.
149 noinst_HEADERS = gettext.h
152 $(LIBADD_SOURCE) $(UNUSED_SOURCE) relocwrapper.c allocsa.valgrind \
153 gen-lbrkprop.c 3level.h Combining.txt \
156 AM_CPPFLAGS = -I. -I$(srcdir) -I.. -I../intl -I$(top_srcdir)/intl
158 DEFS = -DEXEEXT=\"$(EXEEXT)\" -DDEPENDS_ON_LIBINTL=1 -DDEPENDS_ON_LIBICONV=1 @DEFS@
161 # >>> gnulib module stdbool.
162 EXTRA_DIST += stdbool_.h
164 # The following is needed in order to create an <stdbool.h> when the system
165 # doesn't have one that works.
166 all-local $(libgettextlib_la_OBJECTS): @STDBOOL_H@
167 stdbool.h: stdbool_.h
168 sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' < $(srcdir)/stdbool_.h > stdbool.h
169 MOSTLYCLEANFILES += stdbool.h
170 # <<< gnulib module stdbool.
173 # >>> gnulib module alloca.
174 EXTRA_DIST += alloca_.h
176 # The following is needed in order to create an <alloca.h> when the system
177 # doesn't have one that works with the given compiler.
178 all-local $(libgettextlib_la_OBJECTS): @ALLOCA_H@
180 cp $(srcdir)/alloca_.h alloca.h
181 MOSTLYCLEANFILES += alloca.h
182 # <<< gnulib module alloca.
185 # >>> gnulib module fnmatch.
186 BUILT_SOURCES += $(FNMATCH_H)
187 EXTRA_DIST += fnmatch_.h fnmatch_loop.c
189 # The following is needed in order to create an <fnmatch.h> when the system
190 # doesn't have one that works.
191 all-local $(libgettextlib_la_OBJECTS): @FNMATCH_H@
192 fnmatch.h: fnmatch_.h
193 cp $(srcdir)/fnmatch_.h fnmatch.h
194 MOSTLYCLEANFILES += fnmatch.h
195 # <<< gnulib module fnmatch.
198 # >>> gnulib module getopt.
199 BUILT_SOURCES += $(GETOPT_H)
200 EXTRA_DIST += getopt_.h getopt_int.h
202 # The following is needed in order to create a <getopt.h> when the system
203 # doesn't have one that works.
204 all-local $(libgettextlib_la_OBJECTS): @GETOPT_H@
206 cp $(srcdir)/getopt_.h getopt.h
207 MOSTLYCLEANFILES += getopt.h
208 # <<< gnulib module getopt.
211 # >>> gnulib module localcharset.
212 libgettextlib_la_SOURCES += localcharset.h localcharset.c
213 EXTRA_DIST += config.charset ref-add.sin ref-del.sin
214 DEFS += -DLIBDIR=\"$(libdir)\"
216 # The following is needed in order to install a simple file in $(libdir)
217 # which is shared with other installed packages. We use a list of referencing
218 # packages so that "make uninstall" will remove the file if and only if it
219 # is not used by another installed package.
220 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
221 # avoid installing it.
223 all-local: charset.alias ref-add.sed ref-del.sed
225 charset_alias = $(DESTDIR)$(libdir)/charset.alias
226 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
227 install-exec-local: all-local
228 test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir)
229 if test -f $(charset_alias); then \
230 sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
231 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
232 rm -f $(charset_tmp) ; \
234 if test @GLIBC21@ = no; then \
235 sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
236 $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
237 rm -f $(charset_tmp) ; \
241 uninstall-local: all-local
242 if test -f $(charset_alias); then \
243 sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
244 if grep '^# Packages using this file: $$' $(charset_tmp) \
246 rm -f $(charset_alias); \
248 $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
250 rm -f $(charset_tmp); \
253 charset.alias: config.charset
254 $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
257 SUFFIXES += .sed .sin
259 sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
262 CLEANFILES += charset.alias ref-add.sed ref-del.sed
263 # <<< gnulib module localcharset.
268 EXTRA_DIST += Makefile.vms
273 EXTRA_DIST += Makefile.msvc