|
|
|
@ -8,13 +8,15 @@ |
|
|
|
|
## @copy © Marc Wäckerlin |
|
|
|
|
## @license LGPL, see file <a href="license.html">COPYING</a> |
|
|
|
|
## |
|
|
|
|
## 1 2 3 4 5 6 7 8 |
|
|
|
|
## 45678901234567890123456789012345678901234567890123456789012345678901234567890 |
|
|
|
|
|
|
|
|
|
# init |
|
|
|
|
AC_INIT([mrw/mrw.hpp.in]) |
|
|
|
|
PACKAGENAME=mrw-c++ |
|
|
|
|
m4_define(x_major, 2) |
|
|
|
|
m4_define(x_minor, 2) |
|
|
|
|
m4_define(x_least, 1) |
|
|
|
|
m4_define(x_minor, 3) |
|
|
|
|
m4_define(x_least, 0) |
|
|
|
|
AM_INIT_AUTOMAKE(@PACKAGENAME@, @MAJOR@.@MINOR@.@LEAST@, [marc@waeckerlin.org]) |
|
|
|
|
|
|
|
|
|
# copy M4 to shell |
|
|
|
@ -66,19 +68,19 @@ AM_MAINTAINER_MODE |
|
|
|
|
AC_ARG_ENABLE(threads, |
|
|
|
|
[ --disable-threads disable multithreading], |
|
|
|
|
[with_threads="$enableval"], [with_threads="yes"]) |
|
|
|
|
THREADS="-pthread" |
|
|
|
|
AM_CONDITIONAL(HAVE_THREADS, test "$with_threads" == "yes") |
|
|
|
|
THREADS="-pthread -D_MT" |
|
|
|
|
AM_CONDITIONAL(HAVE_THREADS, test "$with_threads" = "yes") |
|
|
|
|
AC_ARG_ENABLE(autofntrace, |
|
|
|
|
[ --disable-autofntrace disable automated function trace (requires gcc)], |
|
|
|
|
[with_autofntrace="$enableval"], [with_autofntrace="yes"]) |
|
|
|
|
AM_CONDITIONAL(AUTOFNTRACE, test "$with_autofntrace" == "yes" -a -n "$GCC") |
|
|
|
|
AM_CONDITIONAL(AUTOFNTRACE, test "$with_autofntrace" = "yes" -a -n "$GCC") |
|
|
|
|
AC_ARG_ENABLE(pedantic, |
|
|
|
|
[ --enable-pedantic enable all warnings and checks, abort on warnings], |
|
|
|
|
[have_pedantic="$enableval"; test "$enableval" = "yes" && \ |
|
|
|
|
AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"]) |
|
|
|
|
AM_CXXFLAGS="${AM_CXXFLAGS:-} -pedantic-errors -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-format-attribute -Wno-multichar -Wpacked -Wredundant-decls -Werror -Wshadow -Wcast-qual -Wno-ctor-dtor-privacy"], [have_pedantic="no"]) |
|
|
|
|
dnl problem in libs: -Wshadow -Wcast-qual |
|
|
|
|
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed) |
|
|
|
|
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes") |
|
|
|
|
AM_CONDITIONAL(PEDANTIC, test "$have_pedantic" = "yes") |
|
|
|
|
AC_ARG_ENABLE(dot, |
|
|
|
|
[ --disable-dot disable dot graphic tools for documentation], |
|
|
|
|
[have_dot="$enableval"]) |
|
|
|
@ -89,17 +91,37 @@ AC_ARG_ENABLE(log4cxx, |
|
|
|
|
[have_log4cxx="$enableval"]) |
|
|
|
|
AM_CONDITIONAL(HAVE_LOG4CXX, test "$have_log4cxx" = "yes") |
|
|
|
|
AC_ARG_ENABLE(ltdl, |
|
|
|
|
[ --disable-ltdl disable use of libtool library dynamic loading |
|
|
|
|
Note: For automated stack trace, you need ltdl], |
|
|
|
|
[have_ltdl="$enableval"]) |
|
|
|
|
[ --disable-ltdl enable use of libtool library dynamic loading |
|
|
|
|
Note: For automated stack trace, you need either |
|
|
|
|
ltdl or the libbfd BFD library from |
|
|
|
|
the binutils package at compile time.], |
|
|
|
|
[have_ltdl="$enableval"], [have_ltdl="yes"]) |
|
|
|
|
AM_CONDITIONAL(HAVE_LTDL, test "$have_ltdl" = "yes") |
|
|
|
|
AC_ARG_ENABLE(dynamicstack, |
|
|
|
|
[ --enable-dynamic-stack enable use of libtool library dynamic loading |
|
|
|
|
for stacktrace, this means the code is not linked |
|
|
|
|
to libbfd, instead a dynamical version of libbfd |
|
|
|
|
is loaded at runtime - this prevents dependency on |
|
|
|
|
the bfd library (which is part of the GNU binutils). |
|
|
|
|
Note: For automated stack trace, you need either |
|
|
|
|
ltdl or the libbfd BFD library from |
|
|
|
|
the GNU binutils package at compile time.], |
|
|
|
|
[have_dynamicstack="$enableval"], [have_dynamicstack="no"]) |
|
|
|
|
AC_ARG_ENABLE(stacktrace, |
|
|
|
|
[ --disable-stacktrace disable stack trace, use this if you cannot |
|
|
|
|
compile the library on your system otherwise and |
|
|
|
|
you still want to use the other parts], |
|
|
|
|
[have_stacktrace="$enableval"], [have_stacktrace=$have_ltdl]) |
|
|
|
|
[have_stacktrace="$enableval"], [have_stacktrace="yes"]) |
|
|
|
|
AM_CONDITIONAL(HAVE_STACKTRACE, test "$have_stacktrace" = "yes") |
|
|
|
|
if test "$have_stacktrace" = "yes"; then |
|
|
|
|
AC_CHECK_HEADER([demangle.h], |
|
|
|
|
[AC_DEFINE([HAVE_DEMANGLE_H])], |
|
|
|
|
[AC_MSG_WARN([Header "demangle.h" from the binutils not found! |
|
|
|
|
- unfortunately, the bintils do not install this header |
|
|
|
|
(even though they should) |
|
|
|
|
- the required symbols are now declared in stacktrace.cpp according to my |
|
|
|
|
own binutils version (binutils-2.16.1) it may or may not be compytible to |
|
|
|
|
yours])]) |
|
|
|
|
AC_SEARCH_LIBS(cplus_demangle, [demangle iberty], |
|
|
|
|
[AC_MSG_RESULT([OK, found cplus_demangle])], |
|
|
|
|
[AC_MSG_ERROR([Function cplus_demangle not found! |
|
|
|
@ -110,6 +132,16 @@ if test "$have_stacktrace" = "yes"; then |
|
|
|
|
-> is the symbol defined? |
|
|
|
|
- Try to compile with option --disable-stacktrace |
|
|
|
|
If you are not a developer, you perhaps don't need it...?])]) |
|
|
|
|
if test "$have_dynamicstack" != "yes"; then |
|
|
|
|
AC_DEFINE([NO_LTDL]) |
|
|
|
|
AC_SEARCH_LIBS(bfd_openr, bfd, |
|
|
|
|
[AC_MSG_RESULT([OK, found libbfd])], |
|
|
|
|
[AC_MSG_ERROR([BFD library from the binutils package not found! |
|
|
|
|
It is required for stach trace! |
|
|
|
|
- install binutils or binutils-devel |
|
|
|
|
- or configure with option --enable-ltdl |
|
|
|
|
- or configure with option --disable-stacktrace])]) |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
AC_ARG_WITH([boost-thread],AS_HELP_STRING([--with-boost-thread], |
|
|
|
|
[specify the boost thread library or suffix to use]), |
|
|
|
@ -122,7 +154,7 @@ AC_ARG_WITH([boost-thread],AS_HELP_STRING([--with-boost-thread], |
|
|
|
|
else |
|
|
|
|
chk_libs="" |
|
|
|
|
fi], |
|
|
|
|
[chk_libs="boost_thread boost_thread-mt boost_thread-gcc-mt"]) |
|
|
|
|
[chk_libs="boost_thread boost_thread-mt boost_thread-${CXX} boost_thread-${CC} boost_thread-${CXX}-mt boost_thread-${CC}-mt"]) |
|
|
|
|
for ax_lib in $chk_libs; do |
|
|
|
|
AC_CHECK_LIB($ax_lib, main, [BOOST_THREAD_LIB="-l$ax_lib" break]) |
|
|
|
|
done |
|
|
|
@ -156,12 +188,12 @@ if test "$have_cppunit" = "no"; then |
|
|
|
|
AC_MSG_WARN([Missing cppunit development library! |
|
|
|
|
- you cannot check the library using "make check" |
|
|
|
|
- everything else works perfectly]); fi |
|
|
|
|
if test "$have_pedantic" == "yes"; then |
|
|
|
|
if test "$have_pedantic" = "yes"; then |
|
|
|
|
AC_MSG_NOTICE([Pedantic compile mode enabled! |
|
|
|
|
- all warnings for GNU g++ are enabled |
|
|
|
|
- all warnings result in an error |
|
|
|
|
- doxygen warnings are treated as error too]); fi |
|
|
|
|
if test "$with_threads" == "no"; then |
|
|
|
|
if test "$with_threads" = "no"; then |
|
|
|
|
AC_MSG_WARN([Multithreading support is disabled! |
|
|
|
|
- use --enable-threads to enable it |
|
|
|
|
- actually, there's only support for automated function trace]); fi |
|
|
|
@ -172,15 +204,22 @@ AC_MSG_WARN([Library log4cxx will not be used! |
|
|
|
|
if test "$have_stacktrace" != "yes"; then |
|
|
|
|
AC_MSG_WARN([mrw::StackTrace is disabled!]); fi |
|
|
|
|
if test "$have_ltdl" != "yes"; then |
|
|
|
|
AC_MSG_ERROR([mrw::DynamicLibrary dynamic library loading is disabled! |
|
|
|
|
- mrw::StackTrace is disabled without mrw::DynamicLibrary |
|
|
|
|
AC_MSG_WARN([mrw::DynamicLibrary dynamic library loading is disabled! |
|
|
|
|
- install the GNU libtool, if you need mrw::DynamicLibrary]);fi |
|
|
|
|
if test "$with_autofntrace" != "yes" -o -z "$GCC"; then |
|
|
|
|
AC_MSG_WARN([Automated GNU gcc function tracing is disabled! |
|
|
|
|
- libmrwautofunctiontracestdout won't be built |
|
|
|
|
- libmrwautofunctiontracelog4cxx won't be built]);fi |
|
|
|
|
if test -z "$BOOST_THREAD_LIB"; then |
|
|
|
|
AC_MSG_WARN([Boost thread library not found! |
|
|
|
|
- multithreading is based on boost thread library |
|
|
|
|
- support for multithreading is disabled |
|
|
|
|
- try to pass the library name, e.g. |
|
|
|
|
--with-boost-thread=boost_thread-icc-mt]);fi |
|
|
|
|
--with-boost-thread=boost_thread-icc-mt]);fi |
|
|
|
|
if test "$have_dynamicstack" = "yes" -a \ |
|
|
|
|
\( "$have_stacktrace" != "yes" -o "$have_ltdl" != "yes" \); then |
|
|
|
|
AC_MSG_ERROR([Option --enable-dynamic-stack was given, but either |
|
|
|
|
stacktrace is disabled or ltdl is disabled. |
|
|
|
|
--enable-dynamic-stack should always be used together with options |
|
|
|
|
--enable-stacktrace and |
|
|
|
|
--enable-ltdl]);fi |
|
|
|
|