|
1 #!/bin/sh |
|
2 |
|
3 |
|
4 PREFIX=/usr |
|
5 EPREFIX=$PREFIX |
|
6 |
|
7 BINDIR= |
|
8 SBINDIR= |
|
9 LIBDIR= |
|
10 LIBEXECDIR= |
|
11 DATADIR= |
|
12 SYSCONFDIR= |
|
13 SHAREDSTATEDIR= |
|
14 LOCALSTATEDIR= |
|
15 INCLUDEDIR= |
|
16 INFODIR= |
|
17 MANDIR= |
|
18 |
|
19 OS=`uname -s` |
|
20 OS_VERSION=`uname -r` |
|
21 |
|
22 TEMP_DIR=".tmp-`uname -n`" |
|
23 mkdir -p "$TEMP_DIR" |
|
24 if [ $? -ne 0 ]; then |
|
25 echo "Cannot create tmp dir" |
|
26 echo "Abort" |
|
27 fi |
|
28 touch "$TEMP_DIR/options" |
|
29 touch "$TEMP_DIR/features" |
|
30 |
|
31 # features |
|
32 FEATURE_DB=on |
|
33 |
|
34 # help text |
|
35 printhelp() |
|
36 { |
|
37 echo "Usage: $0 [OPTIONS]..." |
|
38 cat << __EOF__ |
|
39 Installation directories: |
|
40 --prefix=PREFIX path prefix for architecture-independent files |
|
41 [/usr] |
|
42 --exec-prefix=EPREFIX path prefix for architecture-dependent files |
|
43 [PREFIX] |
|
44 |
|
45 --bindir=DIR user executables [EPREFIX/bin] |
|
46 --sbindir=DIR system admin executables [EPREFIX/sbin] |
|
47 --libexecdir=DIR program executables [EPREFIX/libexec] |
|
48 --sysconfdir=DIR system configuration files [PREFIX/etc] |
|
49 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] |
|
50 --localstatedir=DIR modifiable single-machine data [PREFIX/var] |
|
51 --libdir=DIR object code libraries [EPREFIX/lib] |
|
52 --includedir=DIR C header files [PREFIX/include] |
|
53 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] |
|
54 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] |
|
55 --infodir=DIR info documentation [DATAROOTDIR/info] |
|
56 --mandir=DIR man documentation [DATAROOTDIR/man] |
|
57 |
|
58 Options: |
|
59 --toolkit=(gtk3|cli|gtk2|wpf) |
|
60 |
|
61 Optional Features: |
|
62 --disable-db |
|
63 --enable-gui |
|
64 |
|
65 __EOF__ |
|
66 } |
|
67 |
|
68 # |
|
69 # parse arguments |
|
70 # |
|
71 for ARG in "$@" |
|
72 do |
|
73 case "$ARG" in |
|
74 "--prefix="*) PREFIX=${ARG#--prefix=} ;; |
|
75 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; |
|
76 "--bindir="*) BINDIR=${ARG#----bindir=} ;; |
|
77 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;; |
|
78 "--libdir="*) LIBDIR=${ARG#--libdir=} ;; |
|
79 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;; |
|
80 "--datadir="*) DATADIR=${ARG#--datadir=} ;; |
|
81 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;; |
|
82 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;; |
|
83 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; |
|
84 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; |
|
85 "--infodir="*) INFODIR=${ARG#--infodir=} ;; |
|
86 "--mandir"*) MANDIR=${ARG#--mandir} ;; |
|
87 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;; |
|
88 "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;; |
|
89 "--enable-db") FEATURE_DB=on ;; |
|
90 "--disable-db") unset FEATURE_DB ;; |
|
91 "--enable-gui") FEATURE_GUI=on ;; |
|
92 "--disable-gui") unset FEATURE_GUI ;; |
|
93 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;; |
|
94 esac |
|
95 done |
|
96 |
|
97 # set dir variables |
|
98 if [ -z "$BINDIR" ]; then |
|
99 BINDIR=$EPREFIX/bin |
|
100 fi |
|
101 if [ -z "$SBINDIR" ]; then |
|
102 SBINDIR=$EPREFIX/sbin |
|
103 fi |
|
104 if [ -z "$LIBDIR" ]; then |
|
105 LIBDIR=$EPREFIX/lib |
|
106 fi |
|
107 if [ -z "$LIBEXEC" ]; then |
|
108 LIBEXECDIR=$EPREFIX/libexec |
|
109 fi |
|
110 if [ -z "$DATADIR" ]; then |
|
111 DATADIR=$PREFIX/share |
|
112 fi |
|
113 if [ -z "$SYSCONFDIR" ]; then |
|
114 SYSCONFDIR=$PREFIX/etc |
|
115 fi |
|
116 if [ -z "$SHAREDSTATEDIR" ]; then |
|
117 SHAREDSTATEDIR=$PREFIX/com |
|
118 fi |
|
119 if [ -z "$LOCALSTATEDIR" ]; then |
|
120 LOCALSTATEDIR=$PREFIX/var |
|
121 fi |
|
122 if [ -z "$INCLUDEDIR" ]; then |
|
123 INCLUDEDIR=$PREFIX/include |
|
124 fi |
|
125 if [ -z "$INFODIR" ]; then |
|
126 INFODIR=$PREFIX/info |
|
127 fi |
|
128 if [ -z "$MANDIR" ]; then |
|
129 MANDIR=$PREFIX/man |
|
130 fi |
|
131 |
|
132 which pkg-config > /dev/null |
|
133 if [ $? -eq 0 ]; then |
|
134 PKG_CONFIG=pkg-config |
|
135 else |
|
136 PKG_CONFIG=false |
|
137 fi |
|
138 |
|
139 # Simple uname based platform detection |
|
140 # $PLATFORM is used for platform dependent dependency selection |
|
141 printf "detect platform... " |
|
142 if [ "$OS" = "SunOS" ]; then |
|
143 PLATFORM="solaris sunos unix svr4" |
|
144 fi |
|
145 if [ "$OS" = "Linux" ]; then |
|
146 PLATFORM="linux unix" |
|
147 fi |
|
148 if [ "$OS" = "FreeBSD" ]; then |
|
149 PLATFORM="freebsd bsd unix" |
|
150 fi |
|
151 if [ "$OS" = "Darwin" ]; then |
|
152 PLATFORM="macos osx bsd unix" |
|
153 fi |
|
154 echo "$OS" | grep -i "MINGW" > /dev/null |
|
155 if [ $? -eq 0 ]; then |
|
156 PLATFORM="windows mingw" |
|
157 fi |
|
158 |
|
159 if [ -z "$PLATFORM" ]; then |
|
160 PLATFORM="unix" |
|
161 fi |
|
162 |
|
163 for p in $PLATFORM |
|
164 do |
|
165 PLATFORM_NAME=$p |
|
166 break |
|
167 done |
|
168 echo $PLATFORM_NAME |
|
169 |
|
170 isplatform() |
|
171 { |
|
172 for p in $PLATFORM |
|
173 do |
|
174 if [ "$p" = "$1" ]; then |
|
175 return 0 |
|
176 fi |
|
177 done |
|
178 return 1 |
|
179 } |
|
180 isnotplatform() |
|
181 { |
|
182 for p in $PLATFORM |
|
183 do |
|
184 if [ "$p" = "$1" ]; then |
|
185 return 1 |
|
186 fi |
|
187 done |
|
188 return 0 |
|
189 } |
|
190 |
|
191 # generate config.mk and config.h |
|
192 cat > "$TEMP_DIR/config.mk" << __EOF__ |
|
193 # |
|
194 # config.mk generated by configure |
|
195 # |
|
196 |
|
197 # general vars |
|
198 |
|
199 PREFIX=$PREFIX |
|
200 EPREFIX=$EPREFIX |
|
201 |
|
202 BINDIR=$BINDIR |
|
203 SBINDIR=$SBINDIR |
|
204 LIBDIR=$LIBDIR |
|
205 LIBEXECDIR=$LIBEXECDIR |
|
206 DATADIR=$DATADIR |
|
207 SYSCONFDIR=$SYSCONFDIR |
|
208 SHAREDSTATEDIR=$SHAREDSTATEDIR |
|
209 LOCALSTATEDIR=$LOCALSTATEDIR |
|
210 INCLUDEDIR=$INCLUDEDIR |
|
211 INFODIR=$INFODIR |
|
212 MANDIR=$MANDIR |
|
213 |
|
214 __EOF__ |
|
215 |
|
216 echo > "$TEMP_DIR/make.mk" |
|
217 |
|
218 ENV_CFLAGS=$CFLAGS |
|
219 ENV_LDFLAGS=$LDFLAGS |
|
220 ENV_CXXFLAGS=$CXXFLAGS |
|
221 |
|
222 # Toolchain detection |
|
223 # this will insert make vars to config.mk |
|
224 . make/toolchain.sh |
|
225 |
|
226 # add user specified flags to config.mk |
|
227 echo "# project specific flags" >> "$TEMP_DIR/config.mk" |
|
228 if [ -n "${ENV_CFLAGS}" ]; then |
|
229 echo "CFLAGS += $ENV_CFLAGS" >> "$TEMP_DIR/config.mk" |
|
230 fi |
|
231 if [ -n "${ENV_CXXFLAGS}" ]; then |
|
232 echo "CXXFLAGS += $ENV_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
|
233 fi |
|
234 if [ -n "${ENV_LDFLAGS}" ]; then |
|
235 echo "LDFLAGS += $ENV_LDFLAGS" >> "$TEMP_DIR/config.mk" |
|
236 fi |
|
237 |
|
238 # |
|
239 # DEPENDENCIES |
|
240 # |
|
241 |
|
242 dependency_qt4() |
|
243 { |
|
244 printf "checking for qt4... " |
|
245 # dependency qt4 |
|
246 while true |
|
247 do |
|
248 which qmake-qt4 > /dev/null |
|
249 if [ $? -ne 0 ]; then |
|
250 break |
|
251 fi |
|
252 echo yes |
|
253 return 0 |
|
254 done |
|
255 |
|
256 echo no |
|
257 return 1 |
|
258 } |
|
259 dependency_curl() |
|
260 { |
|
261 printf "checking for curl... " |
|
262 # dependency curl platform="windows" |
|
263 while true |
|
264 do |
|
265 if isnotplatform "windows"; then |
|
266 break |
|
267 fi |
|
268 TEMP_CFLAGS="$TEMP_CFLAGS -I/mingw/include" |
|
269 TEMP_LDFLAGS="$TEMP_LDFLAGS -lcurl" |
|
270 echo yes |
|
271 return 0 |
|
272 done |
|
273 |
|
274 # dependency curl platform="macos" |
|
275 while true |
|
276 do |
|
277 if isnotplatform "macos"; then |
|
278 break |
|
279 fi |
|
280 curl-config --cflags > /dev/null |
|
281 if [ $? -eq 0 ]; then |
|
282 TEMP_CFLAGS="$TEMP_CFLAGS `curl-config --cflags`" |
|
283 else |
|
284 break |
|
285 fi |
|
286 curl-config --ldflags > /dev/null |
|
287 if [ $? -eq 0 ]; then |
|
288 TEMP_LDFLAGS="$TEMP_LDFLAGS `curl-config --ldflags`" |
|
289 else |
|
290 break |
|
291 fi |
|
292 echo yes |
|
293 return 0 |
|
294 done |
|
295 |
|
296 # dependency curl |
|
297 while true |
|
298 do |
|
299 if [ -z "$PKG_CONFIG" ]; then |
|
300 break |
|
301 fi |
|
302 $PKG_CONFIG libcurl |
|
303 if [ $? -ne 0 ] ; then |
|
304 break |
|
305 fi |
|
306 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libcurl`" |
|
307 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libcurl`" |
|
308 echo yes |
|
309 return 0 |
|
310 done |
|
311 |
|
312 echo no |
|
313 return 1 |
|
314 } |
|
315 dependency_test() |
|
316 { |
|
317 printf "checking for test... " |
|
318 # dependency test platform="bsd" |
|
319 while true |
|
320 do |
|
321 if isnotplatform "bsd"; then |
|
322 break |
|
323 fi |
|
324 if isplatform "macos"; then |
|
325 break |
|
326 fi |
|
327 TEMP_CFLAGS="$TEMP_CFLAGS -DBSD" |
|
328 echo yes |
|
329 return 0 |
|
330 done |
|
331 |
|
332 # dependency test |
|
333 while true |
|
334 do |
|
335 TEMP_CFLAGS="$TEMP_CFLAGS -DTEST" |
|
336 echo yes |
|
337 return 0 |
|
338 done |
|
339 |
|
340 echo no |
|
341 return 1 |
|
342 } |
|
343 dependency_sqlite() |
|
344 { |
|
345 printf "checking for sqlite... " |
|
346 # dependency sqlite |
|
347 while true |
|
348 do |
|
349 if [ -z "$PKG_CONFIG" ]; then |
|
350 break |
|
351 fi |
|
352 $PKG_CONFIG sqlite3 |
|
353 if [ $? -ne 0 ] ; then |
|
354 break |
|
355 fi |
|
356 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags sqlite3`" |
|
357 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs sqlite3`" |
|
358 echo yes |
|
359 return 0 |
|
360 done |
|
361 |
|
362 echo no |
|
363 return 1 |
|
364 } |
|
365 dependency_gtk2() |
|
366 { |
|
367 printf "checking for gtk2... " |
|
368 # dependency gtk2 |
|
369 while true |
|
370 do |
|
371 if [ -z "$PKG_CONFIG" ]; then |
|
372 break |
|
373 fi |
|
374 $PKG_CONFIG gtk+-2.0 |
|
375 if [ $? -ne 0 ] ; then |
|
376 break |
|
377 fi |
|
378 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags gtk+-2.0`" |
|
379 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs gtk+-2.0`" |
|
380 echo yes |
|
381 return 0 |
|
382 done |
|
383 |
|
384 echo no |
|
385 return 1 |
|
386 } |
|
387 dependency_gtk3() |
|
388 { |
|
389 printf "checking for gtk3... " |
|
390 # dependency gtk3 |
|
391 while true |
|
392 do |
|
393 if [ -z "$PKG_CONFIG" ]; then |
|
394 break |
|
395 fi |
|
396 $PKG_CONFIG gtk+-5.0 |
|
397 if [ $? -ne 0 ] ; then |
|
398 break |
|
399 fi |
|
400 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags gtk+-5.0`" |
|
401 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs gtk+-5.0`" |
|
402 echo yes |
|
403 return 0 |
|
404 done |
|
405 |
|
406 echo no |
|
407 return 1 |
|
408 } |
|
409 dependency_deptest() |
|
410 { |
|
411 printf "checking for deptest... " |
|
412 # dependency deptest |
|
413 while true |
|
414 do |
|
415 TEMP_CFLAGS="$TEMP_CFLAGS -DDEPTEST" |
|
416 echo yes |
|
417 return 0 |
|
418 done |
|
419 |
|
420 echo no |
|
421 return 1 |
|
422 } |
|
423 dependency_libxml2() |
|
424 { |
|
425 printf "checking for libxml2... " |
|
426 # dependency libxml2 |
|
427 while true |
|
428 do |
|
429 if [ -z "$PKG_CONFIG" ]; then |
|
430 break |
|
431 fi |
|
432 $PKG_CONFIG libxml-2.0 |
|
433 if [ $? -ne 0 ] ; then |
|
434 break |
|
435 fi |
|
436 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libxml-2.0`" |
|
437 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libxml-2.0`" |
|
438 cat >> $TEMP_DIR/make.mk << __EOF__ |
|
439 # Dependency: libxml2 |
|
440 xml = libxml2 |
|
441 |
|
442 __EOF__ |
|
443 echo yes |
|
444 return 0 |
|
445 done |
|
446 |
|
447 echo no |
|
448 return 1 |
|
449 } |
|
450 |
|
451 DEPENDENCIES_FAILED= |
|
452 ERROR=0 |
|
453 # general dependencies |
|
454 TEMP_CFLAGS= |
|
455 TEMP_LDFLAGS= |
|
456 while true |
|
457 do |
|
458 while true |
|
459 do |
|
460 |
|
461 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
462 MVAR = 123 |
|
463 MVAR += 123 |
|
464 |
|
465 __EOF__ |
|
466 |
|
467 break |
|
468 done |
|
469 |
|
470 break |
|
471 done |
|
472 |
|
473 # add general dependency flags to config.mk |
|
474 echo >> "$TEMP_DIR/config.mk" |
|
475 if [ -n "${TEMP_CFLAGS}" ]; then |
|
476 echo "CFLAGS += $TEMP_CFLAGS" >> $TEMP_DIR/config.mk |
|
477 fi |
|
478 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
479 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> $TEMP_DIR/config.mk |
|
480 fi |
|
481 if [ -n "${TEMP_LDFLAGS}" ]; then |
|
482 echo "LDFLAGS += $TEMP_LDFLAGS" >> $TEMP_DIR/config.mk |
|
483 fi |
|
484 |
|
485 # |
|
486 # OPTION VALUES |
|
487 # |
|
488 checkopt_toolkit_gtk3() |
|
489 { |
|
490 VERR=0 |
|
491 dependency_gtk3 |
|
492 if [ $? -ne 0 ]; then |
|
493 VERR=1 |
|
494 fi |
|
495 if [ $VERR -ne 0 ]; then |
|
496 return 1 |
|
497 fi |
|
498 TEMP_CFLAGS="$TEMP_CFLAGS -Da=b" |
|
499 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
500 UIOBJ += graphics_cairo.o |
|
501 |
|
502 __EOF__ |
|
503 return 0 |
|
504 } |
|
505 checkopt_toolkit_cli() |
|
506 { |
|
507 VERR=0 |
|
508 dependency_curl |
|
509 if [ $? -ne 0 ]; then |
|
510 VERR=1 |
|
511 fi |
|
512 dependency_test |
|
513 if [ $? -ne 0 ]; then |
|
514 VERR=1 |
|
515 fi |
|
516 if [ $VERR -ne 0 ]; then |
|
517 return 1 |
|
518 fi |
|
519 return 0 |
|
520 } |
|
521 checkopt_toolkit_gtk2() |
|
522 { |
|
523 VERR=0 |
|
524 dependency_gtk2 |
|
525 if [ $? -ne 0 ]; then |
|
526 VERR=1 |
|
527 fi |
|
528 if [ $VERR -ne 0 ]; then |
|
529 return 1 |
|
530 fi |
|
531 return 0 |
|
532 } |
|
533 checkopt_toolkit_wpf() |
|
534 { |
|
535 VERR=0 |
|
536 dependency_test |
|
537 if [ $? -ne 0 ]; then |
|
538 VERR=1 |
|
539 fi |
|
540 if [ $VERR -ne 0 ]; then |
|
541 return 1 |
|
542 fi |
|
543 return 0 |
|
544 } |
|
545 |
|
546 # |
|
547 # TARGETS |
|
548 # |
|
549 TEMP_CFLAGS= |
|
550 TEMP_CXXFLAGS= |
|
551 TEMP_LDFLAGS= |
|
552 |
|
553 # Target: dav |
|
554 TEMP_CFLAGS= |
|
555 TEMP_LDFLAGS= |
|
556 TEMP_CXXFLAGS= |
|
557 |
|
558 dependency_curl |
|
559 if [ $? -ne 0 ]; then |
|
560 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED curl " |
|
561 ERROR=1 |
|
562 fi |
|
563 dependency_libxml2 |
|
564 if [ $? -ne 0 ]; then |
|
565 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 " |
|
566 ERROR=1 |
|
567 fi |
|
568 dependency_test |
|
569 if [ $? -ne 0 ]; then |
|
570 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED test " |
|
571 ERROR=1 |
|
572 fi |
|
573 |
|
574 # Features |
|
575 if [ -n "$FEATURE_DB" ]; then |
|
576 # check dependency |
|
577 dependency_sqlite |
|
578 if [ $? -ne 0 ]; then |
|
579 # "auto" features can fail and are just disabled in this case |
|
580 if [ "$FEATURE_DB" != "auto" ]; then |
|
581 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED sqlite " |
|
582 ERROR=1 |
|
583 fi |
|
584 fi |
|
585 fi |
|
586 if [ -n "$FEATURE_GUI" ]; then |
|
587 # check dependency |
|
588 dependency_gtk3 |
|
589 if [ $? -ne 0 ]; then |
|
590 # "auto" features can fail and are just disabled in this case |
|
591 if [ "$FEATURE_GUI" != "auto" ]; then |
|
592 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED gtk3 " |
|
593 ERROR=1 |
|
594 fi |
|
595 fi |
|
596 fi |
|
597 |
|
598 # Option: --toolkit |
|
599 if [ -z $OPT_TOOLKIT ]; then |
|
600 SAVED_ERROR="$ERROR" |
|
601 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
|
602 ERROR=0 |
|
603 while true |
|
604 do |
|
605 if isplatform "windows"; then |
|
606 checkopt_toolkit_wpf |
|
607 if [ $? -eq 0 ]; then |
|
608 echo " toolkit: wpf" >> "$TEMP_DIR/options" |
|
609 ERROR=0 |
|
610 break |
|
611 fi |
|
612 fi |
|
613 checkopt_toolkit_gtk3 |
|
614 if [ $? -eq 0 ]; then |
|
615 echo " toolkit: gtk3" >> "$TEMP_DIR/options" |
|
616 ERROR=0 |
|
617 break |
|
618 fi |
|
619 checkopt_toolkit_gtk2 |
|
620 if [ $? -eq 0 ]; then |
|
621 echo " toolkit: gtk2" >> "$TEMP_DIR/options" |
|
622 ERROR=0 |
|
623 break |
|
624 fi |
|
625 break |
|
626 done |
|
627 if [ $ERROR -ne 0 ]; then |
|
628 SAVED_ERROR=1 |
|
629 fi |
|
630 ERROR="$SAVED_ERROR" |
|
631 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
|
632 else |
|
633 if false; then |
|
634 false |
|
635 elif [ "$OPT_TOOLKIT" = "gtk3" ]; then |
|
636 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
|
637 checkopt_toolkit_gtk3 |
|
638 if [ $? -ne 0 ]; then |
|
639 ERROR=1 |
|
640 fi |
|
641 elif [ "$OPT_TOOLKIT" = "cli" ]; then |
|
642 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
|
643 checkopt_toolkit_cli |
|
644 if [ $? -ne 0 ]; then |
|
645 ERROR=1 |
|
646 fi |
|
647 elif [ "$OPT_TOOLKIT" = "gtk2" ]; then |
|
648 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
|
649 checkopt_toolkit_gtk2 |
|
650 if [ $? -ne 0 ]; then |
|
651 ERROR=1 |
|
652 fi |
|
653 elif [ "$OPT_TOOLKIT" = "wpf" ]; then |
|
654 echo " toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options |
|
655 checkopt_toolkit_wpf |
|
656 if [ $? -ne 0 ]; then |
|
657 ERROR=1 |
|
658 fi |
|
659 fi |
|
660 fi |
|
661 |
|
662 echo >> "$TEMP_DIR/config.mk" |
|
663 if [ -n "${TEMP_CFLAGS}" ]; then |
|
664 echo "DAV_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
|
665 fi |
|
666 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
667 echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
|
668 fi |
|
669 if [ -n "${TEMP_LDFLAGS}" ]; then |
|
670 echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
|
671 fi |
|
672 |
|
673 # Target |
|
674 TEMP_CFLAGS= |
|
675 TEMP_LDFLAGS= |
|
676 TEMP_CXXFLAGS= |
|
677 |
|
678 dependency_deptest |
|
679 if [ $? -ne 0 ]; then |
|
680 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED deptest " |
|
681 ERROR=1 |
|
682 fi |
|
683 |
|
684 # Features |
|
685 |
|
686 |
|
687 echo >> "$TEMP_DIR/config.mk" |
|
688 if [ -n "${TEMP_CFLAGS}" ]; then |
|
689 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" |
|
690 fi |
|
691 if [ -n "${TEMP_CXXFLAGS}" ]; then |
|
692 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" |
|
693 fi |
|
694 if [ -n "${TEMP_LDFLAGS}" ]; then |
|
695 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" |
|
696 fi |
|
697 |
|
698 if [ $ERROR -ne 0 ]; then |
|
699 echo |
|
700 echo "Error: Unresolved dependencies" |
|
701 echo "$DEPENDENCIES_FAILED" |
|
702 rm -Rf "$TEMP_DIR" |
|
703 exit 1 |
|
704 fi |
|
705 |
|
706 echo "configure finished" |
|
707 echo |
|
708 echo "Build Config:" |
|
709 echo " PREFIX: $PREFIX" |
|
710 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
|
711 echo "Options:" |
|
712 cat "$TEMP_DIR/options" |
|
713 echo |
|
714 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk |
|
715 rm -Rf "$TEMP_DIR" |
|
716 |
|
717 |