Category Archives: gentoo

compiling windows apps on linux

now that we successfully used cmake to compile a linux app (in the last article), we will now try and compile it for windows.

I am doing this on Gentoo linux, so your mileage may vary if you used a different distribution.

I am starting with http://gentoo-wiki.com/HOWTO_MinGW as a rough guide.

  • # emerge -va sys-devel/crossdev
  • # echo ‘PORTDIR_OVERLAY=”/usr/i686-mingw32/usr/portage /usr/local/portage $PORTDIR_OVERLAY”‘ >> /etc/make.conf
  • create the directory /usr/i686-mingw32/usr/portage
  • install the toolchain: # crossdev i686-mingw32

With Ubuntu/Debian you can simply install it using apt: “apt-get install mingw32”. This will install the toolchain as i586-mingw32msvc-gcc to /usr/bin/ .emerge the packages you want to have as cross compiled programs or libraries.

Once you have installed ming32, it is easy to compile for linux:

#  i686-mingw32-gcc helloworld.cpp -o wintest.exe

Now the next step in the puxxle is to get cmake to compile for both OSes  each time make is run.

Leave a comment

Filed under C++, CDT, cmake, gentoo, linux, windows

Installing eclipse 3.3 on Gentoo

Today was the day to get eclipse going on Gentoo. I downloaded the latest version (3.3) and dropped it into /opt/eclipse.

I fired it up and got:

# ./eclipse
* run-java-tool is not available for sun-jdk-1.6 on i686
* IMPORTANT: some Java tools are not available on some VMs on some architectures

so, clearly it did not like my java.

I know my java is good:

# java-config -L
The following VMs are available for generation-2:
1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2]
2) Sun JDK 1.4.2.13 [sun-jdk-1.4]
3) Sun JDK 1.5.0.10 [sun-jdk-1.5]
*) Sun JDK 1.6.0 [sun-jdk-1.6]

Looking around, I found the following:

Java on Gentoo uses /usr/bin/run-java-tool instead of /usr/bin/java (which links to run-java-tool)

the trick is to edit /usr/bin/run-java-tool

after:

tool=$(basename $0)

add

[[ $tool = “run-java-tool” ]] && tool=”java”

then eclipse started perfectly.

5 Comments

Filed under Eclipse, gentoo, Java, linux

Getting ready for eclipse on Gentoo

Getting ready for eclipse 3.3 on Gentoo, I first need to get my system configured to use a more recent version of Java instead of the default 1.4.

Here is a site dedicated to gentoo java: http://www.gentoo.org/proj/en/java/

the first thing to do is emerge java


get rid of old versions
# emerge -C java-config
add the newest
# emerge -uND java-config

to see what versions are installed, do:

# java-config --list-available-vms
The following VMs are available for generation-2:
1) Blackdown JDK 1.4.2.03 [blackdown-jdk-1.4.2]
2) Blackdown JRE 1.4.2.03 [blackdown-jre-1.4.2]
3) Blackdown 32bit JRE 1.4.2.03 [emul-linux-x86-java-1.4.2]
4) Sun 32bit JRE 1.5.0.08 [emul-linux-x86-java-1.5]
5) Kaffe 1.1.7 [kaffe]
*) Sun JDK 1.5.0.08 [sun-jdk-1.5]

to change the jvm, do:

(By handle (preferred))
# java-config --set-system-vm blackdown-jdk-1.4
Now using blackdown-jdk-1.4 as your generation-2 system JVM
(By number)
# java-config --set-system-vm 6
Now using sun-jdk-1.5 as your generation-2 system JVM

Leave a comment

Filed under Eclipse, gentoo, linux

moving to linux

Well, I finally made the decision to move to Linux from Windows XP.

I have decided upon using Gentoo as my platform of choice.  Gentoo seems to be the most cutting edge, as it supports installations via compiling everything from source, which gives me the ultimate in flexibility.

The only downside is that it takes a long time to get stuff installed.

More soon…

Leave a comment

Filed under gentoo, linux