diff --git a/all b/all index 86f38ac1..051e0106 100755 --- a/all +++ b/all @@ -2,7 +2,11 @@ make -s -j cd testes/libs; make -s cd .. # back to directory 'testes' ulimit -S -s 1100 -if { ../lua -W all.lua; } then +LUA_FLAGS="-W" +if [ "$(uname)" != "Linux" ]; then + LUA_FLAGS="$LUA_FLAGS -e_port=true" +fi +if { ../lua $LUA_FLAGS all.lua; } then echo -e "\n\n final OK!!!!\n\n" else echo -e "\n\n >>>> BUG!!!!\n\n" diff --git a/makefile b/makefile index 8674519f..1e664585 100644 --- a/makefile +++ b/makefile @@ -71,9 +71,18 @@ LOCAL = $(TESTS) $(CWARNS) # To enable Linux goodies, -DLUA_USE_LINUX # For C89, "-std=c89 -DLUA_USE_C89" # Note that Linux/Posix options are not compatible with C89 +# +# Platform detection +UNAME= $(shell uname -s) +ifeq ($(UNAME),Darwin) +MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_MACOSX +MYLDFLAGS= +MYLIBS= +else MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX MYLDFLAGS= -Wl,-E MYLIBS= -ldl +endif CC= gcc @@ -95,7 +104,7 @@ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ ltm.o lundump.o lvm.o lzio.o ltests.o AUX_O= lauxlib.o LIB_O= lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o \ - lutf8lib.o loadlib.o lcorolib.o linit.o + lutf8lib.o loadlib.o lcorolib.o lcmd.o linit.o LUA_T= lua LUA_O= lua.o @@ -148,6 +157,7 @@ lapi.o: lapi.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \ lauxlib.o: lauxlib.c lprefix.h lua.h luaconf.h lauxlib.h llimits.h lbaselib.o: lbaselib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h \ llimits.h +lcmd.o: lcmd.c lprefix.h lua.h luaconf.h lauxlib.h lcmd.h lcode.o: lcode.c lprefix.h lua.h luaconf.h lcode.h llex.h lobject.h \ llimits.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h \ ldo.h lgc.h lstring.h ltable.h lvm.h lopnames.h @@ -167,7 +177,7 @@ lfunc.o: lfunc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \ llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h -linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h llimits.h +linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h llimits.h lcmd.h liolib.o: liolib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h llimits.h llex.o: llex.c lprefix.h lua.h luaconf.h lctype.h llimits.h ldebug.h \ lstate.h lobject.h ltm.h lzio.h lmem.h ldo.h lgc.h llex.h lparser.h \ diff --git a/testes/libs/makefile b/testes/libs/makefile index cf4c6881..208fa04d 100644 --- a/testes/libs/makefile +++ b/testes/libs/makefile @@ -6,6 +6,10 @@ CC = gcc # compilation should generate Dynamic-Link Libraries CFLAGS = -Wall -O2 -I$(LUA_DIR) -fPIC -shared +UNAME = $(shell uname -s) +ifeq ($(UNAME),Darwin) +CFLAGS += -undefined dynamic_lookup +endif # libraries used by the tests all: lib1.so lib11.so lib2.so lib21.so lib2-v2.so