home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / autoconf-2.10-src.tgz / tar.out / fsf / autoconf / testsuite / config / unix.exp
Text File  |  1996-09-28  |  3KB  |  113 lines

  1. # -*- TCL -*-
  2. # Test-specific TCL procedures required by DejaGNU.
  3. # Copyright (C) 1994 Free Software Foundation, Inc.
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16.  
  17. # Modified by David MacKenzie <djm@gnu.ai.mit.edu> from the gcc files
  18. # written by Rob Savoye <rob@cygnus.com>.
  19.  
  20. #
  21. # Called by runtest.
  22. # Extract and print the version number of autoconf.
  23. #
  24. proc autoconf_version {} {
  25.     global AUTOCONF
  26.     global AUTOCONFFLAGS
  27.  
  28.     if {[which $AUTOCONF] != 0} then {
  29.     set tmp [ eval exec $AUTOCONF $AUTOCONFFLAGS --version /dev/null ]
  30.     regexp "version.*$" $tmp version
  31.     if [info exists version] then {
  32.         clone_output "[which $AUTOCONF] $version\n"
  33.     } else {
  34.         warning "cannot get version from $tmp."
  35.     }
  36.     } else {
  37.     warning "$AUTOCONF, program does not exist"
  38.     }
  39. }
  40.  
  41. #
  42. # Compile a configure.in using autoconf.
  43. # Runs autoconf and leaves the output in $comp_output.
  44. # Called by individual test scripts.
  45. # Return 1 if ok, 0 if not.
  46. proc autoconf_start { configout } {
  47.     global verbose
  48.     global AUTOCONF
  49.     global AUTOCONFFLAGS
  50.     global comp_output
  51.  
  52.     if {[which $AUTOCONF] == 0} then {
  53.     error "$AUTOCONF, program does not exist"
  54.     exit 1
  55.     }
  56.  
  57.     set configin "$configout.in"
  58.  
  59.     send_log "$AUTOCONF $AUTOCONFFLAGS $configin > $configout\n"
  60.     if $verbose>1 then {
  61.     send_user "Spawning \"$AUTOCONF $AUTOCONFFLAGS $configin > $configout\"\n"
  62.     }
  63.  
  64.     catch "exec $AUTOCONF $AUTOCONFFLAGS $configin > $configout" comp_output
  65.     if ![string match "" $comp_output] then {
  66.     send_log "$comp_output\n"
  67.     if $verbose>1 then {
  68.         send_user "$comp_output\n"
  69.     }
  70.     }
  71.     catch "exec chmod +x $configout"
  72.     return 1
  73. }
  74.  
  75. #
  76. # Execute the configure script.
  77. # Leaves the output in $exec_output.
  78. # Called by individual test scripts.
  79. # Return 1 if successful so far, 0 if failure already.
  80. proc autoconf_load { args } {
  81.     global verbose
  82.     global exec_output
  83.  
  84.     if ![file exists $args] then {
  85.     error "$args, configure script does not exist"
  86.     return 0
  87.     }
  88.  
  89.     # Capture only stderr in exec_output, not "creating Makefile" etc.
  90.     catch "exec $args --cache=/dev/null >/dev/null" exec_output
  91.     if $verbose>1 then {
  92.     send_user "Executed $args --cache=/dev/null\n"
  93.     }
  94.     if ![string match "" $exec_output] then {
  95.     fail "$args, problem with executing"
  96.     send_log "$exec_output\n"
  97.     return 0
  98.     } else {
  99.     return 1
  100.     }
  101. }
  102.  
  103. #
  104. # Called by runtest.
  105. # Clean up (remove temporary files) before runtest exits.
  106. #
  107. proc autoconf_exit {} {
  108. }
  109.  
  110. load_lib common.exp
  111.