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
77c478bd9Sstevel@tonic-gateUNAME_R=`/usr/bin/uname -r`
87c478bd9Sstevel@tonic-gate
97c478bd9Sstevel@tonic-gateOS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
107c478bd9Sstevel@tonic-gateOS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
117c478bd9Sstevel@tonic-gateOS_VERSION=`echo $UNAME_R | tr '.' '_'`
127c478bd9Sstevel@tonic-gate
137c478bd9Sstevel@tonic-gatecat <<EOF > new_os_version.h
147c478bd9Sstevel@tonic-gate#ifndef OS_VERSION_H
157c478bd9Sstevel@tonic-gate#define OS_VERSION_H
167c478bd9Sstevel@tonic-gate
177c478bd9Sstevel@tonic-gate#define SUNOS_$OS_VERSION
187c478bd9Sstevel@tonic-gate#define OS_MAJOR $OS_MAJOR
197c478bd9Sstevel@tonic-gate#define OS_MINOR $OS_MINOR
207c478bd9Sstevel@tonic-gate
217c478bd9Sstevel@tonic-gate#endif
227c478bd9Sstevel@tonic-gateEOF
237c478bd9Sstevel@tonic-gate
247c478bd9Sstevel@tonic-gateif [ -f os_version.h ]; then
257c478bd9Sstevel@tonic-gate	if /usr/bin/cmp -s new_os_version.h os_version.h; then
267c478bd9Sstevel@tonic-gate		/usr/bin/rm -f new_os_version.h
277c478bd9Sstevel@tonic-gate	else
287c478bd9Sstevel@tonic-gate		/usr/bin/rm -f os_version.h
297c478bd9Sstevel@tonic-gate		/usr/bin/mv new_os_version.h os_version.h
307c478bd9Sstevel@tonic-gate	fi
317c478bd9Sstevel@tonic-gateelse
327c478bd9Sstevel@tonic-gate	/usr/bin/mv new_os_version.h os_version.h
337c478bd9Sstevel@tonic-gatefi
34