aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-02-01 16:34:14 +0100
committerKarel Kočí <karel.koci@nic.cz>2017-02-01 16:34:14 +0100
commitca9fbd420e3249ba865563f799a3af8be2eb48cf (patch)
tree2fccc452a129ff7cbde3498954078977980b2972
parentc517c1e3bed8ff875ec5b05949b4b529c0fc5407 (diff)
downloadturris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.tar.gz
turris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.tar.bz2
turris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.zip
Update configure script to handle strings correctly
-rwxr-xr-xconfigure20
1 files changed, 15 insertions, 5 deletions
diff --git a/configure b/configure
index f10ef90..1a4f548 100755
--- a/configure
+++ b/configure
@@ -5,14 +5,16 @@ set -e
# Configured variables #####################################################
# Described in following format:
# name:initial value:type:if exported to makefile:if exported to C header
-# Where type can be just a string (in C in "") or plain. None implies plain.
+# Where type can be just a string (in C and shell in "") or plain. None implies
+# plain.
CNFS="CBUILD:::F:F
CHOST:::F:F
DEBUG:no::T:F
CPREFIX:::T:F
+CHOST::string:T:F
CCX:g++::T:F
-CFLAGS:::T:F
-LFLAGS:::T:F"
+CFLAGS::string:T:F
+LFLAGS::string:T:F"
############################################################################
# TODO add options to fine tune installation directories
@@ -83,6 +85,10 @@ while [ "$#" -gt 0 ]; do
-r|--release)
DEBUG=no
;;
+ --host=*)
+ CHOST=${1#--host=}
+ shift
+ ;;
--op-makefile)
OP=m
;;
@@ -107,8 +113,12 @@ configure() {
echo "# Please do not edit this file directly." >> "$CONFIG_FILE"
echo "$CNFS" | while read L; do
NAME=`echo "$L" | grep -o -E '^[^:]*'`
- eval "VALUE=\$$NAME"
- echo "$NAME=$VALUE" >> "$CONFIG_FILE"
+ eval "VALUE=\"\$$NAME\""
+ if [ "`echo $L | awk -F ':' '{ print $3 }'`" = "string" ]; then
+ echo "$NAME=\"$VALUE\"" >> "$CONFIG_FILE"
+ else
+ echo "$NAME=$VALUE" >> "$CONFIG_FILE"
+ fi
done
echo "Configuration written to \"$CONFIG_FILE\""
}