Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 911 lines (796 sloc) 25.21 kB
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
1 #!/bin/sh
2
3 #------------------------------------------------------------------------
3c68c97 [wxhaskell-from-cvs @ 2003-07-21 10:57:54 by dleijen]
dleijen authored
4 # Configure script for wxHaskell
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
5 #
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
6 # Copyright (c) 2003, 2004 Daan Leijen.
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
7 #
3c68c97 [wxhaskell-from-cvs @ 2003-07-21 10:57:54 by dleijen]
dleijen authored
8 # See license.txt for details.
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
9 #------------------------------------------------------------------------
10
11 #--------------------------------------------------------------------
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
12 # Load the command line from the cache?
13 #--------------------------------------------------------------------
14
15 # see if --cache is the first argument
16 case "$1" in
17 -cache|--cache)
18 if test -f "config/cache.txt"; then
19 # load from cache
20 cache=`cat config/cache.txt`
21 echo "using cached arguments:"
22 echo " $cache"
23 echo ""
24 $0 $cache
25 exit $?
26 else
27 # nothing cached yet
28 echo "warning:"
29 echo " Option --cache given, but no previous configuration was present."
30 echo ""
31 shift # remove --cache argument
32 fi;;
33 esac
34
35 # save arguments
36 arguments=$@
37
38 # set cache argument for help options
39 if test -f "config/cache.txt"; then
40 cache=`cat config/cache.txt`
41 else
42 cache=""
43 fi
44
45
46 #--------------------------------------------------------------------
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
47 # Variables
48 #--------------------------------------------------------------------
1ea91fa [wxhaskell-from-cvs @ 2004-07-27 12:53:22 by dleijen]
dleijen authored
49 version="0.8"
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
50 release="0"
51
52 # install
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
53 enablestrip="no"
54 enableupx="no"
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
55 withmsc="no"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
56 wxclibname="wxc"
8c6a999 [wxhaskell-from-cvs @ 2004-03-29 14:51:56 by dleijen]
dleijen authored
57 configflags="$*"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
58
59 # haskell
60 hc="ghc"
61 hcpkg="ghc-pkg"
62 hcpkglocal=""
63 hdoc="haddock"
64
65 # directories
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
66 topdir="`pwd`"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
67 prefix="/usr"
68 execprefix=""
69 libdir=""
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
70 sharedprefix="<libdir>"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
71
72 # dll extension and lib prefix
73 exe=""
74 dll=".so"
75 lib="lib"
76
77 # c++ compiler, flags and libraries
78 cxx="c++"
79 wxwincxxflags=""
80 wxwinlibs=""
81
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
82 # wxwidgets
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
83 wxconfig="wx-config"
84 wxtoolkit=""
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
85 wxversion=""
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
86 extraldopts=""
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
87 withopengl="no"
88
89 #--------------------------------------------------------------------
90 # Function "findprogram": find a program in the path
91 #--------------------------------------------------------------------
92 findprogram () {
93 if test -f $1; then return 0; fi
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
94 saveIFS="$IFS"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
95 IFS=':'
96 for dir in $PATH; do
97 if test -z "$dir"; then dir=.; fi
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
98 if test -f $dir/$1; then
99 IFS="$saveIFS"
100 return 0
101 fi
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
102 done
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
103 IFS="$saveIFS"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
104 return 1
105 }
106
107 #--------------------------------------------------------------------
108 # wx-config guess
109 #--------------------------------------------------------------------
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
110
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
111 # macosx: wx-config might be not in the path
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
112 if findprogram "$wxconfig"; then :; else
113 if test -x "/usr/local/wxhaskell/bin/wx-config"; then
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
114 wxconfig="/usr/local/wxhaskell/bin/wx-config"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
115 else
116 if test -x "/usr/local/bin/wx-config"; then
117 wxconfig="/usr/local/bin/wx-config"
118 fi
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
119 fi
120 fi
121
3eebafb [wxhaskell-from-cvs @ 2003-09-16 09:51:00 by dleijen]
dleijen authored
122 # see if wx-config is the first argument
123 case "$1" in
124 -wx-config=*|--wx-config=*)
9d69d96 [wxhaskell-from-cvs @ 2004-03-29 13:05:13 by dleijen]
dleijen authored
125 wxconfig=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
28ff0ef [wxhaskell-from-cvs @ 2004-07-27 10:43:23 by dleijen]
dleijen authored
126 wxconfig=`eval echo $wxconfig` #expand ~
127 shift;; # remove --wx-config argument
3eebafb [wxhaskell-from-cvs @ 2003-09-16 09:51:00 by dleijen]
dleijen authored
128 esac
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
129
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
130
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
131 #--------------------------------------------------------------------
132 # Improve guesses
133 #--------------------------------------------------------------------
134 # improve guess prefix
135 if test -d "/usr/local"; then
136 prefix="/usr/local"
137 fi
138
139 # does 'cygpath' exist?
140 cygpathfound=""
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
141 if findprogram "cygpath"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
142 cygpathfound="yes"
143 fi
144
145 # guess username
146 if test "$USERNAME"; then
147 username="$USERNAME"
148 else if test "$HOME"; then
149 username=`echo $HOME | sed -e 's|.*[/\\]||'`
150 else
151 username="username"
152 fi
153 fi
154
155 # guess base.haddock location
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
156 if findprogram "ghc"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
157 guesshdocbase="`which ghc | sed -e 's|/bin/ghc|/doc/html/base/base.haddock|'`"
158 if test -f "$guesshdocbase"; then
159 hdocbase="$guesshdocbase"
160 fi
161 fi
162
163
164 # improve the guesses if wx-config is present.
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
165 if findprogram "$wxconfig"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
166 # improve prefix guess
167 prefix="`$wxconfig --prefix`"
9d69d96 [wxhaskell-from-cvs @ 2004-03-29 13:05:13 by dleijen]
dleijen authored
168
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
169 # guess version
170 wxversion="`$wxconfig --version`"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
171
172 # guess toolkit
173 wxtoolkit="`$wxconfig --cxxflags | sed -e 's|.*-D__WX\([A-Z]*\)__.*|\1|'`"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
174 # to lowercase
175 wxtoolkit="`echo "$wxtoolkit" | sed -e 'y|ABCDEFGHIJKLMNOPQRSTUVWXYZ|abcdefghijklmnopqrstuvwxyz|'`"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
176
177 # flaky way to guess library extensions
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
178 if test "$wxtoolkit" = "msw"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
179 dll=".dll"
180 lib=""
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
181 else if test "$wxtoolkit" = "mac"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
182 dll=".dylib"
183 lib="lib"
9bc06e1 [wxhaskell-from-cvs @ 2003-08-20 09:57:44 by dleijen]
dleijen authored
184 # use a standard prefix on MacOS X for the installer
185 prefix="/usr/local/wxhaskell"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
186 fi
187 fi
188
189 # guess extra link options
3eebafb [wxhaskell-from-cvs @ 2003-09-16 09:51:00 by dleijen]
dleijen authored
190 extraldopts="`$wxconfig --ldflags`"
191 pthread="`$wxconfig --libs | sed -e \"s|.* -pthread .*|yes|\"`"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
192 if test "$pthread" = "yes"; then
193 if test -z "$extraldopts"; then
194 extraldopts="-pthread"
195 else
196 extraldopts="$extraldopts -pthread"
197 fi
198 fi
9d69d96 [wxhaskell-from-cvs @ 2004-03-29 13:05:13 by dleijen]
dleijen authored
199 else
200 #wxconfig not found!
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
201 case "$1" in
202 -with-msc|--with-msc)
203 ;;
204 *)
205 echo "warning:"
206 echo " Unable to find wxWidgets configuration ($wxconfig)."
207 echo "";;
208 esac
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
209 fi
210
211 # initial completion rules
212 execprefix_doc="<prefix>"
213 libdir_doc="<exec-prefix>/lib"
214 wxclib_doc="<libdir>/${lib}wxc${dll}"
215
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
216
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
217 #--------------------------------------------------------------------
218 # Parse command-line arguments
219 #--------------------------------------------------------------------
220 arg=""
221 while : ; do
222 # put optional argument in the $arg variable
223 case "$1" in
9d69d96 [wxhaskell-from-cvs @ 2004-03-29 13:05:13 by dleijen]
dleijen authored
224 -*=*) arg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
225 arg=`eval echo $arg`;; # expand ~
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
226 *) arg="";;
227 esac
228
229 # match on the arguments
230 case "$1" in
231 "") break;;
232 -?|--help)
233 echo "usage:"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
234 echo " ./configure [options]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
235 echo ""
236 echo "options: [defaults in brackets]"
237 echo " --help show this information"
238 echo " --hc=<program> the haskell compiler [$hc]"
239 echo " --hcpkg=<program> package compiler [$hcpkg]"
240 echo " --package-conf=<file> optional local package configuration [$hcpkglocal]"
241 echo " --version=<version> library version [$version]"
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
242 echo " --release=<version> library release version [$release]"
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
243 echo " --cache use previous configure options (must come first!)"
244 echo " [$cache]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
245 echo ""
246 echo "install options:"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
247 echo " --prefix=<dir> install directory [$prefix]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
248 echo " --exec-prefix=<dir> platform dependent install directory [$execprefix_doc]"
249 echo " --libdir=<dir> library files install directory [$libdir_doc]"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
250 echo " --shared-prefix=<dir> fixed path prefix for dynamic libraries [$sharedprefix]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
251 echo " --enable-strip remove symbols from the libraries [$enablestrip]"
252 echo " --enable-upx compress the dynamic libraries with upx [$enableupx]"
253 echo ""
254 echo "documentation options:"
255 echo " --username=<name> username on sourceforge [$username]"
256 echo " --haddock=<program> haddock documentation tool [$hdoc]"
257 echo ""
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
258 echo "wxwidgets options:"
259 echo " --wx-toolkit=<name> wxWidgets gui toolkit [$wxtoolkit]"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
260 echo " --with-opengl enable openGL support [$withopengl]"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
261 echo " --wx-config=<program> wxWidgets configure script (must be the first option!)"
3eebafb [wxhaskell-from-cvs @ 2003-09-16 09:51:00 by dleijen]
dleijen authored
262 echo " [$wxconfig]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
263 echo ""
264 echo "platform options:"
265 echo " --dllext=<extension> dynamic link library extension [$dll]"
266 echo " --libprefix=<prefix> library prefix [$lib]"
267 echo " --extra-ld-opts=<opts> extra link options [$extraldopts]"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
268 echo " --with-msc compile wxWidgets and wxc with microsoft vc++ [$withmsc]"
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
269 echo " --wxc-libname=<name> wxc library base name [$wxclibname]"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
270 echo ""
271 exit 1;;
272
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
273 -cache|--cache)
274 echo "warning:"
275 echo " Ignoring --cache option; this option must be the first (and only) option."
276 echo "";;
277
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
278 -hc=*|--hc=*)
279 hc="$arg";;
280 -hcpkg=*|--hcpkg=*)
281 hcpkg="$arg";;
282 -package-conf=*|--package-conf=*)
283 hcpkglocal="$arg";;
284 -version=*|--version=*)
285 version="$arg";;
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
286 -release=*|--release=*)
287 release="$arg";;
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
288
289 -prefix=*|--prefix=*)
290 prefix="$arg";;
291 -exec-prefix=*|--exec-prefix=*)
292 execprefix="$arg"
293 execprefix_doc="$arg";;
294 -libdir=*|--libdir=*)
295 libdir="$arg"
296 libdir_doc="$arg";;
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
297 -shared-prefix=*|--shared-prefix=*)
298 sharedprefix="$arg";;
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
299 -enable-strip|--enable-strip)
300 enablestrip="yes";;
301 -disable-strip|--disable-strip)
302 enablestrip="no";;
303 -enable-upx|--enable-upx)
304 enableupx="yes";;
305 -disable-upx|--disable-upx)
306 enableupx="no";;
307
308 -username=*|--username=*)
309 username="$arg";;
310 -haddock=*|--haddock=*)
311 hdoc="$arg";;
312
313 -wx-toolkit=*|--wx-toolkit=*)
314 wxtoolkit="$arg";;
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
315 -with-opengl|--with-opengl)
316 withopengl="yes";;
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
317 -wx-config=*|--wx-config=*)
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
318 echo "warning:"
319 echo " Ignoring --wx-config option; this option must be the first option."
320 echo "";;
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
321
322 -dllext=*|--dllext=*)
323 dll="$arg"
324 wxclib_doc="<libdir>/${lib}wxc${dll}";;
325 -libprefix=*|--libprefix=*)
326 lib="$arg"
327 wxclib_doc="<libdir>/${lib}wxc${dll}";;
328 -extra-ld-opts=*|--extra-ld-opts=*)
329 extraldopts="$arg";;
330 -with-msc|--with-msc)
331 withmsc="yes"
332 lib=""
333 dll=".dll"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
334 wxtoolkit="msw"
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
335 wxversion="2.4.2";; # guess?
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
336 -wxc-libname=*|--wxc-libname=*)
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
337 if test "$withmsc" = "yes"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
338 wxclibname="$arg"
339 else
340 echo "warning:"
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
341 echo " Option --wxc-libname is only valid if preceded with --with-msc."
342 echo ""
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
343 fi;;
344 *) echo "error: Unknown option \"$1\". Use \"--help\" to show valid options." 1>&2
345 echo "" 1>&2
346 exit 2;;
347 esac
348
349 # process next argument
350 shift
351 done
352
353 #--------------------------------------------------------------------
354 # directories
355 #--------------------------------------------------------------------
356 # complete arguments
357 if test -z "$execprefix"; then
358 execprefix="$prefix"
359 fi
360
361 if test -z "$libdir"; then
362 libdir="$execprefix/lib"
363 fi
364
365 if test "$dll" = ".dll"; then
366 exe=".exe"
367 fi
368
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
369 if test "$sharedprefix" = "<libdir>"; then
370 sharedprefix="$libdir"
371 fi
372
373 # add "/" to shared-prefix if not empty or already ending on "/"
374 if test "$sharedprefix"; then
375 case "$sharedprefix" in
376 */) ;;
377 *) sharedprefix="$sharedprefix/";;
378 esac
379 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
380
381 # normalize the library and imports directory since ghc-pkg doesn't like unix names
382 if test "$cygpathfound"; then
383 libdir="`cygpath -w $libdir | sed -e 's|\\\\|/|g'`"
384 fi
385
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
386 echo "checking system:"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
387
388
389 #--------------------------------------------------------------------
390 # wxc: only initialized if not --with-msc
391 #--------------------------------------------------------------------
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
392 if test "$withmsc" != "yes"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
393 # we need wx-config
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
394 if findprogram "$wxconfig"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
395 echo " wx-config found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
396 else
397 echo "error:"
398 echo " Unable to find the 'wx-config' program: $wxconfig"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
399 echo " Maybe you forgot to run 'make install' on wxWidgets?"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
400 echo " Otherwise, add the install directory of wx-config to your path."
401 if test "$WINDIR"; then
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
402 echo ""
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
403 echo " Or maybe you are trying to compile with Microsoft Visual C++?"
404 echo " If so, you can specify that on the command line:"
405 echo " For example: ./configure --with-msc"
406 fi
407 echo ""
408 exit 2
409 fi
410
411 # initialize options for wxc
412 cxx="`$wxconfig --cxx`"
413 wxwincxxflags="`$wxconfig --cxxflags`"
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
414
415 if test "$withopengl" = "yes"; then
416 wxwinlibs="`$wxconfig --libs --gl-libs | tr '\n' ' '`"
417 else
418 wxwinlibs="`$wxconfig --libs`"
419 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
420
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
421 # version
422 wxversion="`$wxconfig --version`"
423
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
424 # extract the wxWidgets wxtoolkit: msw, mac, gtk etc.
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
425 if test -z "$wxtoolkit"; then
426 wxtoolkit="`$wxconfig --cxxflags | sed -e 's|.*-D__WX\([A-Z]*\)__.*|\1|'`"
427 fi
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
428 # to lowercase
429 wxtoolkit="`echo "$wxtoolkit" | sed -e 'y|ABCDEFGHIJKLMNOPQRSTUVWXYZ|abcdefghijklmnopqrstuvwxyz|'`"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
430
c173ead [wxhaskell-from-cvs @ 2003-10-27 23:31:20 by dleijen]
dleijen authored
431 # windows:
432 # we append $prefix/include to the include directories
433 # we add "-lodbc32" since we use "SQL..." calls in the wrapper code :-(
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
434 if test "$wxtoolkit" = "msw"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
435 wxwincxxflags="-I$prefix/include $wxwincxxflags"
c173ead [wxhaskell-from-cvs @ 2003-10-27 23:31:20 by dleijen]
dleijen authored
436 wxwinlibs="$wxwinlibs -lodbc32"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
437 fi
438
439 # windows: we normalize $prefix and $exec-prefix include directories and libraries
440 if test "$cygpathfound"; then
441 wxprefix="`$wxconfig --prefix`"
442 wxexecprefix="`$wxconfig --exec-prefix`"
443 wwxprefix="`cygpath -w $wxprefix | sed -e 's|\\\\|/|g'`"
444 wwxexecprefix="`cygpath -w $wxexecprefix | sed -e 's|\\\\|/|g'`"
445
446 wxwincxxflags="`echo $wxwincxxflags | sed -e \"s|$wxprefix|$wwxprefix|g\"`"
447 wxwinlibs="`echo $wxwinlibs | sed -e \"s|$wxexecprefix|$wwxexecprefix|g\"`"
448 fi
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
449
450 # macosx: we get the resource compiler flags
a17e09c [wxhaskell-from-cvs @ 2004-03-22 14:31:31 by dleijen]
dleijen authored
451 wxrezcomp="`$wxconfig --rezflags`"
452 wxrezfile=""
453 if test "$wxrezcomp"; then
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
454 for word in $wxrezcomp; do
455 temp="`echo $word | grep '[^_]*_mac-[^r]*r'`"
456 if test "$temp"; then
457 wxrezfile="$temp"
458 fi
459 done
460 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
461 fi
462
968ba33 [wxhaskell-from-cvs @ 2004-03-23 15:22:48 by dleijen]
dleijen authored
463 if test "$wxrezfile"; then
9feab4d [wxhaskell-from-cvs @ 2004-03-24 13:28:24 by dleijen]
dleijen authored
464 wxrezdir="`echo $wxrezfile | sed -e 's|\(.*\)/libwx_mac.*|\1|'`"
465 wxinstallrezcomp="`echo \"${wxrezcomp}\" | sed -e \"s|${wxrezdir}|${libdir}|g\"`"
466 wxinstallrezfile="`echo \"${wxrezfile}\" | sed -e \"s|${wxrezdir}|${libdir}|g\"`"
968ba33 [wxhaskell-from-cvs @ 2004-03-23 15:22:48 by dleijen]
dleijen authored
467 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
468
469 #--------------------------------------------------------------------
470 # haskell compiler and package manager
471 #--------------------------------------------------------------------
472
473 # Do we have ghc?
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
474 if findprogram "$hc"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
475 echo " $hc found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
476 else
477 echo "error:"
478 echo " Unable to find: $hc"
479 echo " Pleasy specify the path to GHC."
480 echo " For example: ./configure --hc=/c/ghc/ghc-6.0/bin/ghc"
481 exit 2
482 fi
483
0a5f299 [wxhaskell-from-cvs @ 2003-10-15 18:31:01 by dleijen]
dleijen authored
484 # save haskell compiler name (as $hc also gets flags)
485 hcname="$hc"
486
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
487 # check ghc version
983644c [wxhaskell-from-cvs @ 2003-09-29 14:27:58 by dleijen]
dleijen authored
488 hcversion="`$hc --version | sed -e 's|[A-Za-z \t,]*||'`"
489 if test "$hc" = "ghc"; then
490 case "$hcversion" in
491 0* | 1* | 2* | 3* | 4* | 5.*)
492 echo "WARNING:"
493 echo " You seem to have an older ghc installed, namely $hcversion"
494 echo " Ghc versions prior to 6.0 have garbage collector bugs that make wxHaskell"
495 echo " applications *crash* and may contain incompatible libraries."
496 echo " It is strongly advised to upgrade to a newer version."
497 echo "";;
498 6.*) ;;
499 7.*) ;;
500 8.*) ;;
501 9.*) ;;
502 *) echo "warning:"
503 echo " Unable to recognise the ghc version ($hcversion ?)"
504 echo " Be careful: ghc versions prior to 6.0 have bugs that make wxHaskell"
505 echo " applications *crash* and may contain incompatible libraries."
506 echo "";;
507 esac
508 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
509
510 # Do we have ghc-pkg?
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
511 if findprogram "$hcpkg"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
512 echo " $hcpkg found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
513 else
514 echo "error:"
515 echo " Unable to find: $hcpkg"
516 echo " Pleasy specify the path to ghc-pkg."
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
517 echo " For example: ./configure --hcpkg=/c/ghc/ghc-6.2/bin/ghc-pkg"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
518 hcpkg=echo
519 exit 2
520 fi
521
0d08d13 [wxhaskell-from-cvs @ 2004-03-29 14:18:38 by dleijen]
dleijen authored
522 # save name (hcpkg also gets flags)
523 hcpkgname="$hcpkg"
524
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
525 # Add local package flags
526 if test "$hcpkglocal"; then
527 hc="$hc -package-conf $hcpkglocal"
528 hcpkg="$hcpkg -f $hcpkglocal"
529 fi
530
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
531 # Test if we can include the parsec package explicitly
68e7d9a [wxhaskell-from-cvs @ 2004-03-24 13:29:53 by dleijen]
dleijen authored
532 $hcpkg -s parsec > /dev/null 2> /dev/null
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
533 case $? in
534 0) pkgparsec="-package parsec";;
535 *) pkgparsec="";;
536 esac
537
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
538 #--------------------------------------------------------------------
539 # Haddock
540 #--------------------------------------------------------------------
541 # Do we have haddock?
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
542 if findprogram "$hdoc"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
543 echo " $hdoc found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
544 hdocfound="yes"
545 else
546 echo "warning:"
547 echo " Unable to find: $hdoc"
548 echo " You won't be able to generate documentation."
549 echo " You can specify the haddock executable on the command line."
550 echo " For example: ./configure --haddock=/usr/local/bin/haddock"
551 echo ""
552 hdocbase=""
553 hdocfound="no"
554 fi
555
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
556
557 # Find .haddock files
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
558 if test "$hdocfound" = "yes"; then
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
559 if findprogram "ghc"; then
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
560 ghcroot="`which ghc | sed -e 's|/bin/ghc||'`"
561 docroot="$ghcroot/doc/html/libraries"
562 # normalize the root since haddock doesn't like unix names
563 if test "$cygpathfound"; then
564 normdocroot="`cygpath -w $docroot | sed -e 's|\\\\|/|g'`"
565 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
566
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
567 if test -d "$docroot"; then
568 # modern ghc >= 6.2, include all available haddock files
569 cd $docroot
570 for file in */*.haddock
571 do
572 basename="`echo $file | sed -e 's|/.*||'`"
573 hdocbases="$hdocbases -ihttp://haskell.cs.yale.edu/ghc/docs/latest/html/libraries/$basename,$normdocroot/$file"
574 done
575 cd $topdir
576 else
577 # older ghc < 6.2, try to include the base.haddock file
578 if test -f "$ghcroot/doc/html/base/base.haddock"; then
579 hdocbases=" -ihttp://haskell.cs.yale.edu/ghc/docs/6.0.1/html/base,$ghcroot/doc/html/base/base.haddock"
580 fi
581 fi
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
582 fi
583 fi
584
585 #--------------------------------------------------------------------
a17e09c [wxhaskell-from-cvs @ 2004-03-22 14:31:31 by dleijen]
dleijen authored
586 # wxWidgets
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
587 #--------------------------------------------------------------------
a17e09c [wxhaskell-from-cvs @ 2004-03-22 14:31:31 by dleijen]
dleijen authored
588
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
589
590 #--------------------------------------------------------------------
591 # install
592 #--------------------------------------------------------------------
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
593 if findprogram "install"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
594 echo " install program found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
595 installdir="install -d"
596 install="install -c"
597 else
598 echo "warning:"
599 echo " Unable to find 'install' (using 'cp' and 'mkdir' instead)."
600 echo ""
601 installdir="mkdir -p"
602 install="cp -u"
603 fi
604
605 #--------------------------------------------------------------------
606 # strip and upx
607 #--------------------------------------------------------------------
608 if test "$enablestrip" = "yes"; then
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
609 if findprogram "strip"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
610 echo " strip found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
611 else
612 echo "warning:"
613 echo " Unable to find 'strip'. Libraries will not be stripped."
614 echo ""
615 enablestrip="no"
616 fi
617 fi
618
619 if test "$enableupx" = "yes"; then
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
620 if findprogram "upx"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
621 echo " upx found"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
622 else
623 echo "warning:"
624 echo " Unable to find 'upx'. Dynamic libraries will not be compressed."
625 echo ""
626 enableupx="no"
627 fi
628 fi
629
630
631 runcompress=":"
632 if test "$enableupx" = "yes"; then
633 runcompress="config/compress \$(1)"
634 else
635 if test "$enablestrip" = "yes"; then
636 runcompress="echo strip \$(1); strip \$(1)"
637 fi
638 fi
639
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
640 #--------------------------------------------------------------------
641 # toolkit
642 #--------------------------------------------------------------------
643 if test -z "$wxtoolkit"; then
644 echo "warning:"
645 echo " Unable to determine the wxWindow toolkit."
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
646 echo " Defaulting to 'msw'."
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
647 echo ""
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
648 wxtoolkit="msw"
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
649 fi
650
c350d59 [wxhaskell-from-cvs @ 2003-10-15 16:01:00 by dleijen]
dleijen authored
651 if test "$wxtoolkit" = "msw"; then
652 bat=".bat"
653 else
654 bat=""
655 fi
656
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
657 #--------------------------------------------------------------------
658 # Generate configuration
659 #--------------------------------------------------------------------
660
661 # Create directories
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
662 echo ""
663 echo "creating configuration files:"
664 echo " config"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
665 mkdir -p config
666
667 # Finish generated files
2085484 [wxhaskell-from-cvs @ 2004-03-23 12:37:13 by dleijen]
dleijen authored
668 if findprogram "date"; then
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
669 date="`date`"
670 else
671 date="<unknown>"
672 fi
673
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
674 #echo " makefile configuration"
675 echo " config/config.mk"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
676 cat > config/config.mk << EOF
677 # Generated by configure on $date
678 TOPDIR=$topdir
679 VERSION=$version
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
680 RELEASE=$release
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
681 TOOLKIT=$wxtoolkit
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
682
683 # The Haskell compiler
684 HC=$hc
983644c [wxhaskell-from-cvs @ 2003-09-29 14:27:58 by dleijen]
dleijen authored
685 HCVERSION=$hcversion
0a5f299 [wxhaskell-from-cvs @ 2003-10-15 18:31:01 by dleijen]
dleijen authored
686 HCNAME=$hcname
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
687 HCFLAGS=
688 HCPKG=$hcpkg
689
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
690 # Packages
691 PKG-PARSEC=$pkgparsec
0a5f299 [wxhaskell-from-cvs @ 2003-10-15 18:31:01 by dleijen]
dleijen authored
692
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
693 # C compiler
694 CXX=$cxx
695
696 # Installation
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
697 BINDIR=$execprefix/bin
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
698 LIBDIR=$libdir
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
699 SHARED-PREFIX=$sharedprefix
4c24d2e [wxhaskell-from-cvs @ 2004-03-25 13:46:54 by dleijen]
dleijen authored
700 CONFIG-FLAGS=$configflags
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
701
702 # Compression function
703 run-compress=$runcompress
704
705 # Wxc
706 WITHMSC=$withmsc
707 WXC-LIBNAME=$wxclibname
708
a17e09c [wxhaskell-from-cvs @ 2004-03-22 14:31:31 by dleijen]
dleijen authored
709 # WxWidgets
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
710 WXWIN-VERSION=$wxversion
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
711 WXWIN-LIBS=$wxwinlibs
712 WXWIN-CXXFLAGS=$wxwincxxflags
a17e09c [wxhaskell-from-cvs @ 2004-03-22 14:31:31 by dleijen]
dleijen authored
713 WXWIN-REZFILE=$wxrezfile
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
714
715 # Platform
716 EXE=$exe
717 DLL=$dll
718 LIB=$lib
719
720 # Documentation
16625ce [wxhaskell-from-cvs @ 2003-07-15 13:51:24 by dleijen]
dleijen authored
721 HDOCFOUND=$hdocfound
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
722 HDOC=$hdoc
5d28ac5 [wxhaskell-from-cvs @ 2004-02-12 06:41:49 by dleijen]
dleijen authored
723 HDOCBASES=$hdocbases
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
724 USERNAME=$username
725
726 # Standard programs
727 INSTALL=$install
728 INSTALLDIR=$installdir
42549fc [wxhaskell-from-cvs @ 2003-07-17 12:27:51 by dleijen]
dleijen authored
729 LD=ld
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
730 AR=ar
731 CP=cp -f
732 MV=mv
733 CD=cd
734 RM=rm -f
735 MKDIR=mkdir -p
736 RMDIR=rmdir
737 ZIP=zip
738 TAR=tar
739 GZIP=gzip
740 EOF
741
742 # put quotes around extra-ld-opts of non-empty
743 if test "$extraldopts"; then
744 extraldopts="\"$extraldopts\""
745 fi
746
747 # create packages
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
748 binversion="${wxtoolkit}${wxversion}-${version}"
749
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
750 #echo " package descriptions"
751 echo " config/wxcore.pkg"
9bc06e1 [wxhaskell-from-cvs @ 2003-08-20 09:57:44 by dleijen]
dleijen authored
752 cat > config/wxcore.pkg << EOF
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
753 Package
9bc06e1 [wxhaskell-from-cvs @ 2003-08-20 09:57:44 by dleijen]
dleijen authored
754 { name="wxcore"
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
755 , import_dirs=["\${wxhlibdir}/imports"]
756 , library_dirs=["\${wxhlibdir}"]
9ad0795 [wxhaskell-from-cvs @ 2004-07-24 14:30:59 by dleijen]
dleijen authored
757 , hs_libraries=["wxcore","wxcore0","wxcore1","wxcore2"]
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
758 , extra_libraries=["${wxclibname}-${binversion}"]
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
759 , package_deps = ["base","data"]
760 , extra_ld_opts=[$extraldopts]
761 }
762 EOF
763
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
764 echo " config/wx.pkg"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
765 cat > config/wx.pkg << EOF
766 Package
767 { name="wx"
0ffff70 [wxhaskell-from-cvs @ 2003-10-17 12:33:13 by dleijen]
dleijen authored
768 , import_dirs=["\${wxhlibdir}"]
769 , library_dirs=["\${wxhlibdir}"]
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
770 , hs_libraries=["wx"]
9bc06e1 [wxhaskell-from-cvs @ 2003-08-20 09:57:44 by dleijen]
dleijen authored
771 , package_deps=["wxcore"]
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
772 }
773 EOF
774
eddc2ab [wxhaskell-from-cvs @ 2004-03-17 21:32:18 by dleijen]
dleijen authored
775 updateversion () {
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
776 sed -e "s|wxc-msw[\\.0-9]\+-[\\.0-9]\+\\.|wxc-${binversion}.|g" -e "s|wxcd-msw[\\.0-9]\+-[\\.0-9]\+\\.|wxcd-${binversion}.|g" -e "s|\$|\\r|g" $1 > $1.out
eddc2ab [wxhaskell-from-cvs @ 2004-03-17 21:32:18 by dleijen]
dleijen authored
777 mv -f $1.out $1
778 }
779
31db8ae [wxhaskell-from-cvs @ 2004-02-19 11:20:08 by dleijen]
dleijen authored
780 # set version in msc project file
d6f1d82 [wxhaskell-from-cvs @ 2004-02-20 15:15:54 by dleijen]
dleijen authored
781 if test "$withmsc" = "yes"; then
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
782 echo " update version number in visual c++ project file"
eddc2ab [wxhaskell-from-cvs @ 2004-03-17 21:32:18 by dleijen]
dleijen authored
783 for dsp in wxc/*.dsp
784 do
785 updateversion $dsp
786 done
d6f1d82 [wxhaskell-from-cvs @ 2004-02-20 15:15:54 by dleijen]
dleijen authored
787 fi
31db8ae [wxhaskell-from-cvs @ 2004-02-19 11:20:08 by dleijen]
dleijen authored
788
f1ebdb4 [wxhaskell-from-cvs @ 2004-03-29 20:38:47 by dleijen]
dleijen authored
789 # create installer scripts
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
790 # echo " installer scripts"
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
791
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
792 # generate compress utility
793 if test "$enableupx" = "yes"; then
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
794 echo " config/compress"
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
795 echo "#!/bin/sh" > config/compress
796 echo "upx -t \$1 > /dev/null 2> /dev/null" >> config/compress
797 echo "if test \"\$?\" != \"0\"; then" >> config/compress
798 if test "$enablestrip" = "yes"; then
799 echo " echo \"strip \$1\"" >> config/compress
800 echo " strip \$1" >> config/compress
801 fi
802 echo " upx \$1" >> config/compress
803 echo "fi" >> config/compress
804 fi
805
c350d59 [wxhaskell-from-cvs @ 2003-10-15 16:01:00 by dleijen]
dleijen authored
806 # generate windows installer files.
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
807 echo " config/wxhaskell-register.bat"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
808 echo "@SET wxclibname=${wxclibname}-${binversion}" > config/wxhaskell-register-temp
31db8ae [wxhaskell-from-cvs @ 2004-02-19 11:20:08 by dleijen]
dleijen authored
809 cat config/wxhaskell-register-temp bin/wxhaskell-register-template.bat | sed -e "s|\$|\\r|g" > config/wxhaskell-register.bat
c350d59 [wxhaskell-from-cvs @ 2003-10-15 16:01:00 by dleijen]
dleijen authored
810 rm -f config/wxhaskell-register-temp
811
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
812 echo " config/wxhaskell-unregister.bat"
391ff2c [wxhaskell-from-cvs @ 2004-03-22 15:52:42 by dleijen]
dleijen authored
813 echo "@SET wxclibname=${wxclibname}-${binversion}" > config/wxhaskell-unregister-temp
31db8ae [wxhaskell-from-cvs @ 2004-02-19 11:20:08 by dleijen]
dleijen authored
814 cat config/wxhaskell-unregister-temp bin/wxhaskell-unregister-template.bat | sed -e "s|\$|\\r|g" > config/wxhaskell-unregister.bat
c350d59 [wxhaskell-from-cvs @ 2003-10-15 16:01:00 by dleijen]
dleijen authored
815 rm -f config/wxhaskell-unregister-temp
816
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
817 echo " config/setcd"
149143a [wxhaskell-from-cvs @ 2004-02-29 12:46:53 by dleijen]
dleijen authored
818 cp bin/setcd config/setcd
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
819
fdf2df5 [wxhaskell-from-cvs @ 2003-09-12 12:36:39 by dleijen]
dleijen authored
820 # generate maxosx installer files.
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
821 echo " config/macosx-install.info"
fdf2df5 [wxhaskell-from-cvs @ 2003-09-12 12:36:39 by dleijen]
dleijen authored
822 cat > config/macosx-install.info << EOF
823 Title wxHaskell
824 Version $version
825 Description wxHaskell library
826 DefaultLocation $prefix
827 DeleteWarning
828 NeedsAuthorization YES
829 Required NO
830 Relocatable NO
831 RequiresReboot NO
832 UseUserMask YES
833 OverwritePermissions NO
834 InstallFat NO
835 RootVolumeOnly YES
836 EOF
837
838 # generate macosx post-install files.
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
839 echo " config/macosx-postinstall"
fdf2df5 [wxhaskell-from-cvs @ 2003-09-12 12:36:39 by dleijen]
dleijen authored
840 cat > config/macosx-postinstall << EOF
841 #!/bin/sh
07f02f2 [wxhaskell-from-cvs @ 2003-11-09 08:55:18 by dleijen]
dleijen authored
842 env wxhlibdir="$libdir" /usr/local/bin/ghc-pkg -u -i "\$1/Contents/Resources/wxcore.pkg"
843 env wxhlibdir="$libdir" /usr/local/bin/ghc-pkg -u -i "\$1/Contents/Resources/wx.pkg"
fdf2df5 [wxhaskell-from-cvs @ 2003-09-12 12:36:39 by dleijen]
dleijen authored
844 EOF
845 chmod a+x config/macosx-postinstall
846
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
847 # generate macosx application builder script
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
848 echo " config/macosx-app"
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
849 cat > config/macosx-app-temp << EOF
850 #!/bin/sh
9feab4d [wxhaskell-from-cvs @ 2004-03-24 13:28:24 by dleijen]
dleijen authored
851 rezcomp="$wxinstallrezcomp"
852 rezfile="$wxinstallrezfile"
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
853
854 EOF
855 cat config/macosx-app-temp bin/macosx-app-template > config/macosx-app
856 rm -f config/macosx-app-temp
857 chmod a+x config/macosx-app
858
0d08d13 [wxhaskell-from-cvs @ 2004-03-29 14:18:38 by dleijen]
dleijen authored
859 # generate RPM spec file
860 hcbasename="`echo $hcname | sed -e 's|-[0-9].*||'`"
861 hcpkgbasename="`echo $hcpkgname | sed -e 's|-[0-9].*||'`"
862 # to uppercase
863 wxToolkit="`echo "$wxtoolkit" | sed -e 'y|abcdefghijklmnopqrstuvwxyz|ABCDEFGHIJKLMNOPQRSTUVWXYZ|'`"
864
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
865 echo " config/wxhaskell.spec"
0d08d13 [wxhaskell-from-cvs @ 2004-03-29 14:18:38 by dleijen]
dleijen authored
866 echo "%define wxhversion $version" > config/wxhaskell.spec.temp
867 echo "%define wxhrelease $release" >> config/wxhaskell.spec.temp
8c6a999 [wxhaskell-from-cvs @ 2004-03-29 14:51:56 by dleijen]
dleijen authored
868 echo "%define hcomp $hcbasename" >> config/wxhaskell.spec.temp
0d08d13 [wxhaskell-from-cvs @ 2004-03-29 14:18:38 by dleijen]
dleijen authored
869 echo "%define hcpkg $hcpkgbasename" >> config/wxhaskell.spec.temp
870 echo "%define hcversion $hcversion" >> config/wxhaskell.spec.temp
871 echo "%define wxtoolkit $wxtoolkit" >> config/wxhaskell.spec.temp
872 echo "%define wxToolkit $wxToolkit" >> config/wxhaskell.spec.temp
873 echo "%define wxversion $wxversion" >> config/wxhaskell.spec.temp
f1ebdb4 [wxhaskell-from-cvs @ 2004-03-29 20:38:47 by dleijen]
dleijen authored
874 echo "%define sourceroot $topdir/out/" >> config/wxhaskell.spec.temp
0d08d13 [wxhaskell-from-cvs @ 2004-03-29 14:18:38 by dleijen]
dleijen authored
875 echo "%define configflags $configflags" >> config/wxhaskell.spec.temp
876 echo "" >> config/wxhaskell.spec.temp
877 cat config/wxhaskell.spec.temp bin/wxhaskell-spec-template > config/wxhaskell.spec
878 rm -f config/wxhaskell.spec.temp
879
9ad0795 [wxhaskell-from-cvs @ 2004-07-24 14:30:59 by dleijen]
dleijen authored
880 # generate prologue for documentation
881 echo " config/prologue.txt"
882 echo "Documentation for wxHaskell $version" > config/prologue.txt.temp
883 echo "" >> config/prologue.txt.temp
884 cat config/prologue.txt.temp bin/prologue-template.txt > config/prologue.txt
885 rm -f config/prologue.txt.temp
886
1d7e704 [wxhaskell-from-cvs @ 2004-07-27 10:12:05 by dleijen]
dleijen authored
887 # save arguments
888 echo " config/cache.txt"
889 echo "$arguments" > config/cache.txt
9ad0795 [wxhaskell-from-cvs @ 2004-07-24 14:30:59 by dleijen]
dleijen authored
890
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
891 # show configuration
892 echo ""
893 echo "configuration:"
894 echo " library: wxhaskell-$version (release $release)"
895 echo " compiler: $hcbasename-$hcversion"
896 echo " wxwidgets: $wxtoolkit-$wxversion"
897 echo " with openGL: $withopengl"
898 echo " library dir: $libdir"
899
7b1a5ba [wxhaskell-from-cvs @ 2004-03-30 08:46:06 by dleijen]
dleijen authored
900 if test "$wxrezfile"; then
901 echo " resource: $wxrezfile"
902 fi
903
2573a91 [wxhaskell-from-cvs @ 2003-09-29 14:13:14 by dleijen]
dleijen authored
904 # we are done.
ecde432 [wxhaskell-from-cvs @ 2003-07-13 21:18:59 by dleijen]
dleijen authored
905 echo ""
906 echo "done:"
4e4daf3 [wxhaskell-from-cvs @ 2004-03-30 07:59:18 by dleijen]
dleijen authored
907 echo " type 'make' to build wxhaskell."
908 echo " type 'make install' to install wxhaskell."
909 echo " type 'make help' to receive help on all other make targets"
fdf2df5 [wxhaskell-from-cvs @ 2003-09-12 12:36:39 by dleijen]
dleijen authored
910 echo ""
Something went wrong with that request. Please try again.