Java for C
[MKUltra.git] / defs.Linux
blob376fce3ba636a1f2f7b0a8cd1cb0c3e155aa07f5
1 # -*- Mode: makefile; -*- #
3 so_ext := so
4 so_sfx := .$(so_ext)
5 so_pfx := lib
7 o_ext := o
8 o_sfx := .$(o_ext)
10 exe_ext :=
11 exe_sfx :=
13 pkg_config_path := /usr/lib64/pkgconfig:/usr/local/lib/pkgconfig
14 boost_mt :=
16 CFLAGS += -fPIC
17 CXXFLAGS += -fPIC
19 LDFLAGS += -Wl,-rpath=.
21 ifneq (,$(JAVA))
23 define possibly_set_java_home
24 ifneq (,$(wildcard $(1)))
25 JAVA_HOME ?= $(1)
26 endif
27 endef
29 possible_java_locations := \
30         /usr/lib/jvm/default-java \
31         /usr/lib/jvm/java-1.8.0-openjdk \
32         /usr/lib/jvm/java-8-openjdk-amd64
34 $(foreach x,$(possible_java_locations),$(eval $(call possibly_set_java_home,$(x))))
36 # Fall back location
37 JAVA_HOME ?= /usr/lib/jvm/java-1.8.0-openjdk
38 jvmdir = $(JAVA_HOME)/jre/lib/amd64/server
40 CPPFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
41 LDFLAGS += -L$(jvmdir) -Wl,-rpath,$(jvmdir)
42 LDLIBS += -ljvm
43 endif