diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-02-01 16:34:14 +0100 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-02-01 16:34:14 +0100 |
commit | ca9fbd420e3249ba865563f799a3af8be2eb48cf (patch) | |
tree | 2fccc452a129ff7cbde3498954078977980b2972 /configure | |
parent | c517c1e3bed8ff875ec5b05949b4b529c0fc5407 (diff) | |
download | turris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.tar.gz turris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.tar.bz2 turris-lcd-example-ca9fbd420e3249ba865563f799a3af8be2eb48cf.zip |
Update configure script to handle strings correctly
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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\"" } |