aboutsummaryrefslogtreecommitdiff
path: root/gdb/acinclude.m4
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-04-23 21:28:20 +0000
committerTom Tromey <tromey@redhat.com>2009-04-23 21:28:20 +0000
commitb14b1491f237a685a00ba669fb8410ae9ee7f648 (patch)
tree0d95cea6581f1777f0f83662fa7ae9840cdfd805 /gdb/acinclude.m4
parent5e7b5f74c234fb11db064df93e309463a9058740 (diff)
downloadgdb-b14b1491f237a685a00ba669fb8410ae9ee7f648.zip
gdb-b14b1491f237a685a00ba669fb8410ae9ee7f648.tar.gz
gdb-b14b1491f237a685a00ba669fb8410ae9ee7f648.tar.bz2
gdb
2009-04-23 Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com> Tom Tromey <tromey@redhat.com> * configure, config.in: Regenerate. * configure.ac: Support for relocatable GDB datadir. Use GDB_AC_WITH_DIR. Always define TARGET_SYSTEM_ROOT_RELOCATABLE. * acinclude.m4 (GDB_AC_WITH_DIR): New defun. * top.c (init_main): Add "set data-directory". * defs.h (gdb_datadir): Declare. * main.c (gdb_datadir): New global. (captured_main): Initialize gdb_datadir. Use relocate_directory. (relocate_path): New function. (relocate_directory): Likewise. (get_init_files): Use relocate_path. (README): Mention --with-gdb-datadir. gdb/doc 2009-04-23 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Data Files): New node. (GDB Files): Update menu.
Diffstat (limited to 'gdb/acinclude.m4')
-rw-r--r--gdb/acinclude.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 932dd4f..d1f71c1 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -387,3 +387,38 @@ AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
AC_MSG_RESULT(${private_dir})
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 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])
+ if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ value=0
+ case ${ac_define_dir} 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.])
+ ])