]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/src/c++11/Makefile.am
[multiple changes]
[thirdparty/gcc.git] / libstdc++-v3 / src / c++11 / Makefile.am
1 ## Makefile for the C++03 sources of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4 ## 2006, 2007, 2008, 2009, 2010, 2011, 2012
5 ## Free Software Foundation, Inc.
6 ##
7 ## This file is part of the libstdc++ version 3 distribution.
8 ## Process this file with automake to produce Makefile.in.
9
10 ## This file is part of the GNU ISO C++ Library. This library is free
11 ## software; you can redistribute it and/or modify it under the
12 ## terms of the GNU General Public License as published by the
13 ## Free Software Foundation; either version 3, or (at your option)
14 ## any later version.
15
16 ## This library is distributed in the hope that it will be useful,
17 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ## GNU General Public License for more details.
20
21 ## You should have received a copy of the GNU General Public License along
22 ## with this library; see the file COPYING3. If not see
23 ## <http://www.gnu.org/licenses/>.
24
25 include $(top_srcdir)/fragment.am
26
27 # Convenience library for C++11 runtime.
28 toolexeclib_LTLIBRARIES = libc++11.la
29 noinst_LTLIBRARIES = libc++11convenience.la
30
31 headers =
32
33 sources = \
34 chrono.cc \
35 condition_variable.cc \
36 compatibility-c++0x.cc \
37 compatibility-atomic-c++0x.cc \
38 debug.cc \
39 functexcept.cc \
40 functional.cc \
41 future.cc \
42 hash_c++0x.cc \
43 hashtable_c++0x.cc \
44 limits.cc \
45 mutex.cc \
46 placeholders.cc \
47 regex.cc \
48 shared_ptr.cc \
49 system_error.cc \
50 thread.cc
51
52 if ENABLE_EXTERN_TEMPLATE
53 XTEMPLATE_FLAGS = -fno-implicit-templates
54 inst_sources = \
55 fstream-inst.cc \
56 string-inst.cc \
57 wstring-inst.cc
58 else
59 XTEMPLATE_FLAGS =
60 inst_sources =
61 endif
62
63 vpath % $(top_srcdir)/src/c++11
64 vpath % $(top_srcdir)
65
66 libc__11_la_SOURCES = $(sources) $(inst_sources)
67 libc__11convenience_la_SOURCES = $(sources) $(inst_sources)
68
69 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
70 # modified in a per-library or per-sub-library way. Need to manually
71 # set this option because CONFIG_CXXFLAGS has to be after
72 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
73 # as the occasion calls for it.
74 AM_CXXFLAGS = \
75 $(PIC_CXXFLAGS) \
76 $(XTEMPLATE_FLAGS) \
77 $(WARN_CXXFLAGS) \
78 $(OPTIMIZE_CXXFLAGS) \
79 $(CONFIG_CXXFLAGS) -std=gnu++11
80
81 AM_MAKEFLAGS = \
82 "gxx_include_dir=$(gxx_include_dir)"
83
84 # Libtool notes
85
86 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
87 # last. (That way, things like -O2 passed down from the toplevel can
88 # be overridden by --enable-debug.)
89
90 # 2) In general, libtool expects an argument such as `--tag=CXX' when
91 # using the C++ compiler, because that will enable the settings
92 # detected when C++ support was being configured. However, when no
93 # such flag is given in the command line, libtool attempts to figure
94 # it out by matching the compiler name in each configuration section
95 # against a prefix of the command line. The problem is that, if the
96 # compiler name and its initial flags stored in the libtool
97 # configuration file don't match those in the command line, libtool
98 # can't decide which configuration to use, and it gives up. The
99 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
100 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
101 # attempt to infer which configuration to use.
102 # We have to put --tag disable-shared after --tag CXX lest things
103 # CXX undo the affect of disable-shared.
104 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \
105 --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
106 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
107
108 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
109
110 # 3) We'd have a problem when building the shared libstdc++ object if
111 # the rules automake generates would be used. We cannot allow g++ to
112 # be used since this would add -lstdc++ to the link line which of
113 # course is problematic at this point. So, we get the top-level
114 # directory to configure libstdc++-v3 to use gcc as the C++
115 # compilation driver.
116 CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \
117 --mode=link $(CXX) \
118 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@