17c478bd9Sstevel@tonic-gate#!/bin/sh
27c478bd9Sstevel@tonic-gate
37c478bd9Sstevel@tonic-gate# Copyright (c) 1999 by Sun Microsystems, Inc.
47c478bd9Sstevel@tonic-gate# All rights reserved.
57c478bd9Sstevel@tonic-gate#
67c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
77c478bd9Sstevel@tonic-gate
87c478bd9Sstevel@tonic-gateUNAME_R=`/usr/bin/uname -r`
97c478bd9Sstevel@tonic-gate
107c478bd9Sstevel@tonic-gateOS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
117c478bd9Sstevel@tonic-gateOS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
127c478bd9Sstevel@tonic-gateOS_VERSION=`echo $UNAME_R | tr '.' '_'`
137c478bd9Sstevel@tonic-gate
147c478bd9Sstevel@tonic-gatecat <<EOF > new_os_version.h
157c478bd9Sstevel@tonic-gate#ifndef OS_VERSION_H
167c478bd9Sstevel@tonic-gate#define OS_VERSION_H
177c478bd9Sstevel@tonic-gate
187c478bd9Sstevel@tonic-gate#define SUNOS_$OS_VERSION
197c478bd9Sstevel@tonic-gate#define OS_MAJOR $OS_MAJOR
207c478bd9Sstevel@tonic-gate#define OS_MINOR $OS_MINOR
217c478bd9Sstevel@tonic-gate
227c478bd9Sstevel@tonic-gate#endif
237c478bd9Sstevel@tonic-gateEOF
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gateif [ -f os_version.h ]; then
267c478bd9Sstevel@tonic-gate	if /usr/bin/cmp -s new_os_version.h os_version.h; then
277c478bd9Sstevel@tonic-gate		/usr/bin/rm -f new_os_version.h
287c478bd9Sstevel@tonic-gate	else
297c478bd9Sstevel@tonic-gate		/usr/bin/rm -f os_version.h
307c478bd9Sstevel@tonic-gate		/usr/bin/mv new_os_version.h os_version.h
317c478bd9Sstevel@tonic-gate	fi
327c478bd9Sstevel@tonic-gateelse
337c478bd9Sstevel@tonic-gate	/usr/bin/mv new_os_version.h os_version.h
347c478bd9Sstevel@tonic-gatefi
35