From 789cc8e9a25a5651bbf6faa702be5dce68bc6137 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Fri, 26 Oct 2007 16:10:12 -0600 Subject: [PATCH 1/2] On the Mac, building in the vm object is complicated. Instead, rely on external files. --- classpath/classpath.cpp | 2 ++ makefile | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/classpath/classpath.cpp b/classpath/classpath.cpp index bdd8e3457b..f75d3333a7 100644 --- a/classpath/classpath.cpp +++ b/classpath/classpath.cpp @@ -10,6 +10,7 @@ extern "C" { +#ifndef __APPLE__ extern const uint8_t SYMBOL(start)[]; extern const uint8_t SYMBOL(size)[]; @@ -19,5 +20,6 @@ extern "C" { *size = reinterpret_cast(SYMBOL(size)); return SYMBOL(start); } +#endif } // extern "C" diff --git a/makefile b/makefile index 1c3d22b48b..ccde353083 100644 --- a/makefile +++ b/makefile @@ -36,6 +36,11 @@ build-cc = gcc pthread = -pthread lpthread = -lpthread +ifeq ($(platform),darwin) + pthread = + lpthread = +endif + cxx = $(build-cxx) cc = $(build-cc) ar = ar @@ -190,6 +195,10 @@ classpath-classes = \ $(call java-classes,$(classpath-sources),$(classpath),$(classpath-build)) classpath-object = $(native-build)/classpath-jar.o +ifeq ($(platform),darwin) + classpath-object = +endif + test-sources = $(shell find $(test) -name '*.java') test-classes = $(call java-classes,$(test-sources),$(test),$(test-build)) From 8f604ca7e10cbc090335bc6d3d884bdcf6d1eaa8 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Fri, 26 Oct 2007 16:16:47 -0600 Subject: [PATCH 2/2] makefile cleanups --- makefile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index ccde353083..84b1123dd9 100644 --- a/makefile +++ b/makefile @@ -33,14 +33,6 @@ input = $(test-build)/Hello.class build-cxx = g++ build-cc = gcc -pthread = -pthread -lpthread = -lpthread - -ifeq ($(platform),darwin) - pthread = - lpthread = -endif - cxx = $(build-cxx) cc = $(build-cc) ar = ar @@ -64,13 +56,13 @@ common-cflags = $(warnings) -fno-rtti -fno-exceptions \ -D__STDC_LIMIT_MACROS -D_JNI_IMPLEMENTATION_ build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \ - -I$(JAVA_HOME)/include/linux -I$(src) $(pthread) + -I$(JAVA_HOME)/include/linux -I$(src) -pthread cflags = $(build-cflags) common-lflags = -lm -lz -lflags = $(common-lflags) $(lpthread) -ldl -rdynamic +lflags = $(common-lflags) -lpthread -ldl -rdynamic system = posix asm = x86 @@ -86,8 +78,9 @@ ifeq ($(arch),i386) endif ifeq ($(platform),darwin) + build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \ + -I$(JAVA_HOME)/include/linux -I$(src) lflags = $(common-lflags) -ldl - objcopy = gobjcopy endif ifeq ($(platform),windows)