2010-04-08 12:41:16 +00:00
|
|
|
# $Id$
|
2013-10-21 13:42:51 +00:00
|
|
|
m4_include(ax_cxx_compile_stdcxx_11.m4)
|
2014-09-19 08:23:12 +00:00
|
|
|
m4_include(ax_check_qt.m4)
|
2011-11-10 10:31:08 +00:00
|
|
|
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
|
|
|
|
])
|
2010-04-08 12:41:16 +00:00
|
|
|
|
2009-06-17 12:24:37 +00:00
|
|
|
AC_INIT([README])
|
|
|
|
SRC_DIR=src
|
2010-09-17 08:59:48 +00:00
|
|
|
TST_DIR=
|
2009-06-17 12:24:37 +00:00
|
|
|
DOC_DIR=doc
|
|
|
|
|
|
|
|
m4_define(x_packagename, libpcscxx)
|
2014-03-26 15:07:54 +00:00
|
|
|
m4_define(x_major, 3)
|
2009-06-17 12:24:37 +00:00
|
|
|
m4_define(x_minor, 0)
|
|
|
|
PACKAGENAME=x_packagename
|
|
|
|
MAJOR=x_major
|
|
|
|
MINOR=x_minor
|
2011-11-10 10:31:08 +00:00
|
|
|
BUILDDATE=$(date "+%d.%m.%Y/%H.%M")
|
|
|
|
|
|
|
|
if svn info . 2>&1 > /dev/null; then
|
2010-04-15 13:16:36 +00:00
|
|
|
LEAST=$(LANG= svn info $path | sed -n 's/Revision: //p')
|
|
|
|
break;
|
2011-11-10 10:31:08 +00:00
|
|
|
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
|
2010-04-08 12:41:16 +00:00
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org])
|
|
|
|
|
|
|
|
# files to create
|
2011-11-10 10:31:08 +00:00
|
|
|
AC_CONFIG_FILES([makefile ${PACKAGENAME}.spec
|
2010-09-17 08:59:48 +00:00
|
|
|
src/makefile
|
2010-04-08 12:41:16 +00:00
|
|
|
doc/doxyfile doc/examples/makefile doc/makefile
|
2011-11-10 10:31:08 +00:00
|
|
|
src/${PACKAGENAME}.pc debian/changelog])
|
2010-04-08 12:41:16 +00:00
|
|
|
|
2011-11-10 10:31:08 +00:00
|
|
|
# copy M4 to shell
|
2009-06-17 12:24:37 +00:00
|
|
|
AC_SUBST(MAJOR)
|
|
|
|
AC_SUBST(MINOR)
|
|
|
|
AC_SUBST(LEAST)
|
2011-11-10 10:31:08 +00:00
|
|
|
AC_SUBST(BUILDDATE)
|
2009-06-17 12:24:37 +00:00
|
|
|
|
|
|
|
# libtool versioning
|
|
|
|
LIB_MAJOR=m4_eval(x_major+x_minor)
|
2011-11-10 10:31:08 +00:00
|
|
|
LIB_MINOR=${LEAST}
|
2009-06-17 12:24:37 +00:00
|
|
|
LIB_LEAST=x_minor
|
|
|
|
LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}"
|
|
|
|
AC_SUBST(LIB_VERSION)
|
|
|
|
|
|
|
|
# home
|
|
|
|
AC_SUBST(HOME)
|
|
|
|
|
2011-11-10 10:31:08 +00:00
|
|
|
# datadir for languages
|
|
|
|
AX_DEFINE_DIR([DATADIR], [datadir])
|
|
|
|
#AC_SUBST(DATADIR)
|
|
|
|
|
2009-06-17 12:24:37 +00:00
|
|
|
# macros
|
|
|
|
README=README
|
|
|
|
AC_SUBST_FILE(README)
|
|
|
|
CHANGE_LOG=ChangeLog
|
|
|
|
AC_SUBST_FILE(CHANGE_LOG)
|
|
|
|
|
2010-08-03 13:48:47 +00:00
|
|
|
AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'"
|
|
|
|
|
2013-11-06 12:24:52 +00:00
|
|
|
# Get rid of that stupid -O2 -g options!
|
2009-06-17 12:24:37 +00:00
|
|
|
CXXFLAGS="${CXXFLAGS:-}"
|
|
|
|
|
|
|
|
# languages
|
|
|
|
AC_LANG(C++)
|
2013-10-21 13:49:55 +00:00
|
|
|
AX_CXX_COMPILE_STDCXX_11(noext, optional)
|
2009-06-17 12:24:37 +00:00
|
|
|
|
|
|
|
# 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)
|
2011-11-10 10:31:08 +00:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2009-06-17 12:24:37 +00:00
|
|
|
|
2013-11-06 12:24:52 +00:00
|
|
|
# libraries
|
2014-05-06 15:42:09 +00:00
|
|
|
AC_ARG_ENABLE(pkcs11-download,
|
|
|
|
[AS_HELP_STRING([--enable-pkcs11-download],
|
|
|
|
[download pkcs11 header])],
|
|
|
|
[have_pedantic="$enableval"
|
|
|
|
if test "$enableval" = "yes"; then
|
|
|
|
mkdir -p usr/include
|
|
|
|
cd usr/include
|
|
|
|
for f in $(wget -q -O- ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/ 2>&1 | html2 | sed -n 's,.*/a/@href=\(.*\.h\)$,\1,gp'); do
|
|
|
|
wget --unlink $f
|
|
|
|
done
|
|
|
|
CPPFLAGS="${CPPFLAGS} -I$(pwd)"
|
|
|
|
cd -
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
dnl problem in libs: -Wshadow -Wcast-qual
|
|
|
|
dnl auto.hpp: -Wno-ctor-dtor-privacy (removed)
|
2014-05-06 16:17:51 +00:00
|
|
|
dnl AC_CHECK_HEADER([pkcs11.h], [], [AC_MSG_ERROR([Header pkcs11.h is required])])
|
2014-05-06 16:19:11 +00:00
|
|
|
dnl AC_CHECK_HEADER([wintypes.h], [], [AC_MSG_ERROR([Header wintypes.h is required])])
|
2014-09-19 08:23:12 +00:00
|
|
|
AC_CHECK_HEADER([mrw/checkcxx11.hxx], [], [AC_MSG_ERROR([please install mrw-c++])])
|
|
|
|
AX_CXX_CHECK_QT([QTGUI], [QtCore QtGui QtWidgets])
|
|
|
|
AX_CXX_CHECK_QT([QTNETWORK], [QtNetwork])
|
2013-11-06 12:24:52 +00:00
|
|
|
|
2009-06-17 12:24:37 +00:00
|
|
|
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";
|
|
|
|
AM_PATH_CPPUNIT([1.0.0], [have_cppunit="yes"], [have_cppunit="no"])
|
|
|
|
|
2010-08-26 12:24:12 +00:00
|
|
|
MINGW32=no
|
|
|
|
MAC=no
|
2009-10-21 08:52:04 +00:00
|
|
|
case $host_os in
|
|
|
|
*mingw32*) MINGW32=yes;;
|
2010-08-26 12:24:12 +00:00
|
|
|
*darwin* | *rhapsody* | *macosx*) MAC=yes;;
|
2009-10-21 08:52:04 +00:00
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(MINGW32, test "$MINGW32" = "yes")
|
2010-08-26 12:24:12 +00:00
|
|
|
AM_CONDITIONAL(MAC, test "$MAC" = "yes")
|
2009-06-17 12:24:37 +00:00
|
|
|
|
2013-11-06 14:21:56 +00:00
|
|
|
# author for signing packages
|
|
|
|
if test -z "$PACKAGERID"; then
|
|
|
|
PACKAGERID="Marc Wäckerlin (http://marc.waeckerlin.org) <marc@waeckerlin.org>"
|
|
|
|
fi
|
|
|
|
AC_ARG_VAR(PACKAGERID, [Signature identification of the package author.])
|
|
|
|
|
2009-06-17 12:24:37 +00:00
|
|
|
# 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(THREADS)
|
|
|
|
AC_SUBST(PACKAGENAME)
|
|
|
|
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_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
|