1139731Simp#!/bin/sh -
24Srgrimes# Copyright (c) 2013 Garrett Cooper
34Srgrimes# All rights reserved.
44Srgrimes#
58876Srgrimes# Redistribution and use in source and binary forms, with or without
64Srgrimes# modification, are permitted provided that the following conditions
74Srgrimes# are met:
84Srgrimes# 1. Redistributions of source code must retain the above copyright
94Srgrimes#    notice, this list of conditions and the following disclaimer.
104Srgrimes# 2. Redistributions in binary form must reproduce the above copyright
118876Srgrimes#    notice, this list of conditions and the following disclaimer in the
128876Srgrimes#    documentation and/or other materials provided with the distribution.
134Srgrimes#
144Srgrimes# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
158876Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
164Srgrimes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
178876Srgrimes# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
184Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
194Srgrimes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
204Srgrimes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
214Srgrimes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
228876Srgrimes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
234Srgrimes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
244Srgrimes# SUCH DAMAGE.
254Srgrimes#
264Srgrimes# $FreeBSD: releng/10.2/include/mk-osreldate.sh 255957 2013-09-30 21:01:04Z ian $
27118031Sobrien
28118031Sobrienset -e
29118031Sobrien
304SrgrimesCURDIR=$(pwd)
314SrgrimesECHO=${ECHO:=echo}
324Srgrimes
332056Swollmantmpfile=$(mktemp osreldate.XXXXXXXX)
342056Swollmantrap "rm -f $tmpfile" EXIT
35131952Smarcel
3649558Sphk${ECHO} creating osreldate.h from newvers.sh
3776440Sjhb
3875274Sjhbexport PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}"
395588Sbdeset +e
4030789Sbde. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1
415588Sbdeset -e
4212662Sdgcat > $tmpfile <<EOF
434Srgrimes$COPYRIGHT
444Srgrimes#ifdef _KERNEL
4512662Sdg#error "<osreldate.h> cannot be used in the kernel, use <sys/param.h>"
4624345Sbde#else
474Srgrimes#undef __FreeBSD_version
48131952Smarcel#define __FreeBSD_version $RELDATE
494Srgrimes#endif
50798SwollmanEOF
51131952Smarcelchmod 644 $tmpfile
524Srgrimesmv $tmpfile osreldate.h
53131952Smarcel