diff options
| author | Milutin Jovanovic <jovanovic.milutin@gmail.com> | 2012-03-06 13:26:36 -0500 |
|---|---|---|
| committer | Milutin Jovanovic <jovanovic.milutin@gmail.com> | 2012-03-06 13:26:36 -0500 |
| commit | de54586d5b45800e26952ec77b4f51ad4c1e0079 (patch) | |
| tree | d8025bae00c9248d1d5c76f20df5cce8a3dcfd28 /tests/Makefile | |
| parent | ae191c3a619db25e3c9d4b6c89d1a9970563d825 (diff) | |
| download | tinycc-de54586d5b45800e26952ec77b4f51ad4c1e0079.tar.gz tinycc-de54586d5b45800e26952ec77b4f51ad4c1e0079.tar.bz2 | |
Further changes improving the OSX build. Everything builds. libtest passes.
Other tests still have issues, currently with weak linking.
One of the primary stumbling blocks on OSX is the lack of support for
mach-o binaries. Therefore all tcc usage on OSX has to be limited to elf
binaries, presumably produced by tcc itself.
Therefore I had to enable building of tiny_libmaker for OSX. Then changed
the make to use tcc and tiny_libmaker to compile the tcclib1.
In order to compile the tests, specifically the parts that use weak linking,
I have had to define MACOSX_DEPLOYMENT_TARGET to 10.2, which seems like a
hack, but extensive searching seems to indicate that this is the only way
to make apple gcc allow weak linking. Using any other value, bigger or smaller
breaks weak linking.
Also added _ANSI_SOURCE define required by some OSX headers, and some cosmetic
gitignore changes. I believe these changes should not impact other platforms.
Diffstat (limited to 'tests/Makefile')
| -rw-r--r-- | tests/Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/Makefile b/tests/Makefile index 2cf9e28..4ce9dfa 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,10 +3,10 @@ # # what tests to run -TESTS = libtest test3 +TESTS = libtest test1 test3 # these should work too -# TESTS += test1 test2 speedtest btest weaktest +TESTS += test2 speedtest btest weaktest # these don't work as they should # TESTS += test4 asmtest @@ -18,6 +18,12 @@ ifdef DISABLE_STATIC export LD_LIBRARY_PATH:=$(CURDIR)/.. endif +ifeq ($(TARGETOS),Darwin) +CFLAGS+=-Wl,-flat_namespace,-undefined,warning +export MACOSX_DEPLOYMENT_TARGET:=10.2 +NATIVE_DEFINES+=-D_ANSI_SOURCE +endif + # run local version of tcc with local libraries and includes TCC = ../tcc -B.. RUN_TCC = $(NATIVE_DEFINES) -run -DONE_SOURCE ../tcc.c -B.. |
