73bb0ad537a062de974fc2afd1f9ee138a8aec7c
[fedora-mingw.git] / filesystem / mingw32-configure.sh
1 #!/bin/sh -
2
3 # mingw32-configure
4 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # This is a useful command-line script which configures
21 # a program for cross-compilation.  It is meant to be
22 # the equivalent of the %{_mingw32_configure} macro in
23 # /etc/rpm/macros.mingw32
24
25 mingw32_prefix=/usr/i686-pc-mingw32/sys-root/mingw
26 mingw32_libdir=$mingw32_prefix/lib
27 mingw32_host=i686-pc-mingw32
28 mingw32_target=i686-pc-mingw32
29 mingw32_cc=i686-pc-mingw32-gcc
30 mingw32_cflags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
31
32 PKG_CONFIG_PATH="$mingw32_libdir/pkgconfig" \
33 CC="$mingw32_cc" \
34 CFLAGS="$mingw32_cflags" \
35 ./configure \
36   --host=$mingw32_host \
37   --target=$mingw32_target \
38   --prefix=$_mingw32_prefix \
39   "$@"