From 833f2fc92da8d31c62eb35dae8b3861829a1383a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 22 Dec 2003 16:40:46 +0000 Subject: [PATCH] * GCC 2.95 compatibility. --- configure.ac | 16 ++++++++++++++++ src/boost/format.hpp | 9 ++++++--- src/libmain/shared.cc | 3 +++ src/libstore/exec.cc | 1 + src/libstore/store.cc | 1 + src/nix-env/main.cc | 2 ++ 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 3e0bca31e..85244ebab 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,22 @@ AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB +# Check for pubsetbuf. +AC_MSG_CHECKING([for pubsetbuf]) +AC_LANG_PUSH(C++) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +using namespace std; +static char buf[1024];]], + [[cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));]])], + [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUBSETBUF, 1, [whether pubsetbuf is available])], + AC_MSG_RESULT(no)) +AC_LANG_POP(C++) + +# Check for +AC_LANG_PUSH(C++) +AC_CHECK_HEADERS([locale]) +AC_LANG_POP(C++) + AC_PATH_PROG(wget, wget) AC_PATH_PROG(xmllint, xmllint) AC_PATH_PROG(xsltproc, xsltproc) diff --git a/src/boost/format.hpp b/src/boost/format.hpp index a287048ed..1476cb796 100644 --- a/src/boost/format.hpp +++ b/src/boost/format.hpp @@ -24,10 +24,13 @@ #include #include +#if HAVE_LOCALE #include -//#define BOOST_NO_STD_LOCALE -//#define BOOST_NO_LOCALE_ISIDIGIT -//#include +#else +#define BOOST_NO_STD_LOCALE +#define BOOST_NO_LOCALE_ISIDIGIT +#include +#endif #include diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index b99a74bb4..92349488e 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -1,3 +1,4 @@ + #include #include @@ -71,7 +72,9 @@ int main(int argc, char * * argv) ATinit(argc, argv, &bottomOfStack); /* Turn on buffering for cerr. */ +#if HAVE_PUBSETBUF cerr.rdbuf()->pubsetbuf(buf, sizeof(buf)); +#endif try { initAndRun(argc, argv); diff --git a/src/libstore/exec.cc b/src/libstore/exec.cc index 47a385f14..2adf03841 100644 --- a/src/libstore/exec.cc +++ b/src/libstore/exec.cc @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/src/libstore/store.cc b/src/libstore/store.cc index acdb4708e..20625b9fe 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 06678fc51..6150b2fb6 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -1,3 +1,5 @@ +#include + #include "globals.hh" #include "normalise.hh" #include "shared.hh"