adapt to new build system
This commit is contained in:
259
configure.ac
259
configure.ac
@@ -1,90 +1,33 @@
|
||||
# $Id$
|
||||
|
||||
m4_define(x_package_name, mrw-c++)
|
||||
m4_define(x_major, 4)
|
||||
m4_define(x_minor, 3)
|
||||
|
||||
m4_include(ax_cxx_compile_stdcxx_11.m4)
|
||||
AC_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR])
|
||||
AC_DEFUN([AX_DEFINE_DIR], [
|
||||
prefix_NONE=
|
||||
exec_prefix_NONE=
|
||||
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
|
||||
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
|
||||
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
|
||||
dnl refers to ${prefix}. Thus we have to use `eval' twice.
|
||||
eval ax_define_dir="\"[$]$2\""
|
||||
eval ax_define_dir="\"$ax_define_dir\""
|
||||
AC_SUBST($1, "$ax_define_dir")
|
||||
AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3])
|
||||
test "$prefix_NONE" && prefix=NONE
|
||||
test "$exec_prefix_NONE" && exec_prefix=NONE
|
||||
])
|
||||
|
||||
m4_define(x_least, m4_esyscmd_s(
|
||||
LEAST="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout"
|
||||
for path in . .. ../..; do
|
||||
if svn info $path 2>&1 > /dev/null; then
|
||||
# Mac does not support LEAST > 255
|
||||
LEAST=$(($(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')%256))
|
||||
(cd $path && svn2cl)
|
||||
break;
|
||||
fi
|
||||
done
|
||||
echo $ECHO_N $LEAST
|
||||
))
|
||||
m4_define(x_bugreport, m4_esyscmd_s(
|
||||
head -1 AUTHORS | \
|
||||
sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp'
|
||||
))
|
||||
AC_INIT(x_package_name, x_major.x_minor.x_least, x_bugreport, x_package_name)
|
||||
## @id $Id$
|
||||
#
|
||||
# This file has been added by bootstrap.sh on Tue, 28 July 2015 11:31:59 +0200
|
||||
# Feel free to change it or even remove and rebuild it, up to your needs
|
||||
#
|
||||
## 1 2 3 4 5 6 7 8
|
||||
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
m4_define(x_package_name, mrw-c++) # project's name
|
||||
m4_define(x_major, 4) # project's major version
|
||||
m4_define(x_minor, 4) # project's minor version
|
||||
m4_include(ax_init_standard_project.m4)
|
||||
AC_INIT(x_package_name, x_version, x_bugreport, x_package_name)
|
||||
AM_INIT_AUTOMAKE([1.9 tar-pax])
|
||||
AX_INIT_STANDARD_PROJECT
|
||||
|
||||
SRC_DIR=src
|
||||
TST_DIR=test
|
||||
DOC_DIR=doc
|
||||
# requirements, uncomment, what you need:
|
||||
AX_USE_CXX
|
||||
AX_USE_LIBTOOL
|
||||
#AX_USE_SCRIPTS
|
||||
AX_USE_DOXYGEN
|
||||
AX_USE_DEBIAN_PACKAGING
|
||||
AX_USE_RPM_PACKAGING
|
||||
AX_USE_CPPUNIT
|
||||
AX_BUILD_EXAMPLES
|
||||
#AX_BUILD_HTML
|
||||
|
||||
# files to create
|
||||
AC_CONFIG_FILES([makefile ${PACKAGE_NAME}.spec src/version.cxx
|
||||
src/makefile test/makefile
|
||||
doc/doxyfile doc/makefile
|
||||
src/mrw/mrw.hxx examples/makefile
|
||||
src/${PACKAGE_NAME}.pc debian/changelog debian/control])
|
||||
|
||||
# libtool versioning
|
||||
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)
|
||||
|
||||
# home
|
||||
AC_SUBST(HOME)
|
||||
|
||||
# datadir for languages
|
||||
AX_DEFINE_DIR([DATADIR], [datadir])
|
||||
#AC_SUBST(DATADIR)
|
||||
|
||||
AM_CPPFLAGS="-DPACKAGE_VERSION='\"${PACKAGE_VERSION}\"' -DPACKAGE_NAME='\"${PACKAGE_NAME}\"'"
|
||||
|
||||
# Get rid of that stupid -O2 -g opions!
|
||||
CXXFLAGS="${CXXFLAGS:-}"
|
||||
|
||||
# languages
|
||||
AC_LANG(C++)
|
||||
AX_CXX_COMPILE_STDCXX_11(noext, optional)
|
||||
|
||||
# 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)
|
||||
PKG_PROG_PKG_CONFIG
|
||||
# qt features, uncomment, what you need:
|
||||
#AX_CHECK_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets])
|
||||
#AX_QT_NO_KEYWORDS
|
||||
|
||||
# libraries
|
||||
AC_CHECK_HEADER(log4cxx/logger.h, [have_log4cxx=yes])
|
||||
@@ -97,60 +40,52 @@ AC_CHECK_HEADER(dirent.h, [have_dir=yes])
|
||||
AC_CHECK_HEADER(sys/old_procfs.h, [AM_CPPFLAGS+="-D__solaris__"])
|
||||
|
||||
# Arguments
|
||||
AM_MAINTAINER_MODE
|
||||
AC_ARG_ENABLE(valgrind,
|
||||
AS_HELP_STRING([--enable-valgrind],
|
||||
[runs all checks with valgrind enabled]),
|
||||
[have_valgrind="$enableval"], [have_valgrind="no"])
|
||||
AM_CONDITIONAL(HAVE_VALGRIND, test "$have_valgrind" = "yes")
|
||||
AC_ARG_ENABLE(threads,
|
||||
[ --disable-threads disable multithreading],
|
||||
[with_threads="$enableval"], [with_threads="yes"])
|
||||
THREADS="-pthread -D_MT"
|
||||
AS_HELP_STRING([--disable-threads], [disable multithreading]),
|
||||
[with_threads="$enableval"], [with_threads="yes"])
|
||||
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"])
|
||||
AS_HELP_STRING([--disable-autofntrace],
|
||||
[disable automated function trace (requires gcc)]),
|
||||
[with_autofntrace="$enableval"], [with_autofntrace="yes"])
|
||||
AM_CONDITIONAL(AUTOFNTRACE, test "$with_autofntrace" = "yes" -a -n "$GCC")
|
||||
AC_ARG_ENABLE(dir,
|
||||
[ --disable-dir disable POSIX directory access],
|
||||
[have_dir="$enableval"])
|
||||
AS_HELP_STRING([--disable-dir], [disable POSIX directory access]),
|
||||
[have_dir="$enableval"])
|
||||
AM_CONDITIONAL(HAVE_DIR, test "$have_dir" = "yes")
|
||||
AC_ARG_ENABLE(exec,
|
||||
[ --disable-exec disable UNIX fork and execute with pipes],
|
||||
[have_exec="$enableval"])
|
||||
AS_HELP_STRING([--disable-exec],
|
||||
[disable UNIX fork and execute with pipes]),
|
||||
[have_exec="$enableval"])
|
||||
AM_CONDITIONAL(HAVE_EXEC, test "$have_exec" = "yes")
|
||||
AC_ARG_ENABLE(regexp,
|
||||
[ --disable-regexp disable use of regular expressions],
|
||||
[have_regex="$enableval"])
|
||||
AS_HELP_STRING([--disable-regexp],
|
||||
[disable use of regular expressions]),
|
||||
[have_regex="$enableval"])
|
||||
AM_CONDITIONAL(HAVE_REGEXP, test "$have_regex" = "yes")
|
||||
AC_ARG_ENABLE(log4cxx,
|
||||
[ --disable-log4cxx disable use of log4cxx library in automated
|
||||
stack trace],
|
||||
[have_log4cxx="$enableval"])
|
||||
AS_HELP_STRING([--disable-log4cxx],
|
||||
[disable use of log4cxx library in automated stack trace]),
|
||||
[have_log4cxx="$enableval"])
|
||||
AM_CONDITIONAL(HAVE_LOG4CXX, test "$have_log4cxx" = "yes")
|
||||
AC_ARG_ENABLE(ltdl,
|
||||
[ --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="$have_ltdl"])
|
||||
AS_HELP_STRING([--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="$have_ltdl"])
|
||||
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"])
|
||||
AS_HELP_STRING([--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="yes"])
|
||||
AS_HELP_STRING([--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="yes"])
|
||||
AM_CONDITIONAL(HAVE_STACKTRACE, test "$have_stacktrace" = "yes")
|
||||
if test "$have_stacktrace" = "yes"; then
|
||||
# Hack for bug:
|
||||
@@ -185,21 +120,21 @@ if test "$have_stacktrace" = "yes"; then
|
||||
AC_DEFINE([NO_LTDL])
|
||||
AC_SEARCH_LIBS(compress, z,
|
||||
[AC_MSG_RESULT([OK, found libz])],
|
||||
[AC_MSG_ERROR([zlib (libz) not found!
|
||||
[AC_MSG_ERROR([zlib (libz) not found!
|
||||
It is required for stack trace!
|
||||
- install zlib development package
|
||||
- or configure with option --enable-ltdl
|
||||
- or configure with option --disable-stacktrace])])
|
||||
AC_SEARCH_LIBS(dlopen, dl,
|
||||
[AC_MSG_RESULT([OK, found libdl])],
|
||||
[AC_MSG_ERROR([libdl not found!
|
||||
[AC_MSG_ERROR([libdl not found!
|
||||
It is required for stack trace!
|
||||
- install libdl development package
|
||||
- or configure with option --enable-ltdl
|
||||
- or configure with option --disable-stacktrace])])
|
||||
AC_SEARCH_LIBS(bfd_openr, bfd,
|
||||
[AC_MSG_RESULT([OK, found libbfd])],
|
||||
[AC_MSG_ERROR([BFD library from the binutils package not found!
|
||||
[AC_MSG_ERROR([BFD library from the binutils package not found!
|
||||
It is required for stack trace!
|
||||
- install binutils or binutils-devel
|
||||
- or configure with option --enable-ltdl
|
||||
@@ -209,8 +144,9 @@ It is required for stack trace!
|
||||
ac_includes_default=$old_ac_includes_default
|
||||
# } bug
|
||||
fi
|
||||
AC_ARG_WITH([boost-thread],AS_HELP_STRING([--with-boost-thread],
|
||||
[specify the boost thread library or suffix to use]),
|
||||
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"
|
||||
@@ -228,34 +164,6 @@ for (( i=0; i<${#chk_libs[*]}; ++i )); do rnd=${chk_libs[$i]}
|
||||
done
|
||||
AC_SUBST(BOOST_THREAD_LIB)
|
||||
AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB")
|
||||
AC_ARG_ENABLE(pedantic,
|
||||
[AS_HELP_STRING([--enable-pedantic],
|
||||
[enable all warnings and checks, abort on warnings])],
|
||||
[have_pedantic="$enableval"; test "$enableval" = "yes" && \
|
||||
CXXFLAGS="${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.hxx: -Wno-ctor-dtor-privacy (removed)
|
||||
AM_CONDITIONAL(PEDANTIC, test "$enableval" = "yes")
|
||||
AC_ARG_ENABLE(dot,
|
||||
[AS_HELP_STRING([--disable-dot],
|
||||
[disable dot graphic tools for documentation])],
|
||||
[have_dot="$enableval"])
|
||||
test "$enableval" = "yes" && HAVE_DOT="YES" || HAVE_DOT="NO";
|
||||
AC_ARG_ENABLE(doxygen,
|
||||
[ --disable-doxygen disable build of documentation],
|
||||
[have_doxygen="$enableval"])
|
||||
test "$enableval" = "yes" && HAVE_DOXYGEN="YES" || HAVE_DOXYGEN="NO";
|
||||
AM_CONDITIONAL(HAVE_DOXYGEN, test "$enableval" = "yes")
|
||||
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"])
|
||||
|
||||
MINGW32=no
|
||||
MAC=no
|
||||
case $host_os in
|
||||
*mingw32*) MINGW32=yes;;
|
||||
*darwin* | *rhapsody* | *macosx*) MAC=yes;;
|
||||
esac
|
||||
AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes")
|
||||
AM_CONDITIONAL(MAC, test "$MAC" = "yes")
|
||||
|
||||
# special dependencies for specific distros
|
||||
DIST_BUILDDEPENDS=$(
|
||||
@@ -266,63 +174,14 @@ DIST_BUILDDEPENDS=$(
|
||||
)
|
||||
AC_SUBST(DIST_BUILDDEPENDS)
|
||||
|
||||
# macros
|
||||
README=$(tail -n +3 README)
|
||||
README_DEB=$(tail -n +3 README | sed -e 's/^$/./g' -e 's/^/ /g')
|
||||
DESCRIPTION=$(head -1 README)
|
||||
AUTHOR=$(head -1 AUTHORS)
|
||||
AC_SUBST(AUTHOR)
|
||||
_AM_SUBST_NOTMAKE([AUTHOR])
|
||||
AC_SUBST(DESCRIPTION)
|
||||
_AM_SUBST_NOTMAKE([DESCRIPTION])
|
||||
AC_SUBST(README)
|
||||
_AM_SUBST_NOTMAKE([README])
|
||||
AC_SUBST(README_DEB)
|
||||
_AM_SUBST_NOTMAKE([README_DEB])
|
||||
DISTRO=$(lsb_release -sc)
|
||||
AC_SUBST(DISTRO)
|
||||
BUILD_NUMBER=${BUILD_NUMBER:-1}
|
||||
AC_SUBST(BUILD_NUMBER)
|
||||
BUILD_DATE=$(date -R)
|
||||
AC_SUBST(BUILD_DATE)
|
||||
|
||||
# export macros
|
||||
SRCDIR=${srcdir}
|
||||
AC_SUBST(SRCDIR)
|
||||
AC_SUBST(SRC_DIR)
|
||||
AC_SUBST(TST_DIR)
|
||||
AC_SUBST(DOC_DIR)
|
||||
AC_SUBST(HAVE_DOT)
|
||||
AC_SUBST(HAVE_DOXYGEN)
|
||||
# thread options
|
||||
THREADS="-pthread -D_MT"
|
||||
AC_SUBST(THREADS)
|
||||
AC_SUBST(AM_CXXFLAGS)
|
||||
AC_SUBST(AM_CPPFLAGS)
|
||||
AC_SUBST(LIBS)
|
||||
|
||||
# create output
|
||||
AC_OUTPUT
|
||||
|
||||
# infos and warnings
|
||||
if test "$have_doxygen" = "no"; then
|
||||
AC_MSG_WARN([Missing program doxygen!
|
||||
- you cannot rebuild the documentation with make doc
|
||||
- there are precompiled derived files in the distribution]); fi
|
||||
if test "$have_dot" = "no"; then
|
||||
AC_MSG_WARN([Missing program dot!
|
||||
- when you rebild documentation with make doc, there are no generated images
|
||||
- there are precompiled derived files in the distribution]); fi
|
||||
if test "$have_doxygen" = "no"; then
|
||||
AC_MSG_WARN([Disabled doxygen!
|
||||
- documentation will not be built]); fi
|
||||
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
|
||||
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
|
||||
AC_MSG_WARN([Multithreading support is disabled!
|
||||
- use --enable-threads to enable it
|
||||
|
Reference in New Issue
Block a user