Include the necessary header path and library path automatically, so

you don't need to specify -I/usr/local/mingw32/include
-L/usr/local/mingw32/lib manually to make things work.

OK pirofti@
This commit is contained in:
jeremy 2012-04-02 03:18:17 +00:00
parent 2af41ca8ed
commit 728ba90dfb
3 changed files with 36 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.3 2011/11/17 15:52:39 pirofti Exp $
# $OpenBSD: Makefile,v 1.4 2012/04/02 03:18:17 jeremy Exp $
COMMENT = development environment for native Windows applications
V = 1.0.1
REVISION = 1
REVISION = 2
BASENAME = x86-mingw32-build
DISTNAME = ${BASENAME}-${V}-sh
PKGNAME = mingw-${V}
@ -69,6 +69,9 @@ do-build:
CONFIG_SHELL=${LOCALBASE}/bin/bash \
/bin/sh ${WRKBUILD}/${BASENAME}.sh --no-pre-clean --no-post-clean \
--unattended
cd ${MINGW32_OUT}/lib/gcc/i386-mingw32/3.4.5/ && \
patch < ${FILESDIR}/specs.diff && \
${SUBST_CMD} specs
do-install:
# Fix the autoconf mess

View File

@ -0,0 +1,29 @@
--- specs Thu Nov 17 15:46:31 2011
+++ specs Tue Nov 29 08:24:57 2011
@@ -15,7 +15,7 @@
as %(asm_options) %m.s %A }
*cpp:
-%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}
+%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} -I${LOCALBASE}/mingw32/include
*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}
@@ -54,7 +54,7 @@
%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
*startfile:
-%{shared|mdll:dllcrt2%O%s} %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s} %{!fno-exceptions:crtbegin%O%s}
+%{shared|mdll:${LOCALBASE}/mingw32/lib/dllcrt2%O%s} %{!shared:%{!mdll:${LOCALBASE}/mingw32/lib/crt2%O%s}} %{pg:${LOCALBASE}/mingw32/lib/gcrt2%O%s} %{!fno-exceptions:${LOCALBASE}/mingw32/lib/gcc/i386-mingw32/3.4.5/crtbegin%O%s}
*switches_need_spaces:
@@ -87,7 +87,7 @@
collect2
*link_libgcc:
-%D
+%D -L${LOCALBASE}/mingw32/lib
*md_exec_prefix:

View File

@ -1,4 +1,4 @@
$OpenBSD: README,v 1.2 2011/11/17 14:41:59 pirofti Exp $
$OpenBSD: README,v 1.3 2012/04/02 03:18:17 jeremy Exp $
+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
@ -27,8 +27,7 @@ int main (void)
return 0;
}
$ g++ -L/usr/local/mingw32/lib -I/usr/local/mingw32/include \
CreateFile_test.cpp -o CreateFile_test.exe
$ g++ CreateFile_test.cpp -o CreateFile_test.exe
$ file CreateFile_test.exe
CreateFile_test.exe: MS-DOS executable PE for MS Windows (console)
Intel 80386 32-bit