fix Cygwin/MSYS openjdk-src builds

This commit is contained in:
Joel Dice 2010-11-15 16:27:00 -07:00
parent 46be43a0e3
commit 02bdec6f8c
3 changed files with 21 additions and 8 deletions

View File

@ -169,6 +169,8 @@ so-suffix = .so
shared = -shared shared = -shared
openjdk-extra-cflags = -fvisibility=hidden
ifeq ($(arch),i386) ifeq ($(arch),i386)
pointer-size = 4 pointer-size = 4
endif endif
@ -230,6 +232,7 @@ ifeq ($(platform),windows)
cflags = -I$(inc) $(common-cflags) cflags = -I$(inc) $(common-cflags)
ifeq (,$(filter mingw32 cygwin,$(build-platform))) ifeq (,$(filter mingw32 cygwin,$(build-platform)))
openjdk-extra-cflags += -I$(src)/openjdk/caseSensitive
cxx = x86_64-w64-mingw32-g++ -m32 cxx = x86_64-w64-mingw32-g++ -m32
cc = x86_64-w64-mingw32-gcc -m32 cc = x86_64-w64-mingw32-gcc -m32
dlltool = x86_64-w64-mingw32-dlltool -mi386 --as-flags=--32 dlltool = x86_64-w64-mingw32-dlltool -mi386 --as-flags=--32
@ -246,10 +249,12 @@ ifeq ($(platform),windows)
build-system = windows build-system = windows
common-cflags += "-I$(JAVA_HOME)/include/win32" common-cflags += "-I$(JAVA_HOME)/include/win32"
build-cflags = $(common-cflags) -I$(src) -I$(inc) -mthreads build-cflags = $(common-cflags) -I$(src) -I$(inc) -mthreads
openjdk-extra-cflags =
build-lflags = -L$(lib) $(common-lflags) build-lflags = -L$(lib) $(common-lflags)
ifeq ($(build-platform),cygwin) ifeq ($(build-platform),cygwin)
build-lflags += -mno-cygwin build-lflags += -mno-cygwin
build-cflags += -mno-cygwin build-cflags += -mno-cygwin
openjdk-extra-cflags += -mno-cygwin
lflags += -mno-cygwin lflags += -mno-cygwin
cflags += -mno-cygwin cflags += -mno-cygwin
endif endif
@ -661,10 +666,10 @@ $(classpath-object): $(build)/classpath.jar $(converter)
$(converter) $(<) $(@) _binary_classpath_jar_start \ $(converter) $(<) $(@) _binary_classpath_jar_start \
_binary_classpath_jar_end $(platform) $(arch) _binary_classpath_jar_end $(platform) $(arch)
$(build)/javahome.jar: $(foreach x,$(javahome-files),$(build-javahome)/$(x)) $(build)/javahome.jar:
@echo "creating $(@)" @echo "creating $(@)"
(wd=$$(pwd) && \ (wd=$$(pwd) && \
cd $(build-javahome) && \ cd "$(build-javahome)" && \
$(jar) c0f "$$($(native-path) "$${wd}/$(@)")" $(javahome-files)) $(jar) c0f "$$($(native-path) "$${wd}/$(@)")" $(javahome-files))
$(javahome-object): $(build)/javahome.jar $(converter) $(javahome-object): $(build)/javahome.jar $(converter)
@ -777,20 +782,23 @@ $(openjdk-objects): $(build)/openjdk/%.o: $(openjdk-src)/%.c \
$(openjdk-headers-dep) $(openjdk-headers-dep)
@echo "compiling $(@)" @echo "compiling $(@)"
@mkdir -p $(dir $(@)) @mkdir -p $(dir $(@))
$(cc) -fPIC -fvisibility=hidden $(openjdk-cflags) $(optimization-cflags) \ $(cc) -fPIC $(openjdk-extra-cflags) $(openjdk-cflags) \
-w -c $(<) $(call output,$(@)) $(optimization-cflags) -w -c $(<) $(call output,$(@))
$(openjdk-headers-dep): $(openjdk)/jre/lib/rt.jar $(openjdk-headers-dep):
@echo "generating openjdk headers" @echo "generating openjdk headers"
@mkdir -p $(dir $(@)) @mkdir -p $(dir $(@))
$(javah) -d $(build)/openjdk -bootclasspath $(boot-classpath) \ $(javah) -d $(build)/openjdk -bootclasspath $(boot-classpath) \
$(openjdk-headers-classes) $(openjdk-headers-classes)
@touch $(@) @touch $(@)
$(openjdk-jar-dep): $(openjdk)/jre/lib/rt.jar $(openjdk)/jre/lib/jsse.jar \ $(openjdk-jar-dep):
$(openjdk)/jre/lib/jce.jar $(openjdk)/jre/lib/resources.jar
@echo "extracting openjdk classes" @echo "extracting openjdk classes"
@mkdir -p $(dir $(@)) @mkdir -p $(dir $(@))
@mkdir -p $(classpath-build) @mkdir -p $(classpath-build)
(cd $(classpath-build) && for x in $(^); do jar xf $${x}; done) (cd $(classpath-build) && \
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/rt.jar")" && \
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/jsse.jar")" && \
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/jce.jar")" && \
$(jar) xf "$$($(native-path) "$(openjdk)/jre/lib/resources.jar")")
@touch $(@) @touch $(@)

View File

@ -219,6 +219,11 @@ specifying the location of the OpenJDK source code, e.g.:
$ make openjdk=$(pwd)/../jdk6/build/linux-amd64/j2sdk-image \ $ make openjdk=$(pwd)/../jdk6/build/linux-amd64/j2sdk-image \
openjdk-src=$(pwd)/../jdk6/jdk/src openjdk-src=$(pwd)/../jdk6/jdk/src
You must ensure that the path specified for openjdk-src does not have
any spaces in it; make gets confused when dependency paths include
spaces, and we haven't found away around that except to avoid paths
with spaces entirely.
The result of such a build is a self-contained binary which does not The result of such a build is a self-contained binary which does not
depend on external libraries, jars, or other files. In this case, the depend on external libraries, jars, or other files. In this case, the
specified paths are used only at build time; anything needed at specified paths are used only at build time; anything needed at