Skip to content

Commit

Permalink
Start working on MinGW cross-toolchain for generating PE's.
Browse files Browse the repository at this point in the history
  • Loading branch information
pirofti committed Nov 12, 2011
1 parent 00db547 commit 7faf102
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 0 deletions.
55 changes: 55 additions & 0 deletions devel/mingw/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# $OpenBSD$

COMMENT = cross hosted tool chain for Windows

V = 1.0.1
BASENAME = x86-mingw32-build
DISTNAME = ${BASENAME}-${V}-sh
PKGNAME = mingw-${V}
WRKDIST = ${WRKDIR}/${BASENAME}-${V}
CATEGORIES = devel

HOMEPAGE = http://www.mingw.org

MAINTAINER = Paul Irofti <pirofti@openbsd.org>

# Public Domain
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes

EXTRACT_SUFX = .tar.bz2
EXTRACT_ONLY = ${DISTNAME}${EXTRACT_SUFX}

SCRIPT_MASTER = files/Other/Cross-Hosted%20MinGW%20Build%20Tool/${BASENAME}-${V}
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=mingw/}{SCRIPT_MASTER}-rc1

TOOL_SUFX = .tar.gz
TOOL_MASTER = ${MASTER_SITE_SOURCEFORGE:=mingw/}files/MinGW/Base/

TOOL_GCC = gcc-core-3.4.5-20060117-2
MASTER_SITES0 = ${TOOL_MASTER}gcc/Version3/Previous%20Release_%20{TOOL_GCC}

TOOL_BINUTILS = binutils-2.20.1
MASTER_SITES1 = ${TOOL_MASTER}binutils/${TOOL_BINUTILS}

TOOL_WRT = mingwrt-3.18
MASTER_SITES2 = ${TOOL_MASTER}mingw-rt/${TOOL_WRT}

TOOL_W32API = w32api-3.14
MASTER_SITES3 = ${TOOL_MASTER}w32api/${TOOL_W32API}

TOOLCHAIN = ${TOOL_BINUTILS}-src${TOOL_SUFX}:0 \
${TOOL_GCC}-src${TOOL_SUFX}:1 \
${TOOL_WRT}-mingw32-src${TOOL_SUFX}:2 \
${TOOL_W32API}-mingw32-src${TOOL_SUFX}:3

DISTFILES = ${DISTNAME}${EXTRACT_SUFX} ${TOOLCHAIN}

USE_GMAKE = Yes
do-build:
env WRKDIST=${WRKDIST} FULLDISTDIR=${FULLDISTDIR} WRKINST=${WRKINST} \
sh ${WRKBUILD}/${BASENAME}.sh

