test/configure

changeset 51
5c12e9e29733
parent 47
78ee95836412
child 52
afcb57893858
equal deleted inserted replaced
50:d26da280c934 51:5c12e9e29733
64 } 64 }
65 65
66 # 66 #
67 # parse arguments 67 # parse arguments
68 # 68 #
69 BUILD_TYPE="default"
69 for ARG in "$@" 70 for ARG in "$@"
70 do 71 do
71 case "$ARG" in 72 case "$ARG" in
72 "--prefix="*) PREFIX=${ARG#--prefix=} ;; 73 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
73 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;; 74 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
81 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;; 82 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
82 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;; 83 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
83 "--infodir="*) INFODIR=${ARG#--infodir=} ;; 84 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
84 "--mandir"*) MANDIR=${ARG#--mandir} ;; 85 "--mandir"*) MANDIR=${ARG#--mandir} ;;
85 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;; 86 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;;
87 "--debug") BUILD_TYPE="debug" ;;
88 "--release") BUILD_TYPE="release" ;;
86 "--enable-pg") FEATURE_PG=on ;; 89 "--enable-pg") FEATURE_PG=on ;;
87 "--disable-pg") unset FEATURE_PG ;; 90 "--disable-pg") unset FEATURE_PG ;;
88 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;; 91 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;;
89 esac 92 esac
90 done 93 done
413 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk" 416 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
414 fi 417 fi
415 if [ -n "${TEMP_CXXFLAGS}" ]; then 418 if [ -n "${TEMP_CXXFLAGS}" ]; then
416 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk" 419 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk"
417 fi 420 fi
421 if [ "$BUILD_TYPE" = "debug" ]; then
422 echo 'CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
423 echo 'CXXFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
424 fi
425 if [ "$BUILD_TYPE" = "release" ]; then
426 echo 'CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
427 echo 'CXXFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
428 fi
418 if [ -n "${TEMP_LDFLAGS}" ]; then 429 if [ -n "${TEMP_LDFLAGS}" ]; then
419 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk" 430 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
420 fi 431 fi
421 432
422 if [ $ERROR -ne 0 ]; then 433 if [ $ERROR -ne 0 ]; then

mercurial