iPXE
version.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301, USA.
00018  *
00019  * You can also choose to distribute this program under the terms of
00020  * the Unmodified Binary Distribution Licence (as given in the file
00021  * COPYING.UBDL), provided that you have satisfied its requirements.
00022  */
00023 
00024 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00025 
00026 /** @file
00027  *
00028  * Version number
00029  *
00030  */
00031 
00032 #include <wchar.h>
00033 #include <ipxe/features.h>
00034 #include <ipxe/version.h>
00035 #include <config/general.h>
00036 #include <config/branding.h>
00037 
00038 /**
00039  * Create wide-character version of string
00040  *
00041  * @v string            String
00042  * @ret wstring         Wide-character version of string
00043  */
00044 #define WSTRING( string ) _WSTRING ( string )
00045 #define _WSTRING( string ) L ## string
00046 
00047 /** Version number feature */
00048 FEATURE_VERSION ( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
00049 
00050 /** Build timestamp (generated by linker) */
00051 extern char _build_timestamp[];
00052 
00053 /** Build ID (generated by linker) */
00054 extern char _build_id[];
00055 
00056 /** Build timestamp */
00057 unsigned long build_timestamp = ( ( unsigned long ) _build_timestamp );
00058 
00059 /** Build ID */
00060 unsigned long build_id = ( ( unsigned long ) _build_id );
00061 
00062 /** Product major version */
00063 const int product_major_version = VERSION_MAJOR;
00064 
00065 /** Product minor version */
00066 const int product_minor_version = VERSION_MINOR;
00067 
00068 /** Product version string */
00069 const char product_version[] = VERSION;
00070 
00071 /** Product name string */
00072 const char product_name[] = PRODUCT_NAME;
00073 
00074 /** Product short name string */
00075 const char product_short_name[] = PRODUCT_SHORT_NAME;
00076 
00077 /** Build name string */
00078 const char build_name[] = BUILD_NAME;
00079 
00080 /** Wide-character product version string */
00081 const wchar_t product_wversion[] = WSTRING ( VERSION );
00082 
00083 /** Wide-character product name string */
00084 const wchar_t product_wname[] = WSTRING ( PRODUCT_NAME );
00085 
00086 /** Wide-character product short name string */
00087 const wchar_t product_short_wname[] = WSTRING ( PRODUCT_SHORT_NAME );
00088 
00089 /** Wide-character build name string */
00090 const wchar_t build_wname[] = WSTRING ( BUILD_NAME );
00091 
00092 /** Copy of build name string within ".prefix" */
00093 const char build_name_prefix[] __attribute__ (( section ( ".prefix.name" ) ))
00094         = BUILD_NAME;