OSDN Git Service

2000-10-17 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / libsupc++ / Makefile.am
1 ## Makefile for the GNU C++ Support library.
2 ##
3 ## Copyright (C) 2000 Free Software Foundation, Inc.
4 ##
5 ## Process this file with automake to produce Makefile.in.
6 ##
7 ## This file is part of GNU CC.
8 ##
9 ## GNU CC is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2, or (at your option)
12 ## any later version.
13 ##
14 ## GNU CC 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
20 ## along with GNU CC; see the file COPYING.  If not, write to
21 ## the Free Software Foundation, 59 Temple Place - Suite 330,
22 ## Boston, MA 02111-1307, USA. 
23
24 AUTOMAKE_OPTIONS = 1.3 cygnus
25 MAINT_CHARSET = latin1
26
27 # Cross compiler and multilib support.
28 # Install a library built with a cross compiler in tooldir, not libdir.
29 if USE_LIBDIR
30 toolexeclibdir = $(libdir)$(MULTISUBDIR)
31 else
32 if VERSION_SPECIFIC_LIBS
33 gcc_version = @gcc_version@
34 toolexecdir = $(libdir)/gcc-lib/$(target_alias)
35 toolexeclibdir = $(toolexecdir)/$(gcc_version)
36 else
37 toolexecdir = $(exec_prefix)/$(target_alias)
38 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
39 endif
40 endif
41
42
43 # Need this library to both be part of libstdc++.a, and installed
44 # separately too.
45 # 1) separate libsupc++.la 
46 toolexeclib_LTLIBRARIES = libsupc++.la
47 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
48 noinst_LTLIBRARIES = libsupc++convenience.la
49
50
51 # Compile flags that should be constant throughout the build, both for
52 # SUBDIRS and for libstdc++-v3 in general.
53 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
54
55 # These bits are all figured out from configure. Look in acinclude.m4
56 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
57 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
58 CONFIG_CXXFLAGS = \
59         @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ 
60
61 # Warning flags to use.
62 WARN_CXXFLAGS = \
63         @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
64
65 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
66 GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
67 C_INCLUDE_DIR = @C_INCLUDE_DIR@
68 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
69 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
70 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
71 LIBIO_INCLUDES = @LIBIO_INCLUDES@
72 CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
73
74 INCLUDES = \
75         -I$(top_srcdir)/../gcc -I$(top_srcdir)/../include \
76         $(CSHADOW_INCLUDES)  $(LIBSUPCXX_INCLUDES) -I$(GLIBCPP_INCLUDE_DIR) \
77         $(CONFIG_INCLUDES) -I$(top_builddir)
78
79 headers = \
80         cxxabi.h exception new new.h typeinfo
81
82 sources = \
83         del_op.cc \
84         del_opnt.cc \
85         del_opv.cc \
86         del_opvnt.cc \
87         exception.cc \
88         new_handler.cc \
89         new_op.cc \
90         new_opnt.cc \
91         new_opv.cc \
92         new_opvnt.cc \
93         pure.cc \
94         tinfo.cc \
95         tinfo2.cc \
96         vec.cc
97
98 libsupc___la_SOURCES = $(sources)
99 libsupc__convenience_la_SOURCES = $(sources)
100
101 # Check for various configure bits that change where the headers get installed.
102 if GXX_INCLUDE_DIR
103 glibcppinstalldir = @gxx_include_dir@
104 else
105 if VERSION_SPECIFIC_LIBS
106 glibcppinstalldir = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
107 else
108 glibcppinstalldir = $(prefix)/include/g++-@libstdcxx_interface@
109 endif
110 endif
111
112 glibcppinstall_HEADERS = $(headers)
113
114 # Flags to force separate libtool library to be static only.
115 LIBTOOL = @LIBTOOL@ --tag disable-shared
116 LIBSUPCXX_CXXFLAGS = -prefer-pic
117
118 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
119 # modified in a per-library or per-sub-library way.  Need to manually
120 # set this option because CONFIG_CXXFLAGS has to be after
121 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
122 # as the occasion call for it. (ie, --enable-debug)
123 AM_CXXFLAGS = \
124         -fno-implicit-templates \
125         $(LIBSUPCXX_CXXFLAGS) \
126         $(WARN_CXXFLAGS) \
127         $(OPTIMIZE_CXXFLAGS) \
128         $(CONFIG_CXXFLAGS) 
129
130
131 # libstdc++ libtool notes
132
133 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
134 # last. (That way, things like -O2 passed down from the toplevel can
135 # be overridden by --enable-debug.)
136
137 # 2) In general, libtool expects an argument such as `--tag=CXX' when
138 # using the C++ compiler, because that will enable the settings
139 # detected when C++ support was being configured.  However, when no
140 # such flag is given in the command line, libtool attempts to figure
141 # it out by matching the compiler name in each configuration section
142 # against a prefix of the command line.  The problem is that, if the
143 # compiler name and its initial flags stored in the libtool
144 # configuration file don't match those in the command line, libtool
145 # can't decide which configuration to use, and it gives up.  The
146 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
147 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
148 # attempt to infer which configuration to use
149 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
150                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
151
152 # 3) We have a problem when building the shared libstdc++ object if
153 # the rules automake generates would be used.  We cannot allow CXX to
154 # be used in libtool since this would add -lstdc++ to the link line
155 # which of course is problematic at this point.
156 CXXLINK = $(LIBTOOL) --tag CC --mode=link "$(CC)" \
157           @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@