]> granicus.if.org Git - neomutt/commitdiff
Update autosetup to latest master branch
authorPietro Cerutti <gahr@gahr.ch>
Thu, 19 Oct 2017 11:34:13 +0000 (11:34 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 20 Oct 2017 14:04:33 +0000 (15:04 +0100)
autosetup/LICENSE [changed mode: 0755->0644]
autosetup/README.autosetup
autosetup/autosetup
autosetup/autosetup-find-tclsh
autosetup/autosetup-test-tclsh [changed mode: 0755->0644]
autosetup/cc.tcl
autosetup/jimsh0.c [changed mode: 0755->0644]
autosetup/system.tcl
autosetup/tmake.auto

old mode 100755 (executable)
new mode 100644 (file)
index 590842db3abd8a2caf9886ce0646124e5f4f2d25..2e077b81b12ce5677ae0c4f81abb2be563c26113 100644 (file)
@@ -1,4 +1,4 @@
-README.autosetup created by autosetup v0.6.7
+README.autosetup created by autosetup v0.6.8
 
 This is the autosetup directory for a local install of autosetup.
 It contains autosetup, support files and loadable modules.
index 95f322363ec36dfd0a8eab8034b041c39fcb8fa2..af90225a37c73ad398c7804ebb87d66a4251559e 100755 (executable)
@@ -5,7 +5,7 @@
 # \
 dir=`dirname "$0"`; exec "`$dir/autosetup-find-tclsh`" "$0" "$@"
 
-set autosetup(version) 0.6.7
+set autosetup(version) 0.6.8
 
 # Can be set to 1 to debug early-init problems
 set autosetup(debug) [expr {"--debug" in $argv}]
@@ -94,8 +94,19 @@ proc main {argv} {
                ref:=text manual:=text
                reference:=text => "display the autosetup command reference. 'text', 'wiki', 'asciidoc' or 'markdown'"
                debug        => "display debugging output as autosetup runs"
-               sysinstall:path  => "install standalone autosetup to the given directory (e.g.: /usr/local)"
                install:=.   => "install autosetup to the current or given directory"
+       }
+       if {$autosetup(installed)} {
+               # hidden options so we can produce a nice error
+               options-add {
+                       sysinstall:path
+               }
+       } else {
+               options-add {
+                       sysinstall:path  => "install standalone autosetup to the given directory (e.g.: /usr/local)"
+               }
+       }
+       options-add {
                force init:=help   => "create initial auto.def, etc.  Use --init=help for known types"
                # Undocumented options
                option-checking=1
@@ -575,9 +586,15 @@ proc undefine {name} {
 #
 proc define-append {name args} {
        if {[get-define $name ""] ne ""} {
-               # Make a token attempt to avoid duplicates
+               # Avoid duplicates
                foreach arg $args {
-                       if {[string first $arg $::define($name)] == -1} {
+                       set found 0
+                       foreach str [split $::define($name) " "] {
+                               if {$str eq $arg} {
+                                       incr found
+                               }
+                       }
+                       if {!$found} {
                                append ::define($name) " " $arg
                        }
                }
@@ -1554,11 +1571,16 @@ set modsource(install.tcl) {
 # shared=1 means that we are trying to do a sysinstall. This is only possible from the development source.
 
 proc autosetup_install {dir {shared 0}} {
-       if {$shared && $::autosetup(installed)} {
-               user-error "Can only --sysinstall from development sources"
+       global autosetup
+       if {$shared} {
+               if {$autosetup(installed) || $autosetup(sysinstall)} {
+                       user-error "Can only --sysinstall from development sources"
+               }
+       } elseif {$autosetup(installed)} {
+               user-error "Can't --install from project install"
        }
 
-       if {$::autosetup(sysinstall)} {
+       if {$autosetup(sysinstall)} {
                # This is the sysinstall version, so install just uses references
                cd $dir
 
@@ -1592,7 +1614,7 @@ proc autosetup_install {dir {shared 0}} {
                set publicmodules {}
 
                # First the main script, but only up until "CUT HERE"
-               set in [open $::autosetup(dir)/autosetup]
+               set in [open $autosetup(dir)/autosetup]
                while {[gets $in buf] >= 0} {
                        if {$buf ne "##-- CUT HERE --##"} {
                                puts $f $buf
@@ -1604,7 +1626,7 @@ proc autosetup_install {dir {shared 0}} {
                        # All modules are inserted if $shared is set
                        puts $f "set autosetup(installed) 1"
                        puts $f "set autosetup(sysinstall) $shared"
-                       foreach file [lsort [glob $::autosetup(libdir)/*.{tcl,auto}]] {
+                       foreach file [lsort [glob $autosetup(libdir)/*.{tcl,auto}]] {
                                set modname [file tail $file]
                                set ext [file ext $modname]
                                set buf [readfile $file]
@@ -1621,8 +1643,8 @@ proc autosetup_install {dir {shared 0}} {
                                puts $f "\}\n"
                        }
                        if {$shared} {
-                               foreach {srcname destname} [list $::autosetup(libdir)/README.autosetup-lib README.autosetup \
-                                               $::autosetup(srcdir)/LICENSE LICENSE] {
+                               foreach {srcname destname} [list $autosetup(libdir)/README.autosetup-lib README.autosetup \
+                                               $autosetup(srcdir)/LICENSE LICENSE] {
                                        dputs "install: importing $srcname as $destname"
                                        puts $f "\nset modsource($destname) \\\n[list [readfile $srcname]\n]\n"
                                }
@@ -1630,7 +1652,7 @@ proc autosetup_install {dir {shared 0}} {
                }
                close $in
                close $f
-               exec chmod 755 $target
+               catch {exec chmod 755 $target}
 
                set installfiles {autosetup-config.guess autosetup-config.sub autosetup-test-tclsh}
                set removefiles {}
@@ -1657,8 +1679,7 @@ proc autosetup_install {dir {shared 0}} {
                                lassign $fileinfo source
                                set dest $source
                        }
-                       autosetup_install_file $::autosetup(dir)/$source $targetdir/$dest
-                       exec chmod 755 $targetdir/$dest
+                       autosetup_install_file $autosetup(dir)/$source $targetdir/$dest
                }
 
                # Remove obsolete files
@@ -1728,6 +1749,10 @@ proc autosetup_install_file {source target} {
                error "Missing installation file '$source'"
        }
        writefile $target [readfile $source]\n
+       # If possible, copy the file mode
+       file stat $source stat
+       set mode [format %o [expr {$stat(mode) & 0x1ff}]]
+       catch {exec chmod $mode $target}
 }
 
 proc autosetup_install_readme {target sysinstall} {
index 12d76afb23c83e5c516203aad35f9fac8333e499..dfe70f8a1fa7b7d5323bf3151af31ca8ce09ab25 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 # Looks for a suitable tclsh or jimsh in the PATH
 # If not found, builds a bootstrap jimsh from source
+# Prefer $autosetup_tclsh if is set in the environment
 d=`dirname "$0"`
 { "$d/jimsh0" "$d/autosetup-test-tclsh"; } 2>/dev/null && exit 0
 PATH="$PATH:$d"; export PATH
-for tclsh in jimsh tclsh tclsh8.5 tclsh8.6; do
+for tclsh in $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6; do
        { $tclsh "$d/autosetup-test-tclsh"; } 2>/dev/null && exit 0
 done
 echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
old mode 100755 (executable)
new mode 100644 (file)
index fd4b26b60003a9a87b72db12482cc9284ab0a2fc..50a2d4452ef1db530714ab45c034b70061ed33bb 100644 (file)
@@ -30,11 +30,6 @@ use system
 
 module-options {}
 
-# Note that the return code is not meaningful
-proc cc-check-something {name code} {
-       uplevel 1 $code
-}
-
 # Checks for the existence of the given function by linking
 #
 proc cctest_function {function} {
@@ -155,7 +150,7 @@ proc cc-check-types {args} {
 
 # @cc-check-defines define ...
 #
-# Checks that the given preprocessor symbol is defined.
+# Checks that the given preprocessor symbols are defined.
 proc cc-check-defines {args} {
        cc-check-some-feature $args {
                cctest_define $each
@@ -242,9 +237,8 @@ proc cc-check-function-in-lib {function libs {otherlibs {}}} {
                        }
                }
        }
-       if {$found} {
-               define [feature-define-name $function]
-       } else {
+       define-feature $function $found
+       if {!$found} {
                msg-result "no"
        }
        return $found
old mode 100755 (executable)
new mode 100644 (file)
index 1d9283ebb4c307a856cefb412da3874526d2e4d8..f049d31fe7778a8ed350e271baa4ac81180c5616 100644 (file)
@@ -130,7 +130,8 @@ proc write-if-changed {file buf {script {}}} {
 
 # @make-template template ?outfile?
 #
-# Reads the input file '<srcdir>/$template' and writes the output file '$outfile'.
+# Reads the input file '<srcdir>/$template' and writes the output file '$outfile'
+# (unless unchanged).
 # If '$outfile' is blank/omitted, '$template' should end with '.in' which
 # is removed to create the output file name.
 #
@@ -222,9 +223,9 @@ proc make-template {template {out {}}} {
                }
                lappend result $line
        }
-       writefile $out [string map $mapping [join $result \n]]\n
-
-       msg-result "Created [relative-path $out] from [relative-path $template]"
+       write-if-changed $out [string map $mapping [join $result \n]]\n {
+               msg-result "Created [relative-path $out] from [relative-path $template]"
+       }
 }
 
 # build/host tuples and cross-compilation prefix
@@ -265,8 +266,9 @@ define target [get-define host]
 define prefix $prefix
 define builddir $autosetup(builddir)
 define srcdir $autosetup(srcdir)
-# Allow this to come from the environment
-define top_srcdir [get-env top_srcdir [get-define srcdir]]
+define top_srcdir $autosetup(srcdir)
+define abs_top_srcdir [file-normalize $autosetup(srcdir)]
+define abs_top_builddir [file-normalize $autosetup(builddir)]
 
 # autoconf supports all of these
 set exec_prefix [lindex [opt-val exec-prefix $prefix] end]
index 75813c39b179ef4c38ace29155a4fd3baa6f646d..64a57122437dee3d08f57366a015e8a1321f75a4 100644 (file)
@@ -23,41 +23,30 @@ cc-check-tools ar ranlib
 set objdir [get-env BUILDDIR objdir]
 
 make-config-header $objdir/include/autoconf.h
-make-tmake-settings $objdir/settings.conf {[A-Z]*}
+make-tmake-settings $objdir/settings.conf {[A-Z]*} *dir lib_*
 }
 
        autosetup_check_create project.spec \
 {# Initial project.spec created by 'autosetup --init=tmake'
 
+tmake-require-version 0.7.3
+
 # vim:set syntax=tcl:
 define? DESTDIR _install
 
 # XXX If configure creates additional/different files than include/autoconf.h
 #     that should be reflected here
+Autosetup include/autoconf.h
 
-# We use [set AUTOREMAKE] here to avoid rebuilding settings.conf
-# if the AUTOREMAKE command changes
-Depends {settings.conf include/autoconf.h} auto.def -msg {note Configuring...} -do {
-       run [set AUTOREMAKE] >$build/config.out
-} -onerror {puts [readfile $build/config.out]} -fatal
-Clean config.out
-DistClean --source config.log
-DistClean settings.conf include/autoconf.h
-
-# If not configured, configure with default options
-# Note that it is expected that configure will normally be run
-# separately. This is just a convenience for a host build
-define? AUTOREMAKE configure TOPBUILDDIR=$TOPBUILDDIR --conf=auto.def
-
-Load settings.conf
-
-# e.g. for up autoconf.h
+# e.g. for autoconf.h
 IncludePaths include
 
-ifconfig CONFIGURED
-
-# Hmmm, but should we turn off AutoSubDirs?
-#AutoSubDirs off
+ifconfig !CONFIGURED {
+       # Not configured, so don't process subdirs
+       AutoSubDirs off
+       # And don't process this file any further
+       ifconfig false
+}
 }
 
        if {![file exists build.spec]} {