configure

changeset 280
7845f5872bed
parent 253
6ab35fcb8676
equal deleted inserted replaced
279:97a1a7fb4f1a 280:7845f5872bed
110 --debug add extra compile flags for debug builds 110 --debug add extra compile flags for debug builds
111 --release add extra compile flags for release builds 111 --release add extra compile flags for release builds
112 112
113 Optional Features: 113 Optional Features:
114 --enable-asan Enable address sanitization. 114 --enable-asan Enable address sanitization.
115 --enable-tools Enable compilation of tools.
115 116
116 __EOF__ 117 __EOF__
117 } 118 }
118 119
119 # create temporary directory 120 # create temporary directory
150 151
151 # custom variables 152 # custom variables
152 if true \ 153 if true \
153 ; then 154 ; then
154 SRCDIR=`pwd` 155 SRCDIR=`pwd`
156 TOOLKIT_HOME="${TOOLKIT_HOME:=/usr}"
155 fi 157 fi
156 158
157 # features 159 # features
158 160
159 # 161 #
181 "--help"*) printhelp; abort_configure ;; 183 "--help"*) printhelp; abort_configure ;;
182 "--debug") BUILD_TYPE="debug" ;; 184 "--debug") BUILD_TYPE="debug" ;;
183 "--release") BUILD_TYPE="release" ;; 185 "--release") BUILD_TYPE="release" ;;
184 "--enable-asan") FEATURE_ASAN=on ;; 186 "--enable-asan") FEATURE_ASAN=on ;;
185 "--disable-asan") unset FEATURE_ASAN ;; 187 "--disable-asan") unset FEATURE_ASAN ;;
188 "--enable-tools") FEATURE_TOOLS=on ;;
189 "--disable-tools") unset FEATURE_TOOLS ;;
186 "-"*) echo "unknown option: $ARG"; abort_configure ;; 190 "-"*) echo "unknown option: $ARG"; abort_configure ;;
187 esac 191 esac
188 done 192 done
189 193
190 194
341 345
342 print_check_msg "$dep_checked_sdl3_ttf" "no\n" 346 print_check_msg "$dep_checked_sdl3_ttf" "no\n"
343 dep_checked_sdl3_ttf=1 347 dep_checked_sdl3_ttf=1
344 return 0 348 return 0
345 } 349 }
350 dependency_error_gtk3()
351 {
352 print_check_msg "$dep_checked_gtk3" "checking for gtk3... "
353 # dependency gtk3
354 while true
355 do
356 if [ -z "$PKG_CONFIG" ]; then
357 break
358 fi
359 if test_pkg_config "gtk+-3.0" "" "" "" ; then
360 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags gtk+-3.0`"
361 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs gtk+-3.0`"
362 else
363 break
364 fi
365 TEMP_CFLAGS="$TEMP_CFLAGS -DUI_GTK3"
366 TEMP_LDFLAGS="$TEMP_LDFLAGS -lpthread"
367 print_check_msg "$dep_checked_gtk3" "yes\n"
368 dep_checked_gtk3=1
369 return 1
370 done
371
372 print_check_msg "$dep_checked_gtk3" "no\n"
373 dep_checked_gtk3=1
374 return 0
375 }
376 dependency_error_toolkit()
377 {
378 print_check_msg "$dep_checked_toolkit" "checking for toolkit... "
379 # dependency toolkit
380 while true
381 do
382 if test -n "$TOOLKIT_HOME" > /dev/null ; then
383 :
384 else
385 break
386 fi
387 if test -f "$TOOLKIT_HOME/lib/libuitk.a" > /dev/null ; then
388 :
389 else
390 break
391 fi
392 if test -f "$TOOLKIT_HOME/include/ui/ui.h" > /dev/null ; then
393 :
394 else
395 break
396 fi
397 TEMP_CFLAGS="$TEMP_CFLAGS -I$TOOLKIT_HOME/include"
398 TEMP_LDFLAGS="$TEMP_LDFLAGS $TOOLKIT_HOME/lib/libuitk.a"
399 print_check_msg "$dep_checked_toolkit" "yes\n"
400 dep_checked_toolkit=1
401 return 1
402 done
403
404 print_check_msg "$dep_checked_toolkit" "no\n"
405 dep_checked_toolkit=1
406 return 0
407 }
346 dependency_error_glew() 408 dependency_error_glew()
347 { 409 {
348 print_check_msg "$dep_checked_glew" "checking for glew... " 410 print_check_msg "$dep_checked_glew" "checking for glew... "
349 # dependency glew 411 # dependency glew
350 while true 412 while true
553 fi 615 fi
554 if [ -n "${TEMP_LDFLAGS}" ]; then 616 if [ -n "${TEMP_LDFLAGS}" ]; then
555 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" 617 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
556 fi 618 fi
557 619
620 echo >> "$TEMP_DIR/flags.mk"
621 echo "configuring target: tools"
622 echo "# flags for target tools" >> "$TEMP_DIR/flags.mk"
623 TEMP_CFLAGS=
624 TEMP_CXXFLAGS=
625 TEMP_LDFLAGS=
626
627 if dependency_error_toolkit; then
628 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED toolkit "
629 ERROR=1
630 fi
631 if dependency_error_gtk3; then
632 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED gtk3 "
633 ERROR=1
634 fi
635 if dependency_error_ucx; then
636 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ucx "
637 ERROR=1
638 fi
639
640 # Features
641 if [ -n "$FEATURE_TOOLS" ]; then
642 if [ -n "$DISABLE_FEATURE_TOOLS" ]; then
643 unset FEATURE_TOOLS
644 fi
645 fi
646 if [ -n "$FEATURE_TOOLS" ]; then
647 :
648 else
649 :
650 cat >> "$TEMP_DIR/make.mk" << __EOF__
651 NO_TOOLS=1
652 __EOF__
653 fi
654
655
656 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
657 echo "TOOLS_CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
658 fi
659 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
660 echo "TOOLS_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
661 fi
662 if [ -n "${TEMP_LDFLAGS}" ]; then
663 echo "TOOLS_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
664 fi
665
558 666
559 # final result 667 # final result
560 if [ $ERROR -ne 0 ]; then 668 if [ $ERROR -ne 0 ]; then
561 echo 669 echo
562 echo "Error: Unresolved dependencies" 670 echo "Error: Unresolved dependencies"
631 if [ -n "$FEATURE_ASAN" ]; then 739 if [ -n "$FEATURE_ASAN" ]; then
632 echo " asan: on" 740 echo " asan: on"
633 else 741 else
634 echo " asan: off" 742 echo " asan: off"
635 fi 743 fi
744 if [ -n "$FEATURE_TOOLS" ]; then
745 echo " tools: on"
746 else
747 echo " tools: off"
748 fi
636 echo 749 echo
637 750
638 # generate the config.mk file 751 # generate the config.mk file
639 pwd=`pwd` 752 pwd=`pwd`
640 cat > "$TEMP_DIR/config.mk" << __EOF__ 753 cat > "$TEMP_DIR/config.mk" << __EOF__

mercurial