aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
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/configure.ac
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/configure.ac')
-rw-r--r--gdb/configure.ac69
1 files changed, 15 insertions, 54 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 4c2768d..af396cc 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -92,31 +92,15 @@ AC_SUBST(PACKAGE)
# generate its Makefile.in.
AM_INIT_AUTOMAKE(gdb, UNUSED-VERSION, [no-define])
-debugdir=${libdir}/debug
-
-AC_ARG_WITH(separate-debug-dir,
-[AS_HELP_STRING([--with-separate-debug-dir=PATH], [look for global separate debug info in this path [LIBDIR/debug]])],
-[debugdir="${withval}"])
-
-AC_DEFINE_DIR(DEBUGDIR, debugdir,
- [Global directory for separate debug files. ])
-#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
-
-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
-case ${debugdir} in
-"${test_prefix}"|"${test_prefix}/"*|\
-'${exec_prefix}'|'${exec_prefix}/'*)
- AC_DEFINE(DEBUGDIR_RELOCATABLE, 1, [Define if the debug directory should be relocated when GDB is moved.])
- ;;
-esac
+GDB_AC_WITH_DIR(DEBUGDIR, separate-debug-dir,
+ [look for global separate debug info in this path @<:@LIBDIR/debug@:>@],
+ [${libdir}/debug])
+
+# GDB's datadir relocation
+
+GDB_AC_WITH_DIR(GDB_DATADIR, gdb-datadir,
+ [look for global separate data files in this path @<:@DATADIR/gdb@:>@],
+ [${datadir}/gdb])
AC_ARG_WITH(relocated-sources,
AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this path for source files]),
@@ -1479,6 +1463,7 @@ fi
dnl Handle optional features that can be enabled.
+target_sysroot_reloc=0
AC_ARG_WITH(sysroot,
AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [search for usr/lib et al within DIR]),
[
@@ -1504,44 +1489,20 @@ AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [search for usr/lib et al within DI
"${test_exec_prefix}"|"${test_exec_prefix}/"*|\
'${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
- t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
- TARGET_SYSTEM_ROOT_DEFINE="$t"
+ target_sysroot_reloc=1
;;
esac
], [
TARGET_SYSTEM_ROOT=
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
])
+TARGET_SYSTEM_ROOT_DEFINE="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE=$target_sysroot_reloc"
AC_SUBST(TARGET_SYSTEM_ROOT)
AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
-system_gdbinit=
-AC_ARG_WITH(system-gdbinit,
-AS_HELP_STRING([--with-system-gdbinit=FILE], [automatically load a system-wide gdbinit file]),
-[system_gdbinit=${withval}])
-
-AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
- [System-wide gdbinit file.])
-
-if test "x$prefix" = xNONE; then
- test_prefix=$ac_default_prefix
-else
- test_prefix=$prefix
-fi
-if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
- test_exec_prefix=$test_prefix
-else
- test_exec_prefix=$exec_prefix
-fi
-case ${system_gdbinit} in
- "${test_prefix}"|"${test_prefix}/"*|\
- "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
- '${prefix}'|'${prefix}/'*|\
- '${exec_prefix}'|'${exec_prefix}/'*)
- AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
- [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
- ;;
-esac
+GDB_AC_WITH_DIR(SYSTEM_GDBINIT, system-gdbinit,
+ [automatically load a system-wide gdbinit file],
+ [])
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]),