Compile locale-inst.cc and wlocale-inst.cc as C++11.
[official-gcc.git] / libstdc++-v3 / src / c++11 / Makefile.am
blob829159c1ead355078b1838026cdf815778243abd
1 ## Makefile for the C++03 sources of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997-2014 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.
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.
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.
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/>.
23 include $(top_srcdir)/fragment.am
25 # Convenience library for C++11 runtime.
26 noinst_LTLIBRARIES = libc++11convenience.la
28 headers =
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
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
39 ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
40         $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
42 if ENABLE_DUAL_ABI
43 cxx11_abi_sources = \
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
50 else
51 cxx11_abi_sources =
52 endif
54 sources = \
55         chrono.cc \
56         condition_variable.cc \
57         cow-stdexcept.cc \
58         ctype.cc \
59         debug.cc \
60         functexcept.cc \
61         functional.cc \
62         future.cc \
63         hash_c++0x.cc \
64         hashtable_c++0x.cc \
65         ios.cc \
66         limits.cc \
67         mutex.cc \
68         placeholders.cc \
69         random.cc \
70         regex.cc  \
71         shared_ptr.cc \
72         snprintf_lite.cc \
73         system_error.cc \
74         thread.cc \
75         ${cxx11_abi_sources} \
76         ${host_sources}
78 if ENABLE_DUAL_ABI
79 extra_string_inst_sources = \
80         cow-fstream-inst.cc \
81         cow-sstream-inst.cc \
82         cow-string-inst.cc \
83         cow-wstring-inst.cc \
84         cxx11-locale-inst.cc \
85         cxx11-wlocale-inst.cc
86 else
87 extra_string_inst_sources =
88 endif
90 if ENABLE_EXTERN_TEMPLATE
91 # XTEMPLATE_FLAGS = -fno-implicit-templates
92 inst_sources = \
93         $(extra_string_inst_sources) \
94         ext11-inst.cc \
95         fstream-inst.cc \
96         ios-inst.cc \
97         iostream-inst.cc \
98         istream-inst.cc \
99         locale-inst.cc \
100         ostream-inst.cc \
101         sstream-inst.cc \
102         streambuf-inst.cc \
103         string-inst.cc \
104         wlocale-inst.cc \
105         wstring-inst.cc
106 else
107 # XTEMPLATE_FLAGS =
108 inst_sources =
109 endif
111 vpath % $(top_srcdir)/src/c++11
113 libc__11convenience_la_SOURCES = $(sources)  $(inst_sources)
115 # Use special rules for the hashtable.cc file so that all
116 # the generated template functions are also instantiated. 
117 hashtable_c++0x.lo: hashtable_c++0x.cc
118         $(LTCXXCOMPILE) -fimplicit-templates -c $<
119 hashtable_c++0x.o: hashtable_c++0x.cc
120         $(CXXCOMPILE) -fimplicit-templates -c $<
122 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
123 # modified in a per-library or per-sub-library way.  Need to manually
124 # set this option because CONFIG_CXXFLAGS has to be after
125 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
126 # as the occasion calls for it.
127 AM_CXXFLAGS = \
128         -std=gnu++11 \
129         $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
130         $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
131         $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
133 AM_MAKEFLAGS = \
134         "gxx_include_dir=$(gxx_include_dir)"
136 # Libtool notes
138 # 1) In general, libtool expects an argument such as `--tag=CXX' when
139 # using the C++ compiler, because that will enable the settings
140 # detected when C++ support was being configured.  However, when no
141 # such flag is given in the command line, libtool attempts to figure
142 # it out by matching the compiler name in each configuration section
143 # against a prefix of the command line.  The problem is that, if the
144 # compiler name and its initial flags stored in the libtool
145 # configuration file don't match those in the command line, libtool
146 # can't decide which configuration to use, and it gives up.  The
147 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
148 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
149 # attempt to infer which configuration to use.
151 # The second tag argument, `--tag disable-shared` means that libtool
152 # only compiles each source once, for static objects. In actuality,
153 # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
154 # the libtool command that is used create the object, which is
155 # suitable for shared libraries.  The `--tag disable-shared` must be
156 # placed after --tag CXX lest things CXX undo the affect of
157 # disable-shared.
159 # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is
160 # last. (That way, things like -O2 passed down from the toplevel can
161 # be overridden by --enable-debug.)
162 LTCXXCOMPILE = \
163         $(LIBTOOL) --tag CXX --tag disable-shared \
164         $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
165         --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
166         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS)
168 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
170 # 3) We'd have a problem when building the shared libstdc++ object if
171 # the rules automake generates would be used.  We cannot allow g++ to
172 # be used since this would add -lstdc++ to the link line which of
173 # course is problematic at this point.  So, we get the top-level
174 # directory to configure libstdc++-v3 to use gcc as the C++
175 # compilation driver.
176 CXXLINK = \
177         $(LIBTOOL) --tag CXX --tag disable-shared \
178         $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
179         --mode=link $(CXX) \
180         $(VTV_CXXLINKFLAGS) \
181         $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@