mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-03 15:55:37 +00:00
Merge branch 'master' of https://github.com/unicorn-engine/unicorn
This commit is contained in:
commit
f56bfe1f95
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -45,6 +45,8 @@ unicorn.pc
|
|||
|
||||
unicorn.lib
|
||||
unicorn.dll
|
||||
unicorn.exp
|
||||
unicorn.def
|
||||
unicorn_*.lib
|
||||
unicorn_*.exp
|
||||
unicorn_*.dll
|
||||
|
|
17
Makefile
17
Makefile
|
@ -122,10 +122,12 @@ UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=)
|
|||
# mingw?
|
||||
else ifneq ($(filter MINGW%,$(UNAME_S)),)
|
||||
EXT = dll
|
||||
AR_EXT = lib
|
||||
AR_EXT = a
|
||||
BIN_EXT = .exe
|
||||
UNICORN_QEMU_FLAGS += --disable-stack-protector
|
||||
UNICORN_CFLAGS := $(UNICORN_CFLAGS:-fPIC=)
|
||||
$(LIBNAME)_LDFLAGS += -Wl,--output-def,unicorn.def
|
||||
DO_WINDOWS_EXPORT = 1
|
||||
|
||||
# Linux, Darwin
|
||||
else
|
||||
|
@ -210,7 +212,7 @@ qemu/config-host.h-timestamp:
|
|||
|
||||
unicorn: $(LIBRARY) $(ARCHIVE)
|
||||
|
||||
$(LIBRARY): qemu/config-host.h-timestamp uc.o list.o
|
||||
$(LIBRARY): qemu/config-host.h-timestamp
|
||||
ifeq ($(UNICORN_SHARED),yes)
|
||||
ifeq ($(V),0)
|
||||
$(call log,GEN,$(LIBRARY))
|
||||
|
@ -220,9 +222,16 @@ else
|
|||
$(CC) $(CFLAGS) -shared $(UC_TARGET_OBJ) uc.o list.o -o $(LIBRARY) $($(LIBNAME)_LDFLAGS)
|
||||
-ln -sf $(LIBRARY) $(LIBRARY_SYMLINK)
|
||||
endif
|
||||
ifeq ($(DO_WINDOWS_EXPORT),1)
|
||||
ifneq ($(filter MINGW32%,$(UNAME_S)),)
|
||||
cmd /c "windows_export.bat x86"
|
||||
else
|
||||
cmd /c "windows_export.bat x64"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$(ARCHIVE): qemu/config-host.h-timestamp uc.o list.o
|
||||
$(ARCHIVE): qemu/config-host.h-timestamp
|
||||
ifeq ($(UNICORN_STATIC),yes)
|
||||
ifeq ($(V),0)
|
||||
$(call log,GEN,$(ARCHIVE))
|
||||
|
@ -301,7 +310,7 @@ uninstall:
|
|||
clean:
|
||||
$(MAKE) -C qemu clean
|
||||
rm -rf *.d *.o
|
||||
rm -rf lib$(LIBNAME)* $(LIBNAME)*.lib $(LIBNAME)*.dll cyg$(LIBNAME)*.dll
|
||||
rm -rf lib$(LIBNAME)* $(LIBNAME)*.lib $(LIBNAME)*.dll $(LIBNAME)*.exp cyg$(LIBNAME)*.dll
|
||||
$(MAKE) -C samples clean
|
||||
$(MAKE) -C tests/unit clean
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ if SYSTEM == 'darwin':
|
|||
STATIC_LIBRARY_FILE = 'libunicorn.a'
|
||||
elif SYSTEM in ('win32', 'cygwin'):
|
||||
LIBRARY_FILE = "unicorn.dll"
|
||||
STATIC_LIBRARY_FILE = None
|
||||
STATIC_LIBRARY_FILE = "unicorn.lib"
|
||||
else:
|
||||
LIBRARY_FILE = "libunicorn.so"
|
||||
STATIC_LIBRARY_FILE = 'libunicorn.a'
|
||||
|
@ -147,7 +147,11 @@ def build_libraries():
|
|||
subprocess.call(cmd, env=new_env)
|
||||
|
||||
shutil.copy(LIBRARY_FILE, LIBS_DIR)
|
||||
if STATIC_LIBRARY_FILE: shutil.copy(STATIC_LIBRARY_FILE, LIBS_DIR)
|
||||
try:
|
||||
# static library may fail to build on windows if user doesn't have visual studio 12 installed. this is fine.
|
||||
shutil.copy(STATIC_LIBRARY_FILE, LIBS_DIR)
|
||||
except:
|
||||
pass
|
||||
os.chdir(cwd)
|
||||
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ def _load_lib(path):
|
|||
if sys.platform in ('win32', 'cygwin'):
|
||||
_load_win_support(path)
|
||||
|
||||
lib_file = os.path.join(path, _lib[sys.platform])
|
||||
lib_file = os.path.join(path, _lib.get(sys.platform, 'libunicorn.so'))
|
||||
#print('Trying to load shared library', lib_file)
|
||||
dll = ctypes.cdll.LoadLibrary(lib_file)
|
||||
#print('SUCCESS')
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
mkdir cmocka
|
||||
wget https://cmocka.org/files/1.1/cmocka-1.1.0.tar.xz -O /tmp/cmocka-1.1.0.tar.xz
|
||||
#wget https://cmocka.org/files/1.1/cmocka-1.1.0.tar.xz -O /tmp/cmocka-1.1.0.tar.xz
|
||||
wget --no-check-certificate http://cmocka.org/files/1.1/cmocka-1.1.0.tar.xz -O /tmp/cmocka-1.1.0.tar.xz
|
||||
tar -xf /tmp/cmocka-1.1.0.tar.xz -C /tmp
|
||||
cd cmocka && cmake -DUNIT_TESTING=On /tmp/cmocka-1.1.0 && make && make test
|
||||
# cmake builds an so instead of a dll in mingw/msys
|
||||
|
|
|
@ -43,7 +43,7 @@ AR_EXT = a
|
|||
else ifneq ($(filter MINGW%,$(UNAME_S)),)
|
||||
CFLAGS := $(CFLAGS:-fPIC=)
|
||||
BIN_EXT = .exe
|
||||
AR_EXT = lib
|
||||
AR_EXT = a
|
||||
endif
|
||||
|
||||
ifeq ($(UNICORN_STATIC),yes)
|
||||
|
|
16
windows_export.bat
Normal file
16
windows_export.bat
Normal file
|
@ -0,0 +1,16 @@
|
|||
@echo on
|
||||
|
||||
:: This script invokes the visual studio linker to construct a static library file that can be used outside of mingw.
|
||||
:: The unicorn.def file that it references below is produced by the mingw compiler via a linker flag.
|
||||
:: The arch (x86 or x64) we are working on should be passed via the first argument to this script.
|
||||
|
||||
:: Look up the Visual Studio install path via the registry
|
||||
:: http://stackoverflow.com/questions/445167/how-can-i-get-the-value-of-a-registry-key-from-within-a-batch-script
|
||||
:: If anyone ever tells you that windows is a reasonable operating system, they are wrong
|
||||
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0" /v InstallDir`) DO (
|
||||
set appdir=%%A %%B
|
||||
)
|
||||
|
||||
:: Add the visual studio binaries to our path and run the linker
|
||||
call "%appdir%..\..\VC\vcvarsall.bat" %1
|
||||
call lib /machine:%1 /def:unicorn.def
|
Loading…
Reference in a new issue