summaryrefslogtreecommitdiff
path: root/gdb/acinclude.m4
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-04-23 21:28:16 +0000
committerTom Tromey <tromey@redhat.com>2009-04-23 21:28:16 +0000
commit7cf3956abffb5b35508e4d2dcda4a170819458cf (patch)
tree11257bbb0033f85ab45c5a68645ae114eda71cd5 /gdb/acinclude.m4
parent74d014327a14fc6f8e891e1544514341e347f9cb (diff)
downloadgdb-7cf3956abffb5b35508e4d2dcda4a170819458cf.tar.gz
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 932dd4f3909..d1f71c185bc 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.])
+ ])