]>
Commit | Line | Data |
---|---|---|
dfaa3c47 | 1 | ## Makefile for the C++11 sources of the GNU C++ Standard library. |
8bae34da | 2 | ## |
83ffe9cd | 3 | ## Copyright (C) 1997-2023 Free Software Foundation, Inc. |
8bae34da 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 3, 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 COPYING3. If not see | |
21 | ## <http://www.gnu.org/licenses/>. | |
22 | ||
23 | include $(top_srcdir)/fragment.am | |
24 | ||
25 | # Convenience library for C++11 runtime. | |
8bae34da BK |
26 | noinst_LTLIBRARIES = libc++11convenience.la |
27 | ||
28 | headers = | |
29 | ||
a3e4cd81 JW |
30 | # Source files linked in via configuration/make substitution for a |
31 | # particular host. | |
32 | host_sources = \ | |
33 | ctype_configure_char.cc \ | |
34 | ctype_members.cc | |
35 | ||
36 | ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc | |
37 | $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true | |
38 | ||
39 | ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC) | |
40 | $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true | |
41 | ||
34a2b755 | 42 | if ENABLE_DUAL_ABI |
a5dde6dd | 43 | cxx11_abi_sources = \ |
34a2b755 JW |
44 | cow-locale_init.cc \ |
45 | cow-shim_facets.cc \ | |
46 | cxx11-hash_tr1.cc \ | |
47 | cxx11-ios_failure.cc \ | |
48 | cxx11-shim_facets.cc \ | |
49 | cxx11-stdexcept.cc | |
a5dde6dd JW |
50 | else |
51 | cxx11_abi_sources = | |
52 | endif | |
53 | ||
8bae34da BK |
54 | sources = \ |
55 | chrono.cc \ | |
bb93f35d | 56 | codecvt.cc \ |
8bae34da | 57 | condition_variable.cc \ |
34a2b755 | 58 | cow-stdexcept.cc \ |
a3e4cd81 | 59 | ctype.cc \ |
8bae34da BK |
60 | debug.cc \ |
61 | functexcept.cc \ | |
62 | functional.cc \ | |
eae801ba | 63 | futex.cc \ |
8bae34da BK |
64 | future.cc \ |
65 | hash_c++0x.cc \ | |
66 | hashtable_c++0x.cc \ | |
9b817548 | 67 | ios.cc \ |
ae3ea143 | 68 | ios_errcat.cc \ |
8bae34da BK |
69 | limits.cc \ |
70 | mutex.cc \ | |
71 | placeholders.cc \ | |
a8c3f4c9 | 72 | random.cc \ |
8bae34da BK |
73 | regex.cc \ |
74 | shared_ptr.cc \ | |
9779c871 | 75 | snprintf_lite.cc \ |
8bae34da | 76 | system_error.cc \ |
a3e4cd81 | 77 | thread.cc \ |
a5dde6dd | 78 | ${cxx11_abi_sources} \ |
a3e4cd81 | 79 | ${host_sources} |
8bae34da | 80 | |
34a2b755 JW |
81 | if ENABLE_DUAL_ABI |
82 | extra_string_inst_sources = \ | |
83 | cow-fstream-inst.cc \ | |
84 | cow-sstream-inst.cc \ | |
85 | cow-string-inst.cc \ | |
b333e8eb | 86 | cow-string-io-inst.cc \ |
34a2b755 | 87 | cow-wstring-inst.cc \ |
b333e8eb | 88 | cow-wstring-io-inst.cc \ |
34a2b755 | 89 | cxx11-locale-inst.cc \ |
b333e8eb JW |
90 | cxx11-wlocale-inst.cc \ |
91 | sso_string.cc | |
34a2b755 JW |
92 | else |
93 | extra_string_inst_sources = | |
94 | endif | |
95 | ||
8bae34da | 96 | if ENABLE_EXTERN_TEMPLATE |
2077db1b | 97 | # XTEMPLATE_FLAGS = -fno-implicit-templates |
8bae34da | 98 | inst_sources = \ |
34a2b755 | 99 | $(extra_string_inst_sources) \ |
9b817548 | 100 | ext11-inst.cc \ |
8bae34da | 101 | fstream-inst.cc \ |
9b817548 JW |
102 | ios-inst.cc \ |
103 | iostream-inst.cc \ | |
104 | istream-inst.cc \ | |
28630cd6 | 105 | locale-inst.cc \ |
9b817548 JW |
106 | ostream-inst.cc \ |
107 | sstream-inst.cc \ | |
108 | streambuf-inst.cc \ | |
8bae34da | 109 | string-inst.cc \ |
b333e8eb | 110 | string-io-inst.cc \ |
28630cd6 | 111 | wlocale-inst.cc \ |
b333e8eb JW |
112 | wstring-inst.cc \ |
113 | wstring-io-inst.cc | |
8bae34da | 114 | else |
2077db1b | 115 | # XTEMPLATE_FLAGS = |
8bae34da BK |
116 | inst_sources = |
117 | endif | |
118 | ||
119 | vpath % $(top_srcdir)/src/c++11 | |
8bae34da | 120 | |
8bae34da BK |
121 | libc__11convenience_la_SOURCES = $(sources) $(inst_sources) |
122 | ||
6e1d47c4 | 123 | # Use special rules for the hashtable.cc file so that all |
f92ab29f | 124 | # the generated template functions are also instantiated. |
6e1d47c4 BK |
125 | hashtable_c++0x.lo: hashtable_c++0x.cc |
126 | $(LTCXXCOMPILE) -fimplicit-templates -c $< | |
127 | hashtable_c++0x.o: hashtable_c++0x.cc | |
128 | $(CXXCOMPILE) -fimplicit-templates -c $< | |
129 | ||
c124af93 TH |
130 | # Use special rules for source files that require -fchar8_t. |
131 | codecvt.lo: codecvt.cc | |
132 | $(LTCXXCOMPILE) -fchar8_t -c $< | |
133 | codecvt.o: codecvt.cc | |
134 | $(CXXCOMPILE) -fchar8_t -c $< | |
135 | limits.lo: limits.cc | |
136 | $(LTCXXCOMPILE) -fchar8_t -c $< | |
137 | limits.o: limits.cc | |
138 | $(CXXCOMPILE) -fchar8_t -c $< | |
139 | ||
5f302518 | 140 | if ENABLE_DUAL_ABI |
741346a2 | 141 | # Rewrite the type info for __ios_failure. |
272277dc | 142 | rewrite_ios_failure_typeinfo = sed -e '/^_*_ZTISt13__ios_failure:/,/_ZTVN10__cxxabiv120__si_class_type_infoE/s/_ZTVN10__cxxabiv120__si_class_type_infoE/_ZTVSt19__iosfail_type_info/' |
5f302518 JW |
143 | |
144 | cxx11-ios_failure-lt.s: cxx11-ios_failure.cc | |
2e43880d | 145 | $(LTCXXCOMPILE) -gno-as-loc-support -S $< -o tmp-cxx11-ios_failure-lt.s |
5f302518 JW |
146 | -test -f tmp-cxx11-ios_failure-lt.o && mv -f tmp-cxx11-ios_failure-lt.o tmp-cxx11-ios_failure-lt.s |
147 | $(rewrite_ios_failure_typeinfo) tmp-$@ > $@ | |
148 | -rm -f tmp-$@ | |
149 | cxx11-ios_failure.s: cxx11-ios_failure.cc | |
2e43880d | 150 | $(CXXCOMPILE) -gno-as-loc-support -S $< -o tmp-$@ |
5f302518 JW |
151 | $(rewrite_ios_failure_typeinfo) tmp-$@ > $@ |
152 | -rm -f tmp-$@ | |
153 | ||
154 | cxx11-ios_failure.lo: cxx11-ios_failure-lt.s | |
05b14480 | 155 | $(LTCXXCOMPILE) -g0 -c $< -o $@ |
5f302518 | 156 | cxx11-ios_failure.o: cxx11-ios_failure.s |
05b14480 | 157 | $(CXXCOMPILE) -g0 -c $< |
5f302518 JW |
158 | endif |
159 | ||
8bae34da BK |
160 | # AM_CXXFLAGS needs to be in each subdirectory so that it can be |
161 | # modified in a per-library or per-sub-library way. Need to manually | |
162 | # set this option because CONFIG_CXXFLAGS has to be after | |
163 | # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden | |
164 | # as the occasion calls for it. | |
165 | AM_CXXFLAGS = \ | |
0b284728 | 166 | -std=gnu++11 \ |
ac6d1200 | 167 | $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \ |
2077db1b | 168 | $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ |
0b284728 | 169 | $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) |
8bae34da BK |
170 | |
171 | AM_MAKEFLAGS = \ | |
172 | "gxx_include_dir=$(gxx_include_dir)" | |
173 | ||
174 | # Libtool notes | |
175 | ||
ac6d1200 | 176 | # 1) In general, libtool expects an argument such as `--tag=CXX' when |
8bae34da BK |
177 | # using the C++ compiler, because that will enable the settings |
178 | # detected when C++ support was being configured. However, when no | |
179 | # such flag is given in the command line, libtool attempts to figure | |
180 | # it out by matching the compiler name in each configuration section | |
181 | # against a prefix of the command line. The problem is that, if the | |
182 | # compiler name and its initial flags stored in the libtool | |
183 | # configuration file don't match those in the command line, libtool | |
184 | # can't decide which configuration to use, and it gives up. The | |
185 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
186 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
187 | # attempt to infer which configuration to use. | |
f92ab29f | 188 | # |
ac6d1200 BK |
189 | # The second tag argument, `--tag disable-shared` means that libtool |
190 | # only compiles each source once, for static objects. In actuality, | |
191 | # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to | |
192 | # the libtool command that is used create the object, which is | |
193 | # suitable for shared libraries. The `--tag disable-shared` must be | |
194 | # placed after --tag CXX lest things CXX undo the affect of | |
195 | # disable-shared. | |
196 | ||
b1d6986c | 197 | # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is |
ac6d1200 BK |
198 | # last. (That way, things like -O2 passed down from the toplevel can |
199 | # be overridden by --enable-debug.) | |
0b284728 BK |
200 | LTCXXCOMPILE = \ |
201 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
202 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
203 | --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ | |
b1d6986c | 204 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS) |
8bae34da BK |
205 | |
206 | LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) | |
207 | ||
208 | # 3) We'd have a problem when building the shared libstdc++ object if | |
209 | # the rules automake generates would be used. We cannot allow g++ to | |
210 | # be used since this would add -lstdc++ to the link line which of | |
211 | # course is problematic at this point. So, we get the top-level | |
212 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
213 | # compilation driver. | |
0b284728 BK |
214 | CXXLINK = \ |
215 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
216 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
217 | --mode=link $(CXX) \ | |
2077db1b | 218 | $(VTV_CXXLINKFLAGS) \ |
0b284728 | 219 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ |