[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

overriding DEF for JNI

From: Kyle F. Downey
Subject: overriding DEF for JNI
Date: Thu, 11 Oct 2001 15:06:06 +0000 (GMT)


I have written a configure script for my Java/JNI package that uses
automake+libtool to build the DLL's. DLLTOOL generates a DEF file that
looks like this:

 address@hidden @ 1 ;

This does not match what the JVM expects for JNI, based on what I've read,
and it prevents the JVM from linking properly to the exported function; it
needs an alias that does not include that @8, like this:

 Java_org_amberarcher_util_UUID_1generate = address@hidden @ 2 ;


1) is there any way in automake to "force" use of a particular DEF file
rather than having DLLTOOL generate it?
2) even better, is there some flag I can pass that will make libtool
generate this alias automatically?

I'm writing an article on portable JNI with autoconf, and will give credit
where it's due. Thank you very, very much!

Versions involved:

* automake 1.5
* autoconf 2.52
* libtool 1.4.2
* mingw 1.1 and cygwin 1.3.3

And here's my current

## Process this file with autopmake to produce

# the following is set, else would have to follow GNU conventions
AUTOMAKE_OPTIONS                                = foreign

CLASSDIR                                        = $(top_srcdir)/build/cl
EXTRA_DIST                                      = config

lib_LTLIBRARIES                                 =
cluuid_la_SOURCES                               = UUID.c
cluuid_la_LIBADD                                = -lrpcrt4
cluuid_la_LDFLAGS                               = -release $(LT_RELEASE)
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -mwindows -no-undefined

UUID.c : ../include/org_amberarcher_util_UUID.h

../include/org_amberarcher_util_UUID.h: $(CLASSDIR)/org/amberarcher/util/
        $(JAVAH) -d ../include -jni -classpath $(CLASSDIR) \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]