[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cinvoke-svn] r112 - in trunk/cinvoke: . bindings/java test
From: |
will |
Subject: |
[cinvoke-svn] r112 - in trunk/cinvoke: . bindings/java test |
Date: |
24 Aug 2006 16:48:27 -0400 |
Author: will
Date: 2006-08-24 16:48:26 -0400 (Thu, 24 Aug 2006)
New Revision: 112
Modified:
trunk/cinvoke/bindings/java/Makefile.templ
trunk/cinvoke/bindings/java/Test.java
trunk/cinvoke/configure.pl
trunk/cinvoke/test/Makefile.templ
Log:
fix java on solaris
Modified: trunk/cinvoke/bindings/java/Makefile.templ
===================================================================
--- trunk/cinvoke/bindings/java/Makefile.templ 2006-08-24 15:11:42 UTC (rev
111)
+++ trunk/cinvoke/bindings/java/Makefile.templ 2006-08-24 20:48:26 UTC (rev
112)
@@ -20,7 +20,7 @@
test:
javac Test.java
- LD_LIBRARY_PATH=. java Test
+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:. java Test
doc:
rm -rf javadoc
Modified: trunk/cinvoke/bindings/java/Test.java
===================================================================
--- trunk/cinvoke/bindings/java/Test.java 2006-08-24 15:11:42 UTC (rev
111)
+++ trunk/cinvoke/bindings/java/Test.java 2006-08-24 20:48:26 UTC (rev
112)
@@ -8,8 +8,11 @@
public static void main(String[] args) {
String libname;
- if (System.getProperty("os.name").equals("Mac OS X"))
+ String osname = System.getProperty("os.name");
+ if (osname.equals("Mac OS X"))
libname = "libc.dylib";
+ else if (osname.equals("SunOS"))
+ libname = "libc.so.1";
else
libname = "libc.so.6";
libc c = (libc)CInvoke.load(libname, libc.class);
Modified: trunk/cinvoke/configure.pl
===================================================================
--- trunk/cinvoke/configure.pl 2006-08-24 15:11:42 UTC (rev 111)
+++ trunk/cinvoke/configure.pl 2006-08-24 20:48:26 UTC (rev 112)
@@ -8,6 +8,7 @@
parse_args();
my $LINUX = 0;
+my $SOLARIS = 0;
my $platform = determine_platform();
print "Using platform '$platform'\n";
@@ -25,6 +26,14 @@
my $DYNCFLAGS;
my $LIBDL;
+# Solaris has an issue whereby all object files,
+# even those compiled in static libraries, must
+# have -fpic set if they will eventually be linked
+# by shared libraries
+if ($SOLARIS) {
+ $CFLAGS .= " -fpic";
+}
+
# Linux and OSX have libdl, *BSD doesn't
if ($LINUX || $platform =~ m/_OSX$/) {
$LIBDL = '-ldl';
@@ -44,10 +53,12 @@
} else {
$DYNEXT = 'so';
$JNIDYNEXT = 'so';
- $JNIINCLUDE = '';
+ if ($SOLARIS) { $JNIINCLUDE = '-I/usr/jdk/latest/include
-I/usr/jdk/latest/include/solaris'; }
+ else { $JNIINCLUDE = ''; }
$BUILDSHARED = 'gcc -shared -o';
$CXXBUILDSHARED = 'g++ -shared -o';
- $DYNCFLAGS = '-fpic';
+ if ($SOLARIS) { $DYNCFLAGS = ''; }
+ else { $DYNCFLAGS = '-fpic'; }
$BUILDSTATIC = 'rm -f $(TARGET) && ar rs';
$RANLIB = 'ranlib';
}
@@ -93,6 +104,8 @@
# specific unices
if ($uname =~ m/Linux/) {
$LINUX = 1;
+ } elsif ($uname =~ m/SunOS/) {
+ $SOLARIS = 1;
}
}
Modified: trunk/cinvoke/test/Makefile.templ
===================================================================
--- trunk/cinvoke/test/Makefile.templ 2006-08-24 15:11:42 UTC (rev 111)
+++ trunk/cinvoke/test/Makefile.templ 2006-08-24 20:48:26 UTC (rev 112)
@@ -6,7 +6,7 @@
rm -f lib.o $(SHARED) runtests
lib.o: lib.c
- gcc -g -c [DYNCFLAGS] lib.c -o lib.o -Wall -Werror
+ gcc [CFLAGS] [DYNCFLAGS] -c lib.c -o lib.o
$(SHARED): lib.o
[BUILDSHARED] $(SHARED) lib.o
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cinvoke-svn] r112 - in trunk/cinvoke: . bindings/java test,
will <=