added some comments and dokus

This commit is contained in:
Marc Wäckerlin
2015-07-15 13:54:52 +00:00
parent 6ac39269ac
commit 28a943f4eb
15 changed files with 2888 additions and 195 deletions

View File

@@ -108,7 +108,7 @@ AC_DEFUN([AX_SUBST], [
#
# configures the basic environment
AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME}'"
AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'"
AX_SUBST(NUMBERS)
AX_SUBST(HOME)
README=$(tail -n +3 README)
@@ -134,6 +134,21 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
PROJECT_ICON="${PROJECT_NAME}-icon.png"
fi
AX_SUBST(PROJECT_ICON)
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")
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
AC_CONFIG_FILES([makefile])
AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in])
@@ -174,20 +189,6 @@ AC_DEFUN([AX_USE_CXX], [
AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
AC_SUBST(AM_DISTCHECK_CONFIGURE_FLAGS)
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")
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
MINGW32=no
MAC=no
case $host_os in
@@ -203,6 +204,15 @@ AC_DEFUN([AX_USE_CXX], [
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-cxx-targets], [src/makefile.in])
test -f src/makefile.in && cat >> src/makefile.in <<EOF
#### Begin: Appended by $0
%.app: %
-rm -r [\$][@]
\$(MAKE) DESTDIR=[\$][\$](pwd)/[\$][@]/tmp install
QTDIR="\${QTDIR}" \
QT_PLUGINS="\${QT_PLUGINS}" \
QT_PLUGIN_PATH="\${QT_PLUGIN_PATH}" \
\${top_builddir}/mac-create-app-bundle.sh \
[\$][@] [\$][<] [\$][\$](pwd)/[\$][@]/tmp\${prefix}
maintainer-clean-cxx-targets:
-rm makefile.in
#### End: $0
@@ -373,7 +383,7 @@ EOF
# require a specific package, with fallback: test for a header
# - parameter:
# $1 = unique id (no special characters)
# $2 = module name
# $2 = module name (optional, if different from id)
# $3 = a header file to find (optional)
# $4 = alternative module names (space separated, optional)
#
@@ -385,12 +395,13 @@ EOF
AC_DEFUN([AX_PKG_REQUIRE], [
PKG_PROG_PKG_CONFIG
$1_found=no
PKG_CHECK_MODULES([$1], [$2], [
$1_found=$2
PKG_REQUIREMENTS+=" $2"
secondpar="m4_default([$2], [$1])"
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
$1_found=$secondpar
PKG_REQUIREMENTS+=" $secondpar"
], [
if test -n "$4"; then
AC_MSG_WARN([Recommended package $2 for feature $1 not installed, trying $4])
AC_MSG_WARN([Recommended package $secondpar for feature $1 not installed, trying $4])
for pkg in $4; do
PKG_CHECK_MODULES([$1], [$pkg], [
PKG_REQUIREMENTS+=" $pkg"
@@ -402,22 +413,22 @@ AC_DEFUN([AX_PKG_REQUIRE], [
done
fi
])
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then
if test -n "$3" -a "${$1_found}" != "no"; then
tmp_package=${$1_found}
$1_found=no
old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
AC_CHECK_HEADER([$3], [
$1_found=yes
$1_found=${tmp_package}
], [
for x in ${$1_CFLAGS}; do
AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
for f in $(find ${x[#]-I} -name "$3"); do
if test -f "$f"; then
$1_found=yes
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
@@ -433,7 +444,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AC_MSG_NOTICE([search for $3 in $x])
for f in $(find ${x} -name "$3"); do
if test -f "$f"; then
$1_found=yes
$1_found=${tmp_package}
$1_CFLAGS+=" -I${f%/*}"
AC_MSG_NOTICE([added path ${f%/*}])
break;
@@ -450,16 +461,16 @@ AC_DEFUN([AX_PKG_REQUIRE], [
if test "${$1_found}" = "no"; then
if test -n "$3"; then
if test -n "$4"; then
AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $2 or $4])
AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $secondpar or $4])
else
AC_MSG_ERROR([Feature $1 not found, need header $3 in module $2])
AC_MSG_ERROR([Feature $1 not found, need header $3 in module $secondpar])
fi
else
AC_MSG_ERROR([Feature $1 not found please install module $2])
AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
fi
fi
AM_CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
CPPFLAGS+=" ${$1_CFLAGS}"
CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
])
@@ -475,8 +486,8 @@ AC_DEFUN([AX_PKG_CHECK], [
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
HAVE_$1=1
AM_CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
CPPFLAGS+=" ${$1_CFLAGS}"
CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="m4_default([$2], [$1])"
@@ -488,7 +499,32 @@ AC_DEFUN([AX_PKG_CHECK], [
])
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
AC_SUBST(HAVE_$1)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
])
# make sure, a specific header exists
# - parameter:
# $1 = header name
AC_DEFUN([AX_REQUIRE_HEADER], [
AC_CHECK_HEADER($1, [], [
if test -n "$2"; then
found=0
for d in $2; do
if test -f "${d}/$1"; then
AC_MSG_NOTICE([found file ${d}/$1])
CPPFLAGS+=" -I${d}"
found=1
break;
else
AC_MSG_NOTICE([not found file ${d}/$1])
fi
done
fi
if test $found -eq 0; then
AC_MSG_ERROR([Header $1 not found])
fi
], [])
], [])
])