Skip to content

Commit

Permalink
Respect JAVA_HOME when building, remove jikes references
Browse files Browse the repository at this point in the history
  • Loading branch information
aclemons committed Jun 10, 2017
1 parent c87604b commit a9abe2e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 30 deletions.
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# $Revision$
#

export
export

# what to build -------------------------------------------------------------

Expand All @@ -36,12 +36,8 @@ T_LIBS = JavaReadline
# java-compiler flavor ------------------------------------------------------

## normal javac
JAVAC = javac
JC_FLAGS =

## with jikes
#JAVAC = jikes
#JC_FLAGS = -O +E
JAVAC = $(JAVA_HOME)/bin/javac
JC_FLAGS += -target 1.5 -source 1.5

# installation directories --------------------------------------------------

Expand Down Expand Up @@ -130,21 +126,21 @@ RPM_BASE = `pwd`/$(BUILDDIR)/
world : jar build-native

jar: build-java
cd $(BUILDDIR) ; jar -cvmf ../$(MF_STUB) ../$(JAR) *
cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) *

$(JAR):
cd $(BUILDDIR) ; jar -cvmf ../$(MF_STUB) ../$(JAR) *
cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) *

build-java: $(BUILDDIR)
cd src ; $(MAKE) JAVAC="$(JAVAC)" JC_FLAGS="$(JC_FLAGS)" \
OS_FLAVOR=$(OS_FLAVOR) java

build-native:
build-native:
cd src; $(MAKE) T_LIBS="$(T_LIBS)" JAVAINCLUDE="$(JAVAINCLUDE)" \
OS_FLAVOR=$(OS_FLAVOR) JAVANATINC="$(JAVANATINC)" native

apidoc: $(APIDIR)
javadoc -sourcepath src -d $(APIDIR) -windowtitle $(WTITLE) \
$(JAVA_HOME)/bin/javadoc -sourcepath src -d $(APIDIR) -windowtitle $(WTITLE) \
-doctitle $(DTITLE) -footer $(DFOOTER) -header $(DHEADER) \
-bottom $(DBOTTOM) \
-version -author org.gnu.readline test
Expand Down Expand Up @@ -174,7 +170,7 @@ $(APIDIR):
$(BUILDDIR):
mkdir $(BUILDDIR)

$(METADIR):
$(METADIR):
mkdir $(METADIR)

rpm: src-dist
Expand All @@ -185,7 +181,7 @@ rpm: src-dist
rpm --define _topdir$(RPM_BASE) -ba $(RPM_BASE)/SPECS/libreadline-java.spec

test: $(JAR) build-native
java -Djava.library.path=. -jar $(JAR) src/test/tinputrc $(ARGS)
$(JAVA_HOME)/bin/java -Djava.library.path=. -jar $(JAR) src/test/tinputrc $(ARGS)

clean:
$(MAKE) -C src/native clean
Expand Down
5 changes: 1 addition & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ COMPILATION
===========

Compilation should be no problem. Try "make". You should set the
variable JAVA_HOME (or edit the makefile). Also, if you don't use jikes,
you should change the variables JAVAC and JAVAC_OPT in the makefile. A better
alternative is to install jikes, it will speed up your development by
a factor of 2-3.
variable JAVA_HOME (or edit the makefile).
JAVAC and JAVAC_OPT can also be set in the environment or from the
make commandline.

Expand Down
26 changes: 13 additions & 13 deletions src/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# $Revision$
#

export
export

.PHONY: org_gnu_readline_Readline.o

ifndef CC
CC=cc
CC=cc
endif

# OS-specific stuff ---------------------------------------------------------
Expand All @@ -45,22 +45,22 @@ CFLAGS = -fpic -DPOSIX
LD_FLAGS = -shared

INCLUDES = -I $(JAVAINCLUDE) -I $(JAVANATINC)
LIBPATH = -L/usr/lib/termcap
LIBPATH = -L/usr/lib/termcap

JavaReadline_LIBS = -lreadline -ltermcap -lhistory
JavaEditline_LIBS = -ledit -ltermcap
JavaGetline_LIBS =
JavaGetline_LIBS =
endif

ifeq (CYGWIN,$(OS_FLAVOR))
OBJ_EXT := o
LIB_PRE :=
LIB_PRE :=
LIB_EXT := dll
CFLAGS := -DWIN32
LD_FLAGS = -shared

INCLUDES = -I $(JAVAINCLUDE) -I $(JAVANATINC)
LIBPATH = -L/usr/lib/termcap
LIBPATH = -L/usr/lib/termcap

JavaReadline_LIBS = -lreadline -ltermcap -lhistory
JavaEditline_LIBS = -ledit -ltermcap
Expand All @@ -69,7 +69,7 @@ endif

ifeq (MSWIN,$(OS_FLAVOR))
OBJ_EXT := obj
LIB_PRE :=
LIB_PRE :=
LIB_EXT := dll
CFLAGS := -DWIN32
LD_FLAGS = -LD
Expand All @@ -80,7 +80,7 @@ LIBPATH =
LIB = "c:/Programme/DevStudio/VC/lib"
JavaReadline_LIBS =
JavaEditline_LIBS =
JavaGetline_LIBS =
JavaGetline_LIBS =
endif

ifeq (MAC,$(OS_FLAVOR))
Expand All @@ -95,7 +95,7 @@ LIBPATH = -L/usr/lib -L/sw/lib

JavaReadline_LIBS = -lreadline -ltermcap -lhistory
JavaEditline_LIBS = -ledit -ltermcap
JavaGetline_LIBS =
JavaGetline_LIBS =
endif

# some constants, you should not need to change these variables -------------
Expand All @@ -109,7 +109,7 @@ endif

# targets, finally ;-) ------------------------------------------------------

all: $(T_LIBS)
all: $(T_LIBS)

lib: $(ROOTDIR)/$(LIB_PRE)$(TG).$(LIB_EXT)

Expand Down Expand Up @@ -137,12 +137,12 @@ getline.$(OBJ_EXT): getline.c
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D$(TG) -c getline.c

org_gnu_readline_Readline.$(OBJ_EXT): org_gnu_readline_Readline.h \
org_gnu_readline_Readline.c
org_gnu_readline_Readline.c
$(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -D$(TG) \
-c org_gnu_readline_Readline.c
-c org_gnu_readline_Readline.c

org_gnu_readline_Readline.h: $(BUILDDIR)/org/gnu/readline/Readline.class
javah -classpath $(BUILDDIR) -jni org.gnu.readline.Readline
$(JAVA_HOME)/bin/javah -classpath $(BUILDDIR) -jni org.gnu.readline.Readline
touch org_gnu_readline_Readline.h

clean:
Expand Down

0 comments on commit a9abe2e

Please sign in to comment.