build: Uniquify config macros.

* configure (main): Rename VERSION to MES_VERSION, pkgdatadir to
MES_PKGDATADIR.  Update users.
* configure.sh (mes_system): Likewise.
* src/mes.c (mes_symbols): Update.
(open_boot): Update.
* scaffold/cons-mes.c (main): Update.
* simple.sh: Update.
This commit is contained in:
Jan Nieuwenhuizen 2019-07-26 18:20:32 +02:00
parent 2e98d03699
commit 9628f38be3
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
5 changed files with 12 additions and 12 deletions

4
configure vendored
View File

@ -656,8 +656,8 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
(display "#undef SYSTEM_LIBC
"))
(display (string-append "
#define VERSION \"" VERSION "\"
#define pkgdatadir \"" pkgdatadir "\"
#define MES_VERSION \"" VERSION "\"
#define MES_PKGDATADIR \"" pkgdatadir "\"
")))))
(substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make"))

View File

@ -269,8 +269,8 @@ else
EOF
fi
cat >> include/mes/config.h <<EOF
#define VERSION "$VERSION"
#define pkgdatadir "$pkgdatadir"
#define MES_VERSION "$VERSION"
#define MES_PKGDATADIR "$pkgdatadir"
EOF
cat <<EOF

View File

@ -941,7 +941,7 @@ main (int argc, char *argv[])
if (argc > 1 && !strcmp (argv[1], "--version"))
{
eputs ("Mes ");
return eputs (VERSION);
return eputs (MES_VERSION);
};
#else
if (argc > 1 && !strcmp (argv[1], "--version"))

View File

@ -32,8 +32,8 @@ mes_cpu=x86_64
mes_bits=64
cat > include/mes/config.h <<EOF
#define SYSTEM_LIBC 1
#define VERSION "git"
#define pkgdatadir "/usr/local/share/mes"
#define MES_VERSION "git"
#define MES_PKGDATADIR "/usr/local/share/mes"
EOF
## Build ##
@ -124,8 +124,8 @@ mes_cpu=x86_64
#mes_cpu=x86
cat > include/mes/config.h <<EOF
// #define SYSTEM_LIBC 0
#define VERSION "git"
#define pkgdatadir "/usr/local/share/mes"
#define MES_VERSION "git"
#define MES_PKGDATADIR "/usr/local/share/mes"
EOF
## Build ##

View File

@ -1379,7 +1379,7 @@ mes_symbols () ///((internal))
a = acons (cell_symbol_current_module, cell_symbol_current_module, a);
a = acons (cell_symbol_call_with_current_continuation, cell_call_with_current_continuation, a);
a = acons (cell_symbol_mes_version, MAKE_STRING0 (VERSION), a);
a = acons (cell_symbol_mes_version, MAKE_STRING0 (MES_VERSION), a);
a = acons (cell_symbol_mes_datadir, MAKE_STRING0 (g_datadir), a);
a = acons (cell_type_bytes, MAKE_NUMBER (TBYTES), a);
@ -1778,7 +1778,7 @@ open_boot ()
if (g_debug > 1)
{
eputs (";;; pkgdatadir=");
eputs (pkgdatadir);
eputs (MES_PKGDATADIR);
eputs ("\n");
}
if (getenv ("MES_BOOT"))
@ -1802,7 +1802,7 @@ open_boot ()
}
if (__stdin < 0)
{
strcpy (g_datadir, pkgdatadir);
strcpy (g_datadir, MES_PKGDATADIR);
strcpy (file_name, g_datadir);
strcpy (file_name + strlen (file_name), "/module/mes/");
__stdin = try_open_boot (file_name, boot, "pkgdatadir");