From ac1289693992b0df00ab4f1cce8ef69bf3a67db6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Mar 2016 18:36:16 +0100 Subject: [PATCH] Update GTK+ autoconf macros and regenerate configure Use the macro versions from 2.24.29 and 3.18.8 (latest available in Debian for GTK+ 2 and 3 respectively) to fix the detection of pkg-config which was incorrect in the old gtk-2.0.m4. Closes #17027. --- build/aclocal/gtk-2.0.m4 | 23 +--- build/aclocal/gtk-3.0.m4 | 31 +++-- configure | 245 +++++++++++++++++++++++++++++++++------ 3 files changed, 231 insertions(+), 68 deletions(-) diff --git a/build/aclocal/gtk-2.0.m4 b/build/aclocal/gtk-2.0.m4 index 68a5ea7eea..3c6b6dd8eb 100644 --- a/build/aclocal/gtk-2.0.m4 +++ b/build/aclocal/gtk-2.0.m4 @@ -24,19 +24,8 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run no_gtk="" - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - - if test x$PKG_CONFIG != xno ; then - if pkg-config --atleast-pkgconfig-version 0.7 ; then - : - else - echo "*** pkg-config too old; version 0.7 or better required." - no_gtk=yes - PKG_CONFIG=no - fi - else - no_gtk=yes - fi + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + PKG_PROG_PKG_CONFIG([0.7]) min_gtk_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) @@ -85,7 +74,7 @@ main () int major, minor, micro; char *tmp_version; - system ("touch conf.gtktest"); + fclose (fopen ("conf.gtktest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); @@ -103,7 +92,7 @@ main () gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH environment variable, or by editing\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); @@ -139,7 +128,7 @@ main () printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } @@ -181,7 +170,7 @@ main () echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."]) + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi diff --git a/build/aclocal/gtk-3.0.m4 b/build/aclocal/gtk-3.0.m4 index 8468ef17d6..4838f16a4d 100644 --- a/build/aclocal/gtk-3.0.m4 +++ b/build/aclocal/gtk-3.0.m4 @@ -6,20 +6,19 @@ dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified i dnl pass to pkg-config dnl AC_DEFUN([AM_PATH_GTK_3_0], -[dnl +[m4_warn([obsolete], [AM_PATH_GTK_3_0 is deprecated, use PKG_CHECK_MODULES([GTK], [gtk+-3.0]) instead]) dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) + min_gtk_version=ifelse([$1], [], [3.0.0], [$1]) - pkg_gtk_version=gtk+-3.0 - pkg_config_args=$pkg_gtk_version + pkg_config_args="gtk+-3.0 >= $min_gtk_version" for module in . $4 do case "$module" in gthread) - pkg_gthread_version=gthread-2.0 - pkg_config_args="$pkg_config_args $pkg_gthread_version" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done @@ -40,7 +39,6 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run no_gtk=yes fi - min_gtk_version=ifelse([$1], ,3.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then @@ -49,7 +47,8 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi - if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_gtk_version ; then + + if $PKG_CONFIG $pkg_config_args; then : else no_gtk=yes @@ -83,14 +82,11 @@ dnl int main () { - int major, minor, micro; - char *tmp_version; + unsigned int major, minor, micro; fclose (fopen ("conf.gtktest", "w")); - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } @@ -129,9 +125,9 @@ main () } else { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); @@ -182,7 +178,7 @@ main () echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."]) + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -200,13 +196,14 @@ dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTI dnl Tests for BACKEND-NAME in the GTK targets list dnl AC_DEFUN([GTK_CHECK_BACKEND], -[ +[m4_warn([obsolete], [GTK_CHECK_BACKEND is deprecated, use PKG_CHECK_MODULES([GTK_X11], [gtk+-x11-3.0]) or similar instead]) pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0) min_gtk_version=ifelse([$2],,3.0.0,$2) + pkg_config_args="$pkg_config_args >= $min_gtk_version" AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])]) - if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_gtk_version ; then + if $PKG_CONFIG $pkg_config_args ; then target_found=yes else target_found=no diff --git a/configure b/configure index ae980109fa..dbe140008e 100755 --- a/configure +++ b/configure @@ -22115,7 +22115,123 @@ if test "$wxUSE_GUI" = "yes"; then $as_echo_n "checking for GTK+ version... " >&6; } gtk_version_cached=1 - if ${wx_cv_lib_gtk+:} false; then : + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi +if ${wx_cv_lib_gtk+:} false; then : $as_echo_n "(cached) " >&6 else @@ -22163,8 +22279,13 @@ fi no_gtk="" - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : @@ -22190,7 +22311,6 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi @@ -22204,18 +22324,78 @@ $as_echo "no" >&6; } fi - - if test x$PKG_CONFIG != xno ; then - if pkg-config --atleast-pkgconfig-version 0.7 ; then - : - else - echo "*** pkg-config too old; version 0.7 or better required." - no_gtk=yes - PKG_CONFIG=no - fi - else - no_gtk=yes +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.7 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi min_gtk_version=2.6.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5 @@ -22266,7 +22446,7 @@ main () int major, minor, micro; char *tmp_version; - system ("touch conf.gtktest"); + fclose (fopen ("conf.gtktest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); @@ -22284,7 +22464,7 @@ main () gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH environment variable, or by editing\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); @@ -22320,7 +22500,7 @@ main () printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } @@ -22386,7 +22566,7 @@ if ac_fn_c_try_link "$LINENO"; then : echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed." + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -22405,22 +22585,22 @@ rm -f core conftest.err conftest.$ac_objext \ fi if test -z "$wx_cv_lib_gtk"; then if test "$wxGTK_VERSION" = 3 -o "$wxGTK_VERSION" = any; then - # Check whether --enable-gtktest was given. + +# Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then : enableval=$enable_gtktest; else enable_gtktest=yes fi + min_gtk_version=3.0.0 - pkg_gtk_version=gtk+-3.0 - pkg_config_args=$pkg_gtk_version + pkg_config_args="gtk+-3.0 >= $min_gtk_version" for module in . $GTK_MODULES do case "$module" in gthread) - pkg_gthread_version=gthread-2.0 - pkg_config_args="$pkg_config_args $pkg_gthread_version" + pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done @@ -22481,7 +22661,6 @@ fi no_gtk=yes fi - min_gtk_version=3.0.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } @@ -22491,7 +22670,8 @@ $as_echo_n "checking for GTK+ - version >= $min_gtk_version... " >&6; } echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi - if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_gtk_version ; then + + if $PKG_CONFIG $pkg_config_args; then : else no_gtk=yes @@ -22526,14 +22706,11 @@ else int main () { - int major, minor, micro; - char *tmp_version; + unsigned int major, minor, micro; fclose (fopen ("conf.gtktest", "w")); - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } @@ -22572,9 +22749,9 @@ main () } else { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); @@ -22649,7 +22826,7 @@ if ac_fn_c_try_link "$LINENO"; then : echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed." + echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext