make/configure.vm

changeset 815
b0c4750cecd8
parent 796
fec90b848f4b
child 821
5e6f15005efd
     1.1 --- a/make/configure.vm	Wed Jan 17 21:01:50 2024 +0100
     1.2 +++ b/make/configure.vm	Sat Jan 20 16:02:04 2024 +0100
     1.3 @@ -93,11 +93,7 @@
     1.4  #if( $features.size() > 0 )
     1.5  Optional Features:
     1.6  #foreach( $feature in $features )
     1.7 -#if( $feature.auto )
     1.8 -  --disable-${feature.arg}
     1.9 -#else
    1.10 -  --enable-${feature.arg}
    1.11 -#end
    1.12 +${feature.helpText}
    1.13  #end
    1.14  
    1.15  #end
    1.16 @@ -190,17 +186,17 @@
    1.17  printf "detect platform... "
    1.18  if [ "$OS" = "SunOS" ]; then
    1.19      PLATFORM="solaris sunos unix svr4"
    1.20 -fi
    1.21 -if [ "$OS" = "Linux" ]; then
    1.22 +elif [ "$OS" = "Linux" ]; then
    1.23      PLATFORM="linux unix"
    1.24 -fi
    1.25 -if [ "$OS" = "FreeBSD" ]; then
    1.26 +elif [ "$OS" = "FreeBSD" ]; then
    1.27      PLATFORM="freebsd bsd unix"
    1.28 -fi
    1.29 -if [ "$OS" = "Darwin" ]; then
    1.30 +elif [ "$OS" = "OpenBSD" ]; then
    1.31 +    PLATFORM="openbsd bsd unix"
    1.32 +elif [ "$OS" = "NetBSD" ]; then
    1.33 +    PLATFORM="netbsd bsd unix"
    1.34 +elif [ "$OS" = "Darwin" ]; then
    1.35      PLATFORM="macos osx bsd unix"
    1.36 -fi
    1.37 -if echo "$OS" | grep -i "MINGW" > /dev/null; then
    1.38 +elif echo "$OS" | grep -i "MINGW" > /dev/null; then
    1.39      PLATFORM="windows mingw"
    1.40  fi
    1.41  : ${PLATFORM:="unix"}
    1.42 @@ -228,6 +224,26 @@
    1.43      done
    1.44      return 0
    1.45  }
    1.46 +istoolchain()
    1.47 +{
    1.48 +    for t in $TOOLCHAIN
    1.49 +    do
    1.50 +        if [ "$t" = "$1" ]; then
    1.51 +            return 0
    1.52 +        fi
    1.53 +    done
    1.54 +    return 1
    1.55 +}
    1.56 +notistoolchain()
    1.57 +{
    1.58 +    for t in $TOOLCHAIN
    1.59 +    do
    1.60 +        if [ "$t" = "$1" ]; then
    1.61 +            return 1
    1.62 +        fi
    1.63 +    done
    1.64 +    return 0
    1.65 +}
    1.66  ]]#
    1.67  ## End of unparsed content **
    1.68  
    1.69 @@ -307,8 +323,13 @@
    1.70              break
    1.71          fi
    1.72          #end
    1.73 +        #if( $sub.toolchain )
    1.74 +        if notistoolchain "${sub.toolchain}"; then
    1.75 +            break
    1.76 +        fi
    1.77 +        #end
    1.78          #foreach( $np in $sub.notList )
    1.79 -        if isplatform "${np}"; then
    1.80 +        if isplatform "${np}" || istoolchain "${np}"; then
    1.81              break
    1.82          fi
    1.83          #end
    1.84 @@ -384,8 +405,13 @@
    1.85          break
    1.86      fi
    1.87      #end
    1.88 +    #if( $dependency.toolchain )
    1.89 +    if notistoolchain "${dependency.toolchain}"; then
    1.90 +        break
    1.91 +    fi
    1.92 +    #end
    1.93      #foreach( $np in $dependency.notList )
    1.94 -    if isplatform "${np}"; then
    1.95 +    if isplatform "${np}" || istoolchain "${np}"; then
    1.96          break
    1.97      fi
    1.98      #end
    1.99 @@ -444,10 +470,10 @@
   1.100  
   1.101  # add general dependency flags to flags.mk
   1.102  echo "# general flags" >> "$TEMP_DIR/flags.mk"
   1.103 -if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
   1.104 +if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
   1.105      echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
   1.106  fi
   1.107 -if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
   1.108 +if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
   1.109      echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
   1.110  fi
   1.111  if [ -n "${TEMP_LDFLAGS}" ]; then
   1.112 @@ -578,10 +604,10 @@
   1.113  fi
   1.114  #end
   1.115  
   1.116 -if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then
   1.117 +if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
   1.118      echo "${target.cFlags}  += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
   1.119  fi
   1.120 -if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then
   1.121 +if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
   1.122      echo "${target.cxxFlags}  += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
   1.123  fi
   1.124  if [ "$BUILD_TYPE" = "debug" ]; then
   1.125 @@ -645,6 +671,3 @@
   1.126  write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
   1.127  cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
   1.128  rm -Rf "$TEMP_DIR"
   1.129 -
   1.130 -
   1.131 -

mercurial