Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / libresolv2 / include / make_os_version.sh
blob3654490fee6315d780f75ce46561f2e680e17fe4
1 #!/bin/sh
3 # Copyright (c) 1999 by Sun Microsystems, Inc.
4 # All rights reserved.
6 #pragma ident "%Z%%M% %I% %E% SMI"
8 UNAME_R=`/usr/bin/uname -r`
10 OS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
11 OS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
12 OS_VERSION=`echo $UNAME_R | tr '.' '_'`
14 cat <<EOF > new_os_version.h
15 #ifndef OS_VERSION_H
16 #define OS_VERSION_H
18 #define SUNOS_$OS_VERSION
19 #define OS_MAJOR $OS_MAJOR
20 #define OS_MINOR $OS_MINOR
22 #endif
23 EOF
25 if [ -f os_version.h ]; then
26 if /usr/bin/cmp -s new_os_version.h os_version.h; then
27 /usr/bin/rm -f new_os_version.h
28 else
29 /usr/bin/rm -f os_version.h
30 /usr/bin/mv new_os_version.h os_version.h
32 else
33 /usr/bin/mv new_os_version.h os_version.h