Debian Codegraph @

libstdc++-v3/src/c++26/Makefile.am

raw
1 ## Makefile for the C++26 sources of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997-2025 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 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++26 runtime.
26 noinst_LTLIBRARIES = libc++26convenience.la
27
28 headers =
29
30 if ENABLE_EXTERN_TEMPLATE
31 # XTEMPLATE_FLAGS = -fno-implicit-templates
32 inst_sources =
33 else
34 # XTEMPLATE_FLAGS =
35 inst_sources =
36 endif
37
38 sources = text_encoding.cc
39
40 vpath % $(top_srcdir)/src/c++26
41
42
43 if GLIBCXX_HOSTED
44 libc__26convenience_la_SOURCES = $(sources) $(inst_sources)
45 else
46 libc__26convenience_la_SOURCES =
47 endif
48
49 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
50 # modified in a per-library or per-sub-library way. Need to manually
51 # set this option because CONFIG_CXXFLAGS has to be after
52 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
53 # as the occasion calls for it.
54 AM_CXXFLAGS = \
55 -std=gnu++26 \
56 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
57 $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
58 $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \
59 -fimplicit-templates
60
61 AM_MAKEFLAGS = \
62 "gxx_include_dir=$(gxx_include_dir)"
63
64 # Libtool notes
65
66 # 1) In general, libtool expects an argument such as `--tag=CXX' when
67 # using the C++ compiler, because that will enable the settings
68 # detected when C++ support was being configured. However, when no
69 # such flag is given in the command line, libtool attempts to figure
70 # it out by matching the compiler name in each configuration section
71 # against a prefix of the command line. The problem is that, if the
72 # compiler name and its initial flags stored in the libtool
73 # configuration file don't match those in the command line, libtool
74 # can't decide which configuration to use, and it gives up. The
75 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
76 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
77 # attempt to infer which configuration to use.
78 #
79 # The second tag argument, `--tag disable-shared` means that libtool
80 # only compiles each source once, for static objects. In actuality,
81 # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
82 # the libtool command that is used create the object, which is
83 # suitable for shared libraries. The `--tag disable-shared` must be
84 # placed after --tag CXX lest things CXX undo the affect of
85 # disable-shared.
86
87 # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is
88 # last. (That way, things like -O2 passed down from the toplevel can
89 # be overridden by --enable-debug.)
90 LTCXXCOMPILE = \
91 $(LIBTOOL) --tag CXX --tag disable-shared \
92 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
93 --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
94 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS)
95
96 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
97
98 # 3) We'd have a problem when building the shared libstdc++ object if
99 # the rules automake generates would be used. We cannot allow g++ to
100 # be used since this would add -lstdc++ to the link line which of
101 # course is problematic at this point. So, we get the top-level
102 # directory to configure libstdc++-v3 to use gcc as the C++
103 # compilation driver.
104 CXXLINK = \
105 $(LIBTOOL) --tag CXX --tag disable-shared \
106 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
107 --mode=link $(CXX) \
108 $(VTV_CXXLINKFLAGS) \
109 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@