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 "#undef SYSTEM_LIBC
")) "))
(display (string-append " (display (string-append "
#define VERSION \"" VERSION "\" #define MES_VERSION \"" VERSION "\"
#define pkgdatadir \"" pkgdatadir "\" #define MES_PKGDATADIR \"" pkgdatadir "\"
"))))) ")))))
(substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make")) (substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make"))

View file

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

View file

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

View file

@ -32,8 +32,8 @@ mes_cpu=x86_64
mes_bits=64 mes_bits=64
cat > include/mes/config.h <<EOF cat > include/mes/config.h <<EOF
#define SYSTEM_LIBC 1 #define SYSTEM_LIBC 1
#define VERSION "git" #define MES_VERSION "git"
#define pkgdatadir "/usr/local/share/mes" #define MES_PKGDATADIR "/usr/local/share/mes"
EOF EOF
## Build ## ## Build ##
@ -124,8 +124,8 @@ mes_cpu=x86_64
#mes_cpu=x86 #mes_cpu=x86
cat > include/mes/config.h <<EOF cat > include/mes/config.h <<EOF
// #define SYSTEM_LIBC 0 // #define SYSTEM_LIBC 0
#define VERSION "git" #define MES_VERSION "git"
#define pkgdatadir "/usr/local/share/mes" #define MES_PKGDATADIR "/usr/local/share/mes"
EOF EOF
## Build ## ## 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_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_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_symbol_mes_datadir, MAKE_STRING0 (g_datadir), a);
a = acons (cell_type_bytes, MAKE_NUMBER (TBYTES), a); a = acons (cell_type_bytes, MAKE_NUMBER (TBYTES), a);
@ -1778,7 +1778,7 @@ open_boot ()
if (g_debug > 1) if (g_debug > 1)
{ {
eputs (";;; pkgdatadir="); eputs (";;; pkgdatadir=");
eputs (pkgdatadir); eputs (MES_PKGDATADIR);
eputs ("\n"); eputs ("\n");
} }
if (getenv ("MES_BOOT")) if (getenv ("MES_BOOT"))
@ -1802,7 +1802,7 @@ open_boot ()
} }
if (__stdin < 0) if (__stdin < 0)
{ {
strcpy (g_datadir, pkgdatadir); strcpy (g_datadir, MES_PKGDATADIR);
strcpy (file_name, g_datadir); strcpy (file_name, g_datadir);
strcpy (file_name + strlen (file_name), "/module/mes/"); strcpy (file_name + strlen (file_name), "/module/mes/");
__stdin = try_open_boot (file_name, boot, "pkgdatadir"); __stdin = try_open_boot (file_name, boot, "pkgdatadir");