From: John Hodge Date: Wed, 3 Jul 2013 09:42:21 +0000 (+0800) Subject: Usermode/Libraries - Hacks to get SDL ver of AxWin3 working X-Git-Tag: rel0.15~391 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=40eb5cfbfd8baaa6f398e9bbc4960632525acd39;p=tpg%2Facess2.git Usermode/Libraries - Hacks to get SDL ver of AxWin3 working --- diff --git a/Usermode/Libraries/Makefile.cfg b/Usermode/Libraries/Makefile.cfg index 4bb2c997..d134c850 100644 --- a/Usermode/Libraries/Makefile.cfg +++ b/Usermode/Libraries/Makefile.cfg @@ -15,6 +15,15 @@ ifeq ($(ARCHDIR),native) LDFLAGS += -Wl,-init,SoMain CFLAGS += -fPIC endif +else ifneq ($(HOST_ARCH),) + ASFLAGS += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1 + #CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init" + LD := $(CC) + ifeq ($(PLATFORM),windows) + else + LDFLAGS += -Wl,-init,SoMain + CFLAGS += -fPIC + endif else CPPFLAGS := -ffreestanding CFLAGS := -fno-stack-protector -fPIC diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index 0f6253c3..7c9546f5 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -10,7 +10,8 @@ ifeq ($(ARCH),native) LDFLAGS := $(LDFLAGS:-lc=-lc_acess) endif -ifneq ($(lastword $(subst -, ,$(basename $(LD)))),ld) +_LD_CMD := $(lastword $(subst -, ,$(firstword $(LD)))) +ifneq ($(_LD_CMD),ld) LDFLAGS := $(subst -soname ,-Wl$(comma)-soname$(comma),$(LDFLAGS)) LDFLAGS := $(subst -Map ,-Wl$(comma)-Map$(comma),$(LDFLAGS)) LDFLAGS := $(LDFLAGS:-x=-Wl,-x) @@ -80,7 +81,7 @@ endif # for f in $(INCFILES); do ln -s $f $(ACESSDIR)/include/$f; done #endif -$(_BIN): $(OBJ) $(_LIBS) +$(_BIN): $(OBJ) @mkdir -p $(dir $(_BIN)) @echo [LD] -o $(BIN) $(OBJ) $V$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name) diff --git a/Usermode/Libraries/libimage_sif.so_src/main.c b/Usermode/Libraries/libimage_sif.so_src/main.c index 180668a5..a5158562 100644 --- a/Usermode/Libraries/libimage_sif.so_src/main.c +++ b/Usermode/Libraries/libimage_sif.so_src/main.c @@ -8,6 +8,8 @@ //#include #include // _SysDebug +#define _SysDebug(...) do{}while(0) + // === STRUCTURES === struct sHeader {