This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 01/36] Guile extension language: configure changes
- From: Doug Evans <xdje42 at gmail dot com>
- To: Joel Brobecker <brobecker at adacore dot com>, ludo at gnu dot org
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Feb 2014 09:27:09 -0800
- Subject: Re: [PATCH v2 01/36] Guile extension language: configure changes
- Authentication-results: sourceware.org; auth=none
- References: <52dd9a9a dot 488b440a dot 4678 dot 03e6 at mx dot google dot com> <m3y51j8r62 dot fsf at sspiff dot org> <20140210102342 dot GA7151 at adacore dot com>
Joel Brobecker <brobecker@adacore.com> writes:
> Hi Doug,
>
>> +AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
> [...]
>> +AC_DEFUN([AC_TRY_LIBGUILE],
>> +[
>> + pkg_config=$1
>> + guile_version_list=$2
>> + flag_errors=$3
>> + define([have_libguile_var],$4)
>> + if test "${pkg_config}" = "missing"; then
>> + AC_ERROR(pkg-config program not found)
>> + fi
>> + if test ! -f "${pkg_config}"; then
>> + AC_ERROR(pkg-config program ${pkg_config} not found)
>> + fi
>
> I don't think we should error if pkg-config was not found and --with-guile
> was left to "auto". This is going to break the build of many of us
> who work on systems that don't have that tool installed (I've just
> noticed that on Windows). Intead, let's disable guile support
> when that happens.
>
> For the second error, I think we should apply the same principle.
Indeed!
The only combination I didn't test (removing pkg-config)...
> Can you adjust that part, please?
>
> Thank you,
Ludovic CourtÃs writes:
> I overlooked it before, but it may be simpler to use PKG_CHECK_MODULES
> from pkg.m4, which ships with pkg-config (info "(guile) Autoconf
> Macros").
I still have to handle the case of pkg-config being unavailable and the
user supplying his/her own. So I went this route.
2014-02-10 Doug Evans <xdje42@gmail.com>
* configure.ac: Don't crash if pkg-config is not found and guile
wasn't explicitly requested.
* configure: Regenerate.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 73decd0..fb53f71 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1058,10 +1058,6 @@ AC_SUBST(PYTHON_LIBS)
# Check for libguile. #
# -------------------- #
-dnl We check guile with pkg-config.
-
-AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
-
dnl Utility to simplify finding libguile.
dnl $1 = pkg-config-program
dnl $2 = space-separate list of guile versions to try
@@ -1075,12 +1071,6 @@ AC_DEFUN([AC_TRY_LIBGUILE],
guile_version_list=$2
flag_errors=$3
define([have_libguile_var],$4)
- if test "${pkg_config}" = "missing"; then
- AC_ERROR(pkg-config program not found)
- fi
- if test ! -f "${pkg_config}"; then
- AC_ERROR(pkg-config program ${pkg_config} not found)
- fi
found_usable_guile=checking
AC_MSG_CHECKING([for usable guile from ${pkg_config}])
for guile_version in ${guile_version_list}; do
@@ -1161,6 +1151,9 @@ AC_ARG_WITH(guile,
AC_MSG_CHECKING([whether to use guile])
AC_MSG_RESULT([$with_guile])
+dnl We check guile with pkg-config.
+AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing)
+
try_guile_versions="guile-2.0"
have_libguile=no
case "${with_guile}" in
@@ -1168,13 +1161,24 @@ no)
AC_MSG_WARN([guile support disabled; some features will be unavailable.])
;;
auto)
- AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, no, have_libguile)
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_MSG_WARN([pkg-config not found, guile support disabled])
+ else
+ AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, no, have_libguile)
+ fi
;;
yes)
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_ERROR(pkg-config program not found)
+ fi
AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${try_guile_versions}, yes, have_libguile)
;;
[[\\/]]* | ?:[[\\/]]*)
- AC_TRY_LIBGUILE(${with_guile}, ${try_guile_versions}, yes, have_libguile)
+ if test -x "${with_guile}"; then
+ AC_TRY_LIBGUILE(${with_guile}, ${try_guile_versions}, yes, have_libguile)
+ else
+ AC_ERROR("Guile config program not executable: ${with_guile}")
+ fi
;;
"" | */*)
# Disallow --with=guile="" and --with-guile=foo/bar.
@@ -1182,6 +1186,9 @@ yes)
;;
*)
# A space separate list of guile versions to try, in order.
+ if test "${pkg_config_prog_path}" = "missing"; then
+ AC_ERROR(pkg-config program not found)
+ fi
AC_TRY_LIBGUILE(${pkg_config_prog_path}, ${with_guile}, yes, have_libguile)
;;
esac