This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog config.in configure configur ...
- From: palves at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: Thu, 23 May 2013 18:37:00 +0000
- Subject: src/gdb ChangeLog config.in configure configur ...
CVSROOT: /cvs/src
Module name: src
Changes by: palves@sourceware.org 2013-05-23 18:37:00
Modified files:
gdb : ChangeLog config.in configure configure.ac
gdb/common : filestuff.c
Log message:
common/filestuff.c: No sockets on DJGPP.
Building gdb with --host=i586-pc-msdosdjgpp ends up with:
i586-pc-msdosdjgpp-gcc -g -O2 -I../../src/gdb/config/djgpp -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber -I./../intl -I../../src/gdb/gnulib/import -Ibuild-gnulib/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o filestuff.o -MT filestuff.o -MMD -MP -MF .deps/filestuff.Tpo ../../src/gdb/common/filestuff.c
../../src/gdb/common/filestuff.c:38:24: fatal error: sys/socket.h: No such file or directory
There are no sockets on djgpp. This #ifdef's out the bits in the file
that use sockets, depending on whether winsock or sys/socket.h is
available.
As alternative approach, given ser-tcp.c, ser-pipe.c, etc. are split
into separate files, and which to use is selected by configure.ac:
dnl Figure out which of the many generic ser-*.c files the _host_ supports.
SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
case ${host} in
*go32* ) SER_HARDWIRE=ser-go32.o ;;
*djgpp* ) SER_HARDWIRE=ser-go32.o ;;
*mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
esac
AC_SUBST(SER_HARDWIRE)
... I considered splitting filestuff.c similarly. But I quickly gave
up on the idea, as it looked like a lot more complication over this
approach, for no real gain. Plus, there are uses of these functions
outside the ser*.c framework.
gdbserver's configure.ac is already checking for sys/socket.h.
gdb/
2013-05-23 Pedro Alves <palves@redhat.com>
* common/filestuff.c [USE_WIN32API]: Define HAVE_SOCKETS.
[HAVE_SYS_SOCKET_H]: Define HAVE_SOCKETS.
(socket_mark_cloexec, gdb_socketpair_cloexec, gdb_socket_cloexec):
Only define if HAVE_SOCKETS is defined.
* configure.ac: Check for sys/socket.h.
* config.in, configure: Regenerate.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15624&r2=1.15625
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/config.in.diff?cvsroot=src&r1=1.154&r2=1.155
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/configure.diff?cvsroot=src&r1=1.393&r2=1.394
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/configure.ac.diff?cvsroot=src&r1=1.205&r2=1.206
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/common/filestuff.c.diff?cvsroot=src&r1=1.5&r2=1.6