From 95346323af30bf0b2cec5e159574fbd8bf80283b Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Fri, 25 Apr 2014 16:07:26 +0000 Subject: [PATCH] Added MSVC nmake support for the gui plugins nogui, rfb and win32. Updated comments about DLL plugins in makefiles --- bochs/gui/Makefile.in | 31 +++++++++++++++++-------------- bochs/iodev/Makefile.in | 4 ++-- bochs/iodev/display/Makefile.in | 4 ++-- bochs/iodev/hdimage/Makefile.in | 4 ++-- bochs/iodev/network/Makefile.in | 4 ++-- bochs/iodev/sound/Makefile.in | 4 ++-- bochs/iodev/usb/Makefile.in | 4 ++-- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/bochs/gui/Makefile.in b/bochs/gui/Makefile.in index 98723126b..80b356c89 100644 --- a/bochs/gui/Makefile.in +++ b/bochs/gui/Makefile.in @@ -72,12 +72,12 @@ X_PRE_LIBS = @X_PRE_LIBS@ GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs` GUI_LINK_OPTS_SVGA = -lvga -lvgagl -GUI_LINK_OPTS_RFB = @RFB_LIBS@ +RFB_LINK_OPTS = @RFB_LIBS@ +RFB_LINK_OPTS_VCPP = user32.lib @RFB_LIBS@ GUI_LINK_OPTS_VNCSRV = @GUI_LINK_OPTS_VNCSRV@ GUI_LINK_OPTS_AMIGAOS = -GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \ - comdlg32.lib comctl32.lib +WIN32_LINK_OPTS = -luser32 -lgdi32 -lcomdlg32 -lcomctl32 +WIN32_LINK_OPTS_VCPP = user32.lib gdi32.lib winmm.lib comdlg32.lib comctl32.lib GUI_LINK_OPTS_MACOS = GUI_LINK_OPTS_CARBON = -framework Carbon GUI_LINK_OPTS_NOGUI = @@ -98,9 +98,7 @@ plugins: @PLUGIN_TARGET_2@ plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@) -plugins_msvc: - @echo ERROR: MSVC nmake plugins not yet supported - @exit 1 +plugins_msvc: bx_nogui.dll bx_rfb.dll bx_win32.dll libgui.a: $(NONPLUGIN_OBJS) @RMCOMMAND@ libgui.a @@ -155,9 +153,9 @@ libbx_term.la: term.lo libbx_wx.la: $(GUI_OBJS_WX:.o=.lo) $(GUI_OBJS_WX_SUPPORT:.o=.lo) $(LIBTOOL) --mode=link --tag CXX $(CXX) -module $(GUI_OBJS_WX:.o=.lo) $(GUI_OBJS_WX_SUPPORT:.o=.lo) -o libbx_wx.la -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_WX) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o - $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_WIN32) + $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) $(WIN32_LINK_OPTS) bx_wx.dll: $(GUI_OBJS_WX) $(GUI_OBJS_WX_SUPPORT) $(CXX) $(CXXFLAGS) -shared -o bx_wx.dll $(GUI_OBJS_WX) $(GUI_OBJS_WX_SUPPORT) $(WIN32_DLL_IMPORT_LIBRARY) `wx-config --libs` -luser32 -lgdi32 -lcomdlg32 -lcomctl32 @@ -165,18 +163,23 @@ bx_wx.dll: $(GUI_OBJS_WX) $(GUI_OBJS_WX_SUPPORT) bx_sdl.dll: $(GUI_OBJS_SDL) $(CXX) $(CXXFLAGS) -shared -o bx_sdl.dll $(GUI_OBJS_SDL) $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_SDL) -bx_rfb.dll: $(GUI_OBJS_RFB) - $(CXX) $(CXXFLAGS) -shared -o bx_rfb.dll $(GUI_OBJS_RFB) $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_RFB) - bx_vncsrv.dll: $(GUI_OBJS_VNCSRV) $(CXX) $(CXXFLAGS) -shared -o bx_vncsrv.dll $(GUI_OBJS_VNCSRV) $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_VNCSRV) -# no need to build DLLs for x.o +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake +bx_nogui.dll: $(GUI_OBJS_NOGUI) + @LINK_DLL@ $(GUI_OBJS_NOGUI) $(WIN32_DLL_IMPORT_LIBRARY) + +bx_rfb.dll: $(GUI_OBJS_RFB) + @LINK_DLL@ $(GUI_OBJS_RFB) $(WIN32_DLL_IMPORT_LIBRARY) $(RFB_LINK_OPTS@LINK_VAR@) + +bx_win32.dll: $(GUI_OBJS_WIN32) + @LINK_DLL@ $(GUI_OBJS_WIN32) $(WIN32_DLL_IMPORT_LIBRARY) $(WIN32_LINK_OPTS@LINK_VAR@) ##### end DLL section clean: - @RMCOMMAND@ -rf .libs *.la *.a *.lo *.o *.dll + @RMCOMMAND@ -rf .libs *.la *.a *.lo *.o *.dll *.exp *.lib dist-clean: clean @RMCOMMAND@ Makefile diff --git a/bochs/iodev/Makefile.in b/bochs/iodev/Makefile.in index 104c456ba..1035adf09 100644 --- a/bochs/iodev/Makefile.in +++ b/bochs/iodev/Makefile.in @@ -137,11 +137,11 @@ libbx_pit.la: pit82c54.lo pit.lo libbx_serial.la: serial.lo serial_raw.lo $(LIBTOOL) --mode=link --tag CXX $(CXX) -module serial.lo serial_raw.lo -o libbx_serial.la -rpath $(PLUGIN_PATH) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_keyboard.dll: keyboard.o scancodes.o @LINK_DLL@ keyboard.o scancodes.o $(WIN32_DLL_IMPORT_LIBRARY) diff --git a/bochs/iodev/display/Makefile.in b/bochs/iodev/display/Makefile.in index 51f9641d0..ca56337df 100644 --- a/bochs/iodev/display/Makefile.in +++ b/bochs/iodev/display/Makefile.in @@ -95,11 +95,11 @@ libbx_vga.la: vga.lo vgacore.lo libbx_svga_cirrus.la: svga_cirrus.lo vgacore.lo $(LIBTOOL) --mode=link --tag CXX $(CXX) -module svga_cirrus.lo vgacore.lo -o libbx_svga_cirrus.la -rpath $(PLUGIN_PATH) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_vga.dll: vga.o vgacore.o @LINK_DLL@ vga.o vgacore.o $(WIN32_DLL_IMPORT_LIBRARY) diff --git a/bochs/iodev/hdimage/Makefile.in b/bochs/iodev/hdimage/Makefile.in index ddf4798e1..cd8943c50 100644 --- a/bochs/iodev/hdimage/Makefile.in +++ b/bochs/iodev/hdimage/Makefile.in @@ -96,11 +96,11 @@ libbx_%.la: %.lo libbx_hdimage.la: hdimage.lo vmware3.lo vmware4.lo vvfat.lo vpc-img.lo $(CDROM_OBJS:.o=.lo) $(LIBTOOL) --mode=link --tag CXX $(CXX) -module hdimage.lo vmware3.lo vmware4.lo vvfat.lo vpc-img.lo $(CDROM_OBJS:.o=.lo) -o libbx_hdimage.la -rpath $(PLUGIN_PATH) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_hdimage.dll: hdimage.o $(HDIMAGE_EXTRA_OBJS) $(CDROM_OBJS) @LINK_DLL@ hdimage.o $(HDIMAGE_EXTRA_OBJS) $(CDROM_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(HDIMAGE_LINK_OPTS@LINK_VAR@) diff --git a/bochs/iodev/network/Makefile.in b/bochs/iodev/network/Makefile.in index cb098c762..f013f56d4 100644 --- a/bochs/iodev/network/Makefile.in +++ b/bochs/iodev/network/Makefile.in @@ -119,11 +119,11 @@ libbx_%.la: %.lo libbx_netmod.la: netmod.lo $(NETLOW_OBJS:.o=.lo) $(LIBTOOL) --mode=link --tag CXX $(CXX) -module netmod.lo $(NETLOW_OBJS:.o=.lo) -o libbx_netmod.la -rpath $(PLUGIN_PATH) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_netmod.dll: netmod.o $(NETLOW_OBJS) @LINK_DLL@ netmod.o $(NETLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(NETMOD_LINK_OPTS@LINK_VAR@) diff --git a/bochs/iodev/sound/Makefile.in b/bochs/iodev/sound/Makefile.in index d7e50f9b8..1b560abd0 100644 --- a/bochs/iodev/sound/Makefile.in +++ b/bochs/iodev/sound/Makefile.in @@ -98,11 +98,11 @@ libbx_%.la: %.lo libbx_soundmod.la: soundmod.lo $(SOUNDLOW_OBJS:.o=.lo) $(LIBTOOL) --mode=link --tag CXX $(CXX) -module soundmod.lo $(SOUNDLOW_OBJS:.o=.lo) -o libbx_soundmod.la -rpath $(PLUGIN_PATH) $(SOUND_LINK_OPTS) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_soundmod.dll: soundmod.o $(SOUNDLOW_OBJS) @LINK_DLL@ soundmod.o $(SOUNDLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(SOUNDMOD_LINK_OPTS@LINK_VAR@) diff --git a/bochs/iodev/usb/Makefile.in b/bochs/iodev/usb/Makefile.in index 16ef00a99..90e09fb1b 100644 --- a/bochs/iodev/usb/Makefile.in +++ b/bochs/iodev/usb/Makefile.in @@ -96,11 +96,11 @@ libbx_%.la: %.lo libbx_usb_common.la: usb_common.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo $(LIBTOOL) --mode=link --tag CXX $(CXX) -module usb_common.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo -o libbx_usb_common.la -rpath $(PLUGIN_PATH) -#### building DLLs for win32 (tested on cygwin only) +#### building DLLs for win32 (Cygwin and MinGW/MSYS) bx_%.dll: %.o $(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) -# special link rules for plugins that require more than one object file +# special link rules for plugins with Cygwin, MinGW/MSYS and MSVC nmake bx_usb_common.dll: usb_common.o $(USBDEV_OBJS) scsi_device.o @LINK_DLL@ usb_common.o $(USBDEV_OBJS) scsi_device.o $(WIN32_DLL_IMPORT_LIBRARY)