Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hch/buildsystem fixes #1

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bootfs.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
/usr/lib/jre/lib/server/libjvm.so: %(jdkbase)s/jre/lib/amd64/server/libjvm.so
/usr/lib/jre/lib/libverify.so: %(jdkbase)s/jre/lib/amd64/libverify.so
/usr/lib/jre/lib/libjava.so: %(jdkbase)s/jre/lib/amd64/libjava.so
/usr/lib/libstdc++.so.6: /usr/lib64/libstdc++.so.6
/usr/lib/libm.so.6: /usr/lib64/libm.so.6
/usr/lib/libgcc_s.so.1: /usr/lib64/libgcc_s.so.1
/usr/lib/libstdc++.so.6: /usr/%(libdir)s/libstdc++.so.6
/usr/lib/libm.so.6: /%(libdir)s/libm.so.6
/usr/lib/libgcc_s.so.1: /%(libdir)s/libgcc_s.so.1
25 changes: 19 additions & 6 deletions build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define newline =

endef

quiet = $(if $V, $1, @echo ' ' $2 $(newline) @$1)
quiet = $(if $V, $1, @echo " $2"; $1)
very-quiet = $(if $V, $1, @$1)

makedir = $(call very-quiet, mkdir -p $(dir $@))
Expand Down Expand Up @@ -103,12 +103,25 @@ loader.elf: arch/x64/boot.o arch/x64/loader.ld loader.o runtime.o $(drivers) \
dummy-shlib.so: dummy-shlib.o
$(call quiet, $(CXX) -nodefaultlibs -shared -o $@ $^, LD $@)

jdk-jni.h := $(shell rpm -ql java-1.7.0-openjdk-devel | grep include/jni.h$$)
jdkbase := $(jdk-jni.h:%/include/jni.h=%)
#
# Find the base directory of the java installation. We figure it out based
# on the path of the installed 'java' binary, but it can be manually overriden
# on the make commandline by passing javapath manually.
#
javapath ?= $(shell readlink -f `which java`)
jdkbase := $(javapath:%/jre/bin/java=%)


#
# Recent Debian and Ubuntu systems use (/usr)/lib/x86_64-linux-gnu for 64bit
# libaries while Red Hat derived systems use (/usr)/lib64.
#
libdir=$(shell if [ -d "/lib/x86_64-linux-gnu" ]; then \
echo "lib/x86_64-linux-gnu"; else echo "lib64"; fi)

bootfs.bin: scripts/mkbootfs.py bootfs.manifest
$(src)/scripts/mkbootfs.py -o $@ -d [email protected] -m $(src)/bootfs.manifest \
-D jdkbase=$(jdkbase)
-D jdkbase=$(jdkbase) -D libdir="lib/x86_64-linux-gnu"

bootfs.o: bootfs.bin

Expand All @@ -121,7 +134,7 @@ gen-ctype-data: gen-ctype-data.o
$(call quiet, $(CXX) -o $@ $^, LD $@)

clean:
find -name '*.[od]' | xargs rm
rm -f loader.elf loader.bin
find -name '*.[od]' | xargs rm -f
rm -f loader.elf loader.bin bootfs.bin

-include $(shell find -name '*.d')