Next step for plugin support with MSVC nmake: device plugins that need special

rules can be built now (keyboard, pit, gameport, serial, vga, svga_cirrus,
hdimage, netmod, soundmod, usb_common). The generated DLLs are usable with the
BOCHS.EXE built with the IDE, but the nmake won't work at all yet.
This commit is contained in:
Volker Ruppert 2014-04-21 18:43:22 +00:00
parent 774e66b9c5
commit eb484919fe
9 changed files with 47 additions and 31 deletions

View File

@ -2335,7 +2335,7 @@ if test "$with_wx" = yes; then
case $target in
*-pc-windows* | *-cygwin* | *-mingw32*)
EXTRA_BX_OBJS="$EXTRA_BX_OBJS wxbochs_resources.o"
GUI_LINK_OPTS_WX="$GUI_LINK_OPTS_WX --subsystem,windows -mwindows"
GUI_LINK_OPTS_WX="$GUI_LINK_OPTS_WX"
;;
*)
# This is required for XStringToKeysym
@ -2447,6 +2447,7 @@ case "$target" in
CFLAGS="/nologo /MD /W3 /EHs-c- /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS $C_OPT"
WIN32_DLL_IMPORT_LIB="bochs.lib"
LINK_DLL="link /dll /nologo /subsystem:console /incremental:no /out:\$@"
LINK_VAR="_VCPP"
else
CFLAGS="/nologo /MT /W3 /EHs-c- /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS $C_OPT"
fi
@ -2907,6 +2908,7 @@ AC_SUBST(RMCOMMAND)
AC_SUBST(LINK)
AC_SUBST(LINK_CONSOLE)
AC_SUBST(LINK_DLL)
AC_SUBST(LINK_VAR)
AC_SUBST(EXE)
AC_SUBST(PRIMARY_TARGET)
AC_SUBST(OPTIONAL_TARGET)

View File

@ -48,7 +48,7 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../@WIN32_DLL_IMPORT_LIB@
BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev -I../@INSTRUMENT_DIR@ -I$(srcdir)/../@INSTRUMENT_DIR@
GUI_OBJS_X11 = x.o

View File

@ -47,11 +47,16 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../@WIN32_DLL_IMPORT_LIB@
BX_INCDIRS = -I.. -I$(srcdir)/.. -I../@INSTRUMENT_DIR@ -I$(srcdir)/../@INSTRUMENT_DIR@
LOCAL_CXXFLAGS = $(MCH_CFLAGS)
GAME_LINK_OPTS = -lwinmm
GAME_LINK_OPTS_VCPP = winmm.lib
SER_LINK_OPTS = -lws2_32
SER_LINK_OPTS_VCPP = user32.lib ws2_32.lib
PCIDEV_CXXFLAGS = -I$(srcdir)/../host/linux/pcidev
OBJS_THAT_CANNOT_BE_PLUGINS = \
@ -94,8 +99,8 @@ plugins: @PLUGIN_TARGET_2@
plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
plugins_msvc:
@echo ERROR: MSVC nmake plugins not yet supported
plugins_msvc: bx_keyboard.dll bx_pit.dll bx_gameport.dll bx_serial.dll
@echo ERROR: MSVC nmake plugin support not yet complete
@exit 1
libiodev.a: $(NONPLUGIN_OBJS)
@ -136,16 +141,16 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_keyboard.dll: keyboard.o scancodes.o
$(CXX) $(CXXFLAGS) -shared -o bx_keyboard.dll keyboard.o scancodes.o $(WIN32_DLL_IMPORT_LIBRARY)
@LINK_DLL@ keyboard.o scancodes.o $(WIN32_DLL_IMPORT_LIBRARY)
bx_pit.dll: pit82c54.o pit.o
$(CXX) $(CXXFLAGS) -shared -o bx_pit.dll pit82c54.o pit.o $(WIN32_DLL_IMPORT_LIBRARY)
@LINK_DLL@ pit82c54.o pit.o $(WIN32_DLL_IMPORT_LIBRARY)
bx_gameport.dll: gameport.o
$(CXX) $(CXXFLAGS) -shared -o bx_gameport.dll gameport.o $(WIN32_DLL_IMPORT_LIBRARY) -lwinmm
@LINK_DLL@ gameport.o $(WIN32_DLL_IMPORT_LIBRARY) $(GAME_LINK_OPTS@LINK_VAR@)
bx_serial.dll: serial.o serial_raw.o
$(CXX) $(CXXFLAGS) -shared -o bx_serial.dll serial.o serial_raw.o $(WIN32_DLL_IMPORT_LIBRARY) -lws2_32
@LINK_DLL@ serial.o serial_raw.o $(WIN32_DLL_IMPORT_LIBRARY) $(SER_LINK_OPTS@LINK_VAR@)
##### end DLL section

