xref: /titanic_52/usr/src/lib/libresolv2/include/make_os_version.sh (revision 0c44d0008f52b6a42b9c01d3b344661217520a68)
1*0c44d000Sstevel#!/bin/sh
2*0c44d000Sstevel
3*0c44d000Sstevel# Copyright (c) 1999 by Sun Microsystems, Inc.
4*0c44d000Sstevel# All rights reserved.
5*0c44d000Sstevel#
6*0c44d000Sstevel#pragma ident	"%Z%%M%	%I%	%E% SMI"
7*0c44d000Sstevel
8*0c44d000SstevelUNAME_R=`/usr/bin/uname -r`
9*0c44d000Sstevel
10*0c44d000SstevelOS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
11*0c44d000SstevelOS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
12*0c44d000SstevelOS_VERSION=`echo $UNAME_R | tr '.' '_'`
13*0c44d000Sstevel
14*0c44d000Sstevelcat <<EOF > new_os_version.h
15*0c44d000Sstevel#ifndef OS_VERSION_H
16*0c44d000Sstevel#define OS_VERSION_H
17*0c44d000Sstevel
18*0c44d000Sstevel#define SUNOS_$OS_VERSION
19*0c44d000Sstevel#define OS_MAJOR $OS_MAJOR
20*0c44d000Sstevel#define OS_MINOR $OS_MINOR
21*0c44d000Sstevel
22*0c44d000Sstevel#endif
23*0c44d000SstevelEOF
24*0c44d000Sstevel
25*0c44d000Sstevelif [ -f os_version.h ]; then
26*0c44d000Sstevel	if /usr/bin/cmp -s new_os_version.h os_version.h; then
27*0c44d000Sstevel		/usr/bin/rm -f new_os_version.h
28*0c44d000Sstevel	else
29*0c44d000Sstevel		/usr/bin/rm -f os_version.h
30*0c44d000Sstevel		/usr/bin/mv new_os_version.h os_version.h
31*0c44d000Sstevel	fi
32*0c44d000Sstevelelse
33*0c44d000Sstevel	/usr/bin/mv new_os_version.h os_version.h
34*0c44d000Sstevelfi
35