]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/src/Makefile.am
Preliminary named locales.
[gcc.git] / libstdc++-v3 / src / Makefile.am
1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 ##
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
7
8 ## This file is part of the GNU ISO C++ Library. This library is free
9 ## software; you can redistribute it and/or modify it under the
10 ## terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 2, or (at your option)
12 ## any later version.
13
14 ## This library is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ## GNU General Public License for more details.
18
19 ## You should have received a copy of the GNU General Public License along
20 ## with this library; see the file COPYING. If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
23
24 ## $Id: Makefile.am,v 1.65 2001/01/25 22:39:28 mmitchel Exp $
25
26 AUTOMAKE_OPTIONS = 1.3 gnits
27 MAINT_CHARSET = latin1
28
29 # Cross compiler and multilib support.
30 # Install a library built with a cross compiler in tooldir, not libdir.
31 if USE_LIBDIR
32 if VERSION_SPECIFIC_LIBS
33 gcc_version = @gcc_version@
34 toolexecdir = $(libdir)/gcc-lib/$(target_alias)
35 toolexeclibdir = $(toolexecdir)/$(gcc_version)
36 else
37 toolexeclibdir = $(libdir)$(MULTISUBDIR)
38 endif
39 else
40 toolexecdir = $(exec_prefix)/$(target_alias)
41 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
42 endif
43
44 toolexeclib_LTLIBRARIES = libstdc++.la
45 EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
46
47
48 # Compile flags that should be constant throughout the build, both for
49 # SUBDIRS and for libstdc++-v3 in general.
50 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
51
52 # These bits are all figured out from configure. Look in acinclude.m4
53 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
54 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
55 CONFIG_CXXFLAGS = \
56 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
57
58 # Warning flags to use.
59 WARN_CXXFLAGS = \
60 @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
61
62 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
63 GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
64 C_INCLUDE_DIR = @C_INCLUDE_DIR@
65 CSTD_INCLUDES = @CSTD_INCLUDES@
66 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
67 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
68 LIBIO_INCLUDES = @LIBIO_INCLUDES@
69 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
70
71 INCLUDES = \
72 -nostdinc++ \
73 -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
74 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
75 $(TOPLEVEL_INCLUDES)
76
77 base_headers = \
78 bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
79 bits/std_string.h bits/basic_string.h bits/basic_string.tcc \
80 bits/generic_shadow.h bits/std_utility.h \
81 bits/std_complex.h \
82 bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
83 bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
84 bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
85 bits/exception_support.h \
86 bits/std_fstream.h bits/std_iomanip.h \
87 bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
88 bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
89 bits/std_istream.h bits/istream.tcc bits/std_locale.h \
90 bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
91 bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
92 bits/streambuf.tcc bits/basic_file.h \
93 bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
94 bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
95 bits/stl_threads.h bits/stl_iterator_base.h \
96 bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
97 bits/std_iterator.h bits/std_list.h \
98 bits/std_map.h bits/std_memory.h bits/std_numeric.h \
99 bits/std_queue.h bits/std_set.h bits/std_stack.h \
100 bits/std_stdexcept.h bits/std_vector.h \
101 bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
102 bits/stl_deque.h bits/stl_function.h \
103 bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
104 bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
105 bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
106 bits/stl_relops.h bits/stl_set.h \
107 bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h \
108 bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
109 bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
110 bits/concept_checks.h bits/container_concepts.h \
111 bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
112
113 backward_headers = \
114 backward/complex.h backward/iomanip.h backward/istream.h \
115 backward/ostream.h backward/stream.h backward/streambuf.h \
116 backward/algo.h backward/algobase.h backward/alloc.h \
117 backward/bvector.h backward/defalloc.h backward/deque.h \
118 backward/function.h backward/hash_map.h backward/hash_set.h \
119 backward/hashtable.h backward/heap.h backward/iterator.h \
120 backward/list.h backward/map.h backward/multimap.h backward/new.h \
121 backward/multiset.h backward/pair.h backward/iostream.h \
122 backward/rope.h backward/set.h backward/slist.h backward/stack.h \
123 backward/tempbuf.h backward/tree.h backward/vector.h \
124 backward/fstream.h backward/strstream.h backward/strstream
125
126 ext_headers = \
127 ext/ropeimpl.h ext/stl_rope.h \
128 ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h \
129 ext/hash_map ext/hash_set ext/rope ext/slist \
130 ext/tree ext/bvector
131
132 c_base_headers = \
133 bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h \
134 bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h \
135 bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h \
136 bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h \
137 bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h \
138 bits/std_cwchar.h bits/std_cwctype.h bits/cmath.tcc
139
140 if GLIBCPP_USE_CSHADOW
141 c_shadow_headers = \
142 assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
143 signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
144 wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \
145 features.h langinfo.h \
146 bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \
147 bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
148 bits/wrap_features.h bits/wrap_langinfo.h \
149 sys/cdefs.h
150 else
151 c_shadow_headers =
152 endif
153
154 std_headers = \
155 algorithm bitset complex deque fstream functional \
156 iomanip ios iosfwd iostream istream iterator limits list locale \
157 map memory numeric ostream queue set sstream stack stdexcept \
158 streambuf string utility valarray vector \
159 cassert cctype cerrno cfloat climits clocale ciso646 \
160 cmath csetjmp csignal cstdarg cstddef cstdio cstdlib \
161 cstring ctime cwchar cwctype
162
163 if GLIBCPP_NEED_LIBIO
164 libio_headers = \
165 $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
166 else
167 libio_headers =
168 endif
169
170 build_headers = \
171 bits/std_limits.h \
172 bits/c++config.h bits/c++io.h bits/c++locale.h bits/c++threads.h \
173 bits/atomicity.h bits/os_defines.h \
174 bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h
175
176 sources = \
177 limitsMEMBERS.cc \
178 complex_io.cc \
179 stdexcept.cc bitset.cc \
180 globals.cc \
181 c++io.cc ios.cc strstream.cc \
182 c++locale.cc locale.cc localename.cc codecvt.cc \
183 locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
184
185 wstring_sources = \
186 wstring-inst.cc
187
188 VPATH += $(top_srcdir) $(top_srcdir)/src
189 VPATH += $(GLIBCPP_INCLUDE_DIR)
190 VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
191
192 # Actual sources for the distro, but don't build these.
193 #EXTRA_sources = string-inst.cc
194
195 libstdc___la_SOURCES = $(sources)
196
197 libinst_wstring_la_SOURCES = $(wstring_sources)
198
199 libstdc___la_LIBADD = \
200 ../libmath/libmath.la @libio_la@ \
201 ../libsupc++/libsupc++convenience.la \
202 @libinst_wstring_la@
203
204 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
205
206 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
207
208
209 # Make sure cshadow headers are built first.
210 if GLIBCPP_USE_CSHADOW
211 CSHADOW_H = $(top_builddir)/stamp-cshadow
212 else
213 CSHADOW_H =
214 endif
215
216 # Specify that all *.o's depend on this.
217 $(libstdc___la_OBJECTS): $(CSHADOW_H)
218
219 $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
220 $(top_srcdir)/mkcshadow
221 $(top_srcdir)/mkinclosure \
222 "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
223 rm -f $(top_builddir)/stamp-cshadow
224 echo "done" > $(top_builddir)/stamp-cshadow
225
226
227 # Check for various configure bits that change where the headers get installed.
228 if GXX_INCLUDE_DIR
229 myincludep = @gxx_include_dir@
230 targetincludep = @gxx_include_dir@
231 else
232 if VERSION_SPECIFIC_LIBS
233 myincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
234 targetincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
235 else
236 myincludep = $(prefix)/include/g++-@libstdcxx_interface@
237 targetincludep = @gxx_target_include_dir@
238 endif
239 endif
240
241 # We have our own special, ridiculously complicated installation routine
242 # here, as automake/autoconf is currently brain-damaged when it comes
243 # to installing sub-directories of headers. In particular, we want to
244 # 1) install build headers from (blddir)/include/bits -> (install)/bits
245 # 2) install source headers from
246 # (srcdir)/include/bits -> (install)/bits
247 # (srcdir)/include/ext -> (install)/ext
248 # (srcdir)/include/backward -> (install)/backward
249 # ... and the always entertaining "C" compatibility bits
250 # where * represents configure-time directory switching
251 # (srcdir)/include/c* -> (install)/
252 # (srcdir)/include/c*/bits -> (install)/bits
253 # (srcdir)/include/c*/sys -> (install)/sys
254 install-data-local: myinstalldirs myinstallheaders
255
256 # NB: installation of shadow header directories is not attempted.
257 myinstalldirs:
258 if test -z "$(MULTISUBDIR)"; then \
259 $(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
260 $(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
261 $(mkinstalldirs) $(DESTDIR)$(targetincludep)/bits; \
262 fi
263
264 # NB: As libio_headers may be empty, need this to make sure bash doesn't
265 # choke on an empty for... loop by using libio_headers_install
266 # NB: installation of shadow headers is not attempted.
267 src_incdir = @GLIBCPP_INCLUDE_DIR@
268 bld_incdir = $(top_builddir)/include
269 c_incdir = @C_INCLUDE_DIR@
270 myinstallheaders:
271 if test -z "$(MULTISUBDIR)"; then \
272 for i in $(base_headers); do \
273 echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/"; \
274 $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/; \
275 done; \
276 for i in $(ext_headers); do \
277 echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/"; \
278 $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/; \
279 done; \
280 for i in $(backward_headers); do \
281 echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)"; \
282 $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep); \
283 done; \
284 for i in $(c_base_headers); do \
285 echo "$(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/"; \
286 $(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/; \
287 done; \
288 for i in $(std_headers); do \
289 echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep)";\
290 $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
291 done; \
292 for i in $(build_headers); do \
293 echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/"; \
294 $(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/; \
295 done; \
296 libio_headers_install='$(libio_headers)'; \
297 for i in $$libio_headers_install; do \
298 echo "$(INSTALL_DATA) $$i $(myincludep)"; \
299 $(INSTALL_DATA) $$i $(myincludep); \
300 done; \
301 fi;
302
303
304 # We have to handle misc-inst.cc and locale-inst.cc in a special way
305 # since we cannot instantiate all classes due to missing definitions
306 # for things like vptrs, type_info bits, etc. when using
307 # -fno-implicit-templates.
308 misc-inst.o: misc-inst.cc
309 $(CXXCOMPILE) -fimplicit-templates -c $<
310 misc-inst.lo: misc-inst.cc
311 $(LTCXXCOMPILE) -fimplicit-templates -c $<
312 locale-inst.o: locale-inst.cc
313 $(CXXCOMPILE) -fimplicit-templates -c $<
314 locale-inst.lo: locale-inst.cc
315 $(LTCXXCOMPILE) -fimplicit-templates -c $<
316
317 # Use special rules for the deprecated source files so that they find
318 # deprecated include files.
319 strstream.lo: strstream.cc
320 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
321 strstream.o: strstream.cc
322 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
323
324 # Make wstring-inst.cc from string-inst.cc
325 wstring-inst.o: string-inst.cc
326 $(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
327 wstring-inst.lo: string-inst.cc
328 $(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
329
330
331 # Alexandre put this in here for some libtool-related reason.
332 all: libstdc++.INC
333 libstdc++.INC: Makefile
334 $(MAKE) \
335 top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
336 top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
337 tmp-$@
338 -rm -f $@
339 mv tmp-$@ $@
340
341 tmp-libstdc++.INC: Makefile
342 echo $(INCLUDES) > $@
343
344
345 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
346 # modified in a per-library or per-sub-library way. Need to manually
347 # set this option because CONFIG_CXXFLAGS has to be after
348 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
349 # as the occasion call for it. (ie, --enable-debug)
350 AM_CXXFLAGS = \
351 -fno-implicit-templates \
352 $(LIBSUPCXX_CXXFLAGS) \
353 $(WARN_CXXFLAGS) \
354 $(OPTIMIZE_CXXFLAGS) \
355 $(CONFIG_CXXFLAGS)
356
357
358 # libstdc++ libtool notes
359
360 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
361 # last. (That way, things like -O2 passed down from the toplevel can
362 # be overridden by --enable-debug.)
363
364 # 2) In general, libtool expects an argument such as `--tag=CXX' when
365 # using the C++ compiler, because that will enable the settings
366 # detected when C++ support was being configured. However, when no
367 # such flag is given in the command line, libtool attempts to figure
368 # it out by matching the compiler name in each configuration section
369 # against a prefix of the command line. The problem is that, if the
370 # compiler name and its initial flags stored in the libtool
371 # configuration file don't match those in the command line, libtool
372 # can't decide which configuration to use, and it gives up. The
373 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
374 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
375 # attempt to infer which configuration to use
376 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
377 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
378
379 # 3) We have a problem when building the shared libstdc++ object if
380 # the rules automake generates would be used. We cannot allow CXX to
381 # be used in libtool since this would add -lstdc++ to the link line
382 # which of course is problematic at this point.
383 CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
384 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
This page took 0.062058 seconds and 6 git commands to generate.