From 0e2c27359ef1c5e36c461c15a2855d7bdcfcb892 Mon Sep 17 00:00:00 2001 From: Roberto Metere Date: Sat, 30 Jun 2012 12:31:26 -0400 Subject: [PATCH] development/x86-mingw32-build: Added (Minimalistic GNU for Windows) Signed-off-by: dsomero --- development/x86-mingw32-build/README | 32 ++++ development/x86-mingw32-build/slack-desc | 19 +++ .../x86-mingw32-build.SlackBuild | 119 +++++++++++++ .../x86-mingw32-build/x86-mingw32-build.info | 26 +++ .../x86-mingw32-build.sh.conf | 159 ++++++++++++++++++ 5 files changed, 355 insertions(+) create mode 100644 development/x86-mingw32-build/README create mode 100644 development/x86-mingw32-build/slack-desc create mode 100644 development/x86-mingw32-build/x86-mingw32-build.SlackBuild create mode 100644 development/x86-mingw32-build/x86-mingw32-build.info create mode 100644 development/x86-mingw32-build/x86-mingw32-build.sh.conf diff --git a/development/x86-mingw32-build/README b/development/x86-mingw32-build/README new file mode 100644 index 0000000000..20145e1c0d --- /dev/null +++ b/development/x86-mingw32-build/README @@ -0,0 +1,32 @@ +MinGW cross compiler for Linux build environment + +As of this writing, the MinGW Project does not support any official +build of GCC, more recent than GCC-3.4.5, for use as a cross hosted +MinGW development tool, on any platform. This is unlikely to change, +until after an officially supported stable GCC-4.x version has been +released, for native use on the MS-Windows platform. + +This slackbuild will compile MinGW with + GCC: 3.4.5 + Binutils: 2.20.1 + MinGW Runtime: 3.18 + W32Api: 3.14 + +GCC packages included are: + ada (no) + c++ (yes) + f77 (yes) + java (yes) + objc (yes) + +If you're planning to compile MinGW with different versions of the +packages, like GCC-4.4.0 (stable), you might download them before in +a specified directory. In this case you might want to modify the +configuration file "x86-mingw32-build.sh.conf". + +Moreover, if you're planning to disable/enable some GCC package, like +disabling "java" or "objc", just modify the configuration file +"x86-mingw32-build.sh.conf" commenting or not the corresponding lines, +which are very easy to find. +Actually "ada" gave me some problem and I disabled it from this +SlackBuild. diff --git a/development/x86-mingw32-build/slack-desc b/development/x86-mingw32-build/slack-desc new file mode 100644 index 0000000000..ae8ad5cc6d --- /dev/null +++ b/development/x86-mingw32-build/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +x86-mingw32-build: MinGW (Minimalistic GNU for Windows) +x86-mingw32-build: +x86-mingw32-build: MinGW is a collection of freely available and freely +x86-mingw32-build: distributable Windows specific header files and import +x86-mingw32-build: libraries combined with GNU toolsets that allow one to produce +x86-mingw32-build: native Windows programs that do not rely on any 3rd-party C +x86-mingw32-build: runtime DLLs. +x86-mingw32-build: +x86-mingw32-build: +x86-mingw32-build: +x86-mingw32-build: diff --git a/development/x86-mingw32-build/x86-mingw32-build.SlackBuild b/development/x86-mingw32-build/x86-mingw32-build.SlackBuild new file mode 100644 index 0000000000..81b8161e33 --- /dev/null +++ b/development/x86-mingw32-build/x86-mingw32-build.SlackBuild @@ -0,0 +1,119 @@ +#!/bin/sh + +# Slackware build script for x86-mingw32-build + +# Copyright (c) 2010 Roberto Metere. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=x86-mingw32-build +VERSION=1.0.1 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar -xvf $CWD/$PRGNAM-$VERSION-sh.tar.* +cd $PRGNAM-$VERSION +chown -R root:root . +chmod -R a-s,u+w,go+r-w . + +# Creating the configuration script +CONF_SCRIPT=$CWD/x86-mingw32-build.sh.conf +CONF_SCRIPT_WDIR=/$TMP/$PRGNAM/mingw32 +CONF_SCRIPT_PDIR=$CWD +CONF_SCRIPT_IDIR=$PKG/usr/share/mingw32 + +cat ${CONF_SCRIPT}_src_1 > $CONF_SCRIPT +echo " assume WORKING_DIR $CONF_SCRIPT_WDIR" >> $CONF_SCRIPT +echo " assume PACKAGE_DIR $CONF_SCRIPT_PDIR" >> $CONF_SCRIPT +echo " assume INSTALL_DIR $CONF_SCRIPT_IDIR" >> $CONF_SCRIPT +cat ${CONF_SCRIPT}_src_2 >> $CONF_SCRIPT + +# Patch configuration and script files overwriting slackbuild-ready files +cp $CONF_SCRIPT . + +sh x86-mingw32-build.sh \ + --unattended + +# Link the binaries to the /usr/bin directory +cd $PKG/usr/share/mingw32/bin/ +BINARY_LIST=`ls | grep '-'` +cd $TMP + +mkdir -p $PKG/usr/bin +cd $PKG/usr/bin +for i in $BINARY_LIST +do + # They MUST be relative + ln -sf "../share/mingw32/bin/$i" $i +done +cd $TMP/$PRGNAM-$VERSION + + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mv $PKG/usr/share/mingw32/man $PKG/usr +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +# Don't clobber out stock man pages. +rm -rf $PKG/usr/man/man7 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/development/x86-mingw32-build/x86-mingw32-build.info b/development/x86-mingw32-build/x86-mingw32-build.info new file mode 100644 index 0000000000..a85938af8a --- /dev/null +++ b/development/x86-mingw32-build/x86-mingw32-build.info @@ -0,0 +1,26 @@ +PRGNAM="x86-mingw32-build" +VERSION="1.0.1" +HOMEPAGE="http://www.mingw.org/" +DOWNLOAD="http://downloads.sourceforge.net/project/mingw/Other/Cross-Hosted%20MinGW%20Build%20Tool/x86-mingw32-build-1.0.1-rc1/x86-mingw32-build-1.0.1-sh.tar.bz2 \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/binutils/binutils-2.20.1/binutils-2.20.1-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/mingw-rt/mingwrt-3.18/mingwrt-3.18-mingw32-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/w32api/w32api-3.14/w32api-3.14-mingw32-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version3/Previous%20Release_%20gcc-3.4.5-20060117-2/gcc-objc-3.4.5-20060117-2-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version3/Previous%20Release_%20gcc-3.4.5-20060117-2/gcc-java-3.4.5-20060117-2-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version3/Previous%20Release_%20gcc-3.4.5-20060117-2/gcc-g77-3.4.5-20060117-2-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version3/Previous%20Release_%20gcc-3.4.5-20060117-2/gcc-g%2B%2B-3.4.5-20060117-2-src.tar.gz \ + http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version3/Previous%20Release_%20gcc-3.4.5-20060117-2/gcc-core-3.4.5-20060117-2-src.tar.gz" +MD5SUM=" e637fac77ddd09103c136e0ca791cb75 \ + dd70eff338497b3c9fa1f9f964d5cd26 \ + 34b54cb3379f871f0dcd5c20b69b0350 \ + c31baedaf2a8d38874e056a112a4fbc8 \ + 2bffc1e314f2efb1034b3d3ea1ce2f7d \ + 96b039f4e11bff4d3d8a4e7da6e3998d \ + 57d489658743f0d9048e440b312740c8 \ + ca81c8420ab9d1d05ff9c73a9d4f7d63 \ + d0dc9d57d493889bc1ca88b127290b9d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Roberto Metere" +EMAIL="roberto@metere.it" +APPROVED="dsomero" diff --git a/development/x86-mingw32-build/x86-mingw32-build.sh.conf b/development/x86-mingw32-build/x86-mingw32-build.sh.conf new file mode 100644 index 0000000000..1a69eacec9 --- /dev/null +++ b/development/x86-mingw32-build/x86-mingw32-build.sh.conf @@ -0,0 +1,159 @@ +# x86-mingw32-build.sh.conf -*- sh -*- vim: filetype=sh +# $Id: x86-mingw32-build.sh.conf,v 1.10 2010/03/10 22:16:55 keithmarshall Exp $ +# +# Define user configurable parameters for mingw32 cross-compiler build. +# +# This file is a component of the x86-mingw32-build script; it is not +# intended for stand alone use. +# +# x86-mingw32-build is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# x86-mingw32-build is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for further details. +# +# You should have received a copy of the GNU General Public License along +# with x86-mingw32-build; see the file COPYING. If not, write to the Free +# Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, +# USA. +# +# +# 1) Whether the build script should run interactively, or unattended; +# change this ONLY if you wish to PERMANENTLY disable interactive +# operation; it may be overridden on a per-invocation basis, by +# invoking the script with the `--unattended' option. +# + assume BUILD_METHOD interactive +# +# 2) The preferred host, from which to download source packages. +# Note that this will not resolve to an acceptable host, without +# modification; substitute one of the host names selected from +# the `x86-mingw32-build.sh.hosts' file for the `mirror' field +# in the following URL, to establish a default download host. +# + assume DOWNLOAD_HOST http://prdownloads.sourceforge.net/mingw + assume DOWNLOAD_OPTIONS '?download&use_mirror=mirror' +# +# 3) Directories to use for temporary working space, package storage, +# and ultimate compiler installation. You should adjust these to +# match your own host configuration; note that you MUST have WRITE +# permission for each directory specified. +# + assume WORKING_DIR //tmp/SBo/x86-mingw32-build/mingw32 + assume PACKAGE_DIR /home/gizzmo/build/stage1/x86-mingw32-build + assume INSTALL_DIR /tmp/SBo/package-x86-mingw32-build/usr/share/mingw32 +# +# 4) Package versions, from which the compiler will be built. +# + assume GCC_VERSION 3.4.5-20060117-2 + assume BINUTILS_VERSION 2.20.1 + assume RUNTIME_VERSION 3.18 + assume W32API_VERSION 3.14 +# +# 5) Automatic patching of downloaded packages: if any appropriately +# named patch sets are placed in the nominated patches directory, +# they will be automatically applied, when the package archive is +# expanded. Patches are associated with their related package by +# naming convention; i.e. `binutils--patch-' will be +# associated with the `binutils--src' package. Multiple +# patches may be associated with any single source package; they +# will be applied in increasing order of the serialisation +# suffix, (which should ideally be a two digit number). +# +# All patches should be prepared consistently, assuming that they +# will be applied with the current working directory being that in +# which the package archive is expanded, using a patch command of +# the form `patch $PATCHFLAGS < $PATCHES_DIR/'. +# + assume PATCHFLAGS -p0 + assume PATCHES_DIR $PACKAGE_DIR/patches +# +# 6) Components to be built. These are listed in the order they +# should be built; DO NOT CHANGE IT! If you wish to omit any +# component, you may comment it out. +# + option BUILD_COMPONENTS headers + option BUILD_COMPONENTS binutils + option BUILD_COMPONENTS gcc + option BUILD_COMPONENTS w32api + option BUILD_COMPONENTS mingw-runtime +# +# 7) GCC language options. The compiler MUST be built to support +# at least `C' language. +# + assume GCC_LANGUAGE_SET c +# +# Support for other languages is available at the user's option; +# for interactive use, any of the following may be selected at +# run time; for batch use, ALL listed here will be selected, if +# the corresponding package is available in the PACKAGE_DIR, or +# if it is selected for download. +# +# option GCC_LANGUAGE_OPTIONS ada + option GCC_LANGUAGE_OPTIONS c++ + option GCC_LANGUAGE_OPTIONS f77 + option GCC_LANGUAGE_OPTIONS java + option GCC_LANGUAGE_OPTIONS objc +# +# 8) User preferences for configuration options. These have been +# preconfigured to match the setup of the prebuilt compiler suite, +# as distributed by the MinGW Project, for native use on MS-Win32 +# hosts; comment out any which you do not want to apply, for your +# cross-compiler build. +# +# Note: DO NOT add `--enable-languages=...' to any `USER' or `BASE' +# options class; this is properly defined by `GCC_LANGUAGE_OPTIONS', +# as specified above. +# +# Caution: DO NOT add `--with-sysroot=...' to any `USER' or `BASE' +# options class. `--with-sysroot=$INSTALL_DIR' is hardwired in the +# build script; tampering with it here may damage the build. +# + option GLOBAL_USER_OPTIONS --disable-nls + option GLOBAL_USER_OPTIONS --disable-shared + option GLOBAL_USER_OPTIONS --disable-debug +# + option GCC_USER_OPTIONS --enable-sjlj-exceptions +# +# 9) Standard settings, as used for the prebuilt Win32 native compiler +# suite. Only advanced users should tinker with these settings. +# + option GLOBAL_BASE_OPTIONS --with-gcc + option GLOBAL_BASE_OPTIONS --with-gnu-as + option GLOBAL_BASE_OPTIONS --with-gnu-ld +# + option GCC_BASE_OPTIONS --enable-threads=win32 + option GCC_BASE_OPTIONS --disable-win32-registry +# + option GCC_JAVA_BASE_OPTIONS --enable-libgcj + option GCC_JAVA_BASE_OPTIONS --disable-libgcj-debug + option GCC_JAVA_BASE_OPTIONS --disable-java-awt + option GCC_JAVA_BASE_OPTIONS --enable-java-gc=boehm + option GCC_JAVA_BASE_OPTIONS --enable-interpreter + option GCC_JAVA_BASE_OPTIONS --enable-hash-synchronization + option GCC_JAVA_BASE_OPTIONS --without-x +# + option CFLAGS_FOR_BINUTILS -O2 + option CFLAGS_FOR_BINUTILS -fno-exceptions +# + option LDFLAGS_FOR_BINUTILS -s +# + option CFLAGS_FOR_GCC -O2 + option CFLAGS_FOR_GCC -fomit-frame-pointer +# + option LDFLAGS_FOR_GCC -s +# +# CFLAGS_FOR_RUNTIME and LDFLAGS_FOR_RUNTIME are applied when building +# both the mingw-runtime and the w32api libraries:-- +# + option CFLAGS_FOR_RUNTIME -O2 + option CFLAGS_FOR_RUNTIME -mms-bitfields + option CFLAGS_FOR_RUNTIME -march=${TARGET_CPU-i386} +# + option LDFLAGS_FOR_RUNTIME -s +# +# $RCSfile: x86-mingw32-build.sh.conf,v $Revision: 1.10 $: end of file