diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2016-09-11 10:13:00 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2016-10-17 12:39:16 -0500 |
commit | 6f5880913f80372dd042ae4c9e874d9eab840f55 (patch) | |
tree | 5b94df27766a8aad549003a6803fa7fbb0b3af46 /menuselect/configure | |
parent | d1d446b23795baa73969f725a1231dff6e0b0538 (diff) |
menuselect: invalid test for GTK2
configuire.ac was only checking for the existence of pkg-config
and not the gtk2 package itself. Now it calls AST_PKG_CONFIG_CHECK
for gtk+-2.0.
ASTERISK-26356 #close
Change-Id: I8079d515d6ea99f9ab320a7eaa71c2aaa101ccd5
Diffstat (limited to 'menuselect/configure')
-rwxr-xr-x | menuselect/configure | 197 |
1 files changed, 160 insertions, 37 deletions
diff --git a/menuselect/configure b/menuselect/configure index 648091e5f..4235ea0a4 100755 --- a/menuselect/configure +++ b/menuselect/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 418850 . +# From configure.ac Revision. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -628,7 +628,11 @@ LIBOBJS GTK2_LIB GTK2_INCLUDE PBX_GTK2 -PKGCONFIG +GTK2_LIBS +GTK2_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG CONFIG_LIBXML2 SED PBX_LIBXML2 @@ -725,7 +729,12 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP' +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +GTK2_CFLAGS +GTK2_LIBS' # Initialize some variables set by options. @@ -1356,6 +1365,13 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config + GTK2_LIBS linker flags for GTK2, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -4752,26 +4768,35 @@ if test "${PBX_LIBXML2}" != 1; then as_fn_error $? "Could not find required 'Libxml2' development package" "$LINENO" 5 fi -PBX_GTK2=0 -if test -n "$ac_tool_prefix"; 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_prog_PKGCONFIG+:} false; then : +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$PKGCONFIG"; then - ac_cv_prog_PKGCONFIG="$PKGCONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + 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_prog_PKGCONFIG="${ac_tool_prefix}pkg-config" + 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 @@ -4779,12 +4804,13 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -PKGCONFIG=$ac_cv_prog_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } +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; } @@ -4792,26 +4818,28 @@ fi fi -if test -z "$ac_cv_prog_PKGCONFIG"; then - ac_ct_PKGCONFIG=$PKGCONFIG +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_prog_ac_ct_PKGCONFIG+:} false; then : +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_PKGCONFIG"; then - ac_cv_prog_ac_ct_PKGCONFIG="$ac_ct_PKGCONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + 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_prog_ac_ct_PKGCONFIG="pkg-config" + 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 @@ -4819,19 +4847,20 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_PKGCONFIG=$ac_cv_prog_ac_ct_PKGCONFIG -if test -n "$ac_ct_PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKGCONFIG" >&5 -$as_echo "$ac_ct_PKGCONFIG" >&6; } +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_ct_PKGCONFIG" = x; then - PKGCONFIG="No" + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -4839,20 +4868,114 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - PKGCONFIG=$ac_ct_PKGCONFIG + PKG_CONFIG=$ac_pt_PKG_CONFIG fi else - PKGCONFIG="$ac_cv_prog_PKGCONFIG" + 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 test ! "x${PKGCONFIG}" = xNo; then - GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null) - GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs) - PBX_GTK2=1 + if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5 +$as_echo_n "checking for GTK2... " >&6; } + +if test -n "$GTK2_CFLAGS"; then + pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTK2_LIBS"; then + pkg_cv_GTK2_LIBS="$GTK2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0" 2>&1` + else + GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTK2_PKG_ERRORS" >&5 + + + PBX_GTK2=0 + + +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + PBX_GTK2=0 + + +else + GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS + GTK2_LIBS=$pkg_cv_GTK2_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + PBX_GTK2=1 + GTK2_INCLUDE="$GTK2_CFLAGS" + GTK2_LIB="$GTK2_LIBS" $as_echo "#define HAVE_GTK2 1" >>confdefs.h + fi + fi + |