middle of porting; unstable, don't checkout; refs #1

This commit is contained in:
Marc Wäckerlin
2011-12-10 10:15:28 +00:00
parent 232b7425f1
commit 4357fe3d9f
31 changed files with 1465 additions and 109 deletions

View File

@@ -1,56 +1,81 @@
## @file
##
## $Id$
##
## $Date$
## $Author$
##
## @copy © Marc Wäckerlin
## @license LGPL, see file <a href="license.html">COPYING</a>
##
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
# $Id$
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
])
# init
AC_INIT([mrw/mrw.hpp.in])
AC_CANONICAL_SYSTEM
PACKAGENAME=mrw-c++
m4_define(x_major, 3)
m4_define(x_minor, 3)
m4_define(x_least, 0)
DEBBUILD=1
RPMBUILD=1
AC_SUBST(DEBBUILD)
AC_SUBST(RPMBUILD)
AC_INIT([README])
SRC_DIR=src
TST_DIR=test
DOC_DIR=doc
# copy M4 to shell
m4_define(x_packagename, mrw-c++)
m4_define(x_major, 4)
m4_define(x_minor, 0)
PACKAGENAME=x_packagename
MAJOR=x_major
MINOR=x_minor
LEAST=x_least
BUILDDATE=$(date "+%d.%m.%Y/%H.%M")
if svn info . 2>&1 > /dev/null; then
LEAST=$(LANG= svn info $path | sed -n 's/Revision: //p')
break;
else
LEAST=[$(pwd | sed -n 's,^.*/'${PACKAGENAME}'-'${MAJOR}'\.'${MINOR}'\.\([0-9]*\).*$,\1,p')]
if test -z "${LEAST}"; then
LEAST="ERROR CANNOT DETERMINE REVISION NUMBER from $(pwd)"
fi
fi
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc.waeckerlin@tech.swisssign.com])
# files to create
AC_CONFIG_FILES([makefile ${PACKAGENAME}.spec src/version.cxx
src/makefile test/makefile
doc/doxyfile doc/makefile
src/mrw/mrw.hxx
src/${PACKAGENAME}.pc debian/changelog])
# copy M4 to shell
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(LEAST)
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org])
AC_SUBST(BUILDDATE)
# libtool versioning
LIB_MAJOR=m4_eval(x_major+x_minor)
LIB_MINOR=x_least
LIB_MINOR=${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)
# macros
README=README
AC_SUBST_FILE(README)
README_DEB=README.dpkg
AC_SUBST_FILE(README_DEB)
CHANGE_LOG=ChangeLog
AC_SUBST_FILE(CHANGE_LOG)
AUTHORS=AUTHORS
AC_SUBST_FILE(AUTHORS)
# Get rid of that stupid -O2 -g options!
AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'"
# Get rid of that stupid -O2 -g opions!
CXXFLAGS="${CXXFLAGS:-}"
# languages
@@ -65,6 +90,7 @@ 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
# solaris?
AC_CHECK_HEADER(sys/old_procfs.h, [AM_CPPFLAGS=-D__solaris__])
@@ -92,22 +118,6 @@ 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")
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"], [have_pedantic="no"])
dnl problem in libs: -Wshadow -Wcast-qual
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed)
AM_CONDITIONAL(PEDANTIC, test "$have_pedantic" = "yes")
AC_ARG_ENABLE(dot,
[ --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")
AC_ARG_ENABLE(dir,
[ --disable-dir disable POSIX directory access],
[have_dir="$enableval"])
@@ -195,9 +205,41 @@ for ax_lib in $chk_libs; do
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" && \
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)
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")
# 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)
AC_SUBST(THREADS)
@@ -207,11 +249,7 @@ AC_SUBST(AM_CPPFLAGS)
AC_SUBST(LIBS)
# create output
AC_CONFIG_FILES([makefile mrw-c++.spec mrw-c++-minimal.spec
mrw-c++.dsc debian.control debian.changelog debian.rules
mrw/makefile mrw/doxyfile mrw/mrw.hpp mrw/version.cpp])
AC_OUTPUT
# infos and warnings
if test "$have_doxygen" = "no"; then
AC_MSG_WARN([Missing program doxygen!