diff options
author | Tom Tromey <tom@tromey.com> | 2019-10-22 16:22:58 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-01-14 16:25:02 -0700 |
commit | b2ceabe8f0c2056342834b2b3f52f3b015538df3 (patch) | |
tree | 8b4c16a77281523092995fcff85984a7bad6a862 /gdb | |
parent | 25c51f71d5bef8b4b71aa3e35cce974b54cda731 (diff) | |
download | gdb-b2ceabe8f0c2056342834b2b3f52f3b015538df3.zip gdb-b2ceabe8f0c2056342834b2b3f52f3b015538df3.tar.gz gdb-b2ceabe8f0c2056342834b2b3f52f3b015538df3.tar.bz2 |
Consolidate definition of USE_WIN32API
I noticed that USE_WIN32API is defined separately by gdbserver and
gdb. However, because it is used by code in gdbsupport, it should be
defined by common.m4. This approach ensures that the code will
continue to work when it is moved to the top level.
gdb/ChangeLog
2020-01-14 Tom Tromey <tom@tromey.com>
* gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and
USE_WIN32API when needed.
* configure.ac (USE_WIN32API): Don't define.
(WIN32LIBS): Use WIN32APILIBS.
* configure: Rebuild.
gdb/gdbserver/ChangeLog
2020-01-14 Tom Tromey <tom@tromey.com>
* configure.ac (LIBS): Use WIN32APILIBS.
(USE_WIN32API): Don't define.
* configure: Rebuild.
Change-Id: I40d524d5445ebfb452b36f4d0e102f0b1e1089df
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rwxr-xr-x | gdb/configure | 23 | ||||
-rw-r--r-- | gdb/configure.ac | 13 | ||||
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rwxr-xr-x | gdb/gdbserver/configure | 19 | ||||
-rw-r--r-- | gdb/gdbserver/configure.ac | 11 | ||||
-rw-r--r-- | gdb/gdbsupport/common.m4 | 12 |
7 files changed, 55 insertions, 37 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c3a910d..85d7de2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2020-01-14 Tom Tromey <tom@tromey.com> + * gdbsupport/common.m4 (GDB_AC_COMMON): Define WIN32APILIBS and + USE_WIN32API when needed. + * configure.ac (USE_WIN32API): Don't define. + (WIN32LIBS): Use WIN32APILIBS. + * configure: Rebuild. + +2020-01-14 Tom Tromey <tom@tromey.com> + * configure: Rebuild. * gdbsupport/common.m4 (GDB_AC_COMMON): Fix indentation. diff --git a/gdb/configure b/gdb/configure index f9aed98..fe2d887 100755 --- a/gdb/configure +++ b/gdb/configure @@ -688,12 +688,12 @@ TCL_BIN_DIR TCL_PATCH_LEVEL TCL_VERSION WIN32LDAPP +WIN32LIBS GUI_CFLAGS_X LIBGUI LTLIBLZMA LIBLZMA HAVE_LIBLZMA -WIN32LIBS SER_HARDWIRE WERROR_CFLAGS WARN_CFLAGS @@ -13567,6 +13567,16 @@ _ACEOF fi + WIN32APILIBS= + case ${host} in + *mingw32*) + +$as_echo "#define USE_WIN32API 1" >>confdefs.h + + WIN32APILIBS="-lws2_32" + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } @@ -16356,15 +16366,8 @@ if test x"$gdb_cv_os_cygwin" = xyes; then fi # The ser-tcp.c module requires sockets. -case ${host} in - *mingw32*) - -$as_echo "#define USE_WIN32API 1" >>confdefs.h - - WIN32LIBS="$WIN32LIBS -lws2_32" - ;; -esac - +# Note that WIN32APILIBS is set by GDB_AC_COMMON. +WIN32LIBS="$WIN32LIBS $WIN32APILIBS" # Add ELF support to GDB, but only if BFD includes ELF support. diff --git a/gdb/configure.ac b/gdb/configure.ac index ca0da79..a7b744b 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1827,17 +1827,8 @@ if test x"$gdb_cv_os_cygwin" = xyes; then fi # The ser-tcp.c module requires sockets. -case ${host} in - *mingw32*) - AC_DEFINE(USE_WIN32API, 1, - [Define if we should use the Windows API, instead of the - POSIX API. On Windows, we use the Windows API when - building for MinGW, but the POSIX API when building - for Cygwin.]) - WIN32LIBS="$WIN32LIBS -lws2_32" - ;; -esac -AC_SUBST(WIN32LIBS) +# Note that WIN32APILIBS is set by GDB_AC_COMMON. +WIN32LIBS="$WIN32LIBS $WIN32APILIBS" # Add ELF support to GDB, but only if BFD includes ELF support. GDB_AC_CHECK_BFD([for ELF support in BFD], gdb_cv_var_elf, diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0010e27..6d9e314 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,11 @@ 2020-01-14 Tom Tromey <tom@tromey.com> + * configure.ac (LIBS): Use WIN32APILIBS. + (USE_WIN32API): Don't define. + * configure: Rebuild. + +2020-01-14 Tom Tromey <tom@tromey.com> + * configure: Rebuild. 2020-01-13 Simon Marchi <simon.marchi@efficios.com> diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 9d262bf..154eeac 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -6959,6 +6959,16 @@ _ACEOF fi + WIN32APILIBS= + case ${host} in + *mingw32*) + +$as_echo "#define USE_WIN32API 1" >>confdefs.h + + WIN32APILIBS="-lws2_32" + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } @@ -8705,19 +8715,14 @@ esac if test "${srv_mingwce}" = "yes"; then LIBS="$LIBS -lws2" elif test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lws2_32" + # WIN32APILIBS is set by GDB_AC_COMMON. + LIBS="$LIBS $WIN32APILIBS" elif test "${srv_qnx}" = "yes"; then LIBS="$LIBS -lsocket" elif test "${srv_lynxos}" = "yes"; then LIBS="$LIBS -lnetinet" fi -if test "${srv_mingw}" = "yes"; then - -$as_echo "#define USE_WIN32API 1" >>confdefs.h - -fi - if test "${srv_linux_usrregs}" = "yes"; then $as_echo "#define HAVE_LINUX_USRREGS 1" >>confdefs.h diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 817a861..fab765e 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -248,21 +248,14 @@ esac if test "${srv_mingwce}" = "yes"; then LIBS="$LIBS -lws2" elif test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lws2_32" + # WIN32APILIBS is set by GDB_AC_COMMON. + LIBS="$LIBS $WIN32APILIBS" elif test "${srv_qnx}" = "yes"; then LIBS="$LIBS -lsocket" elif test "${srv_lynxos}" = "yes"; then LIBS="$LIBS -lnetinet" fi -if test "${srv_mingw}" = "yes"; then - AC_DEFINE(USE_WIN32API, 1, - [Define if we should use the Windows API, instead of the - POSIX API. On Windows, we use the Windows API when - building for MinGW, but the POSIX API when building - for Cygwin.]) -fi - if test "${srv_linux_usrregs}" = "yes"; then AC_DEFINE(HAVE_LINUX_USRREGS, 1, [Define if the target supports PTRACE_PEEKUSR for register ] diff --git a/gdb/gdbsupport/common.m4 b/gdb/gdbsupport/common.m4 index f070de3..9e15940 100644 --- a/gdb/gdbsupport/common.m4 +++ b/gdb/gdbsupport/common.m4 @@ -21,6 +21,18 @@ AC_DEFUN([GDB_AC_COMMON], [ AC_HEADER_STDC AC_FUNC_ALLOCA + WIN32APILIBS= + case ${host} in + *mingw32*) + AC_DEFINE(USE_WIN32API, 1, + [Define if we should use the Windows API, instead of the + POSIX API. On Windows, we use the Windows API when + building for MinGW, but the POSIX API when building + for Cygwin.]) + WIN32APILIBS="-lws2_32" + ;; + esac + dnl Note that this requires codeset.m4, which is included dnl by the users of common.m4. AM_LANGINFO_CODESET |