Commit d3a12960 by Benjamin Kosnik Committed by Benjamin Kosnik

acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Remove OPTLEVEL.


2000-05-24  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	* acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Remove
	OPTLEVEL. Add FMTFLAGS.
	* aclocal.m4: Regenerate.
	* src/Makefile.am (AC_CXXFLAGS): Take out OPTLEVEL, as this is has
	been disabled due to higher-level makefiles running amuck over
	this bit, and add in FMTFLAGS so that formatting is clear.
	* src/Makefile.in: Regenerate.
	* configure: Regenerate.

	* src/ios.cc (ios_base::sync_with_stdio): Cleanup buffers from
	initialization.

	* docs/download.html: Remove references to Cygwin-specific bits,
	as this can now be built natively.
	Update with current information.

From-SVN: r34144
parent f5e846c8
2000-05-24 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Remove
OPTLEVEL. Add FMTFLAGS.
* aclocal.m4: Regenerate.
* src/Makefile.am (AC_CXXFLAGS): Take out OPTLEVEL, as this is has
been disabled due to higher-level makefiles running amuck over
this bit, and add in FMTFLAGS so that formatting is clear.
* src/Makefile.in: Regenerate.
* configure: Regenerate.
* src/ios.cc (ios_base::sync_with_stdio): Cleanup buffers from
initialization.
* docs/download.html: Remove references to Cygwin-specific bits,
as this can now be built natively.
Update with current information.
2000-05-24 Phil Edwards <pme@sourceware.cygnus.com>
* acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): If we can use
......@@ -9,7 +27,7 @@
* docs/faq/index.html: Update location of libg++ FAQ.
* docs/faq/index.txt: Regenerate.
2000-05-22 Benjamin Kosnik <bkoz@purist.redhat.soma.com>
2000-05-22 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* docs/17_intro/libstdc++-assign.txt: Change Cygnus to FSF.
......
......@@ -77,6 +77,7 @@ DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FMTFLAGS = @FMTFLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
......@@ -87,7 +88,6 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OPTLEVEL = @OPTLEVEL@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SHADOW_INCLUDES = @SHADOW_INCLUDES@
......
......@@ -155,9 +155,12 @@ AC_SUBST(GLIBCPP_CXXFLAGS)
dnl
dnl Check to see if g++ can compile this library, and if so, if any version-
dnl specific precautions need to be taken.
dnl specific precautions need to be taken. In particular, test for
dnl newer compiler features, or features that are present in newer
dnl compiler version but not older compiler versions should be placed
dnl here.
dnl
dnl Define OPTLEVEL='-O2' if new inlining code present.
dnl Define FMTFLAGS='-fdiagnostics-show-location=once' if possible
dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
dnl code or the new system_header pragma will die. Other options dealing
dnl with warnings, errors, and compiler complaints may be folded into
......@@ -174,6 +177,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
ac_save_CXXFLAGS="$CXXFLAGS"
WERROR='-Werror'
# Sanity check that g++ is capable of dealing with v-3.
AC_MSG_CHECKING([for g++ that will successfullly compile this code])
AC_EGREP_CPP([ok], [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
......@@ -182,7 +186,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
AC_MSG_RESULT($gpp_satisfactory)
AC_MSG_CHECKING([for g++ that supports new system_header pragma])
# Check for pragma system_header.
AC_MSG_CHECKING([for g++ that supports pragma system_header])
CXXFLAGS='-Wunknown-pragmas -Werror'
AC_TRY_COMPILE([#pragma system_header], [int foo;
], [ac_newpragma=yes], [ac_newpragma=no])
......@@ -197,7 +202,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
fi
AC_MSG_RESULT($ac_newpragma)
AC_MSG_CHECKING([for g++ that supports new warning options])
# Check for more sophisticated diagnostic control.
AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
CXXFLAGS='-fdiagnostics-show-location=once'
AC_TRY_COMPILE(, [int foo;
], [ac_gabydiags=yes], [ac_gabydiags=no])
......@@ -208,27 +214,13 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
CXXFLAGS=''
fi
if test "$ac_gabydiags" = "yes"; then
WERROR="$WERROR -fdiagnostics-show-location=once"
FMTFLAGS='-fdiagnostics-show-location=once'
fi
AC_MSG_RESULT($ac_gabydiags)
AC_MSG_CHECKING([for g++ that supports new inlining mechanism])
AC_EGREP_CPP([ok], [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
ok
#endif
], [OPTLEVEL='-O2'], [OPTLEVEL=''])
if test "$OPTLEVEL" = ""; then
AC_MSG_RESULT(no)
# something of a hack here
WERROR=''
else
AC_MSG_RESULT(yes)
fi
AC_LANG_RESTORE
AC_SUBST(OPTLEVEL)
AC_SUBST(WERROR)
AC_SUBST(FMTFLAGS)
])
......
......@@ -167,9 +167,12 @@ AC_SUBST(GLIBCPP_CXXFLAGS)
dnl
dnl Check to see if g++ can compile this library, and if so, if any version-
dnl specific precautions need to be taken.
dnl specific precautions need to be taken. In particular, test for
dnl newer compiler features, or features that are present in newer
dnl compiler version but not older compiler versions should be placed
dnl here.
dnl
dnl Define OPTLEVEL='-O2' if new inlining code present.
dnl Define FMTFLAGS='-fdiagnostics-show-location=once' if possible
dnl Define WERROR='-Werror' if possible; g++'s that lack the new inlining
dnl code or the new system_header pragma will die. Other options dealing
dnl with warnings, errors, and compiler complaints may be folded into
......@@ -186,6 +189,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
ac_save_CXXFLAGS="$CXXFLAGS"
WERROR='-Werror'
# Sanity check that g++ is capable of dealing with v-3.
AC_MSG_CHECKING([for g++ that will successfullly compile this code])
AC_EGREP_CPP([ok], [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
......@@ -194,7 +198,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above"))
AC_MSG_RESULT($gpp_satisfactory)
AC_MSG_CHECKING([for g++ that supports new system_header pragma])
# Check for pragma system_header.
AC_MSG_CHECKING([for g++ that supports pragma system_header])
CXXFLAGS='-Wunknown-pragmas -Werror'
AC_TRY_COMPILE([#pragma system_header], [int foo;
], [ac_newpragma=yes], [ac_newpragma=no])
......@@ -209,7 +214,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
fi
AC_MSG_RESULT($ac_newpragma)
AC_MSG_CHECKING([for g++ that supports new warning options])
# Check for more sophisticated diagnostic control.
AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
CXXFLAGS='-fdiagnostics-show-location=once'
AC_TRY_COMPILE(, [int foo;
], [ac_gabydiags=yes], [ac_gabydiags=no])
......@@ -220,27 +226,13 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
CXXFLAGS=''
fi
if test "$ac_gabydiags" = "yes"; then
WERROR="$WERROR -fdiagnostics-show-location=once"
FMTFLAGS='-fdiagnostics-show-location=once'
fi
AC_MSG_RESULT($ac_gabydiags)
AC_MSG_CHECKING([for g++ that supports new inlining mechanism])
AC_EGREP_CPP([ok], [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
ok
#endif
], [OPTLEVEL='-O2'], [OPTLEVEL=''])
if test "$OPTLEVEL" = ""; then
AC_MSG_RESULT(no)
# something of a hack here
WERROR=''
else
AC_MSG_RESULT(yes)
fi
AC_LANG_RESTORE
AC_SUBST(OPTLEVEL)
AC_SUBST(WERROR)
AC_SUBST(FMTFLAGS)
])
......
......@@ -4,7 +4,7 @@
<H3>Getting the sources by FTP or CVS</H3>
<P>Get the snapshot archive from
<P>Get the snapshot archive via FTP from
<BLOCKQUOTE>
<A HREF="ftp://sourceware.cygnus.com/pub/libstdc++/">
ftp://sourceware.cygnus.com/pub/libstdc++/
......@@ -15,28 +15,29 @@
due to the heavy load on the main server.
</P>
<P>CVS repository available by anonymous CVS.
<UL>
<LI>cvs -z9 -d :pserver:anoncvs@sourceware.cygnus.com:/cvs/libstdc++ login
<LI>enter ``anoncvs'' for the password
<LI>cvs -z9 -d :pserver:anoncvs@sourceware.cygnus.com:/cvs/libstdc++ co libstdc++
<P> The master CVS repository for libstdc++-v3 is now a part of the
gcc repository. As such, checking out the <TT>gcc</TT> module includes the
current libstdc++-v3 development sources. To check out libstdc++-v3
only, use <TT>libstdc++-v3</TT> instead of <TT>gcc</TT> as the module.
<LI>You only need to specify the repository root the first time; after
that cvs will go to the correct place automatically. Using '-z9' is
<B>highly</B> recommended, as it will reduce the bandwidth required.
<UL>
<LI>Read only CVS repository available by anonymous CVS. Directions
<A HREF="http://gcc.gnu.org/cvs.html"> here.
</A>
<LI>You can
<A HREF="http://gcc.gnu.org/cgi-bin/cvsweb.cgi/libstdc++-v3?cvsroot=gcc">browse
the CVS repository over the web</A>.
<P>
<LI>Read-Write CVS repository available by anonymous CVS. Directions
<A HREF="http://gcc.gnu.org/cvswrite.html"> here.
</A>
</UL>
</P>
<P>For those of you using Cygwin or Mingw32, you can avoid various
<A HREF="faq/index.html#3_2">problems building the library</A> by using
prebuilt binaries of snapshots from Mumit Khan's
<A HREF="http://www.xraylith.wisc.edu/~khan/software/gnu-win32/libstdc++-v3.html">Cygwin pages</A>.
</P>
<p>You can also
<A HREF="http://gcc.gnu.org/cgi-bin/cvsweb.cgi/libstdc++-v3?cvsroot=gcc">browse
the CVS repository over the web</A>.
</P>
<!--#include virtual="/libstdc++/footer.html"-->
......
......@@ -77,6 +77,7 @@ DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FMTFLAGS = @FMTFLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
......@@ -87,7 +88,6 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OPTLEVEL = @OPTLEVEL@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SHADOW_INCLUDES = @SHADOW_INCLUDES@
......
......@@ -77,6 +77,7 @@ DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FMTFLAGS = @FMTFLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
......@@ -87,7 +88,6 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OPTLEVEL = @OPTLEVEL@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SHADOW_INCLUDES = @SHADOW_INCLUDES@
......
......@@ -37,15 +37,26 @@ toolexeclib_LTLIBRARIES = libstdc++.la
EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
WERROR = @WERROR@
# OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fsquangle -fnew-exceptions \
# -fdata-sections -ffunction-sections \
# -fvtable-gc -Wl,--gc-sections
# AC_CXXFLAGS = @OPTLEVEL@ @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
AC_CXXFLAGS = @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
AM_CXXFLAGS = -fno-implicit-templates \
-Wall -Wno-format -W -Wwrite-strings -Winline $(WERROR) \
$(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS)
# Using these options is probably a good idea for thrill-seekers. Just
# uncomment the lines below and make, everything else is ready to go...
# OPTIMIZE_CXXFLAGS = \
# -O3 -fstrict-aliasing \
# -fdata-sections -ffunction-sections -fvtable-gc -Wl,--gc-sections
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set.
AC_CXXFLAGS = \
@WERROR@ @FMTFLAGS@ @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
# Need to manually set this option because AC_CXXFLAGS has to be at
# the end of the compile line so that -O2 can be over-riden as the
# occasion call for it. (ie, --enable-debug)
AM_CXXFLAGS = \
$(FORMAT_CXXFLAGS) \
-fno-implicit-templates \
-Wall -Wno-format -W -Wwrite-strings -Winline \
$(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS)
# Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
# things like -O2 passed down from the toplevel can be overridden by
......@@ -62,7 +73,9 @@ LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
# course is impossible.
CXXLINK = $(LIBTOOL) --mode=link "$(CC)" $(AM_CXXFLAGS) $(LDFLAGS) -o $@
TOPLEVEL_INCLUDES = -I$(includedir)
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
CONFIG_INCLUDES = \
......
......@@ -76,6 +76,7 @@ DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
FMTFLAGS = @FMTFLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
......@@ -86,7 +87,6 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OPTLEVEL = @OPTLEVEL@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SHADOW_INCLUDES = @SHADOW_INCLUDES@
......@@ -97,6 +97,7 @@ THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
USE_LONG_DOUBLE = @USE_LONG_DOUBLE@
VERSION = @VERSION@
WERROR = @WERROR@
cpu_include_dir = @cpu_include_dir@
ctype_include_dir = @ctype_include_dir@
glibcpp_basedir = @glibcpp_basedir@
......@@ -114,15 +115,26 @@ MAINT_CHARSET = latin1
toolexeclib_LTLIBRARIES = libstdc++.la
EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
WERROR = @WERROR@
# OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fsquangle -fnew-exceptions \
# -fdata-sections -ffunction-sections \
# -fvtable-gc -Wl,--gc-sections
# AC_CXXFLAGS = @OPTLEVEL@ @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
AC_CXXFLAGS = @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
AM_CXXFLAGS = -fno-implicit-templates \
-Wall -Wno-format -W -Wwrite-strings -Winline $(WERROR) \
$(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS)
# Using these options is probably a good idea for thrill-seekers. Just
# uncomment the lines below and make, everything else is ready to go...
# OPTIMIZE_CXXFLAGS = \
# -O3 -fstrict-aliasing \
# -fdata-sections -ffunction-sections -fvtable-gc -Wl,--gc-sections
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set.
AC_CXXFLAGS = \
@WERROR@ @FMTFLAGS@ @CPUFLAGS@ @EXTRA_CXX_FLAGS@ @DEBUGFLAGS@
# Need to manually set this option because AC_CXXFLAGS has to be at
# the end of the compile line so that -O2 can be over-riden as the
# occasion call for it. (ie, --enable-debug)
AM_CXXFLAGS = \
$(FORMAT_CXXFLAGS) \
-fno-implicit-templates \
-Wall -Wno-format -W -Wwrite-strings -Winline \
$(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS)
# Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
......@@ -143,6 +155,7 @@ LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
CXXLINK = $(LIBTOOL) --mode=link "$(CC)" $(AM_CXXFLAGS) $(LDFLAGS) -o $@
TOPLEVEL_INCLUDES = -I$(includedir)
LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
CONFIG_INCLUDES = \
......
......@@ -276,11 +276,15 @@ namespace std {
// Turn off sync with C FILE* for cin, cout, cerr, clog.
if (!__sync && __retval)
{
// Need to dispose of the buffers created at initialization.
__ioinit._M_cout->~filebuf();
__ioinit._M_cin->~filebuf();
__ioinit._M_cerr->~filebuf();
__ioinit._M_cout = new filebuf();
__ioinit._M_cout->open("stdout", ios_base::out);
__ioinit._M_cin = new filebuf();
__ioinit._M_cin->open("stdin", ios_base::in);
__ioinit._M_cerr = new filebuf();
__ioinit._M_cout->open("stdout", ios_base::out);
__ioinit._M_cin->open("stdin", ios_base::in);
__ioinit._M_cerr->open("stderr", ios_base::out);
cout.rdbuf(__ioinit._M_cout);
cin.rdbuf(__ioinit._M_cin);
......@@ -288,12 +292,15 @@ namespace std {
cerr.flags(ios_base::unitbuf);
clog.rdbuf(__ioinit._M_cerr);
#ifdef _GLIBCPP_USE_WCHAR_T
__ioinit._M_wcout->~wfilebuf();
__ioinit._M_wcin->~wfilebuf();
__ioinit._M_wcerr->~wfilebuf();
__ioinit._M_wcout = new wfilebuf();
__ioinit._M_wcout->open("stdout", ios_base::out);
__ioinit._M_wcin = new wfilebuf();
__ioinit._M_wcin->open("stdin", ios_base::in);
__ioinit._M_wcerr = new wfilebuf();
__ioinit._M_wcerr->open("stderr", ios_base::out);
__ioinit._M_wcout->open("wstdout", ios_base::out);
__ioinit._M_wcin->open("wstdin", ios_base::in);
__ioinit._M_wcerr->open("wstderr", ios_base::out);
wcout.rdbuf(__ioinit._M_wcout);
wcin.rdbuf(__ioinit._M_wcin);
wcerr.rdbuf(__ioinit._M_wcerr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment