## @id $Id$ ## 1 2 3 4 5 6 7 8 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890 # m4_esyscmd_s does not exist on centos 5 and 6 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([ 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 # 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 m4_define(x_minor_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 # Mac does not support LEAST > 255 echo $ECHO_N $(($SVN_REVISION/256)) ])) # setup version number m4_define(x_version, [x_major.m4_eval(x_minor+x_minor_diff).x_least]) ## bugreport mail address is taken from in first line of AUTHORS m4_define(x_bugreport, mrw_esyscmd_s([ head -1 AUTHORS | \ sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp' ])) m4_include(ax_check_qt.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 ]) # add target dependencies to an existing makefile.in # - parameters: # $1 = existing target # $2 = new dependency for that target # $3 = filename of makefile.in AC_DEFUN([AX_ADD_MAKEFILE_TARGET_DEP], [ sh_add_makefile_target_dep() { sed -i -e ':a;/^'${1}':.*\\$/{N;s/\\\n//;ta};s/^'${1}':.*$/& '${2}'/' "${srcdir}/${3}" if ! egrep -q "${1}:.* ${2}" "${srcdir}/${3}"; then echo "${1}: ${2}" >> "${srcdir}/${3}" fi } sh_add_makefile_target_dep "$1" "$2" "$3" if test "$1" != ".PHONY"; then sh_add_makefile_target_dep ".PHONY" "$2" "$3" fi ]) # Same as AC_SUBST, but adds -Dname="value" option to CPPFLAGS # - parameters: # $1 = variable name AC_DEFUN([AX_SUBST], [ AC_SUBST([$1]) tmp_var=$(echo "${$1}" | awk 1 ORS='\\n' | sed 's,\\n$,,') tmp_var=${tmp_var//\"/\\\"} tmp_var=${tmp_var//\'/\'\"\'\"\'} tmp_var=${tmp_var//#/\\#} AM_CPPFLAGS+=" '-D$1=\"${tmp_var}\"'" AC_SUBST(AM_CPPFLAGS) ]) # must be called on the right position in configure.ac # # configure.ac must start with: # # m4_define(x_package_name, YOUR_PACKAGE_NAME) # project's name # m4_define(x_major, MAJOR_NUMBER) # project's major version # m4_define(x_minor, MINOR_NUMBER) # 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 # # you change nothing but: YOUR_PACKAGE_NAME, MAJOR_NUMBER, MINOR_NUMBER # # 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;; esac AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") AM_CONDITIONAL(MAC, test "$MAC" = "yes") AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) README=$(tail -n +3 README) AX_SUBST(README) _AM_SUBST_NOTMAKE([README]) DESCRIPTION=$(head -1 README) AX_SUBST(DESCRIPTION) _AM_SUBST_NOTMAKE([DESCRIPTION]) AUTHOR=$(head -1 AUTHORS) AX_SUBST(AUTHOR) _AM_SUBST_NOTMAKE([AUTHOR]) DISTRO=$(lsb_release -sc) AX_SUBST(DISTRO) BUILD_NUMBER=${BUILD_NUMBER:-1} AX_SUBST(BUILD_NUMBER) BUILD_DATE=$(LANG= date +"%a, %d %b %Y %H:%M:%S %z") AX_SUBST(BUILD_DATE) if test -f "${PROJECT_NAME}-logo.png"; then PROJECT_LOGO="${PROJECT_NAME}-logo.png" fi AX_SUBST(PROJECT_LOGO) if test -f "${PROJECT_NAME}-icon.png"; then 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]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-standard-project-targets], [makefile.in]) test -f makefile.in && cat >> makefile.in <> src/makefile.in <> test/makefile.in <> examples/makefile.in <> examples/html.in <> src/makefile.in <> makefile.in <> makefile.in <> doc/makefile.in <