View File

@ -47,7 +47,7 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ../..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../../@WIN32_DLL_IMPORT_LIB@
DISPLAY_OBJS = @DISPLAY_OBJS@
@ -70,8 +70,8 @@ plugins: @PLUGIN_TARGET_2@
plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
plugins_msvc:
@echo ERROR: MSVC nmake plugins not yet supported
plugins_msvc: bx_vga.dll bx_svga_cirrus.dll
@echo ERROR: MSVC nmake plugin support not yet complete
@exit 1
libdisplay.a: $(NONPLUGIN_OBJS)
@ -103,10 +103,10 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_vga.dll: vga.o vgacore.o
$(CXX) $(CXXFLAGS) -shared -o bx_vga.dll vga.o vgacore.o $(WIN32_DLL_IMPORT_LIBRARY)
@LINK_DLL@ vga.o vgacore.o $(WIN32_DLL_IMPORT_LIBRARY)
bx_svga_cirrus.dll: svga_cirrus.o vgacore.o
$(CXX) $(CXXFLAGS) -shared -o bx_svga_cirrus.dll svga_cirrus.o vgacore.o $(WIN32_DLL_IMPORT_LIBRARY)
@LINK_DLL@ svga_cirrus.o vgacore.o $(WIN32_DLL_IMPORT_LIBRARY)
##### end DLL section

View File