.include <bsd.port.mk>
1 change: 1 addition & 0 deletions devel/mingw/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix Makefile error in libiberty.
25 changes: 25 additions & 0 deletions devel/mingw/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
MD5 (binutils-2.20.1-src.tar.gz) = 3XDv8zhJezyfofn5ZNXNJg==
MD5 (gcc-core-3.4.5-20060117-2-src.tar.gz) = 0NydV9STiJvByoixJykLnQ==
MD5 (mingwrt-3.18-mingw32-src.tar.gz) = NLVMszefhx8NzVwgtpsDUA==
MD5 (w32api-3.14-mingw32-src.tar.gz) = wxuu2vKo04h04FahEqT7yA==
MD5 (x86-mingw32-build-1.0.1-sh.tar.bz2) = 5jf6x33dCRA8E24Mp5HLdQ==
RMD160 (binutils-2.20.1-src.tar.gz) = FZBmzCYPIrfY3+VTIVnw6EUti/0=
RMD160 (gcc-core-3.4.5-20060117-2-src.tar.gz) = Yk3VWsAPuhUmnxs7O71sODzCCCc=
RMD160 (mingwrt-3.18-mingw32-src.tar.gz) = c7a2x9S0OSlFKADC1/mJwxy7tvs=
RMD160 (w32api-3.14-mingw32-src.tar.gz) = XD+NFoJKIX4OYunG8A7UJxE+7Ss=
RMD160 (x86-mingw32-build-1.0.1-sh.tar.bz2) = FTnBeYj7dsIb0vDvZ2pGSqLLw0Y=
SHA1 (binutils-2.20.1-src.tar.gz) = ubOMYsIs69GRxperpNX6142bSGc=
SHA1 (gcc-core-3.4.5-20060117-2-src.tar.gz) = ddWQSfJtxi83MtEau/BW78e8jpU=
SHA1 (mingwrt-3.18-mingw32-src.tar.gz) = RfWrwNPYiwbcsiVt9AgK05/1Edg=
SHA1 (w32api-3.14-mingw32-src.tar.gz) = hR0t9rITwRow6WwFZl+R1o37POk=
SHA1 (x86-mingw32-build-1.0.1-sh.tar.bz2) = 3ZrKb/f/z3ih0adG27sB55oJArU=
SHA256 (binutils-2.20.1-src.tar.gz) = i3LZ5Rn6Fjt6FTQUILTKKlZe5JJ8RTdbwZzdHmPcq8k=
SHA256 (gcc-core-3.4.5-20060117-2-src.tar.gz) = ohwvSLtI1ik17pVayPoxhliGH2MW8w/rPN7FM3q/fwU=
SHA256 (mingwrt-3.18-mingw32-src.tar.gz) = 3kl5/W7t6yHS1Qb+SICoOHBtyIy+vgMeOFYZZ/t8vUI=
SHA256 (w32api-3.14-mingw32-src.tar.gz) = QVy+FyJfhR/kXzHkz+bo+F6qVYjrRFei7lfTRhTqCok=
SHA256 (x86-mingw32-build-1.0.1-sh.tar.bz2) = HnfSBRYD3dOwC+taAdR+R+xBu+ioh3y9GP39DLC+3zo=
SIZE (binutils-2.20.1-src.tar.gz) = 24222538
SIZE (gcc-core-3.4.5-20060117-2-src.tar.gz) = 17695876
SIZE (mingwrt-3.18-mingw32-src.tar.gz) = 391939
SIZE (w32api-3.14-mingw32-src.tar.gz) = 1220398
SIZE (x86-mingw32-build-1.0.1-sh.tar.bz2) = 24947
21 changes: 21 additions & 0 deletions devel/mingw/patches/patch-x86-mingw32-build_sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$OpenBSD$
--- x86-mingw32-build.sh.orig Thu Mar 11 00:16:55 2010
+++ x86-mingw32-build.sh Sat Nov 12 02:24:12 2011
@@ -68,7 +68,7 @@ do
# name, bearing no resemblance to the file requested.
#
( manifest=`echo *`
- $RUN wget $DOWNLOAD_HOST/$FILE$DOWNLOAD_OPTIONS && \
+ $RUN ftp -o $FILE $DOWNLOAD_HOST/$FILE$DOWNLOAD_OPTIONS && \
{ test -f $FILE || \
{ for file in `echo *`
do
@@ -124,7 +124,7 @@ $script: stage $STAGE: build $COMPONENT ..."
$RUN setbuilddir binutils*
$RUN ../configure --prefix="$INSTALL_DIR" --target="$TARGET" \
$GLOBAL_BASE_OPTIONS $BINUTILS_BASE_OPTIONS \
- --with-sysroot="${INSTALL_DIR}" || die $? \
+ --with-sysroot="${INSTALL_DIR}" --disable-werror || die $? \
"$unrecoverable configuring binutils"
fi
$RUN $MAKE CFLAGS="`echo $CFLAGS_FOR_BINUTILS`" \
82 changes: 82 additions & 0 deletions devel/mingw/patches/patch-x86-mingw32-build_sh_conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
$OpenBSD$
--- x86-mingw32-build.sh.conf.orig Thu Mar 11 00:16:55 2010
+++ x86-mingw32-build.sh.conf Sat Nov 12 02:15:45 2011
@@ -27,7 +27,7 @@
# operation; it may be overridden on a per-invocation basis, by
# invoking the script with the `--unattended' option.
#
- assume BUILD_METHOD interactive
+ assume BUILD_METHOD unattended
#
# 2) The preferred host, from which to download source packages.
# Note that this will not resolve to an acceptable host, without
@@ -35,17 +35,17 @@
# 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'
+# 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 $HOME/tmp/mingw-3.4.5
- assume PACKAGE_DIR $HOME/packages/mingw-3.4.5
- assume INSTALL_DIR $HOME/mingw32
+ assume WORKING_DIR ${WRKDIST}/build
+ assume PACKAGE_DIR ${FULLDISTDIR}
+ assume INSTALL_DIR ${WRKINST}
#
# 4) Package versions, from which the compiler will be built.
#
@@ -93,11 +93,11 @@
# 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
+# 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,
@@ -114,7 +114,7 @@
# 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 --enable-shared
option GLOBAL_USER_OPTIONS --disable-debug
#
option GCC_USER_OPTIONS --enable-sjlj-exceptions
@@ -129,13 +129,13 @@
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 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
1 change: 1 addition & 0 deletions devel/mingw/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cross-build toolchain generating applications for deployment on MS-Windows.

0 comments on commit 7faf102

Please sign in to comment.