-Unfortunately on some 32 bit systems there is a problem with wx-widgets

configuring itself for largefile support.  On these systems largefile
     support breaks C++ compiles by defining away many of the C standard library
     routines that should reside in namespace std::.  In order to get around
     problem first we have to check the largefile support macros.  Later we will
     use the macro SAH_LARGEFILE_BREAKS_CXX to check for the breakage.  If
     if breakage is found LARGEFILE_BREAKS_CXX is defined in config.h.  This
     define is checked in std_fixes.h and the appropriate functions are defined
     in order to solve the problem. (These functions were already in place)
     Because these defines affect the behavior of standard library headers,
     std_fixes.h is being included from config.h
    -Added AM_CPPFLAGS, AM_CFLAGS, and AM_CXXFLAGS (for flags common to all
     compiles) so they will be defined in all Makefile.am files.
    -Put #ifdef _cplusplus around the C++ specific items in std_fixes.h so it
     may be included from C source files.

svn path=/trunk/boinc/; revision=5375
This commit is contained in:
Eric J. Korpela 2005-02-09 19:39:04 +00:00
parent 6e1c442831
commit 0e47fe1fa6
6 changed files with 87 additions and 8 deletions

View File

@ -22,7 +22,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/sched \
$(MYSQL_CFLAGS) \
$(PTHREAD_CFLAGS) \
-include $(top_builddir)/config.h
-include $(top_srcdir)/config.h
AM_CFLAGS = $(AM_CPPFLAGS)
AM_CXXFLAGS = $(AM_CPPFLAGS)
AM_LDFLAGS =
# dependencies to make sure libs gets compiled before
# programs linking to them:
@ -38,3 +42,4 @@ $(LIBSCHED):
LIBBOINC = $(top_builddir)/libboinc.a
$(LIBBOINC):
cd $(top_builddir)/lib; ${MAKE} libboinc.a

View File

@ -3,8 +3,8 @@
include $(top_srcdir)/Makefile.incl
AM_CFLAGS = @GLUT_CFLAGS@
AM_LDFLAGS = @GLUT_LIBS@
AM_CFLAGS += @GLUT_CFLAGS@
AM_LDFLAGS += @GLUT_LIBS@
api_files= \
boinc_api.C

View File

@ -24333,6 +24333,8 @@ Bruce 8 Feb 2005
sched_config.C
sched_config.h
Bruce 8 Feb 2005
- Turn off ops pages that update the data base. These now issue a message
informing the project admin that they need to be explicitly edited to
@ -24359,3 +24361,29 @@ David 9 Feb 2005
client/
app_control.C
client_state.h
Eric K. 9 Feb 2005
-Unfortunately on some 32 bit systems there is a problem with wx-widgets
configuring itself for largefile support. On these systems largefile
support breaks C++ compiles by defining away many of the C standard library
routines that should reside in namespace std::. In order to get around
problem first we have to check the largefile support macros. Later we will
use the macro SAH_LARGEFILE_BREAKS_CXX to check for the breakage. If
if breakage is found LARGEFILE_BREAKS_CXX is defined in config.h. This
define is checked in std_fixes.h and the appropriate functions are defined
in order to solve the problem. (These functions were already in place)
Because these defines affect the behavior of standard library headers,
std_fixes.h is being included from config.h
-Added AM_CPPFLAGS, AM_CFLAGS, and AM_CXXFLAGS (for flags common to all
compiles) so they will be defined in all Makefile.am files.
-Put #ifdef _cplusplus around the C++ specific items in std_fixes.h so it
may be included from C source files.
configure.ac
Makefile.incl
m4/
sah_largefile_breaks_cxx.m4
api/
Makefile.am
lib/
std_fixes.h

View File

