-
Notifications
You must be signed in to change notification settings - Fork 39
/
cross-configure.sh
executable file
·106 lines (85 loc) · 2.78 KB
/
cross-configure.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/sh
# adapted from http://www.libsdl.org/extras/win32/cross/README.txt
CONFIG_SHELL=/bin/sh
export CONFIG_SHELL
TARGET=i586-mingw32msvc
CROSS_DEV=/home/ycombe/Win32/98
PATH="$PATH:$CROSS_DEV/bin"
export PATH
#PYTHON is copied from a windows install (with pygtk, pycairo, pysqlite) into:
# $CROSS_DEV/Python24/
#########################################
# Libs using pkg-config
#
# rem: for me libxml2 as and hand-written pc file
#
# PKG_CONFIG in cross-configuration.
PKG_CONFIG_LIBDIR="$CROSS_DEV/lib/pkgconfig:$CROSS_DEV/Python24/Lib/pkgconfig"
DIRS="$(ls $CROSS_DEV)"
# all my libs are in $CROSS_DEV/__libname__/
# the *.pc files needs there prefix adapted
for f in $DIRS; do
if test -d $CROSS_DEV/$f/lib/pkgconfig ; then
PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:$CROSS_DEV/$f/lib/pkgconfig" ;
fi
done
# /PKG_CONFIG
#########################################
#########################################
# PYTHON
export PKG_CONFIG_LIBDIR
export PKG_CONFIG_PATH
PYTHONHOME="$CROSS_DEV/Python24"
PYTHONPATH="$CROSS_DEV/Python24/Lib"
PYTHON_CFLAGS="-I$CROSS_DEV/Python24/include"
PYTHON_LIBS="-L$CROSS_DEV/Python24/libs -lpython24"
# GCompris configure will skip PYTHON_TEST if this is exported:
export PYTHONHOME
export PYTHONPATH
export PYTHON_CFLAGS
export PYTHON_LIBS
# /PYTHON
##########################################
##########################################
# SDL and SDL_mixer
SDL_MIXER_CFLAGS="-I$CROSS_DEV/SDL_mixer/SDL_mixer-1.2.7/include"
SDL_MIXER_LDFLAGS="-L$CROSS_DEV/SDL_mixer/SDL_mixer-1.2.7/lib"
SDL_CFLAGS="-I$CROSS_DEV/SDL/SDL-1.2.11/include"
SDL_LIBS="-L$CROSS_DEV/SDL/SDL-1.2.11/lib -lSDLmain -lSDL"
# GCompris configure will skip SDL_TEST if this is exported:
export SDL_CFLAGS
export SDL_LIBS
CFLAGS="-g -O2 -I$CROSS_DEV/include $SDL_MIXER_CFLAGS"
LDFLAGS="-L$CROSS_DEV/lib $SDL_MIXER_LDFLAGS"
# /SDL and SDL_mixer
###########################################
###########################################
# These libs do not use pkg-config !
# sqlite3
CFLAGS="$CFLAGS -I$CROSS_DEV/sqlite/include"
LDFLAGS="$LDFLAGS -L$CROSS_DEV/sqlite/lib"
# /sqlite3
#libiconv
CFLAGS="$CFLAGS -I$CROSS_DEV/libiconv/include"
LDFLAGS="$LDFLAGS -L$CROSS_DEV/libiconv/lib"
#gettext
CFLAGS="$CFLAGS -I$CROSS_DEV/gettext/include"
LDFLAGS="$LDFLAGS -L$CROSS_DEV/gettext/lib"
#zlib
CFLAGS="$CFLAGS -I$CROSS_DEV/zlib/include"
LDFLAGS="$LDFLAGS -L$CROSS_DEV/zlib/lib"
# LIBXML2
# !!!!!! libxml2 if it does not hace pc file
# adapt CFLAGS
# adapt LDFLAGS
############################################
cache=cross-config.cache
CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" sh configure --cache-file="$cache" \
--target=$TARGET --host=$TARGET --build=i386-linux \
--enable-py-build-only \
--with-sdl-prefix="$CROSS_DEV/SDL/SDL-1.2.11" \
--disable-binreloc \
$*
status=$?
rm -f "$cache"
exit $status