LWJGL
May 25, 2013, 17:00:09 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [FIXED] AppletLoader bitness support for OS X  (Read 1597 times)
Simon Felix
Talks Too Much
***
Posts: 103



WWW
« on: May 12, 2011, 17:07:23 »

Although OS X supports fat/universal binaries not all libraries are built that way. It'd be useful for me to specify different native libraries for OS X depending on whether an applet runs with a 32bit or 64bit VM.

The (untested, as I don't have OS X) fix should be trivial:

Code:
    }
 
   } else if (osName.startsWith("Mac") || osName.startsWith("Darwin")) {
-      nativeJarList = getParameter("al_mac");
+  
+      // check if arch specific natives have been specified
+      if (System.getProperty("os.arch").endsWith("64")) {
+        nativeJarList = getParameter("al_mac64");
+      } else {
+        nativeJarList = getParameter("al_mac32");
+      }
+     
+      if (nativeJarList == null) {
+        nativeJarList = getParameter("al_mac");
+      }
+     
     } else if (osName.startsWith("Solaris") || osName.startsWith("SunOS")) {
       nativeJarList = getParameter("al_solaris");
     } else if (osName.startsWith("FreeBSD")) {

Cheers,
Simon
Logged

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/
kappa
Administrator
Nerdus Imperius
*****
Posts: 1113



« Reply #1 on: May 13, 2011, 01:55:35 »

Sounds like a good enhancement especially for non LWJGL natives and as its just a minor change can be added easily (hopefully tonight).
Logged
Simon Felix
Talks Too Much
***
Posts: 103



WWW
« Reply #2 on: May 13, 2011, 07:28:51 »

Did you ever know that you're my hero,
and everything I would like to be?
I can fly higher than an eagle,
'cause you are the wind beneath my wings.

 Smiley
Logged

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/
kappa
Administrator
Nerdus Imperius
*****
Posts: 1113



« Reply #3 on: May 13, 2011, 09:27:32 »

Code:
else if (osName.startsWith("Mac") || osName.startsWith("Darwin")) {

// check if arch specific natives have been specified
if (System.getProperty("os.arch").endsWith("64")) {
nativeJarList = getParameter("al_mac64");
} else if (System.getProperty("os.arch").endsWith("ppc")) {
nativeJarList = getParameter("al_macppc");
} else {
nativeJarList = getParameter("al_mac32");
}

if (nativeJarList == null) {
nativeJarList = getParameter("al_mac");
}

committed the above code, so you'd use al_mac32, al_mac64 or al_macppc otherwise if they are not specified the AppletLoader will fall back to al_mac parameter.
Logged
Simon Felix
Talks Too Much
***
Posts: 103



WWW
« Reply #4 on: May 13, 2011, 10:47:57 »

Well, "ppc" and "ppc64" are possible values for OS X. You'll probably want to change System.getProperty("os.arch").endsWith("ppc") instead of System.getProperty("os.arch").startsWith("ppc") to match both architectures.
Logged

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/
kappa
Administrator
Nerdus Imperius
*****
Posts: 1113



« Reply #5 on: May 13, 2011, 12:17:25 »

ah, good point, fixed.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!