This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libstdc++] Minor config cleanups, abstract subdirs
- From: Phil Edwards <phil at jaj dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Aug 2003 20:41:33 -0400
- Subject: [libstdc++] Minor config cleanups, abstract subdirs
The only nontrivial change here is adding a list of SUBDIRS in autoconf,
like we always have in automake. Other than, mostly cleanup, removing
unused variables, etc. The stamp-* rules in include/Makefile.am were
slightly off in that, depending on what you delete by hand, "make all"
couldn't always recover, but just spin rerunning the same rules. We need
to always update the timestamps on the files that make is testing against.
(Sounds like a serious error, but in a normal build, nobody would ever
stumble over this.)
Tested on i686-linux, committed to trunk.
2003-08-26 Phil Edwards <pme@gcc.gnu.org>
* Makefile.am: Add comment.
* acinclude.m4 (GLIBCXX_CONFIGURE): Set new glibcxx_SUBDIRS and
SUBDIRS variables.
* configure.ac: Use them both here, instead of hardcoded lists.
* fragment.am: Add STAMP varaible.
* include/Makefile.am: Cosmetic whitespace cleanup. Use $(LN_S)
instead of @LN_S@.
(stamp-*): Move file creation rule outside of 'if' branches to
ensure the stamp-* files are actually updated. Use $(STAMP).
* src/Makefile.am: Remove now-nonexistant variable.
* libsupc++/Makefile.am: Likewise. Snap the assignment chain
for -prefer-pic.
* po/Makefile.am: Include same fragment as all the others.
* aclocal.m4, configure, Makefile.in, include/Makefile.in,
libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in: Regenerated.
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/Makefile.am,v
retrieving revision 1.45
diff -u -3 -p -r1.45 Makefile.am
--- Makefile.am 17 Aug 2003 20:23:03 -0000 1.45
+++ Makefile.am 27 Aug 2003 00:25:34 -0000
@@ -24,6 +24,7 @@
include $(top_srcdir)/fragment.am
+## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
SUBDIRS = include libmath libsupc++ src po testsuite
# These rules are messy, but are hella worth it.
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.263
diff -u -3 -p -r1.263 acinclude.m4
--- acinclude.m4 17 Aug 2003 20:23:03 -0000 1.263
+++ acinclude.m4 27 Aug 2003 00:25:34 -0000
@@ -48,6 +48,7 @@ dnl variables like $host.
dnl
dnl Sets:
dnl gcc_version (x.y.z format)
+dnl SUBDIRS
dnl Substs:
dnl glibcxx_builddir (absolute path)
dnl glibcxx_srcdir (absolute path)
@@ -61,6 +62,12 @@ dnl - default settings for all AM_CONFI
dnl - lots of tools, like CC and CXX
dnl
AC_DEFUN(GLIBCXX_CONFIGURE, [
+ # Keep these sync'd with the list in Makefile.am. The first provides an
+ # expandable list at autoconf time; the second provides an expandable list
+ # (i.e., shell variable) at configure time.
+ m4_define([glibcxx_SUBDIRS],[include libmath libsupc++ src po testsuite])
+ SUBDIRS='glibcxx_SUBDIRS'
+
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.ac,v
retrieving revision 1.4
diff -u -3 -p -r1.4 configure.ac
--- configure.ac 17 Aug 2003 20:27:28 -0000 1.4
+++ configure.ac 27 Aug 2003 00:25:39 -0000
@@ -294,15 +294,10 @@ AC_SUBST(LIBSUPCXX_PICFLAGS)
dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros,
dnl which can all be called multiple times as needed, plus one (different)
dnl AC_OUPUT macro. This one lists the files to be created:
-AC_CONFIG_FILES([ \
+AC_CONFIG_FILES( \
Makefile \
- include/Makefile \
- libmath/Makefile \
- libsupc++/Makefile \
- po/Makefile \
- src/Makefile \
- testsuite/Makefile \
- ])
+ AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ])
+ )
AC_CONFIG_FILES([scripts/check_survey],[chmod +x scripts/check_survey])
AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
@@ -320,7 +315,7 @@ AC_CONFIG_COMMANDS([default],
cat > vpsed << \_EOF
s!`test -f '$<' || echo '$(srcdir)/'`!!
_EOF
- for i in libmath libsupc++ src testsuite; do
+ for i in $SUBDIRS; do
case $CONFIG_FILES in
*${i}/Makefile*)
#echo "Adding MULTISUBDIR to $i/Makefile"
@@ -335,7 +330,9 @@ _EOF
(cd include && ${MAKE-make})
],
[
-# No init-vars needed so far which aren't already passed by autoconf.
+# Variables needed in config.status (file generation) which aren't already
+# passed by autoconf.
+SUBDIRS="$SUBDIRS"
])
dnl And this actually makes things happen:
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.67
diff -u -3 -p -r1.67 Makefile.am
--- include/Makefile.am 17 Aug 2003 20:23:07 -0000 1.67
+++ include/Makefile.am 27 Aug 2003 00:25:39 -0000
@@ -56,7 +56,7 @@ std_headers = \
${std_srcdir}/std_utility.h \
${std_srcdir}/std_valarray.h \
${std_srcdir}/std_vector.h
-# Renamed at build time.
+# Renamed at build time.
std_headers_rename = \
algorithm \
bitset \
@@ -221,7 +221,7 @@ ext_headers = \
${ext_srcdir}/ropeimpl.h \
${ext_srcdir}/slist \
${ext_srcdir}/hash_fun.h \
- ${ext_srcdir}/hashtable.h
+ ${ext_srcdir}/hashtable.h
# This is the common subset of files that all three "C" header models use.
@@ -245,7 +245,7 @@ c_base_headers = \
${c_base_srcdir}/std_cstring.h \
${c_base_srcdir}/std_ctime.h \
${c_base_srcdir}/std_cwchar.h \
- ${c_base_srcdir}/std_cwctype.h
+ ${c_base_srcdir}/std_cwctype.h
c_base_headers_rename = \
cassert \
cctype \
@@ -264,7 +264,7 @@ c_base_headers_rename = \
cstring \
ctime \
cwchar \
- cwctype
+ cwctype
# "C" compatibility headers.
c_compatibility_srcdir = ${glibcxx_srcdir}/include/c_compatibility
@@ -287,21 +287,21 @@ c_compatibility_headers = \
${c_compatibility_srcdir}/string.h \
${c_compatibility_srcdir}/time.h \
${c_compatibility_srcdir}/wchar.h \
- ${c_compatibility_srcdir}/wctype.h
+ ${c_compatibility_srcdir}/wctype.h
# Some of the different "C" header models need extra files.
# Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std
if GLIBCXX_C_HEADERS_C_STD
-c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
+c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
else
-c_base_headers_extra =
+c_base_headers_extra =
endif
if GLIBCXX_C_HEADERS_COMPATIBILITY
c_compatibility_headers_extra = ${c_compatibility_headers}
else
-c_compatibility_headers_extra =
+c_compatibility_headers_extra =
endif
host_srcdir = ${glibcxx_srcdir}/@OS_INC_SRCDIR@
@@ -312,7 +312,7 @@ host_headers = \
${host_srcdir}/ctype_noninline.h \
${host_srcdir}/os_defines.h \
${glibcxx_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
- ${glibcxx_srcdir}/@FPOS_INC_SRCDIR@/fpos.h
+ ${glibcxx_srcdir}/@FPOS_INC_SRCDIR@/fpos.h
# Non-installed host_header files.
host_headers_noinst = \
@@ -342,15 +342,15 @@ if GLIBCXX_BUILD_PCH
pch_build = ${pch_input}
pch_install = install-pch
else
-pch_build =
-pch_install =
+pch_build =
+pch_install =
endif
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
- stamp-backward stamp-ext stamp-host
+ stamp-backward stamp-ext stamp-host
# List of all files that are created by explicit building, editing, or
# catenation.
@@ -360,7 +360,7 @@ allcreated = \
${pch_build}
# Here are the rules for building the headers
-all-local: ${allstamped} ${allcreated}
+all-local: ${allstamped} ${allcreated}
# This rule is slightly different, in that we must change the name of the
# local file from std_foo.h to foo.
@@ -371,34 +371,34 @@ stamp-std: ${std_headers}
if [ ! -f stamp-std ]; then \
(cd ${std_builddir} && for h in $?; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
- echo `date` > stamp-std ;\
- fi
+ fi ;\
+ $(STAMP) stamp-std
stamp-bits: ${bits_headers}
@if [ ! -d "${bits_builddir}" ]; then \
mkdir -p ${bits_builddir} ;\
fi ;\
if [ ! -f stamp-bits ]; then \
- (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-bits ;\
- fi
+ (cd ${bits_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-bits
-stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
+stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
if [ ! -f stamp-c_base ]; then \
(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
+ $(LN_S) $$h ./$${official_name} || true ;\
done) ;\
if [ ! -z "${c_base_headers_extra}" ]; then \
- (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra} . || true) ;\
+ (cd ${bits_builddir} && $(LN_S) ${c_base_headers_extra} . || true) ;\
fi ;\
- echo `date` > stamp-c_base ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_base
stamp-c_compatibility: ${c_compatibility_headers_extra}
@if [ ! -d "${c_compatibility_builddir}" ]; then \
@@ -406,53 +406,53 @@ stamp-c_compatibility: ${c_compatibility
fi ;\
if [ ! -f stamp-c_compatibility ]; then \
if [ ! -z "${c_compatibility_headers_extra}" ]; then \
- (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
+ (cd ${c_compatibility_builddir} && $(LN_S) $? . || true) ;\
fi ;\
- echo `date` > stamp-c_compatibility ;\
- fi
+ fi ;\
+ $(STAMP) stamp-c_compatibility
stamp-backward: ${backward_headers}
@if [ ! -d "${backward_builddir}" ]; then \
mkdir -p ${backward_builddir} ;\
fi ;\
if [ ! -f stamp-backward ]; then \
- (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-backward ;\
- fi
+ (cd ${backward_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-backward
stamp-ext: ${ext_headers}
@if [ ! -d "${ext_builddir}" ]; then \
mkdir -p ${ext_builddir} ;\
fi ;\
if [ ! -f stamp-ext ]; then \
- (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
- echo `date` > stamp-ext ;\
- fi
+ (cd ${ext_builddir} && $(LN_S) $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-ext
stamp-${host_alias}:
@if [ ! -d ${host_builddir} ]; then \
mkdir -p ${host_builddir} ;\
- echo `date` > stamp-${host_alias} ;\
- fi
+ fi ;\
+ $(STAMP) stamp-${host_alias}
# Host includes static.
# XXX Missing dependency info for {host_headers_extra}
stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
@if [ ! -f stamp-host ]; then \
(cd ${host_builddir} ;\
- @LN_S@ ${host_headers} . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@BASIC_FILE_H@ basic_file.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CSTDIO_H@ c++io.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CTIME_H@ time_members.h || true ;\
- @LN_S@ ${glibcxx_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
- echo `date` > stamp-host ; \
- fi
+ $(LN_S) ${host_headers} . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@BASIC_FILE_H@ basic_file.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CSTDIO_H@ c++io.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CLOCALE_INTERNAL_H@ . || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CTIME_H@ time_members.h || true ;\
+ $(LN_S) ${glibcxx_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true);\
+ fi ;\
+ $(STAMP) stamp-host
# Host includes dynamic.
-${host_builddir}/c++config.h: ${CONFIG_HEADER} \
+${host_builddir}/c++config.h: ${top_builddir}/config.h \
${glibcxx_srcdir}/include/bits/c++config \
stamp-${host_alias}
@cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
Index: libsupc++/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.46
diff -u -3 -p -r1.46 Makefile.am
--- libsupc++/Makefile.am 17 Aug 2003 20:23:10 -0000 1.46
+++ libsupc++/Makefile.am 27 Aug 2003 00:25:40 -0000
@@ -31,9 +31,6 @@ toolexeclib_LTLIBRARIES = libsupc++.la
noinst_LTLIBRARIES = libsupc++convenience.la
-
-LIBSUPCXX_CXXFLAGS = @LIBSUPCXX_PICFLAGS@
-
headers = \
exception new typeinfo cxxabi.h exception_defines.h
@@ -78,7 +75,7 @@ glibcxxinstall_HEADERS = $(headers)
# as the occasion call for it.
AM_CXXFLAGS = \
-fno-implicit-templates \
- $(LIBSUPCXX_CXXFLAGS) \
+ $(LIBSUPCXX_PICFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
Index: po/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/po/Makefile.am,v
retrieving revision 1.10
diff -u -3 -p -r1.10 Makefile.am
--- po/Makefile.am 17 Aug 2003 20:23:11 -0000 1.10
+++ po/Makefile.am 27 Aug 2003 00:25:40 -0000
@@ -21,6 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
+include $(top_srcdir)/fragment.am
# Location of installation directories.
locale_installdir = $(DESTDIR)$(datadir)/locale
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.131
diff -u -3 -p -r1.131 Makefile.am
--- src/Makefile.am 17 Aug 2003 20:23:11 -0000 1.131
+++ src/Makefile.am 27 Aug 2003 00:25:40 -0000
@@ -166,7 +166,6 @@ demangle.o: demangle.cc
# as the occasion calls for it.
AM_CXXFLAGS = \
-fno-implicit-templates \
- $(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
Index: fragment.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/fragment.am,v
retrieving revision 1.1
diff -u -3 -p -r1.1 fragment.am
--- fragment.am 17 Aug 2003 20:23:06 -0000 1.1
+++ fragment.am 27 Aug 2003 00:36:02 -0000
@@ -5,6 +5,7 @@ MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD_COMMAND = $${PWDCMD-pwd}
+STAMP = echo timestamp >
toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)