@ -52,6 +52,9 @@ WIN32_DLL_IMPORT_LIBRARY=../../@WIN32_DLL_IMPORT_LIB@
CDROM_OBJS = @CDROM_OBJS@
HDIMAGE_EXTRA_OBJS = vmware3.o vmware4.o vpc-img.o vvfat.o
HDIMAGE_LINK_OPTS =
HDIMAGE_LINK_OPTS_VCPP = user32.lib
BX_INCDIRS = -I.. -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. -I../../@INSTRUMENT_DIR@ -I$(srcdir)/../../@INSTRUMENT_DIR@
LOCAL_CXXFLAGS = $(MCH_CFLAGS)
@ -99,7 +102,7 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_hdimage.dll: hdimage.o $(HDIMAGE_EXTRA_OBJS) $(CDROM_OBJS)
@LINK_DLL@ hdimage.o $(HDIMAGE_EXTRA_OBJS) $(CDROM_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(LIBS)
@LINK_DLL@ hdimage.o $(HDIMAGE_EXTRA_OBJS) $(CDROM_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(HDIMAGE_LINK_OPTS@LINK_VAR@)
##### end DLL section

View File

@ -47,10 +47,13 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ../..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../../@WIN32_DLL_IMPORT_LIB@
NETLOW_OBJS = @NETLOW_OBJS@
NETMOD_LINK_OPTS = -lws2_32 -liphlpapi
NETMOD_LINK_OPTS_VCPP = ws2_32.lib iphlpapi.lib
SLIRP_OBJS = \
slirp/arp_table.o \
slirp/bootp.o \
@ -92,8 +95,8 @@ plugins: @PLUGIN_TARGET_2@
plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
plugins_msvc:
@echo ERROR: MSVC nmake plugins not yet supported
plugins_msvc: bx_netmod.dll
@echo ERROR: MSVC nmake plugin support not yet complete
@exit 1
libnetwork.a: $(NONPLUGIN_OBJS)
@ -122,7 +125,7 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_netmod.dll: netmod.o $(NETLOW_OBJS)
$(CXX) $(CXXFLAGS) -shared -o bx_netmod.dll netmod.o $(NETLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) -lws2_32 -liphlpapi
@LINK_DLL@ netmod.o $(NETLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(NETMOD_LINK_OPTS@LINK_VAR@)
##### end DLL section

View File

@ -47,10 +47,13 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ../..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../../@WIN32_DLL_IMPORT_LIB@
SOUNDLOW_OBJS = @SOUNDLOW_OBJS@
SOUNDMOD_LINK_OPTS = -lwinmm
SOUNDMOD_LINK_OPTS_VCPP = winmm.lib
BX_INCDIRS = -I.. -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. -I../../@INSTRUMENT_DIR@ -I$(srcdir)/../../@INSTRUMENT_DIR@
LOCAL_CXXFLAGS = $(MCH_CFLAGS)
@ -71,8 +74,8 @@ plugins: @PLUGIN_TARGET_2@
plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
plugins_msvc:
@echo ERROR: MSVC nmake plugins not yet supported
plugins_msvc: bx_soundmod.dll
@echo ERROR: MSVC nmake plugin support not yet complete
@exit 1
libsound.a: $(NONPLUGIN_OBJS)
@ -101,7 +104,7 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_soundmod.dll: soundmod.o $(SOUNDLOW_OBJS)
$(CXX) $(CXXFLAGS) -shared -o bx_soundmod.dll soundmod.o $(SOUNDLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) -lwinmm
@LINK_DLL@ soundmod.o $(SOUNDLOW_OBJS) $(WIN32_DLL_IMPORT_LIBRARY) $(SOUNDMOD_LINK_OPTS@LINK_VAR@)
##### end DLL section

View File

@ -47,7 +47,7 @@ RANLIB = @RANLIB@
PLUGIN_PATH=@libdir@
top_builddir = ../..
LIBTOOL=@LIBTOOL@
WIN32_DLL_IMPORT_LIBRARY=../../dllexports.a
WIN32_DLL_IMPORT_LIBRARY=../../@WIN32_DLL_IMPORT_LIB@
USBDEV_OBJS = @USBDEV_OBJS@
SCSI_OBJS = @SCSI_OBJS@
@ -72,8 +72,8 @@ plugins: @PLUGIN_TARGET_2@
plugins_gcc: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
plugins_msvc:
@echo ERROR: MSVC nmake plugins not yet supported
plugins_msvc: bx_usb_common.dll
@echo ERROR: MSVC nmake plugin support not yet complete
@exit 1
libusb.a: $(NONPLUGIN_OBJS)
@ -102,7 +102,7 @@ bx_%.dll: %.o
# special link rules for plugins that require more than one object file
bx_usb_common.dll: usb_common.o $(USBDEV_OBJS) scsi_device.o
$(CXX) $(CXXFLAGS) -shared -o bx_usb_common.dll usb_common.o $(USBDEV_OBJS) scsi_device.o $(WIN32_DLL_IMPORT_LIBRARY)
@LINK_DLL@ usb_common.o $(USBDEV_OBJS) scsi_device.o $(WIN32_DLL_IMPORT_LIBRARY)
##### end DLL section

View File

@ -1,7 +1,7 @@
----------------------------------------------------------------------
Patch name: patch.example-user-plugin
Author: Volker Ruppert
Updated: 14 Apr 2012
Updated: 21 Apr 2014
Status: Demo
Detailed description:
@ -21,7 +21,7 @@ Detailed description:
Patch was created with:
diff -u
Apply patch to what version:
svn revision 11138 (April 14, 2012)
svn revision 12288 (April 21, 2014)
Instructions:
To patch, go to main bochs directory.
Type "patch -p0 < THIS_PATCH_FILE".
@ -43,7 +43,7 @@ diff -urN ../bochs/user-plugin/Makefile.in ./user-plugin/Makefile.in
--- ../bochs/user-plugin/Makefile.in 1970-01-01 01:00:00.000000000 +0100
+++ ./user-plugin/Makefile.in 2012-04-14 16:18:03.046503743 +0200
@@ -0,0 +1,108 @@
+# Copyright (C) 2009-2012 Volker Ruppert
+# Copyright (C) 2009-2014 Volker Ruppert
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
@ -93,7 +93,7 @@ diff -urN ../bochs/user-plugin/Makefile.in ./user-plugin/Makefile.in
+PLUGIN_PATH=@libdir@
+top_builddir = ..
+LIBTOOL=@LIBTOOL@
+WIN32_DLL_IMPORT_LIBRARY=../dllexports.a
+WIN32_DLL_IMPORT_LIBRARY=../@WIN32_DLL_IMPORT_LIB@
+
+BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev -I../@INSTRUMENT_DIR@ -I$(srcdir)/../@INSTRUMENT_DIR@
+