|
|
|
@ -8,7 +8,16 @@ m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))]) |
|
|
|
|
|
|
|
|
|
# define least version number from subversion's revision number: |
|
|
|
|
# it is taken modulo 256 due to a bug on Apple's MacOSX |
|
|
|
|
m4_define(x_least, mrw_esyscmd_s([ |
|
|
|
|
m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ |
|
|
|
|
SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" |
|
|
|
|
for path in . .. ../..; do |
|
|
|
|
if svn info $path 2>&1 > /dev/null; then |
|
|
|
|
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') |
|
|
|
|
break; |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
echo $ECHO_N $(($SVN_REVISION)) |
|
|
|
|
]), mrw_esyscmd_s([ |
|
|
|
|
SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" |
|
|
|
|
for path in . .. ../..; do |
|
|
|
|
if svn info $path 2>&1 > /dev/null; then |
|
|
|
@ -18,7 +27,7 @@ m4_define(x_least, mrw_esyscmd_s([ |
|
|
|
|
done |
|
|
|
|
# Mac does not support LEAST > 255 |
|
|
|
|
echo $ECHO_N $(($SVN_REVISION%256)) |
|
|
|
|
])) |
|
|
|
|
]))) |
|
|
|
|
# define version number from subversion's revision number: |
|
|
|
|
# it is taken modulo 256 due to a bug on Apple's MacOSX |
|
|
|
|
# add to x_minor if revision number is > 256 |
|
|
|
@ -34,7 +43,7 @@ m4_define(x_minor_diff, mrw_esyscmd_s([ |
|
|
|
|
echo $ECHO_N $(($SVN_REVISION/256)) |
|
|
|
|
])) |
|
|
|
|
# setup version number |
|
|
|
|
m4_define(x_version, [x_major.m4_eval(x_minor+x_minor_diff).x_least]) |
|
|
|
|
m4_define(x_version, [x_major.m4_ifdef([x_least_diff], x_minor, m4_eval(x_minor+x_minor_diff)).m4_eval(m4_ifdef([x_least_diff], [x_least-x_least_diff], [x_least]))]) |
|
|
|
|
|
|
|
|
|
## bugreport mail address is taken from <user@host> in first line of AUTHORS |
|
|
|
|
m4_define(x_bugreport, mrw_esyscmd_s([ |
|
|
|
@ -107,14 +116,27 @@ AC_DEFUN([AX_SUBST], [ |
|
|
|
|
# |
|
|
|
|
# configures the basic environment |
|
|
|
|
AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ |
|
|
|
|
MINGW=no |
|
|
|
|
MAC=no |
|
|
|
|
case $host in |
|
|
|
|
*mingw*) MINGW=yes;; |
|
|
|
|
*darwin* | *rhapsody* | *macosx*) MAC=yes;; |
|
|
|
|
AC_MSG_CHECKING([target platfrom]) |
|
|
|
|
UNIX=1 |
|
|
|
|
MINGW= |
|
|
|
|
MACOSX= |
|
|
|
|
for h in ${target} ${target_os} ${host} ${host_os} \ |
|
|
|
|
${build} ${build_os} $(uname -s 2> /dev/null); do |
|
|
|
|
p="$h is generic Unix" |
|
|
|
|
case "$h" in |
|
|
|
|
(*mingw*) |
|
|
|
|
UNIX=; MINGW=1; p="MinGW"; break;; |
|
|
|
|
(*Darwin*|*darwin*|*rhapsody*|*macosx*) |
|
|
|
|
UNIX=; MACOSX=1; p="MacOSX"; break;; |
|
|
|
|
esac |
|
|
|
|
AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") |
|
|
|
|
AM_CONDITIONAL(MAC, test "$MAC" = "yes") |
|
|
|
|
done |
|
|
|
|
AC_MSG_RESULT($p) |
|
|
|
|
AM_CONDITIONAL(UNIX, test "$UNIX" = "1") |
|
|
|
|
AM_CONDITIONAL(MINGW, test "$MINGW" = "1") |
|
|
|
|
AM_CONDITIONAL(MACOSX, test "$MACOSX" = "1") |
|
|
|
|
AX_SUBST(UNIX) |
|
|
|
|
AX_SUBST(MINGW) |
|
|
|
|
AX_SUBST(MACOSX) |
|
|
|
|
AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" |
|
|
|
|
AX_SUBST(NUMBERS) |
|
|
|
|
AX_SUBST(HOME) |
|
|
|
@ -127,8 +149,17 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ |
|
|
|
|
AUTHOR=$(head -1 AUTHORS) |
|
|
|
|
AX_SUBST(AUTHOR) |
|
|
|
|
_AM_SUBST_NOTMAKE([AUTHOR]) |
|
|
|
|
DISTRO=$(lsb_release -sc) |
|
|
|
|
DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null) |
|
|
|
|
AX_SUBST(DISTRO) |
|
|
|
|
DISTRIBUTOR=$(lsb_release -si 2>/dev/null || uname -s 2>/dev/null) |
|
|
|
|
case "${DISTRIBUTOR// /-}" in |
|
|
|
|
(Ubuntu) UBUNTU=1; AX_SUBST(UBUNTU);; |
|
|
|
|
(Debian) DEBIAN=1; AX_SUBST(DEBIAN);; |
|
|
|
|
(SUSE-LINUX) SUSE=1; AX_SUBST(SUSE);; |
|
|
|
|
(Fedora) FEDORA=1; AX_SUBST(FEDORA);; |
|
|
|
|
(Centos) CENTOS=1; AX_SUBST(CENTOS);; |
|
|
|
|
esac |
|
|
|
|
AX_SUBST(DISTRIBUTOR) |
|
|
|
|
BUILD_NUMBER=${BUILD_NUMBER:-1} |
|
|
|
|
AX_SUBST(BUILD_NUMBER) |
|
|
|
|
BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") |
|
|
|
@ -156,19 +187,36 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ |
|
|
|
|
- all warnings result in an error |
|
|
|
|
- doxygen warnings are treated as error too]); fi |
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug, |
|
|
|
|
[AS_HELP_STRING([--enable-debug], |
|
|
|
|
[compile for debugger])], |
|
|
|
|
[have_debug="$enableval"], [have_debug="no"]) |
|
|
|
|
AM_CONDITIONAL(DEBUG, test "$enableval" = "yes") |
|
|
|
|
if test "$have_debug" == "yes"; then |
|
|
|
|
AC_MSG_NOTICE([Debug compile mode enabled]); |
|
|
|
|
AM_CPPFLAGS="${AM_CPPFLAGS} -DDEBUG" |
|
|
|
|
AM_CXXFLAGS="${AM_CXXFLAGS:-} -ggdb3 -O0" |
|
|
|
|
AM_LDFLAGS="${AM_LDFLAGS} -ggdb3 -O0" |
|
|
|
|
else |
|
|
|
|
AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG" |
|
|
|
|
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]) |
|
|
|
|
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-standard-project-targets], [makefile.in]) |
|
|
|
|
test -f makefile.in && cat >> makefile.in <<EOF |
|
|
|
|
#### Begin: Appended by $0 |
|
|
|
|
EXTRA_DIST = bootstrap.sh |
|
|
|
|
EXTRA_DIST += bootstrap.sh ax_init_standard_project.m4 ax_cxx_compile_stdcxx_11.m4 \ |
|
|
|
|
ax_check_qt.m4 resolve-debbuilddeps.sh resolve-rpmbuilddeps.sh \ |
|
|
|
|
build-resource-file.sh mac-create-app-bundle.sh |
|
|
|
|
|
|
|
|
|
clean-standard-project-targets: |
|
|
|
|
-rm -rf \${PACKAGE_NAME}-\${PACKAGE_VERSION} |
|
|
|
|
-rm \${PACKAGE_TARNAME}-\${PACKAGE_VERSION}.tar.gz |
|
|
|
|
distclean-standard-project-targets: |
|
|
|
|
-rm -r autom4te.cache |
|
|
|
|
-rm aclocal.m4 config.guess config.sub configure depcomp compile install-sh ltmain.sh makefile missing mkinstalldirs |
|
|
|
|
-rm aclocal.m4 config.guess config.sub configure depcomp compile install-sh ltmain.sh makefile missing mkinstalldirs test-driver |
|
|
|
|
maintainer-clean-standard-project-targets: |
|
|
|
|
-rm makefile.in |
|
|
|
|
#### End: $0 |
|
|
|
@ -250,10 +298,10 @@ EOF |
|
|
|
|
# use this in configure.ac to support HTML data for webservers |
|
|
|
|
AC_DEFUN([AX_BUILD_HTML], [ |
|
|
|
|
AC_CONFIG_FILES([html/makefile]) |
|
|
|
|
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-example-targets], [html/makefile.in]) |
|
|
|
|
test -f html/makefile.in && cat >> examples/html.in <<EOF |
|
|
|
|
AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-html-targets], [html/makefile.in]) |
|
|
|
|
test -f html/makefile.in && cat >> html/makefile.in <<EOF |
|
|
|
|
#### Begin: Appended by $0 |
|
|
|
|
maintainer-clean-example-targets: |
|
|
|
|
maintainer-clean-html-targets: |
|
|
|
|
-rm makefile.in |
|
|
|
|
#### End: $0 |
|
|
|
|
EOF |
|
|
|
@ -386,6 +434,8 @@ EOF |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
# $3 = a header file to find (optional) |
|
|
|
|
# $4 = alternative module names (space separated, optional) |
|
|
|
|
# $5 = optional flags: |
|
|
|
|
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged |
|
|
|
|
# |
|
|
|
|
# uses PKG_CHECK_MODULES to test for a module |
|
|
|
|
# then, if given, looks for the header file |
|
|
|
@ -394,6 +444,7 @@ EOF |
|
|
|
|
# fails if not found |
|
|
|
|
AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
PKG_PROG_PKG_CONFIG |
|
|
|
|
optional_flags="$5" |
|
|
|
|
$1_found=no |
|
|
|
|
secondpar="m4_default([$2], [$1])" |
|
|
|
|
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [ |
|
|
|
@ -430,7 +481,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
], [ |
|
|
|
|
for x in ${$1_CFLAGS}; do |
|
|
|
|
AC_MSG_NOTICE([search for $3 in ${x[#]-I}]) |
|
|
|
|
for f in $(find ${x[#]-I} -name "$3"); do |
|
|
|
|
for f in $(find ${x[#]-I} -name "$3" 2> /dev/null); do |
|
|
|
|
if test -f "$f"; then |
|
|
|
|
$1_found=${tmp_package} |
|
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
|
@ -446,7 +497,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package) |
|
|
|
|
for x in ${tmp_includedir}; do |
|
|
|
|
AC_MSG_NOTICE([search for $3 in $x]) |
|
|
|
|
for f in $(find ${x} -name "$3"); do |
|
|
|
|
for f in $(find ${x} -name "$3" 2> /dev/null); do |
|
|
|
|
if test -f "$f"; then |
|
|
|
|
$1_found=${tmp_package} |
|
|
|
|
$1_CFLAGS+=" -I${f%/*}" |
|
|
|
@ -473,26 +524,47 @@ AC_DEFUN([AX_PKG_REQUIRE], [ |
|
|
|
|
AC_MSG_ERROR([Feature $1 not found please install module $secondpar]) |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
CPPFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
CXXFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
[$1]_CPPFLAGS="${$1_CFLAGS}" |
|
|
|
|
[$1]_CXXFLAGS="${$1_CFLAGS}" |
|
|
|
|
AC_SUBST([$1]_CPPFLAGS) |
|
|
|
|
AC_SUBST([$1]_CXXFLAGS) |
|
|
|
|
if test "${optional_flags/manualflags/}" = "${optional_flags}"; then |
|
|
|
|
CPPFLAGS+=" ${$1_CPPFLAGS}" |
|
|
|
|
CXXFLAGS+=" ${$1_CXXFLAGS}" |
|
|
|
|
LIBS+=" ${$1_LIBS}" |
|
|
|
|
AC_MSG_NOTICE([Adding flags for $1]) |
|
|
|
|
else |
|
|
|
|
AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) |
|
|
|
|
fi |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# check if a specific package exists |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = unique id (no special characters) |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
# $3 = optional flags: |
|
|
|
|
# manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged |
|
|
|
|
# |
|
|
|
|
# uses PKG_CHECK_MODULES to test for a module |
|
|
|
|
# sets automake conditional HAVE_$1 to 0 (not found) or 1 (found) |
|
|
|
|
# sets all flags, so that the module can be used everywhere |
|
|
|
|
AC_DEFUN([AX_PKG_CHECK], [ |
|
|
|
|
optional_flags="$3" |
|
|
|
|
PKG_PROG_PKG_CONFIG |
|
|
|
|
PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [ |
|
|
|
|
HAVE_$1=1 |
|
|
|
|
CPPFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
CXXFLAGS+=" ${$1_CFLAGS}" |
|
|
|
|
[$1]_CPPFLAGS="${$1_CFLAGS}" |
|
|
|
|
[$1]_CXXFLAGS="${$1_CFLAGS}" |
|
|
|
|
AC_SUBST([$1]_CPPFLAGS) |
|
|
|
|
AC_SUBST([$1]_CXXFLAGS) |
|
|
|
|
if test "${optional_flags/manualflags/}" = "${optional_flags}"; then |
|
|
|
|
CPPFLAGS+=" ${$1_CPPFLAGS}" |
|
|
|
|
CXXFLAGS+=" ${$1_CXXFLAGS}" |
|
|
|
|
LIBS+=" ${$1_LIBS}" |
|
|
|
|
AC_MSG_NOTICE([Adding flags for $1]) |
|
|
|
|
else |
|
|
|
|
AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS]) |
|
|
|
|
fi |
|
|
|
|
if test -z "$PKG_REQUIREMENTS"; then |
|
|
|
|
PKG_REQUIREMENTS="m4_default([$2], [$1])" |
|
|
|
|
else |
|
|
|
@ -501,7 +573,7 @@ AC_DEFUN([AX_PKG_CHECK], [ |
|
|
|
|
], [ |
|
|
|
|
HAVE_$1=0 |
|
|
|
|
]) |
|
|
|
|
AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1) |
|
|
|
|
AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1) |
|
|
|
|
AC_SUBST(HAVE_$1) |
|
|
|
|
AC_SUBST(CPPFLAGS) |
|
|
|
|
AC_SUBST(CXXFLAGS) |
|
|
|
@ -532,3 +604,95 @@ AC_DEFUN([AX_REQUIRE_HEADER], [ |
|
|
|
|
], []) |
|
|
|
|
], []) |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# Check within a list of CPP-Flags for the first that is usable and |
|
|
|
|
# configure it |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_CPP_FLAG], [ |
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
save_cppflags="$CPPFLAGS" |
|
|
|
|
newflag="no" |
|
|
|
|
for test_flag in $1; do |
|
|
|
|
CPPFLAGS+=" ${test_flag}" |
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
newflag="$test_flag" |
|
|
|
|
CPPFLAGS="$save_cppflags" |
|
|
|
|
CPPFLAGS+=" ${test_flag}" |
|
|
|
|
break; |
|
|
|
|
]) |
|
|
|
|
CPPFLAGS="$save_cppflags" |
|
|
|
|
done |
|
|
|
|
AC_SUBST(CPPFLAGS) |
|
|
|
|
AC_MSG_RESULT([$newflag in $CPPFLAGS]) |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# Check within a list of CXX-Flags for the first that is usable and |
|
|
|
|
# configure it |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_CXX_FLAG], [ |
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
save_cxxflags="$CXXFLAGS" |
|
|
|
|
newflag="no" |
|
|
|
|
for test_flag in $1; do |
|
|
|
|
CXXFLAGS+=" ${test_flag}" |
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
newflag="$test_flag" |
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
CXXFLAGS+=" ${test_flag}" |
|
|
|
|
break; |
|
|
|
|
]) |
|
|
|
|
CXXFLAGS="$save_cxxflags" |
|
|
|
|
done |
|
|
|
|
AC_SUBST(CXXFLAGS) |
|
|
|
|
AC_MSG_RESULT([$newflag in $CXXFLAGS]) |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# Check within a list of C-Flags for the first that is usable and |
|
|
|
|
# configure it |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_C_FLAG], [ |
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
save_cflags="$CFLAGS" |
|
|
|
|
newflag="no" |
|
|
|
|
for test_flag in $1; do |
|
|
|
|
CFLAGS+=" ${test_flag}" |
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
newflag="$test_flag" |
|
|
|
|
CFLAGS="$save_cflags" |
|
|
|
|
CFLAGS+=" ${test_flag}" |
|
|
|
|
break; |
|
|
|
|
]) |
|
|
|
|
CFLAGS="$save_cflags" |
|
|
|
|
done |
|
|
|
|
AC_SUBST(CFLAGS) |
|
|
|
|
AC_MSG_RESULT([$newflag in $CFLAGS]) |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
# Check within a list of LD-Flags for the first that is usable and |
|
|
|
|
# configure it |
|
|
|
|
# - parameter: |
|
|
|
|
# $1 = white-space separated list of alternative flags |
|
|
|
|
# $2 = module name (optional, if different from id) |
|
|
|
|
AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [ |
|
|
|
|
AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])]) |
|
|
|
|
save_ldflags="$LDFLAGS" |
|
|
|
|
newflag="no" |
|
|
|
|
for test_flag in $1; do |
|
|
|
|
LDFLAGS+=" ${test_flag}" |
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ |
|
|
|
|
newflag="$test_flag" |
|
|
|
|
LDFLAGS="$save_ldflags" |
|
|
|
|
LDFLAGS+=" ${test_flag}" |
|
|
|
|
break; |
|
|
|
|
]) |
|
|
|
|
LDFLAGS="$save_ldflags" |
|
|
|
|
done |
|
|
|
|
AC_SUBST(LDFLAGS) |
|
|
|
|
AC_MSG_RESULT([$newflag in $LDFLAGS]) |
|
|
|
|
]) |
|
|
|
|