# # BEGIN COPYRIGHT BLOCK # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. # Copyright (C) 2005 Red Hat, Inc. # All rights reserved. # END COPYRIGHT BLOCK # @date = localtime(); $FILEVERSION = &doubleDigit( $date[5] ) . ',' . # year &doubleDigit( $date[4] + 1 ) . ',' . # month &doubleDigit( $date[3] ) . ',' . # date &doubleDigit( $date[2] ); $FILEVERSIONTEXT = '"' . &doubleDigit( $date[4] ) . '/' . # month &doubleDigit( $date[3] ) . '/' . # date &doubleDigit( $date[5] ) . ' ' . # year &doubleDigit( $date[2] ) . ':' . # hour &doubleDigit( $date[1] ) . '"'; # minute $MAJORVERSION=$ARGV[1]; $MINORVERSION=$ARGV[2]; open(VERSIONFILE, ">$ARGV[0]/include/nt/ntversion.h"); print VERSIONFILE "// This file is automatically generated.\r\n"; print VERSIONFILE "// Please do not edit this file manually.\r\n"; print VERSIONFILE "// It contains the version number of this build.\r\n"; print VERSIONFILE "\r\n"; print VERSIONFILE "#define VERSION $FILEVERSION\r\n"; print VERSIONFILE "#define PRODUCT $MAJORVERSION,0,0,$MINORVERSION\r\n"; print VERSIONFILE "#define VERSIONTEXT $FILEVERSIONTEXT\r\n"; print VERSIONFILE "#define PRODUCTTEXT \"$MAJORVERSION.$MINORVERSION\"\r\n"; close( VERSIONFILE ); sub doubleDigit { $_[0] > 9 ? $_[0] : '0' . $_[0]; }