source: trunk/third/xntp/scripts/mkver.bat @ 10832

Revision 10832, 2.2 KB checked in by brlewis, 27 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r10831, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1@rem = '--*-Perl-*--';
2@rem = '
3@echo off
4perl -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
5goto endofperl
6@rem ';
7######################################################################
8#
9# Revision: mkver.bat
10# Author:   Greg Schueman
11# Date:     05/03/1996
12# Purpose:  Provide a perl script for NT to replace the
13#           mkversion shell script.
14#           
15#
16#
17# Subroutines:
18#     print_help
19#     
20#
21#
22######################################################################
23
24use English;
25use Getopt::Long;
26
27#*********************************************************************
28#  Program Dependency Requirements
29#*********************************************************************
30
31#*********************************************************************
32#  Set Environment
33#*********************************************************************
34$PROGRAM = $0;
35$USAGE   = "Usage: ${PROGRAM} [ -P <Program Name> -H ]\n";
36
37
38#*********************************************************************
39#  Subroutine Print Help
40#*********************************************************************
41
42sub print_help
43{
44   print STDERR $USAGE;
45   print STDERR " -P --Program Name      Database Name\n";
46   print STDERR " -H --Help         Help on options\n";
47   print STDERR "\n";
48} # print_help end
49
50
51
52#*********************************************************************
53#  Main program
54#*********************************************************************
55
56#
57# Process runtime options
58#
59$result = GetOptions('help|H', 'prog|P=s');
60
61if ($opt_help == 1)
62{
63   print_help();
64   exit();
65};
66
67
68if (length($opt_prog) > 0)
69   { $GENERATED_PROGRAM=$opt_prog; }
70else
71   { die "Program Name parameter required."; }
72
73#
74# Program logic
75#
76
77$DATE =  localtime;
78chomp $DATE;
79$RUN = "0"; # Not working yet
80
81open( INPUT, '<..\configure' );
82open( OUTPUT, '>version.c' );
83
84while ($_ = <INPUT> )
85{
86#   if (/^[0-9a-zA-Z_]*=/)
87   if (/^VERSION=/)
88   {
89      $FLAGS = $POSTMATCH;
90   }
91}
92chomp $FLAGS;
93
94print OUTPUT "char * Version = \"$GENERATED_PROGRAM $FLAGS $DATE ($RUN)\" ;";
95
96close( OUTPUT );
97close( INPUT );
98
99__END__
100:endofperl
Note: See TracBrowser for help on using the repository browser.