From: Pietro Cerutti Date: Mon, 4 Mar 2019 12:06:38 +0000 (+0000) Subject: Update to latest autosetup X-Git-Tag: 2019-10-25~342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3dfae6080730bb191ec62429de627c0b03867f5b;p=neomutt Update to latest autosetup --- diff --git a/autosetup/autosetup b/autosetup/autosetup index 8038b27f4..f5ac5691e 100755 --- a/autosetup/autosetup +++ b/autosetup/autosetup @@ -709,6 +709,9 @@ proc define-append {name args} { if {[get-define $name ""] ne ""} { # Avoid duplicates foreach arg $args { + if {$arg eq ""} { + continue + } set found 0 foreach str [split $::define($name) " "] { if {$str eq $arg} { @@ -1860,7 +1863,7 @@ WRAPPER="$0"; export WRAPPER; "autosetup" "$@" writefile configure \ {#!/bin/sh dir="`dirname "$0"`/autosetup" -WRAPPER="$0"; export WRAPPER; exec "`$dir/autosetup-find-tclsh`" "$dir/autosetup" "$@" +WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@" } } catch {exec chmod 755 configure} diff --git a/autosetup/cc.tcl b/autosetup/cc.tcl index 40f2ae1b2..fa15d8572 100644 --- a/autosetup/cc.tcl +++ b/autosetup/cc.tcl @@ -11,6 +11,7 @@ # ## CC - C compiler ## CXX - C++ compiler +## CPP - C preprocessor ## CCACHE - Set to "none" to disable automatic use of ccache ## CFLAGS - Additional C compiler flags ## CXXFLAGS - Additional C++ compiler flags @@ -697,6 +698,15 @@ if {[get-define CC] eq ""} { define CCACHE [find-an-executable [get-env CCACHE ccache]] +# If any of these are set in the environment, propagate them to the AUTOREMAKE commandline +foreach i {CC CXX CCACHE CPP CFLAGS CXXFLAGS CXXFLAGS LDFLAGS LIBS CROSS CPPFLAGS LINKFLAGS CC_FOR_BUILD LD} { + if {[env-is-set $i]} { + # Note: If the variable is set on the command line, get-env will return that value + # so the command line will continue to override the environment + define-append AUTOREMAKE [quote-if-needed $i=[get-env $i ""]] + } +} + # Initial cctest settings cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0} set autosetup(cc-include-deps) {} diff --git a/configure b/configure index 32c8cfddf..adac37c34 100755 --- a/configure +++ b/configure @@ -1,3 +1,3 @@ #!/bin/sh dir="`dirname "$0"`/autosetup" -WRAPPER="$0"; export WRAPPER; exec "`$dir/autosetup-find-tclsh`" "$dir/autosetup" "$@" +WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"