My earlier patch -- commit
c5adaa192 ("Fix creation of stamp-h by
gdb's configure script") -- broke the creation of nm.h. In
particular, configure removes nm.h, so if you touch configure and
rebuild, nothing will re-create the link, breaking the build.
This patch fixes the bug, and also updates configure.ac to use
AC_CONFIG_LINKS, rather than the obsolete AC_LINK_FILES.
Finally, I noticed that gcore is in generated_files in the
Makefile.in. I think this is incorrect, as generated_files is only
needed for files that can be the target of a #include. So, this patch
removes it.
gdb/ChangeLog
2019-10-21 Tom Tromey <tom@tromey.com>
* configure.ac (nm.h): Conditionally create nm.h link. Subst
NM_H. Use AC_CONFIG_LINKS.
* configure: Rebuild.
* Makefile.in (NM_H): New variable.
(generated_files): Add NM_H. Remove gcore.
(nm.h, stamp-nmh): New targets.
Change-Id: I8dd539785d52455e85389425e4bb996c8a127a0e
+2019-10-21 Tom Tromey <tom@tromey.com>
+
+ * configure.ac (nm.h): Conditionally create nm.h link. Subst
+ NM_H. Use AC_CONFIG_LINKS.
+ * configure: Rebuild.
+ * Makefile.in (NM_H): New variable.
+ (generated_files): Add NM_H. Remove gcore.
+ (nm.h, stamp-nmh): New targets.
+
2019-10-20 Tom Tromey <tom@tromey.com>
* objfiles.h (unlink_objfile, put_objfile_before): Don't declare.
MH_CFLAGS = @MH_CFLAGS@
XM_CLIBS = @XM_CLIBS@
NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
+NM_H = @NM_H@
HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
# Native-target dependent makefile fragment comes in here.
generated_files = \
ada-lex.c \
config.h \
- gcore \
jit-reader.h \
- $(NAT_GENERATED_FILES)
+ $(NAT_GENERATED_FILES) \
+ $(NM_H)
# Flags needed to compile Python code
PYTHON_CFLAGS = @PYTHON_CFLAGS@
stamp-h: $(srcdir)/config.in config.status
$(SHELL) config.status config.h
+nm.h: stamp-nmh ; @true
+stamp-nmh: config.status
+ $(SHELL) config.status nm.h
+
config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
GCORE_TRANSFORM_NAME
GDB_TRANSFORM_NAME
XSLTPROC
+NM_H
GDB_NM_FILE
LTLIBBABELTRACE
LIBBABELTRACE
fi
fi
-# If nativefile (NAT_FILE) is not set in configure.nat, we link to an
-# empty version.
-
-files=
-links=
-
+NM_H=
rm -f nm.h
if test "${nativefile}" != ""; then
case "${nativefile}" in
nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
* ) GDB_NM_FILE="${nativefile}"
esac
- files="${files} ${GDB_NM_FILE}"
- links="${links} nm.h"
+ ac_config_links="$ac_config_links nm.h:$GDB_NM_FILE"
+
cat >>confdefs.h <<_ACEOF
#define GDB_NM_FILE "${GDB_NM_FILE}"
_ACEOF
+ NM_H=nm.h
fi
+
for ac_prog in xsltproc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
fi
-ac_sources="$files"
-ac_dests="$links"
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
- ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
-done
-ac_config_links="$ac_config_links $ac_config_links_1"
-
-
# INIT-COMMANDS
#
ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
+GDB_NM_FILE=$GDB_NM_FILE
_ACEOF
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
"depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
"jit-reader.h") CONFIG_FILES="$CONFIG_FILES jit-reader.h:jit-reader.in" ;;
- "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
+ "nm.h") CONFIG_LINKS="$CONFIG_LINKS nm.h:$GDB_NM_FILE" ;;
"gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;;
case $ac_file$ac_mode in
"config.h":H) echo > stamp-h ;;
"depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
+ "nm.h":L) echo > stamp-nmh ;;
"gcore":F) chmod +x gcore ;;
esac
fi
fi
-# If nativefile (NAT_FILE) is not set in configure.nat, we link to an
-# empty version.
-
-files=
-links=
-
+NM_H=
rm -f nm.h
if test "${nativefile}" != ""; then
case "${nativefile}" in
nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
* ) GDB_NM_FILE="${nativefile}"
esac
- files="${files} ${GDB_NM_FILE}"
- links="${links} nm.h"
+ AC_CONFIG_LINKS([nm.h:$GDB_NM_FILE], [echo > stamp-nmh],
+ [GDB_NM_FILE=$GDB_NM_FILE])
AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile])
+ NM_H=nm.h
fi
AC_SUBST(GDB_NM_FILE)
+AC_SUBST(NM_H)
dnl Add dependency for xsltproc if building with maintainer-mode enabled.
AC_PATH_PROGS(XSLTPROC, xsltproc, missing)
fi
AC_SUBST(XSLTPROC)
-AC_LINK_FILES($files, $links)
-
dnl Check for exe extension set on certain hosts (e.g. Win32)
AC_EXEEXT