+2014-06-12 Tom Tromey <tromey@redhat.com>
+
+ * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
+ * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
+ (parse_debug_format_options): Likewise.
+ (gdbserver_usage): Likewise.
+ * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
+ (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
+ (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
+ against libiberty.
+ ($(LIBGNU)): Depend on libiberty.
+ (all-lib): Recurse into all subdirs.
+ (install-only): Invoke "install" target in subdirs.
+ (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
+ targets.
+ * configure: Rebuild.
+ * configure.ac: Add ACX_CONFIGURE_DIR for libiberty. Don't check
+ for vasprintf, vsnprintf, or gettimeofday.
+ * configure.srv: Don't add safe-ctype.o or lbasename.o to
+ srv_tgtobj.
+
2014-06-05 Joel Brobecker <brobecker@adacore.com>
* development.sh: Delete.
INCLUDE_DIR = ${srcdir}/../../include
INCLUDE_DEP = $$(INCLUDE_DIR)
+LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
+LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
+
# Where is ust? These will be empty if ust was not available.
ustlibs = @ustlibs@
ustinc = @ustinc@
IPA_DEPFILES = @IPA_DEPFILES@
extra_libraries = @extra_libraries@
-SUBDIRS = $(GNULIB_BUILDDIR)
+SUBDIRS = $(GNULIB_BUILDDIR) $(LIBIBERTY_BUILDDIR)
CLEANDIRS = $(SUBDIRS)
# List of subdirectories in the build tree that must exist.
# This is used to force build failures in existing trees when
# a new directory is added.
# The format here is for the `case' shell command.
-REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR)
+REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
fi; \
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
$(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
- @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
+ # Note that we run install and not install-only, as the latter
+ # is not part of GNU standards and in particular not provided
+ # in libiberty.
+ @$(MAKE) $(FLAGS_TO_PASS) DO=install "DODIRS=$(SUBDIRS)" subdir_do
uninstall: force
n=`echo gdbserver | sed '$(program_transform_name)'`; \
clean-info: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
-gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU)
+gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY)
rm -f gdbserver$(EXEEXT)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
- $(LIBGNU) $(GDBSERVER_LIBS) $(XM_CLIBS)
+ $(LIBGNU) $(LIBIBERTY) $(GDBSERVER_LIBS) $(XM_CLIBS)
-$(LIBGNU) $(GNULIB_H): all-lib
-all-lib: $(GNULIB_BUILDDIR)/Makefile
- @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do
+$(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
+all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
+ @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS="$(SUBDIRS)" subdir_do
.PHONY: all-lib
-gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU)
+gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY)
rm -f gdbreplay$(EXEEXT)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
- $(XM_CLIBS) $(LIBGNU)
+ $(XM_CLIBS) $(LIBGNU) $(LIBIBERTY)
IPA_OBJS=ax-ipa.o tracepoint-ipa.o format-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o tdesc-ipa.o print-utils-ipa.o rsp-low-ipa.o ${IPA_DEPFILES}
$(COMPILE) $<
$(POSTCOMPILE)
-# We build vasprintf with -DHAVE_CONFIG_H because we want that unit to
-# include our config.h file. Otherwise, some system headers do not get
-# included, and the compiler emits a warning about implicitly defined
-# functions (missing declaration).
-vasprintf.o: $(srcdir)/../../libiberty/vasprintf.c
- $(COMPILE) $< -DHAVE_CONFIG_H
- $(POSTCOMPILE)
-vsnprintf.o: $(srcdir)/../../libiberty/vsnprintf.c
- $(COMPILE) $<
- $(POSTCOMPILE)
-safe-ctype.o: $(srcdir)/../../libiberty/safe-ctype.c
- $(COMPILE) $<
- $(POSTCOMPILE)
-lbasename.o: $(srcdir)/../../libiberty/lbasename.c
- $(COMPILE) $<
- $(POSTCOMPILE)
-
aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
cd "$ac_popdir"
+
+ in_src="../../libiberty"
+ in_build="build-libiberty-gdbserver"
+
+ # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+ # so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ eval "set x $ac_configure_args"
+ shift
+ for ac_arg
+ do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+ --disable-option-checking)
+ ;;
+ *)
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+ esac
+ done
+
+ # Always prepend --prefix to ensure using the same prefix
+ # in subdir configurations.
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+ # Pass --silent
+ if test "$silent" = yes; then
+ ac_sub_configure_args="--silent $ac_sub_configure_args"
+ fi
+
+ # Always prepend --disable-option-checking to silence warnings, since
+ # different subdirs can have different --enable and --with options.
+ ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+ ac_popdir=`pwd`
+ ac_dir=$in_build
+
+ ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+ $as_echo "$ac_msg" >&6
+ as_dir="$ac_dir"; as_fn_mkdir_p
+
+ case $srcdir in
+ [\\/]* | ?:[\\/]* )
+ ac_srcdir=$srcdir/$in_src ;;
+ *) # Relative name.
+ ac_srcdir=../$srcdir/$in_src ;;
+ esac
+
+ cd "$ac_dir"
+
+ ac_sub_configure=$ac_srcdir/configure
+
+ # Make the cache file name correct relative to the subdirectory.
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+ *) # Relative name.
+ ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+ # The eval makes quoting arguments work.
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ as_fn_error "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+
+ cd "$ac_popdir"
+
+
for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h linux/elf.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
done
-for ac_func in gettimeofday pread pwrite pread64 readlink
+for ac_func in pread pwrite pread64 readlink
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
# build it in the same directory, when building in the source dir.
ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])
+ACX_CONFIGURE_DIR(["../../libiberty"], ["build-libiberty-gdbserver"])
+
AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
proc_service.h sys/procfs.h linux/elf.h dnl
errno.h fcntl.h signal.h sys/file.h malloc.h dnl
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
netinet/tcp.h arpa/inet.h)
-AC_CHECK_FUNCS(gettimeofday pread pwrite pread64 readlink)
+AC_CHECK_FUNCS(pread pwrite pread64 readlink)
AC_REPLACE_FUNCS(vasprintf vsnprintf)
GDB_AC_COMMON
;;
arm*-*-mingw32ce*) srv_regobj=reg-arm.o
srv_tgtobj="win32-low.o win32-arm-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_tgtobj="${srv_tgtobj} wincecompat.o"
# hostio_last_error implementation is in win32-low.c
srv_hostio_err_objs=""
;;
i[34567]86-*-cygwin*) srv_regobj="$srv_i386_regobj"
srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_xmlfiles="$srv_i386_xmlfiles"
;;
i[34567]86-*-linux*) srv_regobj="$srv_i386_linux_regobj"
i[34567]86-*-mingw32ce*)
srv_regobj="$srv_i386_regobj"
srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_tgtobj="${srv_tgtobj} wincecompat.o"
srv_xmlfiles="$srv_i386_xmlfiles"
# hostio_last_error implementation is in win32-low.c
;;
i[34567]86-*-mingw*) srv_regobj="$srv_i386_regobj"
srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_xmlfiles="$srv_i386_xmlfiles"
srv_mingw=yes
;;
;;
x86_64-*-mingw*) srv_regobj="$srv_amd64_regobj"
srv_tgtobj="i386-low.o i387-fp.o win32-low.o win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_xmlfiles="$srv_i386_xmlfiles $srv_amd64_xmlfiles"
srv_mingw=yes
;;
x86_64-*-cygwin*) srv_regobj="$srv_amd64_regobj"
srv_tgtobj="i386-low.o i387-fp.o win32-low.o win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} safe-ctype.o lbasename.o"
srv_xmlfiles="$srv_i386_xmlfiles"
;;
debug_printf (const char *msg, ...)
{
va_list args;
-#if defined (HAVE_GETTIMEOFDAY) && !defined (IN_PROCESS_AGENT)
+#if !defined (IN_PROCESS_AGENT)
/* N.B. Not thread safe, and can't be used, as is, with IPA. */
static int new_line = 1;
vfprintf (stderr, msg, args);
va_end (args);
-#if defined (HAVE_GETTIMEOFDAY) && !defined (IN_PROCESS_AGENT)
+#if !defined (IN_PROCESS_AGENT)
if (*msg)
new_line = msg[strlen (msg) - 1] == '\n';
#endif
monitor_output (" set debug-format option1[,option2,...]\n");
monitor_output (" Add additional information to debugging messages\n");
monitor_output (" Options: all, none");
-#ifdef HAVE_GETTIMEOFDAY
monitor_output (", timestamp");
-#endif
monitor_output ("\n");
monitor_output (" exit\n");
monitor_output (" Quit GDBserver\n");
if (is_monitor)
monitor_output ("All extra debug format options disabled.\n");
}
-#ifdef HAVE_GETTIMEOFDAY
else if (strcmp (option, "timestamp") == 0)
{
debug_timestamp = 1;
if (is_monitor)
monitor_output ("Timestamps will be added to debug output.\n");
}
-#endif
else if (*option == '\0')
{
/* An empty option, e.g., "--debug-format=foo,,bar", is ignored. */
" Options:\n"
" all\n"
" none\n"
-#ifdef HAVE_GETTIMEOFDAY
" timestamp\n"
-#endif
" --remote-debug Enable remote protocol debugging output.\n"
" --version Display version information and exit.\n"
" --wrapper WRAPPER -- Run WRAPPER to start new programs.\n"