Difference between revisions of "Autobuild/Quick Start/build-cmd.sh"
< Autobuild | Quick Start
Jump to navigation
Jump to search
Alain Linden (talk | contribs) (Created page with "<pre> {'package_description': {'copyright': 'Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>', 'description': u'The GNU Hello program…") |
Alain Linden (talk | contribs) |
||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
#!/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 | |||
</pre> | </pre> | ||
[[Category:Open Source Portal]] | [[Category:Open Source Portal]] |
Latest revision as of 16: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