diff options
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | configure.ac | 45 | ||||
-rw-r--r-- | m4/compiler.m4 | 41 | ||||
-rw-r--r-- | m4/config_h.m4 | 3 |
4 files changed, 97 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog index 130e35aace5..64a4e58c032 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +Wed Mar 19 11:10:50 2003 Ossama Othman <ossama@uci.edu> + + * configure.ac: + + If reentrant functions are enabled by the user and detected by + the `configure' script, make sure "_REENTRANT" is added to the + preprocessor flags. [Bug 411] + + Added test for ACE_HAS_POSIX_GETPWNAM_R macro. Fixes problems + on Linux when threading is disabled. [Bug 914] + + The restartable system calls test was re-enabled in earlier + commits. [Bug 275] + + * m4/compiler.m4 (OCXXFLAGS): + + Added missing HP-UX aCC compiler optimization flag. + + * m4/config_h.m4 (ACE_HAS_POSIX_GETPWNAM_R): + + Added autoheader template for this macro. + Fri Mar 14 11:38:56 2003 Ossama Othman <ossama@uci.edu> * tests/Dirent_Test.cpp (TEST_ENTRY): diff --git a/configure.ac b/configure.ac index d0c0260e57e..dc10dfaae66 100644 --- a/configure.ac +++ b/configure.ac @@ -1675,16 +1675,6 @@ if test -n "$GXX"; then ]) fi -dnl Check for working "const" -dnl This test doesn't always work. -dnl AC_C_CONST - -dnl Check for working "inline" -dnl AC_C_INLINE dnl This test now appears to be broken!!! -if test "$ac_cv_c_inline" = no; then - AC_DEFINE([ACE_LACKS_INLINE_FUNCTIONS]) -fi - dnl Check to see if we are running on a big endian platform dnl "ace/Basic_Types.h" should perhaps be modified to take advantage dnl of the results of this test. @@ -4494,7 +4484,36 @@ if test "$ace_user_enable_reentrant_funcs" = yes; then ],, [AC_DEFINE([ACE_LACKS_STRTOK_R_PROTOTYPE])]) ],) - AC_CHECK_FUNC([getpwnam_r],,[AC_DEFINE([ACE_LACKS_PWD_REENTRANT_FUNCTIONS])]) + AC_CHECK_FUNC([getpwnam_r], + [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifndef _REENTRANT +# define _REENTRANT +#endif +#ifdef HAVE_PWD_H +# include <pwd.h> +#endif +#ifndef ACE_LACKS_SYS_TYPES_H +# include <sys/types.h> +#endif + ]], + [[ + const char * name; + struct passwd * pwent; + char * buffer; + int buflen; + struct passwd * result; + + int status = getpwnam_r (name, pwent, buffer, buflen, &result); + ]])], + [ + AC_DEFINE([ACE_HAS_POSIX_GETPWNAM_R]) + ], + [ + dnl Nothing to do! + ]) + ], + [AC_DEFINE([ACE_LACKS_PWD_REENTRANT_FUNCTIONS])]) AC_CHECK_FUNC([ctime_r],,) @@ -6413,6 +6432,10 @@ if test "$ace_user_enable_reentrant_funcs" = yes && test "$ac_cv_func_gmtime_r" = yes && test "$ac_cv_func_asctime_r" = yes; then AC_DEFINE([ACE_HAS_REENTRANT_FUNCTIONS]) + # Explicitly enable reentrant functions if thread support is not enabled. + if test "$ace_user_enable_threads" = no; then + ACE_CPPFLAGS="$ACE_CPPFLAGS -D_REENTRANT" + fi fi dnl Don't bother with reentrant functions if they are disabled by the user. diff --git a/m4/compiler.m4 b/m4/compiler.m4 index ff0de2416f7..ab45d22b038 100644 --- a/m4/compiler.m4 +++ b/m4/compiler.m4 @@ -181,6 +181,19 @@ changequote([, ])dnl esac ;; *hpux*) + # HP-UX OS version specific settings. + case "$host" in + *hpux11*) +# aCC's "-mt" flag detected by the configure script should already set +# the appropriate preprocessor, compiler and linker flags. +# if test "$ace_user_enable_threads" = yes; then +# # Prefer kernel threads over CMA (user) threads. +# ACE_CPPFLAGS="$ACE_CPPFLAGS -D_POSIX_C_SOURCE=199506L" +# fi + ;; + esac + + # HP-UX compiler specific settings. case "$CXX" in CC) CXXFLAGS="$CXXFLAGS -pta -ti,/bin/true -tr,/bin/true" @@ -190,11 +203,33 @@ changequote([, ])dnl ;; aCC) CXXFLAGS="$CXXFLAGS" - ACE_CXXFLAGS="$ACE_CXXFLAGS +W302,495,667,829" + # Warning 930 is spurious when new(std::nothrow) is + # used. Reported to HP as support call 3201224717. (Steve + # Huston, 23-Nov-2002) + # + # Suppress warning 302 ((...) parameter list is a + # non-portable feature) + # + # Additionally, on HP-UX 10.20, suppress 495 to shut up the + # warnings from the system header files. 667 is also + # suppressed, but the compiler still tells you there was a + # future error, but at least you can pick out any real errors + # by quickly scanning the output. 829 is suppressed because + # the system headers have offending string literals assigned + # to char *. + ACE_CXXFLAGS="$ACE_CXXFLAGS +W302,495,667,829,908,930" DCXXFLAGS="-g" - OCXXFLAGS="" + OCXXFLAGS="-O" + # Warning 67: Invalid pragma name -- needed for + # ACE_LACKS_PRAGMA_ONCE WERROR="+We67" - # Warning 67: Invalid pragma name -- needed for ACE_LACKS_PRAGMA_ONCE + + # If exception support is explicitly disabled, tell the + # compiler. This is not recommended since the run-time + # library can throw exceptions. + if test "$ace_user_enable_exceptions" != yes; then + ACE_CXXFLAGS="$ACE_CXXFLAGS +noeh" + fi ;; *) if test -n "$GXX"; then diff --git a/m4/config_h.m4 b/m4/config_h.m4 index 45f623bdf90..ea2890ddae6 100644 --- a/m4/config_h.m4 +++ b/m4/config_h.m4 @@ -618,6 +618,9 @@ AH_TEMPLATE([ACE_HAS_POSITION_INDEPENDENT_POINTERS], [Platform supports "position-independent" features provided by ACE_Based_Pointer<>.]) +AH_TEMPLATE([ACE_HAS_POSIX_GETPWNAM_R], +[Platform supports POSIX getpwnam_r() function]) + AH_TEMPLATE([ACE_HAS_POSIX_NONBLOCK], [Platform supports POSIX O_NONBLOCK semantics]) |