xref: /freebsd/crypto/krb5/src/lib/krb5/krb/brand.c (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* lib/krb5/krb/brand.c */
3 /*
4  * Copyright (C) 2004 by the Massachusetts Institute of Technology.
5  * All rights reserved.
6  *
7  * Export of this software from the United States of America may
8  *   require a specific license from the United States Government.
9  *   It is the responsibility of any person or organization contemplating
10  *   export to obtain such a license before exporting.
11  *
12  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13  * distribute this software and its documentation for any purpose and
14  * without fee is hereby granted, provided that the above copyright
15  * notice appear in all copies and that both that copyright notice and
16  * this permission notice appear in supporting documentation, and that
17  * the name of M.I.T. not be used in advertising or publicity pertaining
18  * to distribution of the software without specific, written prior
19  * permission.  Furthermore if you modify this software you must label
20  * your software as modified software and not distribute it in such a
21  * fashion that it might be confused with the original M.I.T. software.
22  * M.I.T. makes no representations about the suitability of
23  * this software for any purpose.  It is provided "as is" without express
24  * or implied warranty.
25  */
26 
27 /*
28  * This file is used to put a "release brand" on a Krb5 library before
29  * it is released via some release engineering process.  This gives us
30  * an easy way to tell where a binary came from.
31  *
32  * It depends on patchlevel.h for the master version stamp info.
33  */
34 
35 /* Format: "KRB5_BRAND: <cvs_tag> <release_name> <date>" */
36 
37 #include "patchlevel.h"
38 
39 #define XSTR(x) #x
40 #define STR(x) XSTR(x)
41 
42 #ifdef KRB5_RELTAG
43 #define RELTAG KRB5_RELTAG
44 #else
45 #define RELTAG "[untagged]"
46 #endif
47 
48 #define MAJOR_MINOR STR(KRB5_MAJOR_RELEASE) "." STR(KRB5_MINOR_RELEASE)
49 
50 #if KRB5_PATCHLEVEL != 0
51 #define MAYBE_PATCH "." STR(KRB5_PATCHLEVEL)
52 #else
53 #define MAYBE_PATCH ""
54 #endif
55 
56 #ifdef KRB5_RELTAIL
57 #define RELTAIL "-" KRB5_RELTAIL
58 #else
59 #define RELTAIL ""
60 #endif
61 
62 #define RELNAME MAJOR_MINOR MAYBE_PATCH RELTAIL
63 
64 #ifdef KRB5_RELDATE
65 #define RELDATE KRB5_RELDATE
66 #else
67 #define RELDATE "[date unknown]"
68 #endif
69 
70 #define BRANDSTR RELTAG " " RELNAME " " RELDATE
71 
72 char krb5_brand[] = "KRB5_BRAND: " BRANDSTR;
73