From ca9fbd420e3249ba865563f799a3af8be2eb48cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 1 Feb 2017 16:34:14 +0100 Subject: Update configure script to handle strings correctly --- configure | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'configure') 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\"" } -- cgit v1.2.3