@ -112,6 +112,18 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LN_S
dnl Unfortunately on some 32 bit systems there is a problem with wx-widgets
dnl configuring itself for largefile support. On these systems largefile
dnl support breaks C++ compiles by defining away many of the C standard library
dnl routines that should reside in namespace std::. In order to get around
dnl problem first we have to check the largefile support macros. Later we will
dnl use the macro SAH_LARGEFILE_BREAKS_CXX to check for the breakage. If
dnl if breakage is found LARGEFILE_BREAKS_CXX is defined in config.h. This
dnl define is checked in std_fixes.h and the appropriate functions are defined
dnl in order to solve the problem.
AC_SYS_LARGEFILE
if test "${enable_server}" = yes; then
AC_CHECK_MYSQL
if test "${no_mysql}" = yes; then
@ -197,6 +209,9 @@ AH_TOP([
])
AH_BOTTOM([
/* include fixes for the most common problems */
#include "std_fixes.h"
/* end double-inclusion protection for config.h */
#endif /* #ifndef BOINC_CONFIG_H */
])
@ -211,6 +226,7 @@ AC_TYPE_SIGNAL
AC_CHECK_HEADERS(arpa/inet.h dirent.h fcntl.h malloc.h netdb.h netinet/in.h netinet/tcp.h signal.h strings.h sys/file.h sys/ipc.h sys/mount.h sys/param.h sys/resource.h sys/select.h sys/shm.h sys/socket.h sys/stat.h sys/statvfs.h sys/statfs.h sys/swap.h sys/sysctl.h sys/systeminfo.h sys/time.h sys/types.h sys/utsname.h sys/vmmeter.h sys/wait.h unistd.h utmp.h errno.h procfs.h)
AC_LANG_PUSH(C++)
SAH_LARGEFILE_BREAKS_CXX
SAH_HEADER_STDCXX
SAH_CHECK_NAMESPACES
AH_TEMPLATE([HAVE_STD_MIN],[Define to 1 if min is in namespace std::])

View File

@ -20,6 +20,8 @@
#ifndef _STD_FIXES_H_
#define _STD_FIXES_H_
#ifdef __cplusplus
#ifndef CONFIG_TEST
#ifndef HAVE_STD_MIN
@ -34,7 +36,7 @@ inline T min(const T &a, const T &b) {
return ((a<b)?a:b);
}
}
#endif
#endif /* HAVE_STD_MIN */
#ifndef HAVE_STD_MAX
namespace std {
@ -48,7 +50,7 @@ inline T max(const T &a, const T &b) {
}
}
#endif
#endif /* HAVE_STD_MAX */
#ifndef HAVE_STD_TRANSFORM
#include <algorithm>
@ -70,8 +72,8 @@ o_iterator transform(i_iterator first, i_iterator last, o_iterator res, OP op) {
}
#endif
#endif
#endif /* HAVE_STD_TRANSFORM */
#endif /* CONFIG_TEST */
#if defined(LARGEFILE_BREAKS_CXX) && (defined(_LARGE_FILES) || (_FILE_OFFSET_BITS==64))
@ -113,5 +115,6 @@ inline int open(const char *filename, int flags, mode_t mode) { return open64(fi
inline int creat(const char *filename, mode_t mode) { return creat64(filename,mode); }
#endif
#endif
#endif /* __cplusplus */
#endif /* STD_FIXES_H */

View File

@ -0,0 +1,27 @@
# SETI_BOINC is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
AC_DEFUN([SAH_LARGEFILE_BREAKS_CXX],[
AC_MSG_CHECKING([whether largefile support breaks C++])
AC_LANG_PUSH(C++)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#define CONFIG_TEST
#include <iostream>
]],
[[
std::cout << 1.0 << std::endl;
]])],
[tmp_res="no"],
[AC_DEFINE([LARGEFILE_BREAKS_CXX],[1],
["Define to 1 if largefile support causes missing symbols in C++"] )
tmp_res="yes"
sah_cxx_includes=`echo "#include \"$TOP_BUILD_DIR/lib/std_fixes.h\"" ; echo $sah_cxx_includes`
]
)
AC_MSG_RESULT($tmp_res)
AC_LANG_POP
])