libtool
[Top][All Lists]
Advanced

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

Re: Problem with shrext on Mac OS X


From: Peter O'Gorman
Subject: Re: Problem with shrext on Mac OS X
Date: Thu, 31 Jul 2008 17:58:24 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Ian Kerr wrote:
> Hello,
> 

Hi,

> I'm trying to build a JNI library and, from what I understand, the
> library needs to have a '.jnilib' extension on Mac OS X. 

Yes, the requirement was recently lifted, now java will also look for
.dylib.

http://developer.apple.com/releasenotes/Java/JavaLeopardRN/ResolvedIssues/chapter_3_section_14.html#

 As I
> understand it, I should be able to use the -shrext flag to get libtool
> to use the jnilib extension rather than the standard shared library
> extension.  However, I can't get this to work.  I issue the command:
> 
> /bin/sh ../../../libtool --mode=link g++ -shared -rpath /usr/local/lib
> -shrext .jnilib -o libjmath.la swig_math.lo
> 
> and the following g++ invocation is made:
> 
> g++ -dynamiclib  -single_module -flat_namespace -undefined suppress -o
> .libs/libjmath.0.dylib  .libs/swig_math.o   -install_name
> /usr/local/lib/libjmath.0.dylib -compatibility_version 1
> -current_version 1.0
> 
> As you can see, the extension isn't changed from dylib to jnilib. As I'm
> new to libtool I figure I'm doing something wrong.  Any ideas?

What version of libtool and what version of Mac OS X? This does work for me.

On Leopard, I get:
$ /usr/bin/glibtool --mode=link --tag=CXX g++ -shrext .jnilib -o java.la
java.lo -rpath /usr/local/lib -module -avoid-version

g++ ${wl}-undefined ${wl}dynamic_lookup -o .libs/java.jnilib -bundle
.libs/java.o

$ /usr/bin/glibtool --version
ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)

on a more recent libtool-2.2.x, I get:

libtool: link: /usr/bin/g++ -Wl,-undefined -Wl,dynamic_lookup -o
.libs/java.jnilib -bundle  .libs/java.o
libtool: link: dsymutil .libs/java.jnilib || :

Peter
-- 
Peter O'Gorman
http://pogma.com




reply via email to

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