Difference between revisions of "Autobuild/Quick Start/build-cmd.sh"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "<pre> {'package_description': {'copyright': 'Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>', 'description': u'The GNU Hello program…")
 
 
Line 1: Line 1:
<pre>
<pre>
{'package_description': {'copyright': 'Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>',
#!/bin/bash
                        'description': u'The GNU Hello program produces a familiar, friendly greeting. Yes, this is another implementation of the classic program that prints \u201cHello, world!\u201d when you run it.',
 
                        'license': 'gpl3',
# turn on verbose debugging output for parabuild logs.
                        'license_file': 'LICENSES/hello.txt',
set -x
                        'name': 'hello',
# make errors fatal
                        'platforms': {'common': {'configurations': {'default': {'build': {'command': '../build-cmd.sh'},
set -e
                                                                                'name': 'default'}},
 
                                                  'manifest': ['include/hello/*.h',
if [ -z "$AUTOBUILD" ] ; then
                                                              'LICENSES/hello.txt'],
    fail
                                                  'name': 'common'},
fi
                                      'darwin': {'build_directory': 'stage',
 
                                                  'configurations': {'default': {'build': {},
if [ "$OSTYPE" = "cygwin" ] ; then
                                                                                'default': 'true',
    export AUTOBUILD="$(cygpath -u $AUTOBUILD)"
                                                                                'name': 'default'}},
fi
                                                  'manifest': ['lib/*.a',
 
                                                              'bin/*'],
HELLO_VERSION="2.6"
                                                  'name': 'darwin'},
HELLO_SOURCE_DIR="hello-$HELLO_VERSION"
                                      'linux': {'build_directory': 'stage',
HELLO_ARCHIVE="hello-$HELLO_VERSION.tar.gz"
                                                'configurations': {'default': {'build': {},
HELLO_URL="http://ftp.gnu.org/gnu/hello/$HELLO_ARCHIVE"
                                                                                'default': 'true',
HELLO_MD5="066ba7113eed3554cde6bc34b7b43e9b" # for hello-2.6.tar.gz
                                                                                'name': 'default'}},
 
                                                'manifest': ['lib/*.a',
# load autbuild provided shell functions and variables
                                                              'bin/*'],
eval "$("$AUTOBUILD" source_environment)"
                                                'name': 'linux'},
 
                                      'windows': {'build_directory': 'stage',
fetch_archive "$HELLO_URL" "$HELLO_ARCHIVE" "$HELLO_MD5"
                                                  'configurations': {'default': {'build': {},
extract "$HELLO_ARCHIVE"
                                                                                  'default': 'true',
 
                                                                                  'name': 'default'}},
top="$(cd $(dirname $0) ; pwd)"
                                                  'manifest': ['lib/debug/*.pdb',
stage="$(pwd)"
                                                                'lib/release/*.pdb',
 
                                                                'lib/release/*.lib',
pushd "$HELLO_SOURCE_DIR"
                                                                'lib/debug/*.lib',
    case "$AUTOBUILD_PLATFORM" in
                                                                'bin/*.exe'],
        "windows")
                                                  'name': 'windows'}},
            fail "GNU hello doesn't really build on windows. I guess I chose a bad example, sorry! -Brad"
                        'version': '2.6'},
        ;;
'type': 'autobuild',
        "darwin")
'version': '1.2'}
            opts='-arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk'
            CFLAGS="$opts" CXXFLAGS="$opts" ./configure  --prefix="$stage"
            make
            make install
        ;;
        "linux")
            # TODO: see darwin notes here above
            CFLAGS=-m32 CXXFLAGS=-m32 CC=gcc-4.1 CXX=g++-4.1 ./configure --prefix="$stage"
            make
            make install
        ;;
    esac
    mkdir -p "$stage/LICENSES"
    cp COPYING "$stage/LICENSES/hello.txt"
popd
 
pass
</pre>
</pre>


[[Category:Open Source Portal]]
[[Category:Open Source Portal]]

Latest revision as of 17:11, 4 January 2011

#!/bin/bash

# turn on verbose debugging output for parabuild logs.
set -x
# make errors fatal
set -e

if [ -z "$AUTOBUILD" ] ; then 
    fail
fi

if [ "$OSTYPE" = "cygwin" ] ; then
    export AUTOBUILD="$(cygpath -u $AUTOBUILD)"
fi

HELLO_VERSION="2.6"
HELLO_SOURCE_DIR="hello-$HELLO_VERSION"
HELLO_ARCHIVE="hello-$HELLO_VERSION.tar.gz"
HELLO_URL="http://ftp.gnu.org/gnu/hello/$HELLO_ARCHIVE"
HELLO_MD5="066ba7113eed3554cde6bc34b7b43e9b" # for hello-2.6.tar.gz

# load autbuild provided shell functions and variables
eval "$("$AUTOBUILD" source_environment)"

fetch_archive "$HELLO_URL" "$HELLO_ARCHIVE" "$HELLO_MD5"
extract "$HELLO_ARCHIVE"

top="$(cd $(dirname $0) ; pwd)"
stage="$(pwd)"

pushd "$HELLO_SOURCE_DIR"
    case "$AUTOBUILD_PLATFORM" in
        "windows")
            fail "GNU hello doesn't really build on windows. I guess I chose a bad example, sorry! -Brad"
        ;;
        "darwin")
            opts='-arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.4u.sdk'
            CFLAGS="$opts" CXXFLAGS="$opts" ./configure  --prefix="$stage"
            make
            make install
        ;;
        "linux")
            # TODO: see darwin notes here above
            CFLAGS=-m32 CXXFLAGS=-m32 CC=gcc-4.1 CXX=g++-4.1 ./configure --prefix="$stage"
            make
            make install
        ;;
    esac
    mkdir -p "$stage/LICENSES"
    cp COPYING "$stage/LICENSES/hello.txt"
popd

pass