View Single Post
Old 7th January 2008, 01:14 PM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Compiling for GNU/Linux, OSX, and XP

Hello all,
So I have developed some plugins under GNU/Linux. I am able to compile the plugins and run them in the GNU/Linux version of AC3D without any trouble. I created a script to handle the compiling for me which is listed below in the code section.

So I guess what I would like to know is how do you compile under OSX and Windows? When I try to run this script in OSX, it fails b/c "ld" doens't know what the "-shared" flag is.

I have no idea how to compile in windows.

Does anyone have a script for compiling in either of the metioned OS's?

Code:
#!/bin/bash

AC3D_HOME=/Applications/creators/ac3dmac
AC3D_PLUGIN=$AC3D_HOME/plugins
AC3D_SCRIPTS=$AC3D_HOME/scripts

function compile {
    g++ -c $PROG.cpp
}

function linkIt {
    ld -shared $PROG.o -o $PROG.p
}

function copy {
    cp $PROG.p $AC3D_PLUGIN/.
    #cp $PROG.tcl $AC3D_SCRIPTS/.
    cp $PROG.tcl $AC3D_PLUGIN/.
}


if [ $1 ]; then
    PROG=$1
    echo 'Compiling '
    compile
    echo 'Linking'
    linkIt
    echo 'Copying'
    copy

else
    echo "Usage: compile <prog name>"
fi
conzar is offline   Reply With Quote