src/test/resources/golden-sample/configure2

changeset 51
5c12e9e29733
parent 47
78ee95836412
child 52
afcb57893858
--- a/src/test/resources/golden-sample/configure2	Tue Sep 12 22:42:12 2023 +0200
+++ b/src/test/resources/golden-sample/configure2	Tue Sep 12 23:36:45 2023 +0200
@@ -56,6 +56,8 @@
   --mandir=DIR            man documentation [DATAROOTDIR/man]
 
 Options:
+  --debug                 add extra compile flags for debug builds
+  --release               add extra compile flags for release builds
   --toolkit=(gtk3|cli|gtk2|wpf)
 
 Optional Features:
@@ -68,6 +70,7 @@
 #
 # parse arguments
 #
+BUILD_TYPE="default"
 for ARG in "$@"
 do
     case "$ARG" in
@@ -85,6 +88,8 @@
         "--infodir="*)        INFODIR=${ARG#--infodir=} ;;
         "--mandir"*)          MANDIR=${ARG#--mandir} ;;
         "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;;
+        "--debug")           BUILD_TYPE="debug" ;;
+        "--release")         BUILD_TYPE="release" ;;
         "--toolkit="*) OPT_TOOLKIT=${ARG#--toolkit=} ;;
         "--enable-db") FEATURE_DB=on ;;
         "--disable-db") unset FEATURE_DB ;;
@@ -670,6 +675,14 @@
 if [ -n "${TEMP_CXXFLAGS}" ]; then
     echo "DAV_CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk"
 fi
+if [ "$BUILD_TYPE" = "debug" ]; then
+    echo 'DAV_CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
+    echo 'DAV_CXXFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
+fi
+if [ "$BUILD_TYPE" = "release" ]; then
+    echo 'DAV_CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
+    echo 'DAV_CXXFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
+fi
 if [ -n "${TEMP_LDFLAGS}" ]; then
     echo "DAV_LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
 fi
@@ -695,6 +708,14 @@
 if [ -n "${TEMP_CXXFLAGS}" ]; then
     echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk"
 fi
+if [ "$BUILD_TYPE" = "debug" ]; then
+    echo 'CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
+    echo 'CXXFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
+fi
+if [ "$BUILD_TYPE" = "release" ]; then
+    echo 'CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
+    echo 'CXXFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
+fi
 if [ -n "${TEMP_LDFLAGS}" ]; then
     echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
 fi

mercurial