This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
cheers, Mitch
#----------------------------------------------------- # # BEGIN USER SETTINGS # # You need to review and adjust the macros that follow # #-----------------------------------------------------
# What directory will the cross-compiler be built in? # This is the directory into which source archives will # be downloaded, expanded, compiled, etc. You need to # have write-access to this directory. If you leave it # blank, it defaults to the current directory.
# Where does the cross-compiler go? # This should be the directory into which your cross-compiler # will be installed. Remember that if you set this to a directory # that only root has write access to, you will need to run this # script as root.
# Purge anything and everything already in the $PREFIX #(also known as the destination or installation) directory? # Set to "Y" to purge, any other value omits the purge step.
# Set the following to the files from the current MinGW release # (or whichever MinGW release you wish to build and install) # You need to set both the URL they will be downloaded from # and the exact name of the individual component files.
# GCC_CORE is required; the other components are optional. # Set any you don't want to "". You need binutils, # mingw runtime and w32api; do not ever set those to "".
GCC_CORE_ARCHIVE="gcc-core-4.0.2.tar.gz" # GCC_GPP_ARCHIVE="gcc-g++-4.0.2.tar.gz" GCC_OBJC_ARCHIVE="gcc-objc-4.0.2.tar.gz"
# GCC_G77_ARCHIVE="gcc-g77-3.4.2-20040916-1-src.tar.gz" # GCC_OBJC_ARCHIVE="gcc-objc-3.4.2-20040916-1-src.tar.gz" # GCC_JAVA_ARCHIVE="gcc-java-3.4.2-20040916-1-src.tar.gz" GCC_ADA_ARCHIVE="" GCC_PATCH=""
# "The specified version of binutils did not build for me (on neither # Debian amd64 nor i386), whereas binutils-2.16.91-20050827-1-src.tar.gz # built fine on both. " # # - JoelDice # # BINUTILS_ARCHIVE="binutils-2.15.91-20040904-1-src.tar.gz"
#----------------------------------------------------- # # END USER SETTINGS # # The remainder of the script should not neet any edits # #-----------------------------------------------------
GCC_CORE="" BINUTILS="" GCC_LANGS="c"
if [ "x$BUILDDIR" = "x" ]; then # Default to the current directory BUILDDIR=$(pwd) fi SRCDIR="$BUILDDIR/source"
#----------------------------------------------------- # # Functions that do most of the work # #-----------------------------------------------------
function download_files { # Download a file from a given url, only if it is not present mkdir -p "$SRCDIR"
# Make sure wget is installed if test "x`which wget`" = "x" ; then echo "You need to install wget." exit 1 fi
if [ "x$GCC_GPP_ARCHIVE" != "x" ]; then download_file "$GCC_GPP_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_G77_ARCHIVE" != "x" ]; then download_file "$GCC_G77_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_OBJC_ARCHIVE" != "x" ]; then download_file "$GCC_OBJC_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_JAVA_ARCHIVE" != "x" ]; then download_file "$GCC_JAVA_ARCHIVE" "$GCC_URL" fi if [ "x$GCC_ADA_ARCHIVE" != "x" ]; then download_file "$GCC_ADA_ARCHIVE" "$GCC_URL" fi
download_file "$BINUTILS_ARCHIVE" "$MINGW_URL" download_file "$MINGW_ARCHIVE" "$MINGW_URL" download_file "$W32API_ARCHIVE" "$MINGW_URL"
function download_file { cd "$SRCDIR" if test ! -f $1 ; then echo "Downloading $1" wget "$2/$1" if test ! -f $1 ; then echo "Could not download $1" exit 1 fi else echo "Found $1 in the srcdir $SRCDIR" fi cd "$BUILDDIR" }
function purge_existing_install { echo "Purging the existing files in $PREFIX" if cd "$PREFIX"; then rm -rf * fi cd "$BUILDDIR" }
function install_libs { echo "Installing cross libs and includes"
mkdir -p "$PREFIX/$TARGET" cd "$PREFIX" ln -s "$TARGET" usr
cd "$PREFIX/$TARGET" tar -xzf "$SRCDIR/$MINGW_ARCHIVE" tar -xzf "$SRCDIR/$W32API_ARCHIVE"
cd "$BUILDDIR" }
function extract_binutils { cd "$SRCDIR" BINUTILS=`tar -tzf "$SRCDIR/$BINUTILS_ARCHIVE" | head -n 1` rm -rf "$BINUTILS" echo "Extracting binutils" tar -xzf "$SRCDIR/$BINUTILS_ARCHIVE" cd "$BUILDDIR" }
function extract_gcc { cd "$SRCDIR" GCC=`tar -tzf "$SRCDIR/$GCC_CORE_ARCHIVE" | head -n 1` rm -rf "$GCC" echo "Extracting gcc" tar -xzf "$SRCDIR/$GCC_CORE_ARCHIVE" if [ "x$GCC_GPP_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",c++" tar -xzf "$SRCDIR/$GCC_GPP_ARCHIVE" fi if [ "x$GCC_G77_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",f77" tar -xzf "$SRCDIR/$GCC_G77_ARCHIVE" fi if [ "x$GCC_OBJC_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",objc" tar -xzf "$SRCDIR/$GCC_OBJC_ARCHIVE" fi if [ "x$GCC_JAVA_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",java" tar -xzf "$SRCDIR/$GCC_JAVA_ARCHIVE" fi if [ "x$GCC_ADA_ARCHIVE" != "x" ]; then GCC_LANGS=${GCC_LANGS}",ada" tar -xzf "$SRCDIR/$GCC_ADA_ARCHIVE" fi cd "$BUILDDIR" }
function patch_gcc { if [ "$GCC_PATCH" != "" ]; then echo "Patching gcc" cd "$SRCDIR/$GCC" patch -p1 < "$SRCDIR/$GCC_PATCH" cd "$BUILDDIR" fi }
function final_tweaks { echo "Finalizing installation"
# remove gcc build headers rm -rf "$PREFIX/$TARGET/sys-include"
# make cc and c++ symlinks to gcc and g++ # if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then # ln "$PREFIX/bin/$TARGET-g++" "$PREFIX/$TARGET/bin/g++" # fi # if [ ! -f "$PREFIX/$TARGET/bin/cc" ]; then # ln -s "gcc" "$PREFIX/$TARGET/bin/cc" # fi # if [ ! -f "$PREFIX/$TARGET/bin/c++" ]; then # ln -s "g++" "$PREFIX/$TARGET/bin/c++" # fi
# copy gsl headers to sdk mkdir -p "$PREFIX/$TARGET/include" cp -r /usr/local/include/gsl "$PREFIX/$TARGET/include"
# copy static libraries to sdk cp /usr/local/mingw/lib/* "$PREFIX/$TARGET/lib"
echo "Installation complete!" }
# # Main part of the script #
if [ "x$PURGE_DIR" = "xY" ]; then purge_existing_install fi
extract_binutils configure_binutils build_binutils install_binutils
extract_gcc patch_gcc configure_gcc build_gcc install_gcc
# # End #
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |