diff --git a/ax_check_qt.m4 b/ax_check_qt.m4 index 211513a..91c0072 100644 --- a/ax_check_qt.m4 +++ b/ax_check_qt.m4 @@ -1,16 +1,16 @@ # SYNOPSIS # # Check if a module exists: -# AX_CXX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # Abort if a module does not exist: -# AX_CXX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_REQUIRE_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # DESCRIPTIONS # # qt_prefix # -# Each call to AX_CXX_CHECK_QT should have a different prefix +# Each call to AX_CHECK_QT should have a different prefix # value (with a few exceptions discussed later on). This value, # usually provided in uppercase, is used as prefix to the # variables holding the compiler flags and libraries reported by @@ -43,12 +43,18 @@ AC_DEFUN([AX_CXX_QT_TOOL], [ AC_MSG_CHECKING([for $2]) AC_ARG_VAR([$1], [path to Qt tool $2]) $1=${$1:-$(${PKG_CONFIG} --variable=$2_location Qt5Core)} + $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2-qt5} $1=${$1:-$(${PKG_CONFIG} --variable=host_bins Qt5Core)/$2} $1=${$1:-$(${PKG_CONFIG} --variable=$2_location QtCore)} $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2} + $1=${$1:-$(${PKG_CONFIG} --variable=host_bins QtCore)/$2-qt4} if ! which "${$1%% *}" > /dev/null; then - if which "$2" > /dev/null; then + if which "$2-qt5" > /dev/null; then + $1=$2-qt5 + elif which "$2" > /dev/null; then $1=$2 + elif which "$2-qt4" > /dev/null; then + $1=$2-qt4 else HAVE_$1=0 $1="" @@ -179,13 +185,13 @@ qrc_%.cxx: %.qrc # SYNOPSIS # -# AX_CXX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) +# AX_CHECK_QT([qt_prefix], [list-of-qt-modules], [optional-modules]) # # DESCRIPTIONS # # qt_prefix # -# Each call to AX_CXX_CHECK_QT should have a different prefix +# Each call to AX_CHECK_QT should have a different prefix # value (with a few exceptions discussed later on). This value, # usually provided in uppercase, is used as prefix to the # variables holding the compiler flags and libraries reported by diff --git a/ax_init_standard_project.m4 b/ax_init_standard_project.m4 index 87ad90c..c94918f 100644 --- a/ax_init_standard_project.m4 +++ b/ax_init_standard_project.m4 @@ -3,45 +3,46 @@ ## 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, m4_esyscmd_s( +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') - (cd $path && svn2cl) 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_fixed, m4_esyscmd_s( +m4_define(x_minor_fixed, 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') - (cd $path && svn2cl) break; fi done # Mac does not support LEAST > 255 echo $ECHO_N $((x_minor+$SVN_REVISION/256)) -)) +])) # setup version number -m4_define(x_version, m4_esyscmd_s( +m4_define(x_version, mrw_esyscmd_s([ echo $ECHO_N x_major.x_minor_fixed.x_least -)) +])) ## bugreport mail address is taken from in first line of AUTHORS -m4_define(x_bugreport, m4_esyscmd_s( +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) @@ -84,7 +85,7 @@ AC_DEFUN([AX_ADD_MAKEFILE_TARGET_DEP], [ # $1 = variable name AC_DEFUN([AX_SUBST], [ AC_SUBST([$1]) - tmp_var=$(echo "${$1}" | awk 1 ORS='\\n') + tmp_var=$(echo "${$1}" | awk 1 ORS='\\n' | sed 's,\\n$,,') tmp_var=${tmp_var//\"/\\\"} tmp_var=${tmp_var//\'/\'\"\'\"\'} tmp_var=${tmp_var//#/\\#} @@ -116,7 +117,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ esac AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") AM_CONDITIONAL(MAC, test "$MAC" = "yes") - AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'" + AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) README=$(tail -n +3 README) @@ -164,7 +165,6 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ test -f makefile.in && cat >> makefile.in <> makefile.in <