2004-08-28 16:21:25 +00:00
|
|
|
## @file
|
|
|
|
##
|
|
|
|
## $Id$
|
|
|
|
##
|
|
|
|
## $Date$
|
|
|
|
## $Author$
|
|
|
|
##
|
|
|
|
## @copy © Marc Wäckerlin
|
|
|
|
## @license LGPL, see file <a href="license.html">COPYING</a>
|
|
|
|
##
|
|
|
|
|
2004-04-23 16:03:29 +00:00
|
|
|
# init
|
|
|
|
AC_INIT([mrw/mrw.hpp.in])
|
2004-04-21 06:39:20 +00:00
|
|
|
PACKAGENAME=mrw-c++
|
2005-02-28 08:00:21 +00:00
|
|
|
m4_define(x_major, 2)
|
|
|
|
m4_define(x_minor, 0)
|
2005-03-14 16:30:32 +00:00
|
|
|
m4_define(x_least, 1)
|
2004-09-09 20:09:06 +00:00
|
|
|
AM_INIT_AUTOMAKE(@PACKAGENAME@, @MAJOR@.@MINOR@.@LEAST@, [marc@waeckerlin.org])
|
|
|
|
|
|
|
|
# copy M4 to shell
|
2004-10-07 07:02:30 +00:00
|
|
|
MAJOR=x_major
|
|
|
|
MINOR=x_minor
|
|
|
|
LEAST=x_least
|
2004-09-09 20:09:06 +00:00
|
|
|
AC_SUBST(MAJOR)
|
|
|
|
AC_SUBST(MINOR)
|
|
|
|
AC_SUBST(LEAST)
|
|
|
|
|
|
|
|
# libtool versioning
|
2004-10-07 07:02:30 +00:00
|
|
|
LIB_MAJOR=m4_eval(x_major+x_minor)
|
|
|
|
LIB_MINOR=x_least
|
|
|
|
LIB_LEAST=x_minor
|
|
|
|
LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}"
|
|
|
|
AC_SUBST(LIB_VERSION)
|
2004-04-23 16:03:29 +00:00
|
|
|
|
|
|
|
# macros
|
|
|
|
README=README
|
|
|
|
AC_SUBST_FILE(README)
|
|
|
|
CHANGE_LOG=ChangeLog
|
|
|
|
AC_SUBST_FILE(CHANGE_LOG)
|
2004-04-21 06:39:20 +00:00
|
|
|
|
2005-03-11 23:27:48 +00:00
|
|
|
# Get rid of that stupid -O2 -g opions!
|
|
|
|
CXXFLAGS="${CXXFLAGS:-}"
|
|
|
|
|
2004-04-21 06:39:20 +00:00
|
|
|
# languages
|
|
|
|
AC_LANG(C++)
|
|
|
|
|
|
|
|
# programs
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
|
|
|
|
AC_CHECK_PROG(have_dot, dot, yes, no)
|
|
|
|
|
2004-04-23 16:03:29 +00:00
|
|
|
# solaris?
|
|
|
|
AC_CHECK_HEADER(sys/old_procfs.h, [AM_CPPFLAGS=-D__solaris__])
|
|
|
|
|
2004-04-21 06:39:20 +00:00
|
|
|
# libraries
|
2004-08-28 16:21:25 +00:00
|
|
|
AC_CHECK_HEADER(log4cxx/logger.h, [have_log4cxx=yes])
|
2005-02-28 08:00:21 +00:00
|
|
|
AC_CHECK_HEADER(ltdl.h, [have_ltdl=yes])
|
2004-04-21 06:39:20 +00:00
|
|
|
|
|
|
|
# Arguments
|
|
|
|
AM_MAINTAINER_MODE
|
2005-03-11 23:27:48 +00:00
|
|
|
AC_ARG_ENABLE(threads,
|
|
|
|
[ --disable-threads disable multithreading],
|
|
|
|
[with_threads="$enableval"], [with_threads="yes"])
|
|
|
|
THREADS="-pthread"
|
|
|
|
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")
|
2004-05-05 06:13:29 +00:00
|
|
|
AC_ARG_ENABLE(pedantic,
|
2004-08-31 16:01:10 +00:00
|
|
|
[ --enable-pedantic enable all warnings and checks, abort on warnings],
|
2004-11-25 18:33:18 +00:00
|
|
|
[have_pedantic="$enableval"; test "$enableval" = "yes" && \
|
2004-08-28 16:21:25 +00:00
|
|
|
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"])
|
|
|
|
dnl problem in libs: -Wshadow -Wcast-qual
|
|
|
|
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed)
|
2004-10-07 07:02:30 +00:00
|
|
|
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes")
|
2004-04-21 06:39:20 +00:00
|
|
|
AC_ARG_ENABLE(dot,
|
2004-08-28 16:21:25 +00:00
|
|
|
[ --disable-dot disable dot graphic tools for documentation],
|
2004-04-21 06:39:20 +00:00
|
|
|
[have_dot="$enableval"])
|
|
|
|
test "$enableval" = "yes" && HAVE_DOT="YES" || HAVE_DOT="NO";
|
2004-08-28 16:21:25 +00:00
|
|
|
AC_ARG_ENABLE(log4cxx,
|
|
|
|
[ --disable-log4cxx disable use of log4cxx library in automated
|
|
|
|
stack trace],
|
|
|
|
[have_log4cxx="$enableval"])
|
|
|
|
AM_CONDITIONAL(HAVE_LOG4CXX, test "$have_log4cxx" = "yes")
|
2005-02-28 08:00:21 +00:00
|
|
|
AC_ARG_ENABLE(ltdl,
|
|
|
|
[ --disable-ltdl disable use of libtool library dynamic loading
|
|
|
|
Note: For automated stack trace, you need ltdl],
|
|
|
|
[have_ltdl="$enableval"])
|
|
|
|
AM_CONDITIONAL(HAVE_LTDL, test "$have_ltdl" = "yes")
|
2004-08-28 16:21:25 +00:00
|
|
|
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],
|
2005-02-28 08:00:21 +00:00
|
|
|
[have_stacktrace="$enableval"], [have_stacktrace=$have_ltdl])
|
2004-08-28 16:21:25 +00:00
|
|
|
AM_CONDITIONAL(HAVE_STACKTRACE, test "$have_stacktrace" = "yes")
|
2004-08-31 16:24:55 +00:00
|
|
|
if test "$have_stacktrace" = "yes"; then
|
2005-01-07 00:36:26 +00:00
|
|
|
AC_SEARCH_LIBS(cplus_demangle, [demangle iberty],
|
|
|
|
[AC_MSG_RESULT([OK, found cplus_demangle])],
|
2005-03-13 08:44:32 +00:00
|
|
|
[AC_MSG_ERROR([Function cplus_demangle not found!
|
|
|
|
- I looked in libdemangle and libiberty
|
|
|
|
- Try "ls -l /usr/lib/libdemangle* /usr/lib/libiberty*"
|
|
|
|
- is one of them installed?
|
|
|
|
- If yes, try: "nm <filename> | grep cplus_demangle"
|
|
|
|
-> is the symbol defined?
|
|
|
|
- Try to compile with option --disable-stacktrace
|
|
|
|
If you are not a developer, you perhaps don't need it...?])])
|
2004-08-31 16:01:10 +00:00
|
|
|
fi
|
2005-03-11 23:27:48 +00:00
|
|
|
AC_ARG_WITH([boost-thread],AS_HELP_STRING([--with-boost-thread],
|
|
|
|
[specify the boost thread library or suffix to use]),
|
|
|
|
[if test "$with_boost_thread" != "no"; then
|
|
|
|
if test "$with_boost_thread" != "yes"; then
|
|
|
|
chk_libs="$with_boost_thread boost_thread-$with_boost_thread"
|
|
|
|
else
|
|
|
|
chk_libs="boost_thread boost_thread-mt boost_thread-gcc-mt"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
chk_libs=""
|
|
|
|
fi],
|
|
|
|
[chk_libs="boost_thread boost_thread-mt boost_thread-gcc-mt"])
|
|
|
|
for ax_lib in $chk_libs; do
|
|
|
|
AC_CHECK_LIB($ax_lib, main, [BOOST_THREAD_LIB="-l$ax_lib" break])
|
|
|
|
done
|
|
|
|
AC_SUBST(BOOST_THREAD_LIB)
|
|
|
|
AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB")
|
2005-01-28 10:49:20 +00:00
|
|
|
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"])
|
2004-04-21 06:39:20 +00:00
|
|
|
|
|
|
|
# export macros
|
|
|
|
AC_SUBST(HAVE_DOT)
|
2005-03-11 23:27:48 +00:00
|
|
|
AC_SUBST(THREADS)
|
2004-04-21 06:39:20 +00:00
|
|
|
AC_SUBST(PACKAGENAME)
|
2004-05-05 06:13:29 +00:00
|
|
|
AC_SUBST(AM_CXXFLAGS)
|
|
|
|
AC_SUBST(AM_CPPFLAGS)
|
2005-01-07 00:36:26 +00:00
|
|
|
AC_SUBST(LIBS)
|
2004-04-21 06:39:20 +00:00
|
|
|
|
|
|
|
# create output
|
2004-10-07 13:41:16 +00:00
|
|
|
AC_CONFIG_FILES([makefile mrw-c++.spec
|
2004-08-28 16:21:25 +00:00
|
|
|
mrw/makefile mrw/doxyfile mrw/mrw.hpp mrw/version.cpp])
|
2004-04-21 19:03:38 +00:00
|
|
|
AC_OUTPUT
|
2004-04-21 06:39:20 +00:00
|
|
|
|
|
|
|
# infos and warnings
|
|
|
|
if test "$have_doxygen" = "no"; then
|
|
|
|
AC_MSG_WARN([Missing program doxygen!
|
|
|
|
- you cannot rebuild the documentation with make doc
|
2005-02-18 16:20:13 +00:00
|
|
|
- there are precompiled derived files in the distribution]); fi
|
2004-04-21 06:39:20 +00:00
|
|
|
if test "$have_dot" = "no"; then
|
|
|
|
AC_MSG_WARN([Missing program dot!
|
|
|
|
- when you rebild documentation with make doc, there are no generated images
|
2005-02-18 16:20:13 +00:00
|
|
|
- there are precompiled derived files in the distribution]); fi
|
2005-01-28 10:49:20 +00:00
|
|
|
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
|
2004-11-25 18:33:18 +00:00
|
|
|
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
|
2005-03-11 23:27:48 +00:00
|
|
|
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
|
2004-08-28 16:21:25 +00:00
|
|
|
if test "$have_log4cxx" != "yes"; then
|
|
|
|
AC_MSG_WARN([Library log4cxx will not be used!
|
|
|
|
- if you want it, download it from:
|
|
|
|
http://logging.apache.org/log4cxx]); fi
|
|
|
|
if test "$have_stacktrace" != "yes"; then
|
|
|
|
AC_MSG_WARN([mrw::StackTrace is disabled!]); fi
|
2005-02-28 08:00:21 +00:00
|
|
|
if test "$have_ltdl" != "yes"; then
|
|
|
|
AC_MSG_ERROR([mrw::DynamicLibrary dynamic library loading is disabled!
|
|
|
|
- mrw::StackTrace is disabled without mrw::DynamicLibrary
|
2005-03-11 23:27:48 +00:00
|
|
|
- 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!
|
|
|
|
- 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
|