libtool
[Top][All Lists]
Advanced

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

Mac OS X and loadable JNI (java runtime) libraries


From: Don Anderson
Subject: Mac OS X and loadable JNI (java runtime) libraries
Date: Mon, 8 Jul 2002 10:32:03 -0400 (EDT)

Hello,

I'm attaching a change that we use to get our product to build
Java native libraries (loadable modules written in C using the JNI
APIs) on Mac OS X.  The Java JDK (I think it must ship with the OS)
expects that JNI libraries have a .jnilib extension instead of .so,
which is the 'normal' extension you get via linking using -module.

I added a -jnimodule option (analogous to -module) to indicate that a
Java JNI lib is being built.  Yes, this is probably specific to the
JDK being used, but the reality (for us, anyway) is that this is the
runtime that people are using.  I'll be happy to update the doc too if
you think this is a good idea.  Frankly, I'm hoping that you all
will come up with a better approach.

- Don

Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1125
diff -c -r1.1125 ChangeLog
*** ChangeLog   26 Jun 2002 07:15:36 -0000      1.1125
--- ChangeLog   8 Jul 2002 14:14:10 -0000
***************
*** 1,3 ****
--- 1,11 ----
+ 2002-07-08  Donald Anderson  <address@hidden>
+ 
+       * ltmain.sh (option parsing): added -jnimodule, similar to -module,
+       but specified to create Java JNI libraries, which may have
+       platform specific extensions.
+       * libtool.m4 (darwin): specify .jnilib for the extension to
+       use when -jnimodule is used.
+ 
  2002-06-26  Bob Friesenhahn  <address@hidden>
  
        * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [mingw]: Remove
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.261
diff -c -r1.261 libtool.m4
*** libtool.m4  26 Jun 2002 07:15:36 -0000      1.261
--- libtool.m4  8 Jul 2002 14:14:16 -0000
***************
*** 1153,1160 ****
    # FIXME: Relying on posixy $() will cause problems for
    #        cross-compilation, but unfortunately the echo tests do not
    #        yet detect zsh echo's removal of \ escapes.
!   library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes 
&& echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes 
&& echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo 
dylib)'
!   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so 
|| echo dylib)'
    shlibpath_overrides_runpath=yes
    shlibpath_var=DYLD_LIBRARY_PATH
    ;;
--- 1153,1162 ----
    # FIXME: Relying on posixy $() will cause problems for
    #        cross-compilation, but unfortunately the echo tests do not
    #        yet detect zsh echo's removal of \ escapes.
!   # support for -jnimodule is encapsulated below in ${darwin_suffix}
!   darwin_suffix='$(test .$jnimodule = .yes && echo jnilib || (test .$module = 
.yes && echo so || echo dylib))'
!   library_names_spec='${libname}${release}${versuffix}.'"${darwin_suffix}"' 
${libname}${release}${major}.'"${darwin_suffix}"' ${libname}.'"${darwin_suffix}"
!   soname_spec='${libname}${release}${major}.'"${darwin_suffix}"
    shlibpath_overrides_runpath=yes
    shlibpath_var=DYLD_LIBRARY_PATH
    ;;
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.299
diff -c -r1.299 ltmain.in
*** ltmain.in   24 Jun 2002 19:32:41 -0000      1.299
--- ltmain.in   8 Jul 2002 14:14:20 -0000
***************
*** 1228,1233 ****
--- 1228,1239 ----
        continue
        ;;
  
+       -jnimodule)
+       module=yes
+       jnimodule=yes
+       continue
+       ;;
+ 
        -no-fast-install)
        fast_install=no
        continue
***************
*** 5522,5527 ****
--- 5528,5534 ----
    -LLIBDIR          search LIBDIR for required installed libraries
    -lNAME            OUTPUT-FILE requires the installed library libNAME
    -module           build a library that can dlopened
+   -jnimodule        build a library that can dlopened via Java JNI
    -no-fast-install  disable the fast-install mode
    -no-install       link a not-installable executable
    -no-undefined     declare that a library does not refer to external symbols

-- 

        =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        Remember to send requests for assistance on
        new problems to address@hidden
        =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        Don Anderson                    address@hidden
        Sleepycat Software Inc.         +1-978-287-4781
        118 Tower Rd.                   http://www.sleepycat.com
        Lincoln, MA 01773




reply via email to

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