From f28f0a8ea2aa16894b45ba43dcabee0c2c073a02 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Mon, 30 Aug 1999 00:13:13 +0000 Subject: Added entries and tests for the following macros: ACE_AUTO_PTR_LACKS_RESET ACE_HAS_LLSEEK ACE_HAS_EXPLICIT_KEYWORD ACE_HAS_MUTABLE_KEYWORD ACE_HAS_STD_TEMPLATE_SPECIALIZATION ACE_HAS_STD_TEMPLATE_METHOD_SPECIALIZATION ACE_HAS_SIGTIMEDWAIT ACE_LACKS_ATEXIT ACE_LACKS_GETPPID Fixed auto_ptr test. auto_ptr was being used incorrectly. --- configure.in | 422 ++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 320 insertions(+), 102 deletions(-) diff --git a/configure.in b/configure.in index 405a4dd57e9..d9f076663dd 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl dnl $Id$ -AC_REVISION($Revision 0.61 $)dnl +AC_REVISION($Revision 0.62 $)dnl dnl dnl An autoconf script to automatically configure ACE. @@ -2164,7 +2164,7 @@ dnl This test doesn't always work. dnl AC_C_CONST dnl Check for working "inline" -AC_C_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 @@ -2511,28 +2511,18 @@ if test "$ac_cv_header_new" = yes && AC_TRY_COMPILE( [ #include - - template - class Foo - { - public: - Foo (void); - ~Foo (void); - - T* bar (void) const { return this->bar_; } - private: - T* bar_; - }; ], [ - Foo Baz = 0; + int *foo = new int; #ifdef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB - std::auto_ptr > Foobar; + std::auto_ptr safe (foo); #else - auto_ptr > Foobar; + auto_ptr safe (foo); #endif - Foobar = Baz; + foo = safe.release (); + + delete foo; ], [ ace_cv_lib_auto_ptr_class=yes @@ -2549,6 +2539,38 @@ if test "$ac_cv_header_new" = yes && ]) fi +if test $ace_cv_lib_auto_ptr_class=yes; then + dnl Check for auto_ptr reset method + ACE_CACHE_CHECK(for C++ auto_ptr reset method, + ace_cv_lib_auto_ptr_reset, + [ + AC_TRY_COMPILE( + [ +#include + ], + [ + int *foo = new int; + +#ifdef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB + std::auto_ptr safe (foo); +#else + auto_ptr safe (foo); +#endif + int *bar = new int; + + safe.reset (bar); + + foo = safe.release (); + ], + [ + ace_cv_lib_auto_ptr_reset=yes + ], + [ + ace_cv_lib_auto_ptr_reset=no + ]) + ],, AC_DEFINE(ACE_AUTO_PTR_LACKS_RESET)) +fi dnl test $ace_cv_lib_auto_ptr_class=yes + dnl Check for ANSI C++ cast support ACE_CACHE_CHECK(for ANSI C++ cast support, ace_cv_lib_posix_standard_casts,[ @@ -2613,6 +2635,119 @@ ACE_CACHE_CHECK(for ANSI C++ cast support, fi ],) +dnl Check for explicit C++ constructor support +ACE_CACHE_CHECK(for explicit C++ constructor support, + ace_cv_feature_explicit_constructor, + [ + AC_TRY_COMPILE( + [ +class Foo +{ + public: + explicit Foo (int i) { this->val_ = i; } + private: + int val_; +}; + ], + [ +Foo bar = 'a'; // error: no implicit char->Foo conversion + ], + [ +dnl The above test *should* fail! + ace_cv_feature_explicit_constructor=no + ], + [ + AC_TRY_COMPILE( + [ +class Foo +{ + public: + explicit Foo (int i) { this->val_ = i; } + private: + int val_; +}; + ], + [ +Foo bar (5); + ], + [ + ace_cv_feature_explicit_constructor=yes + ], + [ + ace_cv_feature_explicit_constructor=no + ]) + ]) + ], AC_DEFINE(ACE_HAS_EXPLICIT_KEYWORD),) + +dnl Check for C++ mutable keyword +ACE_CACHE_CHECK(for C++ mutable keyword, + ace_cv_feature_cxx_mutable_keyword, + [ + AC_TRY_COMPILE( + [ +class Foo +{ + public: + Foo (void) : val_ (0) {} + + mutable int val_; +}; + ], + [ +const Foo bar; + +bar.val_ = 3; // mutable declaration should allow this to be modified + ], + [ + ace_cv_feature_cxx_mutable_keyword=yes + ], + [ + ace_cv_feature_cxx_mutable_keyword=no + ]) + ], AC_DEFINE(ACE_HAS_MUTABLE_KEYWORD),) + +dnl Check if platform supports typename keyword +ACE_CACHE_CHECK(for C++ typename keyword, + ace_cv_feature_posix_typename_keyword,[ + AC_TRY_COMPILE([ + class Bar + { + public: + typedef int Y; + Bar(int bar) : bar_(bar) {} + private: + int bar_; + }; + + template + class Foo + { + public: + typedef typename T::Y Y; + Foo(T* foo) : foo_(foo) {} + void bilbo(typename T::Y y); + private: + T* foo_; + }; + + template + void Foo::bilbo(typename T::Y y) + { + } + ], + [ + Bar bar(15); + Foo foo(&bar); + foo.bilbo(10); + ], + [ + ace_cv_feature_posix_typename_keyword=yes + ], + [ + ace_cv_feature_posix_typename_keyword=no + ]) + ], AC_DEFINE(ACE_HAS_TYPENAME_KEYWORD),) + dnl Check if const char * can be rvalue in conditional operator ACE_CACHE_CHECK(if const char * can be rvalue in conditional operator, ace_cv_feature_conditional_str_cast, @@ -2782,7 +2917,41 @@ EOF dnl Check if platform supports template specialization ACE_CACHE_CHECK(for template specialization, ace_cv_feature_cxx_template_specialization,[ - AC_TRY_COMPILE([ + AC_TRY_COMPILE( + [ + template + class Foo + { + public: + Foo(T bar) : bar_(bar) {}; + private: + T bar_; + }; + + class Foo + { + public: + Foo(int bar) : bar_(bar + 1) {}; + private: + int bar_; + }; + ], + [ + Foo foo(11); + ], + [ + ace_cv_feature_cxx_template_specialization=yes + ], + [ + ace_cv_feature_cxx_template_specialization=no + ]) + ], AC_DEFINE(ACE_HAS_TEMPLATE_SPECIALIZATION),) + +dnl Check if platform supports *standard *template specialization +ACE_CACHE_CHECK(for standard template specialization, + ace_cv_feature_cxx_std_template_specialization,[ + AC_TRY_COMPILE( + [ // Some compilers have a hard time with this test since the syntax is // too "new" for them. @@ -2815,88 +2984,129 @@ private: void** p; int sz; }; - ], - [ + ], + [ Vector vi; Vector vpv; - ], - [ - ace_cv_feature_cxx_template_specialization=yes - ], - [ - dnl Try the "old" test if the "proper" test failed - AC_TRY_COMPILE( - [ - template - class Foo - { - public: - Foo(T bar) : bar_(bar) {}; - private: - T bar_; - }; + ], + [ + ace_cv_feature_cxx_std_template_specialization=yes + ], + [ + ace_cv_feature_std_cxx_template_specialization=no + ]) + ], AC_DEFINE(ACE_HAS_STD_TEMPLATE_SPECIALIZATION),) - class Foo - { - public: - Foo(int bar) : bar_(bar + 1) {}; - private: - int bar_; - }; - ], - [ - Foo foo(11); - ], - [ - ace_cv_feature_cxx_template_specialization=yes - ], - [ - ace_cv_feature_cxx_template_specialization=no - ]) - ]) - ], AC_DEFINE(ACE_HAS_TEMPLATE_SPECIALIZATION),) +if test $ace_cv_feature_cxx_std_template_specialization = yes; then -dnl Check if platform supports typename keyword -ACE_CACHE_CHECK(for C++ typename keyword, - ace_cv_feature_posix_typename_keyword,[ - AC_TRY_COMPILE([ - class Bar - { - public: - typedef int Y; - Bar(int bar) : bar_(bar) {} - private: - int bar_; - }; +dnl Check if platform needs *standard* template method specialization +ACE_CACHE_CHECK(if platform needs standard template method specialization, + ace_cv_feature_cxx_std_template_method_specialization,[ + AC_TRY_COMPILE( + [ +// Some compilers have a hard time with this test since the syntax is +// too "new" for them. - template - class Foo - { - public: - typedef typename T::Y Y; - Foo(T* foo) : foo_(foo) {} - void bilbo(typename T::Y y); - private: - T* foo_; - }; +// general vector type +template +class Vector +{ +public: + Vector (void); + Vector (int); - template - void Foo::bilbo(typename T::Y y) - { - } - ], - [ - Bar bar(15); - Foo foo(&bar); - foo.bilbo(10); - ], - [ - ace_cv_feature_posix_typename_keyword=yes - ], - [ - ace_cv_feature_posix_typename_keyword=no - ]) - ], AC_DEFINE(ACE_HAS_TYPENAME_KEYWORD),) + T& elem (int i) { return v[i]; } + T& operator[] (int i); +private: + T* v; + int sz; +}; + +// void * specialization +template<> +class Vector +{ +public: + Vector (void); + Vector (int); + + void*& elem (int i) { return p[i]; } + void*& operator[] (int i); +private: + void** p; + int sz; +}; + +void *& +Vector::operator[] (int i) +{ + return p[i]; +} + ], + [ + Vector vpv; + ], + [ +dnl template method specialization is *not* needed + ace_cv_feature_cxx_std_template_method_specialization=no + ], + [ + AC_TRY_COMPILE( + [ +// Some compilers have a hard time with this test since the syntax is +// too "new" for them. + +// general vector type +template +class Vector +{ +public: + Vector (void); + Vector (int); + + T& elem (int i) { return v[i]; } + T& operator[] (int i); +private: + T* v; + int sz; +}; + +// void * specialization +template<> +class Vector +{ +public: + Vector (void); + Vector (int); + + void*& elem (int i) { return p[i]; } + void*& operator[] (int i); +private: + void** p; + int sz; +}; + +template <> +void *& +Vector::operator[] (int i) +{ + return p[i]; +} + ], + [ + Vector vpv; + ], + [ +dnl template method specialization is needed + ace_cv_feature_cxx_std_template_method_specialization=yes + ], + [ +dnl template method specialization is *not* needed + ace_cv_feature_cxx_std_template_method_specialization=no + ]) + ]) + ], AC_DEFINE(ACE_HAS_STD_TEMPLATE_METHOD_SPECIALIZATION),) +fi dnl test $ace_cv_feature_cxx_std_template_specialization = yes dnl Check if platform supports template typedefs ACE_CACHE_CHECK(for template typedefs, @@ -3143,6 +3353,10 @@ AC_CHECK_FUNC(access, dnl , AC_DEFINE(ACE_LACKS_ACCESS)) +AC_CHECK_FUNC(atexit, dnl + , + AC_DEFINE(ACE_LACKS_ATEXIT)) + AC_CHECK_FUNC(bsearch, dnl , AC_DEFINE(ACE_LACKS_BSEARCH)) @@ -3176,6 +3390,9 @@ AC_CHECK_FUNC(difftime, dnl , AC_DEFINE(ACE_LACKS_DIFFTIME)) +AC_CHECK_FUNC(llseek, dnl + AC_DEFINE(ACE_HAS_LLSEEK),) + AC_CHECK_FUNC(bind, dnl [ ACE_CACHE_CHECK(if bind() will select the port if it is zero, @@ -3287,6 +3504,9 @@ AC_CHECK_FUNC(writev, , AC_DEFINE(ACE_LACKS_WRITEV)) dnl AC_CHECK_FUNC(set_t_errno, AC_DEFINE(ACE_HAS_SET_T_ERRNO),) dnl +AC_CHECK_FUNC(sigtimedwait, dnl + AC_DEFINE(ACE_HAS_SIGTIMEDWAIT),) + AC_CHECK_FUNC(socketpair, dnl , AC_DEFINE(ACE_LACKS_SOCKETPAIR)) @@ -3377,6 +3597,10 @@ AC_CHECK_FUNC(getpgid, dnl , AC_DEFINE(ACE_LACKS_GETPGID)) +AC_CHECK_FUNC(getppid, dnl + , + AC_DEFINE(ACE_LACKS_GETPPID)) + AC_CHECK_FUNC(getpagesize, dnl AC_DEFINE(ACE_HAS_GETPAGESIZE), AC_DEFINE(ACE_PAGE_SIZE, 4096)) @@ -3758,10 +3982,8 @@ dnl ACE will define a sigwait function if we lie and say we don't have dnl one. Unfortunately, the ACE function may conflict with our dnl function, so we'll go ahead and turn this on, even if we are dnl ignoring threads. -dnl - AC_CHECK_FUNC(sigwait, dnl - AC_DEFINE(ACE_HAS_SIGWAIT),) + AC_DEFINE(ACE_HAS_SIGWAIT),) dnl Check for reentrant functions @@ -6553,7 +6775,6 @@ dnl created first. AC_OUTPUT([ Makefile ace-config - ace-diff-config ace/Makefile apps/Makefile apps/gperf/Makefile @@ -6578,9 +6799,6 @@ AC_OUTPUT([ tests/Makefile ]) -dnl Make sure ace-diff-config is executable -chmod 755 ace-diff-config - echo "" echo "Configuration of ACE is now complete." echo "" -- cgit v1.2.1