Add PhysicsFS instructions
[mingw-xscripts.git] / mingw-environment.sh
blob28c4d75958f91d5b004da79e1a17184771c00b60
1 # This file is in the public domain for what it's worth.
2 # Written by Jānis Rūcis <parasti@gmail.com>
3 # Last updated in September, 2008.
5 # README:
7 # * If the date above seems too far back in the past, the stuff
8 # below is likely horribly outdated and only of historic relevance.
9 # Don't use it.
11 # * Some of the variables below will have to be modified for the
12 # script to be useful on your system. These include MINGW_PREFIX,
13 # BUILD and TARGET.
15 # * The script is deliberately minimalistic. Its primary purpose is
16 # to provide a proper cross-compilation environment for Neverball
17 # and its dependencies, so you will probably need to add more
18 # variables to get your own software to compile.
20 # * This script is designed to be as transparent as possible, so
21 # that no changes are necessary to a build system. However, due to
22 # there being no way to inform GCC of a non-standard library path
23 # when cross-compiling, a build system still has support the LDFLAGS
24 # environment variable.
26 # If 'make install' is used to install this script, a few of the
27 # settings below are overwritten with the ones from the Makefile.
29 MINGW_PREFIX=~/dev/mingw
30 export MINGW_PREFIX
32 # This isn't plain 'wine' because in Debian the Wine in PATH is
33 # actually the Winelauncher script, which is a bit too slow and too
34 # helpful for our tastes.
36 # Useful for builds that use their own functionality half-way through.
37 WINE=/usr/lib/wine/wine.bin
38 export WINE
40 # Some rationale for why some of the variables below have to be
41 # specified: it appears that configure scripts use different methods
42 # to determine whether cross-compilation is in effect. Some rely on
43 # the specified compiler, some require that --host be specified, some
44 # only work properly when both --build and --host are provided (which
45 # is strange considering that most of them are able to detect the
46 # build system automatically).
48 # config.guess is available in the autotools-dev package on Debian and
49 # in most autotools-based packages. You can probably use the script
50 # if you need some flexibility.
52 #BUILD=$(sh /usr/share/misc/config.guess)
53 BUILD=i686-linux-gnu
54 # TARGET is the exact prefix of the cross binaries sans hyphen.
55 TARGET=i586-mingw32msvc
56 HOST=$TARGET
58 # The variables above do not need to be exported.
59 # No exports here, move along!
61 CC=$TARGET-gcc
62 export CC
64 CXX=$TARGET-g++
65 export CXX
67 # Appears to be used by libtool, although I haven't (yet) run into any
68 # trouble without it.
70 CC_FOR_BUILD=cc
71 export CC_FOR_BUILD
73 # When a project that uses libtool does not inform libtool that it has
74 # been ported to build native Windows DLLs (by using the
75 # AC_LIBTOOL_WIN32_DLL macro in configure.in or, since this macro has
76 # been deprecated recently, some other equivalent way), dynamic
77 # libraries fail to build. Although libtool documentation does
78 # mention this requirement, libtool itself does not seem to handle
79 # this cleanly and fails in obscure ways. Explicitly setting OBJDUMP
80 # is (sometimes) a sufficient work-around. (Note that this might have
81 # been fixed to some extent in recent libtool versions.)
83 # This is an incomplete list of binary utilies. Expand as needed.
85 OBJDUMP=$TARGET-objdump
86 export OBJDUMP
88 RANLIB=$TARGET-ranlib
89 export RANLIB
91 NM=$TARGET-nm
92 export NM
94 WINDRES=$TARGET-windres
95 export WINDRES
97 STRIP=$TARGET-strip
98 export STRIP
100 # CFLAGS and CPPFLAGS aren't always the best place for setting these.
101 # Instead, we inform GCC directly.
103 CPATH="$MINGW_PREFIX/include:$CPATH"
104 export CPATH
106 # The LIBRARY_PATH environment variable would be the perfect way of
107 # letting GCC know in which directories to look for libraries, but
108 # unfortunately it is not used when cross compiling. The reason for
109 # this remains a mystery.
111 LDFLAGS="-L$MINGW_PREFIX/lib $LDFLAGS"
112 export LDFLAGS
114 # This particular PATH setting is seen often in cross compilation
115 # scripts, but I have only experienced problems with it and haven't
116 # yet come across a setup where it's actually necessary.
118 #PATH="$MINGW_PREFIX/bin:/usr/$TARGET/bin:$PATH" # Bad idea.
119 PATH="$MINGW_PREFIX/bin:$PATH" # Good idea.
120 export PATH
122 # If configure picks up build system's pkg-config, we politely ask it
123 # to look in all the right places. Might not work with an old
124 # pkg-config.
126 PKG_CONFIG_LIBDIR="$MINGW_PREFIX/lib/pkgconfig"
127 export PKG_CONFIG_LIBDIR