Fixed compilation with Cygwin

- reverted changes in SVN revision 10985 (-DWIN32 now works again with Cygwin)
- don't link Bochs.exe or RFB gui with wsock32.dll in the Cygwin case
- the win32 gui doesn't need to be linked wsock32.dll at all
This commit is contained in:
Volker Ruppert 2013-12-22 12:17:28 +00:00
parent 3d93ca1b64
commit e3862e34e5
3 changed files with 14 additions and 20 deletions

@ -101,9 +101,9 @@ GUI_LINK_OPTS_SVGA = -lvga -lvgagl
GUI_LINK_OPTS_RFB = @RFB_LIBS@ GUI_LINK_OPTS_RFB = @RFB_LIBS@
GUI_LINK_OPTS_VNCSRV = @GUI_LINK_OPTS_VNCSRV@ GUI_LINK_OPTS_VNCSRV = @GUI_LINK_OPTS_VNCSRV@
GUI_LINK_OPTS_AMIGAOS = GUI_LINK_OPTS_AMIGAOS =
GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -lwsock32 -lshell32 GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -lshell32
GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \ GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \
comdlg32.lib comctl32.lib wsock32.lib advapi32.lib shell32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib
GUI_LINK_OPTS_MACOS = GUI_LINK_OPTS_MACOS =
GUI_LINK_OPTS_CARBON = -framework Carbon GUI_LINK_OPTS_CARBON = -framework Carbon
GUI_LINK_OPTS_NOGUI = GUI_LINK_OPTS_NOGUI =

@ -44,25 +44,16 @@ case "$target" in
DEFAULT_GUI=win32 # default to win32 gui DEFAULT_GUI=win32 # default to win32 gui
MSVC_TARGET=1 MSVC_TARGET=1
;; ;;
*-cygwin*) *-cygwin* | *-mingw32*)
NO_LT=1 # do not use libtool at all on cygwin NO_LT=1 # do not use libtool at all on cygwin
if test "$with_term" = yes; then if test "$with_term" = yes; then
# ncurses won't compile with -mno-cygwin or -DWIN32 # ncurses won't compile with -DWIN32
# also, I can't get it to link without this -DBROKEN_LINKER=1 hack.
# see /usr/include/curses.h for details.
ADD_FLAGS="-DBROKEN_LINKER=1"
fi
;;
*-mingw32*)
NO_LT=1 # do not use libtool at all on cygwin
if test "$with_term" = yes; then
# ncurses won't compile with -mno-cygwin or -DWIN32
# also, I can't get it to link without this -DBROKEN_LINKER=1 hack. # also, I can't get it to link without this -DBROKEN_LINKER=1 hack.
# see /usr/include/curses.h for details. # see /usr/include/curses.h for details.
ADD_FLAGS="-DBROKEN_LINKER=1" ADD_FLAGS="-DBROKEN_LINKER=1"
else else
# default case # default case
ADD_FLAGS="-DWIN32" # required for mingw compile+win32 gui ADD_FLAGS="-DWIN32" # required for cygwin/mingw compile+win32 gui
DEFAULT_GUI=win32 # default to win32 gui DEFAULT_GUI=win32 # default to win32 gui
fi fi
;; ;;
@ -1369,12 +1360,13 @@ AC_SUBST(INSTRUMENT_DIR)
AC_SUBST(INSTRUMENT_VAR) AC_SUBST(INSTRUMENT_VAR)
dnl // serial mode 'socket' needs wsock32.dll in non-plugin mode dnl // serial mode 'socket' needs wsock32.dll in non-plugin mode
dnl // but don't use it with cygwin
if test "$bx_plugins" = 0; then if test "$bx_plugins" = 0; then
case $target in case $target in
*-pc-windows*) *-pc-windows*)
DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS wsock32.lib" DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS wsock32.lib"
;; ;;
*-cygwin* | *-mingw32*) *-mingw32*)
DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwsock32" DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwsock32"
;; ;;
esac esac
@ -2556,16 +2548,18 @@ fi
if test "$with_rfb" = yes; then if test "$with_rfb" = yes; then
# we need the socket function # we need the socket function
case $target in case $target in
*-pc-windows*) *-pc-windows* | *-pc-winnt*)
# is this okay without a check ?
RFB_LIBS="$RFB_LIBS wsock32.lib" RFB_LIBS="$RFB_LIBS wsock32.lib"
have_socket=yes have_socket=yes
;; ;;
*-pc-winnt* | *-cygwin* | *-mingw32*) *-mingw32*)
# is this okay without a check ?
RFB_LIBS="$RFB_LIBS -lwsock32" RFB_LIBS="$RFB_LIBS -lwsock32"
have_socket=yes have_socket=yes
;; ;;
*-cygwin*)
# is this okay without a check ?
have_socket=yes
;;
*) *)
AC_CHECK_FUNCS(socket, have_socket=yes) AC_CHECK_FUNCS(socket, have_socket=yes)
if test "$have_socket" != yes; then if test "$have_socket" != yes; then

@ -77,7 +77,7 @@ GUI_LINK_OPTS_VNCSRV = @GUI_LINK_OPTS_VNCSRV@
GUI_LINK_OPTS_AMIGAOS = GUI_LINK_OPTS_AMIGAOS =
GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32 GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32
GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \ GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \
comdlg32.lib comctl32.lib wsock32.lib comdlg32.lib comctl32.lib
GUI_LINK_OPTS_MACOS = GUI_LINK_OPTS_MACOS =
GUI_LINK_OPTS_CARBON = -framework Carbon GUI_LINK_OPTS_CARBON = -framework Carbon
GUI_LINK_OPTS_NOGUI = GUI_LINK_OPTS_NOGUI =