summaryrefslogtreecommitdiff
path: root/gdb/acinclude.m4
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-05-27 03:40:43 +0000
committerDoug Evans <dje@google.com>2010-05-27 03:40:43 +0000
commite2525e60c4727ffa8ce5a9f94ad49ea54d8284d9 (patch)
tree448bae9b1c78aa33f74b504f52ed76735ba8e79e /gdb/acinclude.m4
parent2fe486b869f8d2c434900635de935bb81a2ff187 (diff)
downloadgdb-e2525e60c4727ffa8ce5a9f94ad49ea54d8284d9.tar.gz
Allow python to find its files if moved from original location.
* acinclude.m4 (GDB_AC_DEFINE_RELOCATABLE): New function. (GDB_AC_WITH_DIR): Call it. * configure.ac: Define WITH_PYTHON_PATH if we can find the python installation directory. * config.in: Regenerate. * configure: Regenerate. * defs.h (python_libdir): Declare. * main.c (python_libdir): Define. (captured_main): Initialize python_libdir. * python/python.c (_initialize_python): #ifdef WITH_PYTHON_PATH, call Py_SetProgramName to make sure python can find its libraries and modules.
Diffstat (limited to 'gdb/acinclude.m4')
-rw-r--r--gdb/acinclude.m439
1 files changed, 24 insertions, 15 deletions
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index e3f604ecff6..1942ef484ff 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -403,22 +403,12 @@ AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
fi
])
-dnl GDB_AC_WITH_DIR([VARIABLE], [ARG-NAME], [HELP], [DEFAULT])
-dnl Add a new --with option that defines a directory.
-dnl The result is stored in VARIABLE. AC_DEFINE_DIR is called
-dnl on this variable, as is AC_SUBST.
-dnl ARG-NAME is the base name of the argument (without "--with").
-dnl HELP is the help text to use.
-dnl If the user's choice is relative to the prefix, then the
+dnl GDB_AC_DEFINE_RELOCATABLE([VARIABLE], [ARG-NAME], [SHELL-VARIABLE])
+dnl For use in processing directory values for --with-foo.
+dnl If the path in SHELL_VARIABLE is relative to the prefix, then the
dnl result is relocatable, then this will define the C macro
dnl VARIABLE_RELOCATABLE to 1; otherwise it is defined as 0.
-dnl DEFAULT is the default value, which is used if the user
-dnl does not specify the argument.
-AC_DEFUN([GDB_AC_WITH_DIR], [
- AC_ARG_WITH([$2], AS_HELP_STRING([--with-][$2][=PATH], [$3]), [
- [$1]=$withval], [[$1]=[$4]])
- AC_DEFINE_DIR([$1], [$1], [$3])
- AC_SUBST([$1])
+AC_DEFUN([GDB_AC_DEFINE_RELOCATABLE], [
if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
@@ -429,11 +419,30 @@ AC_DEFUN([GDB_AC_WITH_DIR], [
test_prefix=$exec_prefix
fi
value=0
- case ${ac_define_dir} in
+ case [$3] in
"${test_prefix}"|"${test_prefix}/"*|\
'${exec_prefix}'|'${exec_prefix}/'*)
value=1
;;
esac
AC_DEFINE_UNQUOTED([$1]_RELOCATABLE, $value, [Define if the $2 directory should be relocated when GDB is moved.])
+])
+
+dnl GDB_AC_WITH_DIR([VARIABLE], [ARG-NAME], [HELP], [DEFAULT])
+dnl Add a new --with option that defines a directory.
+dnl The result is stored in VARIABLE. AC_DEFINE_DIR is called
+dnl on this variable, as is AC_SUBST.
+dnl ARG-NAME is the base name of the argument (without "--with").
+dnl HELP is the help text to use.
+dnl If the user's choice is relative to the prefix, then the
+dnl result is relocatable, then this will define the C macro
+dnl VARIABLE_RELOCATABLE to 1; otherwise it is defined as 0.
+dnl DEFAULT is the default value, which is used if the user
+dnl does not specify the argument.
+AC_DEFUN([GDB_AC_WITH_DIR], [
+ AC_ARG_WITH([$2], AS_HELP_STRING([--with-][$2][=PATH], [$3]), [
+ [$1]=$withval], [[$1]=[$4]])
+ AC_DEFINE_DIR([$1], [$1], [$3])
+ AC_SUBST([$1])
+ GDB_AC_DEFINE_RELOCATABLE([$1], [$2], ${ac_define_dir})
])