]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/src/Makefile.am
Preliminary named locales.
[thirdparty/gcc.git] / libstdc++-v3 / src / Makefile.am
CommitLineData
b2dad0e3
BK
1## Makefile for the src subdirectory of the GNU C++ Standard library.
2##
469550eb 3## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
b2dad0e3
BK
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
0214010c 24## $Id: Makefile.am,v 1.65 2001/01/25 22:39:28 mmitchel Exp $
421173e6 25
b2dad0e3
BK
26AUTOMAKE_OPTIONS = 1.3 gnits
27MAINT_CHARSET = latin1
28
29# Cross compiler and multilib support.
30# Install a library built with a cross compiler in tooldir, not libdir.
31if USE_LIBDIR
1fd2f510
BK
32if VERSION_SPECIFIC_LIBS
33gcc_version = @gcc_version@
34toolexecdir = $(libdir)/gcc-lib/$(target_alias)
35toolexeclibdir = $(toolexecdir)/$(gcc_version)
36else
a50372f5
MH
37toolexeclibdir = $(libdir)$(MULTISUBDIR)
38endif
39else
b2dad0e3
BK
40toolexecdir = $(exec_prefix)/$(target_alias)
41toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
42endif
0b8e0cf3 43
b2dad0e3 44toolexeclib_LTLIBRARIES = libstdc++.la
5d89258a 45EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
b2dad0e3
BK
46
47
e466dc8a
BK
48# Compile flags that should be constant throughout the build, both for
49# SUBDIRS and for libstdc++-v3 in general.
50OPTIMIZE_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.
55CONFIG_CXXFLAGS = \
56 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
57
58# Warning flags to use.
59WARN_CXXFLAGS = \
60 @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
61
62# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
63GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
64C_INCLUDE_DIR = @C_INCLUDE_DIR@
a40ba78e 65CSTD_INCLUDES = @CSTD_INCLUDES@
e466dc8a
BK
66LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
67LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
68LIBIO_INCLUDES = @LIBIO_INCLUDES@
a40ba78e 69TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
e466dc8a 70
5b80666b 71INCLUDES = \
85fe3810 72 -nostdinc++ \
a40ba78e
BK
73 -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
74 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
0b8e0cf3 75 $(TOPLEVEL_INCLUDES)
5b80666b 76
a6863e25 77base_headers = \
e974e9cc 78 bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
e61c3e8c 79 bits/std_string.h bits/basic_string.h bits/basic_string.tcc \
b2dad0e3
BK
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 \
a6863e25 85 bits/exception_support.h \
b2dad0e3
BK
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 \
b2dad0e3
BK
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 \
54a3a087 110 bits/concept_checks.h bits/container_concepts.h \
fc81ccd3
BK
111 bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
112
113backward_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
126ext_headers = \
b2dad0e3 127 ext/ropeimpl.h ext/stl_rope.h \
fc81ccd3 128 ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h \
b2dad0e3 129 ext/hash_map ext/hash_set ext/rope ext/slist \
a6863e25
BK
130 ext/tree ext/bvector
131
132c_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 \
a30dbb39 138 bits/std_cwchar.h bits/std_cwctype.h bits/cmath.tcc
a6863e25 139
fc81ccd3 140if GLIBCPP_USE_CSHADOW
a6863e25
BK
141c_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 \
51d61f86 145 features.h langinfo.h \
a6863e25
BK
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 \
51d61f86 148 bits/wrap_features.h bits/wrap_langinfo.h \
a6863e25 149 sys/cdefs.h
a6863e25 150else
fc81ccd3 151c_shadow_headers =
a6863e25 152endif
b2dad0e3
BK
153
154std_headers = \
a6863e25 155 algorithm bitset complex deque fstream functional \
b2dad0e3 156 iomanip ios iosfwd iostream istream iterator limits list locale \
a6863e25 157 map memory numeric ostream queue set sstream stack stdexcept \
5feb272b 158 streambuf string utility valarray vector \
a6863e25
BK
159 cassert cctype cerrno cfloat climits clocale ciso646 \
160 cmath csetjmp csignal cstdarg cstddef cstdio cstdlib \
161 cstring ctime cwchar cwctype
b2dad0e3
BK
162
163if GLIBCPP_NEED_LIBIO
164libio_headers = \
f22ad9d0 165 $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
b2dad0e3
BK
166else
167libio_headers =
168endif
169
e974e9cc 170build_headers = \
0214010c
BK
171 bits/std_limits.h \
172 bits/c++config.h bits/c++io.h bits/c++locale.h bits/c++threads.h \
a50372f5
MH
173 bits/atomicity.h bits/os_defines.h \
174 bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h
5b80666b
BK
175
176sources = \
dd75251f 177 limitsMEMBERS.cc \
1228c7b6 178 complex_io.cc \
abfadcb1 179 stdexcept.cc bitset.cc \
bfd7f4ec 180 globals.cc \
469550eb 181 c++io.cc ios.cc strstream.cc \
0214010c 182 c++locale.cc locale.cc localename.cc codecvt.cc \
c470c17d 183 locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
b2dad0e3
BK
184
185wstring_sources = \
c470c17d 186 wstring-inst.cc
b2dad0e3 187
35ba1733 188VPATH += $(top_srcdir) $(top_srcdir)/src
a6863e25
BK
189VPATH += $(GLIBCPP_INCLUDE_DIR)
190VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
b2dad0e3
BK
191
192# Actual sources for the distro, but don't build these.
c470c17d 193#EXTRA_sources = string-inst.cc
b2dad0e3
BK
194
195libstdc___la_SOURCES = $(sources)
196
5d89258a
BK
197libinst_wstring_la_SOURCES = $(wstring_sources)
198
199libstdc___la_LIBADD = \
c4d3f801 200 ../libmath/libmath.la @libio_la@ \
06bd10fb 201 ../libsupc++/libsupc++convenience.la \
c470c17d 202 @libinst_wstring_la@
b2dad0e3
BK
203
204libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
205
5d89258a
BK
206libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
207
b2dad0e3 208
5b80666b
BK
209# Make sure cshadow headers are built first.
210if GLIBCPP_USE_CSHADOW
211CSHADOW_H = $(top_builddir)/stamp-cshadow
212else
213CSHADOW_H =
214endif
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 \
0517cb99 222 "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
5b80666b
BK
223 rm -f $(top_builddir)/stamp-cshadow
224 echo "done" > $(top_builddir)/stamp-cshadow
225
226
1fd2f510
BK
227# Check for various configure bits that change where the headers get installed.
228if GXX_INCLUDE_DIR
229myincludep = @gxx_include_dir@
752808fb 230targetincludep = @gxx_include_dir@
1fd2f510
BK
231else
232if VERSION_SPECIFIC_LIBS
233myincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
752808fb 234targetincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
1fd2f510
BK
235else
236myincludep = $(prefix)/include/g++-@libstdcxx_interface@
752808fb 237targetincludep = @gxx_target_include_dir@
1fd2f510
BK
238endif
239endif
b2dad0e3 240
fc81ccd3 241# We have our own special, ridiculously complicated installation routine
1fd2f510 242# here, as automake/autoconf is currently brain-damaged when it comes
fc81ccd3
BK
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
254install-data-local: myinstalldirs myinstallheaders
255
256# NB: installation of shadow header directories is not attempted.
257myinstalldirs:
258 if test -z "$(MULTISUBDIR)"; then \
259 $(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
fc81ccd3 260 $(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
6e138b89 261 $(mkinstalldirs) $(DESTDIR)$(targetincludep)/bits; \
fc81ccd3 262 fi
b2dad0e3
BK
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
fc81ccd3
BK
266# NB: installation of shadow headers is not attempted.
267src_incdir = @GLIBCPP_INCLUDE_DIR@
268bld_incdir = $(top_builddir)/include
269c_incdir = @C_INCLUDE_DIR@
270myinstallheaders:
b2dad0e3 271 if test -z "$(MULTISUBDIR)"; then \
fc81ccd3
BK
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 \
07467d31
BK
281 echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)"; \
282 $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep); \
fc81ccd3
BK
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; \
b2dad0e3 288 for i in $(std_headers); do \
fc81ccd3
BK
289 echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep)";\
290 $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
b2dad0e3 291 done; \
e974e9cc 292 for i in $(build_headers); do \
6e138b89
BK
293 echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/"; \
294 $(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/; \
b2dad0e3
BK
295 done; \
296 libio_headers_install='$(libio_headers)'; \
297 for i in $$libio_headers_install; do \
fc81ccd3
BK
298 echo "$(INSTALL_DATA) $$i $(myincludep)"; \
299 $(INSTALL_DATA) $$i $(myincludep); \
b2dad0e3 300 done; \
b2dad0e3
BK
301 fi;
302
a40ba78e 303
d94611f1
BK
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.
b2dad0e3
BK
308misc-inst.o: misc-inst.cc
309 $(CXXCOMPILE) -fimplicit-templates -c $<
310misc-inst.lo: misc-inst.cc
311 $(LTCXXCOMPILE) -fimplicit-templates -c $<
312locale-inst.o: locale-inst.cc
313 $(CXXCOMPILE) -fimplicit-templates -c $<
314locale-inst.lo: locale-inst.cc
315 $(LTCXXCOMPILE) -fimplicit-templates -c $<
316
a40ba78e
BK
317# Use special rules for the deprecated source files so that they find
318# deprecated include files.
319strstream.lo: strstream.cc
320 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
321strstream.o: strstream.cc
322 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
323
324# Make wstring-inst.cc from string-inst.cc
c470c17d
BK
325wstring-inst.o: string-inst.cc
326 $(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
327wstring-inst.lo: string-inst.cc
328 $(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
d94611f1 329
e974e9cc
BK
330
331# Alexandre put this in here for some libtool-related reason.
7d7aced2
AO
332all: libstdc++.INC
333libstdc++.INC: Makefile
239a3da0
APB
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
341tmp-libstdc++.INC: Makefile
09314637 342 echo $(INCLUDES) > $@
35ba1733 343
a40ba78e 344
0b8e0cf3 345# AM_CXXFLAGS needs to be in each subdirectory so that it can be
a9117427
BK
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)
0b8e0cf3
BK
350AM_CXXFLAGS = \
351 -fno-implicit-templates \
a9117427 352 $(LIBSUPCXX_CXXFLAGS) \
0b8e0cf3
BK
353 $(WARN_CXXFLAGS) \
354 $(OPTIMIZE_CXXFLAGS) \
355 $(CONFIG_CXXFLAGS)
356
e974e9cc 357
a9117427
BK
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
376LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
377 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
e974e9cc 378
a9117427
BK
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.
697649ea 383CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
a9117427 384 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@