2012-01-16 Doug Evans * Makefile.in (TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_DEFINE): Delete. (main.o): Remove rule. * configure.ac (BINDIR): Define in config.h. (--with-sysroot): Define using GDB_AC_WITH_DIR. * configure: Regenerate. * config.in: Regenerate. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.1186 diff -u -p -r1.1186 Makefile.in --- Makefile.in 10 Jan 2012 16:30:43 -0000 1.1186 +++ Makefile.in 17 Jan 2012 06:42:31 -0000 @@ -166,10 +166,6 @@ INTL = @LIBINTL@ INTL_DEPS = @LIBINTL_DEP@ INTL_CFLAGS = @INCINTL@ -# Did the user give us a --with-sysroot option? -TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ -TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ - # Did the user give us a --with-gdb-datadir option? GDB_DATADIR = @GDB_DATADIR@ @@ -1518,11 +1514,6 @@ ALLDEPFILES = \ # Some files need explicit build rules (due to -Werror problems) or due # to sub-directory fun 'n' games. -# main.o needs an explicit build rule to get TARGET_SYSTEM_ROOT and BINDIR. -main.o: $(srcdir)/main.c - $(COMPILE) $(TARGET_SYSTEM_ROOT_DEFINE) -DBINDIR=\"$(bindir)\" $(srcdir)/main.c - $(POSTCOMPILE) - # FIXME: cagney/2003-08-10: "monitor.c" gets -Wformat-nonliteral # errors. It turns out that that is the least of monitor.c's # problems. The function print_vsprintf appears to be using Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.152 diff -u -p -r1.152 configure.ac --- configure.ac 4 Jan 2012 08:17:00 -0000 1.152 +++ configure.ac 17 Jan 2012 06:42:32 -0000 @@ -125,6 +125,14 @@ GDB_AC_WITH_DIR(DEBUGDIR, separate-debug [look for global separate debug info in this path @<:@LIBDIR/debug@:>@], [${libdir}/debug]) +# We can't pass paths as command line arguments. +# Mingw32 tries to be clever and will convert the paths for us. +# For example -DBINDIR="/usr/local/bin" passed on the command line may get +# converted to -DBINDIR="E:/msys/mingw32/msys/1.0/local/bin". +# This breaks GDB's relocatable path conversions since paths passed in +# config.h do not get so translated. +AC_DEFINE_DIR(BINDIR, bindir, [Directory of programs.]) + # GDB's datadir relocation GDB_AC_WITH_DIR(GDB_DATADIR, gdb-datadir, @@ -1753,42 +1761,12 @@ 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]), -[ - case ${with_sysroot} in - yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;; - *) TARGET_SYSTEM_ROOT=$with_sysroot ;; - esac - - TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' - - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - 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 ${TARGET_SYSTEM_ROOT} in - "${test_prefix}"|"${test_prefix}/"*|\ - "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ - '${prefix}'|'${prefix}/'*|\ - '${exec_prefix}'|'${exec_prefix}/'*) - 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) +if test "x$with_sysroot" = xyes; then + with_sysroot="${exec_prefix}/${target_alias}/sys-root" +fi +GDB_AC_WITH_DIR(TARGET_SYSTEM_ROOT, sysroot, + [search for usr/lib et al within PATH], + []) GDB_AC_WITH_DIR(SYSTEM_GDBINIT, system-gdbinit, [automatically load a system-wide gdbinit file],