diff --git a/ase/awk/Awk.java b/ase/awk/Awk.java index bcbae989..6b16e04f 100644 --- a/ase/awk/Awk.java +++ b/ase/awk/Awk.java @@ -1,11 +1,12 @@ /* - * $Id: Awk.java,v 1.16 2007-01-18 13:49:27 bacon Exp $ + * $Id: Awk.java,v 1.17 2007-01-18 14:34:17 bacon Exp $ */ package ase.awk; import java.security.AccessController; import java.security.PrivilegedAction; +import java.net.URL; public abstract class Awk { @@ -23,8 +24,10 @@ public abstract class Awk { public Object run () { - String dll = ase.awk.Awk.class.getResource("aseawk.dll").getFile(); - System.load (dll); + URL url = ase.awk.Awk.class.getResource("aseawk.dll"); + if (url == null) url = ase.awk.Awk.class.getResource("libaseawk.so"); + + if (url != null) System.load (url.getFile()); //System.load ("c://projects//ase/awk/aseawk.dll"); //System.loadLibrary ("aseawk"); return null; diff --git a/ase/awk/makefile.lnx.gcc b/ase/awk/makefile.lnx.gcc index c13b002b..6530beb5 100644 --- a/ase/awk/makefile.lnx.gcc +++ b/ase/awk/makefile.lnx.gcc @@ -1,4 +1,4 @@ -OUT = libaseawk +OUT = aseawk C_SRCS = awk.c err.c tree.c str.c tab.c map.c parse.c \ run.c rec.c val.c func.c misc.c extio.c rex.c @@ -17,7 +17,7 @@ CC = gcc AR = ar LD = ld RANLIB = ranlib -CFLAGS = -Wall -O2 -D_REENTRANT -D_THREAD_SAFE -fPIC -I../.. $(JNI_INCPATH) +CFLAGS = -Wall -O2 -D_REENTRANT -D_THREAD_SAFE -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -I../.. $(JNI_INCPATH) LDFLAGS = LIBS = @@ -27,13 +27,16 @@ JAVACFLAGS = -classpath ../.. all: lib jni lib: $(C_OBJS) - $(AR) cr $(OUT).a $(C_OBJS) + $(AR) cr lib$(OUT).a $(C_OBJS) jni: lib $(JNI_OBJS) $(JAVA_OBJS) - $(LD) -fPIC -shared -soname $(OUT).so -o $(OUT).so -L . -l aseawk jni.o + $(CC) -shared -o lib$(OUT)_jni.so $(JNI_OBJS) -lm -L. -l$(OUT) + +#$(CC) -fPIC -shared -static-libgcc -o lib$(OUT)_jni.so -L. -laseawk -lm libaseawk.a jni.o +#$(LD) -fPIC -shared -soname lib$(OUT).so -o lib$(OUT).so -L . -l aseawk jni.o clean: - rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) $(OUT).a $(OUT).so *.o + rm -rf $(C_OBJS) $(JNI_OBJS) $(JAVA_OBJS) lib$(OUT).a lib$(OUT).so *.o .SUFFIXES: .c .o .java .class .c.o: