diff options
author | Tomas Chvatal <tchvatal@suse.cz> | 2012-03-13 15:05:46 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-04-25 10:55:17 +0200 |
commit | 32c70a883286590815111a6ee9dd271abd22f3e6 (patch) | |
tree | 99d56c276e4797d4e7945262240eb2618ff9cc9c /m4 | |
parent | 1059029fac4b27fd97008337e97f7ed2c502fdc2 (diff) |
Add the quirks to produce same config.h as previously
Diffstat (limited to 'm4')
-rw-r--r-- | m4/README | 3 | ||||
-rw-r--r-- | m4/ac_cxx_have_strstream.m4 | 29 | ||||
-rw-r--r-- | m4/ac_dll.m4 | 47 | ||||
-rw-r--r-- | m4/ax_cxx_gcc_abi_demangle.m4 | 1 | ||||
-rw-r--r-- | m4/ax_cxx_have_isfinite.m4 | 27 | ||||
-rw-r--r-- | m4/ax_cxx_have_sstream.m4 | 2 | ||||
-rw-r--r-- | m4/ax_cxx_namespaces.m4 | 2 | ||||
-rw-r--r-- | m4/ax_cxx_rtti.m4 | 2 |
8 files changed, 110 insertions, 3 deletions
@@ -3,3 +3,6 @@ # Exceptions internal code: # bb_enable_doxygen.m4 # ac_cxx_string_compare_string_first.m4 +# ax_cxx_have_isfinite.m4 +# ac_dll.m4 +# ac_cxx_have_strstream.m4 diff --git a/m4/ac_cxx_have_strstream.m4 b/m4/ac_cxx_have_strstream.m4 new file mode 100644 index 0000000..232a3d6 --- /dev/null +++ b/m4/ac_cxx_have_strstream.m4 @@ -0,0 +1,29 @@ +dnl @synopsis AC_CXX_HAVE_STRSTREAM +dnl +dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM. +dnl +dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins +dnl +AC_DEFUN([AC_CXX_HAVE_STRSTREAM], +[AC_CACHE_CHECK(whether the library defines class strstream, +ac_cv_cxx_have_class_strstream, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_CHECK_HEADERS(strstream) + AC_TRY_COMPILE([ +#if HAVE_STRSTREAM +# include <strstream> +#else +# include <strstream.h> +#endif +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[ostrstream message; message << "Hello"; return 0;], + ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_have_class_strstream" = yes; then + AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream]) +fi +]) diff --git a/m4/ac_dll.m4 b/m4/ac_dll.m4 new file mode 100644 index 0000000..ad7438a --- /dev/null +++ b/m4/ac_dll.m4 @@ -0,0 +1,47 @@ + +# AC_LTDL_DLLIB +# ------------- +AC_DEFUN([AC_LTDL_DLLIB], +[LIBADD_DL= +AC_SUBST(LIBADD_DL) + +AC_CHECK_FUNC([shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.])], + [AC_CHECK_LIB([dld], [shl_load], + [AC_DEFINE([HAVE_SHL_LOAD], [1], + [Define if you have the shl_load function.]) + LIBADD_DL="$LIBADD_DL -ldld"], + [AC_CHECK_LIB([dl], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-ldl"], + [AC_TRY_LINK([#if HAVE_DLFCN_H +# include <dlfcn.h> +#endif + ], + [dlopen(0, 0);], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.])], + [AC_CHECK_LIB([svld], [dlopen], + [AC_DEFINE([HAVE_LIBDL], [1], + [Define if you have the libdl library or equivalent.]) + LIBADD_DL="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [AC_DEFINE([HAVE_DLD], [1], + [Define if you have the GNU dld library.]) + LIBADD_DL="$LIBADD_DL -ldld" + ]) + ]) + ]) + ]) + ]) +]) + +if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then + LIBS_SAVE="$LIBS" + LIBS="$LIBS $LIBADD_DL" + AC_CHECK_FUNCS(dlerror) + LIBS="$LIBS_SAVE" +fi +])# AC_LTDL_DLLIB diff --git a/m4/ax_cxx_gcc_abi_demangle.m4 b/m4/ax_cxx_gcc_abi_demangle.m4 index 2642ced..0275c7e 100644 --- a/m4/ax_cxx_gcc_abi_demangle.m4 +++ b/m4/ax_cxx_gcc_abi_demangle.m4 @@ -32,6 +32,7 @@ ax_cv_cxx_gcc_abi_demangle, AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <typeinfo> #include <cxxabi.h> +#include <malloc.h> #include <string> template<typename TYPE> diff --git a/m4/ax_cxx_have_isfinite.m4 b/m4/ax_cxx_have_isfinite.m4 new file mode 100644 index 0000000..5f9c7fc --- /dev/null +++ b/m4/ax_cxx_have_isfinite.m4 @@ -0,0 +1,27 @@ +dnl @synopsis AX_CXX_HAVE_ISFINITE +dnl +dnl If isfinite() is available to the C++ compiler: +dnl define HAVE_ISFINITE +dnl add "-lm" to LIBS +dnl +AC_DEFUN([AX_CXX_HAVE_ISFINITE], + [ax_cxx_have_isfinite_save_LIBS=$LIBS + LIBS="$LIBS -lm" + + AC_CACHE_CHECK(for isfinite, ax_cv_cxx_have_isfinite, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <math.h>]], + [[int f = isfinite( 3 );]])], + [ax_cv_cxx_have_isfinite=yes], + [ax_cv_cxx_have_isfinite=no]) + AC_LANG_RESTORE]) + + if test "$ax_cv_cxx_have_isfinite" = yes; then + AC_DEFINE([HAVE_ISFINITE],1,[define if compiler has isfinite]) + else + LIBS=$ax_cxx_have_isfinite_save_LIBS + fi +]) diff --git a/m4/ax_cxx_have_sstream.m4 b/m4/ax_cxx_have_sstream.m4 index 49a4fef..bad6c45 100644 --- a/m4/ax_cxx_have_sstream.m4 +++ b/m4/ax_cxx_have_sstream.m4 @@ -36,6 +36,6 @@ using namespace std; AC_LANG_RESTORE ]) if test "$ax_cv_cxx_have_sstream" = yes; then - AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream]) + AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream]) fi ]) diff --git a/m4/ax_cxx_namespaces.m4 b/m4/ax_cxx_namespaces.m4 index 9fdc374..81b97a7 100644 --- a/m4/ax_cxx_namespaces.m4 +++ b/m4/ax_cxx_namespaces.m4 @@ -35,6 +35,6 @@ ax_cv_cxx_namespaces, AC_LANG_RESTORE ]) if test "$ax_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) + AC_DEFINE(HAVE_NAMESPACES,1,[define if the compiler implements namespaces]) fi ]) diff --git a/m4/ax_cxx_rtti.m4 b/m4/ax_cxx_rtti.m4 index f8f145d..97cfe06 100644 --- a/m4/ax_cxx_rtti.m4 +++ b/m4/ax_cxx_rtti.m4 @@ -46,7 +46,7 @@ return typeid (*ptr) == typeid (Derived); AC_LANG_RESTORE ]) if test "$ax_cv_cxx_rtti" = yes; then - AC_DEFINE(HAVE_RTTI,, + AC_DEFINE(HAVE_RTTI,1, [define if the compiler supports Run-Time Type Identification]) fi ]) |