]> git.sur5r.net Git - openldap/blob - build/mkversion
572c72b797118599562c704160651d7bbb24bfd8
[openldap] / build / mkversion
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-2003 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
17 PACKAGE=OpenLDAP
18 VERSION=unknown
19 SYMBOL=__Version
20 static=static
21 const=const
22 while :
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
45 done
46
47 if test $# != 1 ; then
48         echo 'usage: mkversion [-c] [-s] [-p package] [-v version] application'
49         exit 1
50 fi
51
52 APPLICATION=$1
53 WHOWHERE="$USER@`uname -n`:`pwd`"
54
55 cat << __EOF__
56 /*
57  * Copyright 1998-2003 The OpenLDAP Foundation
58  * COPYING RESTRICTIONS APPLY.  See COPYRIGHT file in top level directory
59  * of this package for details.
60  */
61 static const char copyright[] =
62 "Copyright 1998-2003 The OpenLDAP Foundation\n"
63 "COPYING RESTRICTIONS APPLY\n";
64
65 $static $const char $SYMBOL[] =
66 "@(#) \$$PACKAGE: $APPLICATION $VERSION (" __DATE__ " " __TIME__ ") \$\n\t$WHOWHERE\n";
67
68 __EOF__