Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How to compile JInput on 64-bit for 32-bit  (Read 2278 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Member




There is nothing common about common sense


« Posted 2012-05-23 11:52:51 »

I would like to build a 32-bit version of JInput for GNU/Linux.  The problem is, I only have 64-bit systems.  Is it possible to build a 32-bit version from the 64-bit version?  Or will I need to result to using a 32-bit VM?

The changes that I have made for GNU/Linux are:
* Added grab feature
* Added detecting if controllers have disconnected or connected

Ubuntu
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #1 - Posted 2012-05-23 11:56:11 »

Hi

The way the os arch is detected is by whatever the JVM tells it, so on windows, I build both on a 64 bit box by running 1 ant script in a 32 bit jdk and then again in a 64 bit, which spits out both. It can do this because 64 bit visual studio has both 32 and 64 bit compilers and libraries. If you 64 bit linux system has 32 bit libs for linking and can compile 32 bit code, then I see no reason that the same trick shouldn't work.

HTH

Endolf

Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #2 - Posted 2012-05-23 12:33:31 »

Thanks endolf.  I tried setting a 32-bit jvm that but it doesn't seem to work.

I suspect it has to do with the following condition.
1  
2  
3  
4  
   <target name="compileNativeJinputLib">
                <exec executable="uname" outputproperty="hwplatform">
                        <arg value="-m"/>
                </exec>


uname -m reports a 64-bit kernel.  Maybe I'll just install a 32-bit VM for the time being ...

Ubuntu
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #3 - Posted 2012-05-23 12:35:05 »

What happens if you frig it?, force it to do 32 bit and see if it compiles or not Smiley

Endolf

Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #4 - Posted 2012-05-23 12:40:26 »

It seems that your suggestion works.  At least it compiles.  I'll have to check it in a VM to see that it indeed compiled a 32-bit version and not a 64-bit.
Thanks for your help!!!!

Ubuntu
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #5 - Posted 2012-05-23 12:41:56 »

Cool, if it works, I might try and find a way to switch it based on the jdk used to compile, that way a 64 bit machine can compile both based on the jdk used to run the ant task.

Endolf

Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #6 - Posted 2012-05-23 12:53:08 »

Something like this
1  
2  
3  
<condition property="libname" value="${libname64}" else="${libname32}">
    <equals arg1="${os.arch}" arg2="amd64"/>
</condition>


Where on 32-bit jvms os.arch = i386 and on 64-bit jvms os.arch = amd64

Ubuntu
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #7 - Posted 2012-05-23 13:32:45 »

So it ended up not working.  It produced a 64-bit .so Sad 
I'm going to compile it on a 32-bit system now ...

Ubuntu
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (18 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (30 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (41 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!