tmake.auto
1 # Copyright (c) 2016 WorkWare Systems http://www.workware.net.au/ 2 # All rights reserved 3 4 # Auto-load module for 'tmake' build system integration 5 6 use init 7 8 autosetup_add_init_type tmake "Tcl-based tmake build system" { 9 autosetup_check_create auto.def \ 10 {# Initial auto.def created by 'autosetup --init=tmake' 11 # vim:set syntax=tcl: 12 13 use cc cc-lib cc-db cc-shared 14 use tmake 15 16 # Add any user options here 17 # Really want a --configure that takes over the rest of the command line 18 options { 19 } 20 21 cc-check-tools ar ranlib 22 23 set objdir [get-env BUILDDIR objdir] 24 25 make-config-header $objdir/include/autoconf.h 26 make-tmake-settings $objdir/settings.conf {[A-Z]*} *dir lib_* 27 } 28 29 autosetup_check_create project.spec \ 30 {# Initial project.spec created by 'autosetup --init=tmake' 31 32 tmake-require-version 0.7.3 33 34 # vim:set syntax=tcl: 35 define? DESTDIR _install 36 37 # XXX If configure creates additional/different files than include/autoconf.h 38 # that should be reflected here 39 Autosetup include/autoconf.h 40 41 # e.g. for autoconf.h 42 IncludePaths include 43 44 ifconfig !CONFIGURED { 45 # Not configured, so don't process subdirs 46 AutoSubDirs off 47 # And don't process this file any further 48 ifconfig false 49 } 50 } 51 52 set configure [readfile configure] 53 # XXX Do we need also need to support a system install of tmake? 54 if {[string first {#@TMAKEUPDATED@} $configure] < 0} { 55 if {[regsub {#@@INITCHECK@@#} $configure \ 56 {test -z "$TMAKE" -a -x "$dir/tmake" \&\& exec "$dir/tmake" --force --configure "$@"; #@TMAKEUPDATED@} configure]} { 57 writefile configure $configure\n 58 exec chmod +x configure 59 puts "Updated configure to invoke local tmake." 60 if {![file exec autosetup/tmake]} { 61 puts "Warning: autosetup/tmake is missing." 62 puts " Install it with: tmake --install=autosetup" 63 } 64 } else { 65 puts "Warning: configure isn't created by a recent autosetup, not updating." 66 } 67 } else { 68 puts "I see configure for tmake already exists." 69 } 70 if {![file exists build.spec]} { 71 puts "Note: I don't see build.spec. Try running: tmake --genie" 72 } 73 }