xref: /netbsd-src/external/bsd/openldap/dist/build/mkversion (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1#! /bin/sh
2# Create a version.c file
3# $OpenLDAP$
4## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5##
6## Copyright 1998-2014 The OpenLDAP Foundation.
7## All rights reserved.
8##
9## Redistribution and use in source and binary forms, with or without
10## modification, are permitted only as authorized by the OpenLDAP
11## Public License.
12##
13## A copy of this license is available in the file LICENSE in the
14## top-level directory of the distribution or, alternatively, at
15## <http://www.OpenLDAP.org/license.html>.
16
17PACKAGE=OpenLDAP
18VERSION=unknown
19SYMBOL=__Version
20static=static
21const=const
22while :
23	do case "$1" in
24		-p)
25			PACKAGE=$2
26			shift; shift ;;
27		-v)
28			VERSION=$2
29			shift; shift ;;
30
31		-c)
32			const=
33			shift ;;
34		-n)
35			SYMBOL=$2
36			shift; shift ;;
37		-s)
38			static=
39			shift ;;
40
41#		-*) shift ;;
42		*)
43			break ;;
44	esac
45done
46
47if test $# != 1 ; then
48	echo 'usage: mkversion [-c] [-s] [-p package] [-v version] application'
49	exit 1
50fi
51
52APPLICATION=$1
53
54cat << __EOF__
55/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
56 *
57 * Copyright 1998-2014 The OpenLDAP Foundation.
58 * All rights reserved.
59 *
60 * Redistribution and use in source and binary forms, with or without
61 * modification, are permitted only as authorized by the OpenLDAP
62 * Public License.
63 *
64 * A copy of this license is available in the file LICENSE in the
65 * top-level directory of the distribution or, alternatively, at
66 * <http://www.OpenLDAP.org/license.html>.
67 */
68
69static const char copyright[] =
70"Copyright 1998-2014 The OpenLDAP Foundation.  All rights reserved.\n"
71"COPYING RESTRICTIONS APPLY\n";
72
73$static $const char $SYMBOL[] =
74"@(#) \$$PACKAGE: $APPLICATION $VERSION \$\n";
75
76__EOF__
77