|
@@ -520,6 +520,7 @@ rng_none="no"
|
|
|
secret_keyring=""
|
|
|
libdaxctl=""
|
|
|
host_device_support="yes"
|
|
|
+shared_lib="no"
|
|
|
|
|
|
supported_cpu="no"
|
|
|
supported_os="no"
|
|
@@ -885,7 +886,8 @@ Darwin)
|
|
|
darwin="yes"
|
|
|
hax="yes"
|
|
|
hvf="yes"
|
|
|
- LDFLAGS_SHARED="-bundle -undefined dynamic_lookup"
|
|
|
+ DSOSUF=".dylib"
|
|
|
+ LDFLAGS_SHARED="-dynamiclib -undefined dynamic_lookup"
|
|
|
if [ "$cpu" = "x86_64" ] ; then
|
|
|
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
|
|
|
QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
|
|
@@ -893,8 +895,8 @@ Darwin)
|
|
|
cocoa="yes"
|
|
|
audio_drv_list="coreaudio try-sdl"
|
|
|
audio_possible_drivers="coreaudio sdl"
|
|
|
- QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS"
|
|
|
- libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
|
|
|
+ QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit -lresolv $QEMU_LDFLAGS"
|
|
|
+ libs_softmmu="-F/System/Library/Frameworks -framework IOKit $libs_softmmu"
|
|
|
# Disable attempts to use ObjectiveC features in os/object.h since they
|
|
|
# won't work when we're compiling with gcc as a C compiler.
|
|
|
QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
|
|
@@ -907,7 +909,8 @@ iOS)
|
|
|
ios="yes"
|
|
|
hax="yes"
|
|
|
hvf="yes"
|
|
|
- LDFLAGS_SHARED="-bundle -undefined dynamic_lookup"
|
|
|
+ DSOSUF=".dylib"
|
|
|
+ LDFLAGS_SHARED="-dynamiclib"
|
|
|
if [ "$cpu" = "x86_64" ] ; then
|
|
|
QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
|
|
|
QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS"
|
|
@@ -1679,6 +1682,17 @@ for opt do
|
|
|
;;
|
|
|
--disable-libdaxctl) libdaxctl=no
|
|
|
;;
|
|
|
+ --enable-shared-lib)
|
|
|
+ shared_lib=yes
|
|
|
+ want_tools=no
|
|
|
+ cocoa=no
|
|
|
+ gtk=no
|
|
|
+ sdl=no
|
|
|
+ QEMU_CFLAGS="$QEMU_CFLAGS -fPIC"
|
|
|
+ DSOSUF="-module$DSOSUF" # fix for make 2.81 not building target order correctly
|
|
|
+ ;;
|
|
|
+ --disable-shared-lib) shared_lib=no
|
|
|
+ ;;
|
|
|
*)
|
|
|
echo "ERROR: unknown option $opt"
|
|
|
echo "Try '$0 --help' for more information"
|
|
@@ -1871,6 +1885,7 @@ Advanced options (experts only):
|
|
|
enable plugins via shared library loading
|
|
|
--disable-containers don't use containers for cross-building
|
|
|
--gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin]
|
|
|
+ --enable-shared-lib build QEMU as a shared library instead of an application
|
|
|
|
|
|
Optional features, enabled with --enable-FEATURE and
|
|
|
disabled with --disable-FEATURE, default is enabled if available:
|
|
@@ -2404,6 +2419,7 @@ if test "$cocoa" = "yes"; then
|
|
|
if test "$gtk" = "yes"; then
|
|
|
error_exit "Cocoa and GTK UIs cannot both be enabled at once"
|
|
|
fi
|
|
|
+ libs_softmmu="$libs_softmmu -framework Cocoa"
|
|
|
gtk=no
|
|
|
sdl=no
|
|
|
fi
|
|
@@ -7059,6 +7075,7 @@ echo "gdb $gdb_bin"
|
|
|
echo "rng-none $rng_none"
|
|
|
echo "Linux keyring $secret_keyring"
|
|
|
echo "host device support $host_device_support"
|
|
|
+echo "build shared lib $shared_lib"
|
|
|
|
|
|
if test "$supported_cpu" = "no"; then
|
|
|
echo
|
|
@@ -7132,6 +7149,9 @@ fi
|
|
|
if test "$host_device_support" = "yes" ; then
|
|
|
echo "CONFIG_HOST_DEVICE=y" >> $config_host_mak
|
|
|
fi
|
|
|
+if test "$shared_lib" = "yes" ; then
|
|
|
+ echo "CONFIG_SHARED_LIB=y" >> $config_host_mak
|
|
|
+fi
|
|
|
if test "$debug_tcg" = "yes" ; then
|
|
|
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
|
|
|
fi
|