diff options
author | Doug Evans <dje@google.com> | 2010-05-27 03:40:45 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-05-27 03:40:45 +0000 |
commit | 0c4a40633c767da2c7659a3f460cf1e8e3dd3a5c (patch) | |
tree | 5e04abc4cc89fd32c6532d5d7bdd654af37b4c45 /gdb/acinclude.m4 | |
parent | ec685c5ecafd5bf8876d332a0eb17f206c8d733a (diff) | |
download | gdb-0c4a40633c767da2c7659a3f460cf1e8e3dd3a5c.zip gdb-0c4a40633c767da2c7659a3f460cf1e8e3dd3a5c.tar.gz gdb-0c4a40633c767da2c7659a3f460cf1e8e3dd3a5c.tar.bz2 |
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.m4 | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index e3f604e..1942ef4 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}) ]) |