Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
emutools_buildinfo.c
Go to the documentation of this file.
1 /* Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
2  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
3 
4  The goal of emutools.c is to provide a relative simple solution
5  for relative simple emulators using SDL2.
6 
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20 
22 
23 const char XEMU_BUILDINFO_CC[] = CC_TYPE " " __VERSION__ " " ARCH_BITS_AS_TEXT ENDIAN_NAME;
24 
25 const char emulators_disclaimer[] =
26  "LICENSE: Copyright (C)" COPYRIGHT_YEARS " Gábor Lénárt (aka LGB) lgb@lgb.hu http://lgb.hu/" NL
27  "LICENSE: This software is a GNU/GPL version 2 (or later) software." NL
28  "LICENSE: <http://gnu.org/licenses/gpl.html>" NL
29  "LICENSE: This is free software; you are free to change and redistribute it." NL
30  "LICENSE: There is NO WARRANTY, to the extent permitted by law." NL
31 ;
32 
34 {
35 #ifdef XEMU_OFFICIAL_BUILD
36  return 1;
37 #else
38  static int is_official = -1;
39  if (is_official < 0)
40  is_official = !!getenv("XEMU_OFFICIAL_BUILD");
41  return is_official;
42 #endif
43 }
44 
45 void xemu_dump_version ( FILE *fp, const char *slogan )
46 {
47  if (!fp)
48  return;
49  if (slogan)
50  fprintf(fp, "**** %s ****" NL, slogan);
51  fprintf(fp, "This software is part of the Xemu project: https://github.com/lgblgblgb/xemu" NL);
52  fprintf(fp, "CREATED: %s at %s" NL "CREATED: %s for %s" NL, XEMU_BUILDINFO_ON, XEMU_BUILDINFO_AT, XEMU_BUILDINFO_CC, XEMU_ARCH_NAME);
53  fprintf(fp, "VERSION: %s %s %s" NL, XEMU_BUILDINFO_GIT, XEMU_BUILDINFO_CDATE, xemu_is_official_build() ? "official-build" : "custom-build");
54  fprintf(fp, "EMULATE: %s (%s): %s" NL, TARGET_DESC, TARGET_NAME, XEMU_BUILDINFO_TARGET);
55  fprintf(fp, "%s" NL, emulators_disclaimer);
56 }
TARGET_DESC
#define TARGET_DESC
Definition: xemu-target.h:2
xemu_is_official_build
int xemu_is_official_build(void)
Definition: emutools_buildinfo.c:33
CC_TYPE
#define CC_TYPE
Definition: emutools_basicdefs.h:104
XEMU_BUILDINFO_CC
const char XEMU_BUILDINFO_CC[]
Definition: emutools_buildinfo.c:23
xemu_dump_version
void xemu_dump_version(FILE *fp, const char *slogan)
Definition: emutools_buildinfo.c:45
ENDIAN_NAME
#define ENDIAN_NAME
Definition: emutools_basicdefs.h:199
emulators_disclaimer
const char emulators_disclaimer[]
Definition: emutools_buildinfo.c:25
COPYRIGHT_YEARS
#define COPYRIGHT_YEARS
Definition: emutools_basicdefs.h:24
XEMU_BUILDINFO_GIT
const char XEMU_BUILDINFO_GIT[]
Definition: emutools_basicdefs.h:251
ARCH_BITS_AS_TEXT
#define ARCH_BITS_AS_TEXT
Definition: emutools_basicdefs.h:90
TARGET_NAME
#define TARGET_NAME
Definition: xemu-target.h:1
emutools_basicdefs.h
XEMU_BUILDINFO_TARGET
const char XEMU_BUILDINFO_TARGET[]
Definition: emutools_basicdefs.h:251
NL
#define NL
Definition: fat32.c:37
XEMU_BUILDINFO_CDATE
const char XEMU_BUILDINFO_CDATE[]
Definition: emutools_basicdefs.h:251
XEMU_BUILDINFO_ON
const char XEMU_BUILDINFO_ON[]
XEMU_BUILDINFO_AT
const char XEMU_BUILDINFO_AT[]
Definition: emutools_basicdefs.h:251