build: Replace POSIX, posix_p by WITH_GLIBC, wip_glibc_p.
* build-aux/build-mes.sh: Replace POSIX, posix_p by WITH_GLIBC, wip_glibc_p. * build-aux/build.sh.in: Likewise. * build-aux/cc.sh (link): Likewise. * build-aux/config.make.in (with_glibc_p): Likewise. * build-aux/config.sh (libc): Likewise. (CPPFLAGS): Likewise. * build-aux/config.status.in (with_glibc_p): Likewise. * build-aux/test.sh: Likewise. * configure (main): Likewise. * configure.sh (subst): Likewise. (mes_arch): Likewise. * include/libmes.h: Likewise. * include/linux/x86_64/syscall.h: Likewise. * lib/libmes.c: Likewise. * lib/tests/stdio/70-printf-hello.c (main): Likewise. * lib/tests/stdio/70-printf-simple.c (main): Likewise. * lib/tests/stdio/80-sscanf.c (main): Likewise. * lib/tests/stdlib/50-malloc.c: Likewise. * module/mescc/preprocess.scm (c99-input->full-ast): Likewise. * scaffold/cons-mes.c: Likewise. * scaffold/lib/stdlib/malloc.c: Likewise. * scaffold/micro-mes.c: Likewise. * scaffold/tests/61-array.c (getenv): Likewise. * scaffold/tiny-mes.c: Likewise. * src/mes.c: Likewise.
This commit is contained in:
parent
66019c8421
commit
48a0bf181d
|
@ -32,7 +32,7 @@ fi
|
||||||
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.S lib/$mes_arch/crt1.S
|
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.S lib/$mes_arch/crt1.S
|
||||||
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.o lib/$mes_arch/crt1.o
|
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.o lib/$mes_arch/crt1.o
|
||||||
|
|
||||||
[ ! "$mesc_p" -a ! "$posix_p" ] && (program_prefix= compile lib/linux/$mes_arch/crt0)
|
[ ! "$mesc_p" -a ! "$with_glibc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crt0)
|
||||||
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crti)
|
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crti)
|
||||||
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crtn)
|
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crtn)
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ elif [ -d "$MES_SEED" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## FIXME: remove this and have user configure/build/install for each compiler?
|
## FIXME: remove this and have user configure/build/install for each compiler?
|
||||||
unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p posix_p
|
unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p with_glibc_p
|
||||||
MES=guile
|
MES=guile
|
||||||
mesc_p=1
|
mesc_p=1
|
||||||
mes_p=1
|
mes_p=1
|
||||||
|
|
|
@ -41,7 +41,7 @@ archive () {
|
||||||
|
|
||||||
link () {
|
link () {
|
||||||
lib=$libc
|
lib=$libc
|
||||||
[ "$posix_p" ] && lib='-l mes'
|
[ "$with_glibc_p" ] && lib='-l mes'
|
||||||
out=$(dirname "$1")/${program_prefix}$(basename "$1")
|
out=$(dirname "$1")/${program_prefix}$(basename "$1")
|
||||||
trace "CCLD $1" $CC $CFLAGS $LDFLAGS -o" $out" $crt1 "$1".${program_prefix}o $2 $lib
|
trace "CCLD $1" $CC $CFLAGS $LDFLAGS -o" $out" $crt1 "$1".${program_prefix}o $2 $lib
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ infodir:=@infodir@
|
||||||
libdir:=@libdir@
|
libdir:=@libdir@
|
||||||
mandir:=@mandir@
|
mandir:=@mandir@
|
||||||
moduledir:=@moduledir@
|
moduledir:=@moduledir@
|
||||||
posix_p:=@posix_p@
|
with_glibc_p:=@with_glibc_p@
|
||||||
program_prefix:=@program_prefix@
|
program_prefix:=@program_prefix@
|
||||||
srcdest:=@srcdest@
|
srcdest:=@srcdest@
|
||||||
srcdir:=@srcdir@
|
srcdir:=@srcdir@
|
||||||
|
|
|
@ -81,7 +81,7 @@ export mes_p
|
||||||
export mesc_p
|
export mesc_p
|
||||||
export tcc_p
|
export tcc_p
|
||||||
export mes_arch
|
export mes_arch
|
||||||
export posix_p
|
export with_glibc_p
|
||||||
|
|
||||||
CPPFLAGS=${CPPFLAGS-"
|
CPPFLAGS=${CPPFLAGS-"
|
||||||
-D 'VERSION=\"$VERSION\"'
|
-D 'VERSION=\"$VERSION\"'
|
||||||
|
@ -92,7 +92,7 @@ CPPFLAGS=${CPPFLAGS-"
|
||||||
-I ${srcdest}include
|
-I ${srcdest}include
|
||||||
"}
|
"}
|
||||||
|
|
||||||
[ "$posix_p" ] && CPPFLAGS="$CPPFLAGS -D POSIX=1 -D WITH_GLIBC=1"
|
[ "$with_glibc_p" ] && CPPFLAGS="$CPPFLAGS -D WITH_GLIBC=1"
|
||||||
|
|
||||||
LDFLAGS=${LDFLAGS-"
|
LDFLAGS=${LDFLAGS-"
|
||||||
-v
|
-v
|
||||||
|
|
|
@ -64,7 +64,7 @@ infodir="@infodir@"
|
||||||
libdir="@libdir@"
|
libdir="@libdir@"
|
||||||
mandir="@mandir@"
|
mandir="@mandir@"
|
||||||
moduledir="@moduledir@"
|
moduledir="@moduledir@"
|
||||||
posix_p="@posix_p@"
|
with_glibc_p="@with_glibc_p@"
|
||||||
program_prefix="@program_prefix@"
|
program_prefix="@program_prefix@"
|
||||||
srcdest="@srcdest@"
|
srcdest="@srcdest@"
|
||||||
srcdir="@srcdir@"
|
srcdir="@srcdir@"
|
||||||
|
|
|
@ -26,7 +26,7 @@ sh ${srcdest}build-aux/test-cc.sh $1
|
||||||
|
|
||||||
if [ ! "$mesc_p" ]; then
|
if [ ! "$mesc_p" ]; then
|
||||||
#FIXME: c&p
|
#FIXME: c&p
|
||||||
unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p posix_p
|
unset CFLAGS CPPFLAGS LDFLAGS gcc_p tcc_p with_glibc_p
|
||||||
MES=${MES-guile}
|
MES=${MES-guile}
|
||||||
mesc_p=1
|
mesc_p=1
|
||||||
mes_p=1
|
mes_p=1
|
||||||
|
|
2
configure
vendored
2
configure
vendored
|
@ -533,7 +533,7 @@ Some influential environment variables:
|
||||||
("@mes_arch@" . ,mes-arch)
|
("@mes_arch@" . ,mes-arch)
|
||||||
("@mes_p@" . ,(if mes? "1" ""))
|
("@mes_p@" . ,(if mes? "1" ""))
|
||||||
("@mesc_p@" . ,(if mesc? "1" ""))
|
("@mesc_p@" . ,(if mesc? "1" ""))
|
||||||
("@posix_p@" . ,(if posix? "1" ""))
|
("@with_glibc_p@" . ,(if posix? "1" ""))
|
||||||
("@tcc_p@" . ,(if tcc? "1" ""))
|
("@tcc_p@" . ,(if tcc? "1" ""))
|
||||||
|
|
||||||
("@abs_top_srcdir@" . ,abs-top-srcdir)
|
("@abs_top_srcdir@" . ,abs-top-srcdir)
|
||||||
|
|
|
@ -111,7 +111,7 @@ subst () {
|
||||||
-e s,"@mesc_p@,$mesc_p,"\
|
-e s,"@mesc_p@,$mesc_p,"\
|
||||||
-e s,"@tcc_p@,$tcc_p,"\
|
-e s,"@tcc_p@,$tcc_p,"\
|
||||||
-e s,"@mes_arch@,$mes_arch,"\
|
-e s,"@mes_arch@,$mes_arch,"\
|
||||||
-e s,"@posix_p@,$posix_p,"\
|
-e s,"@with_glibc_p@,$with_glibc_p,"\
|
||||||
-e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
|
-e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
|
||||||
-e s,"@abs_top_builddir@,$abs_top_builddir,"\
|
-e s,"@abs_top_builddir@,$abs_top_builddir,"\
|
||||||
-e s,"@top_builddir@,$top_builddir,"\
|
-e s,"@top_builddir@,$top_builddir,"\
|
||||||
|
@ -195,7 +195,7 @@ if [ ! "$mesc_p" ]; then
|
||||||
mes_arch=$mes_arch-$compiler
|
mes_arch=$mes_arch-$compiler
|
||||||
fi
|
fi
|
||||||
if [ ! "$mesc_p" -a ! "$mes_p" ]; then
|
if [ ! "$mesc_p" -a ! "$mes_p" ]; then
|
||||||
posix_p=1
|
with_glibc_p=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
subst ${srcdest}mes/module/mes/boot-0.scm.in mes/module/mes/boot-0.scm
|
subst ${srcdest}mes/module/mes/boot-0.scm.in mes/module/mes/boot-0.scm
|
||||||
|
|
|
@ -23,6 +23,11 @@
|
||||||
|
|
||||||
#include <libmes-mini.h>
|
#include <libmes-mini.h>
|
||||||
|
|
||||||
|
#if WITH_GLIBC
|
||||||
|
int mes_open (char const *file_name, int flags, ...);
|
||||||
|
#define open mes_open
|
||||||
|
#endif
|
||||||
|
|
||||||
int __mes_debug ();
|
int __mes_debug ();
|
||||||
void __ungetc_init ();
|
void __ungetc_init ();
|
||||||
void __ungetc_clear (int filedes);
|
void __ungetc_clear (int filedes);
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
#define SYS_getegid 0x6c
|
#define SYS_getegid 0x6c
|
||||||
#define SYS_getppid 0x6e
|
#define SYS_getppid 0x6e
|
||||||
|
|
||||||
// make+POSIX
|
// make+WITH_GLIBC
|
||||||
#define SYS_rt_sigprocmask 0x0e
|
#define SYS_rt_sigprocmask 0x0e
|
||||||
|
|
||||||
#endif // __MES_LINUX_X86_64_SYSCALL_H
|
#endif // __MES_LINUX_X86_64_SYSCALL_H
|
||||||
|
|
|
@ -41,7 +41,10 @@
|
||||||
#include <mes/fdputs.c>
|
#include <mes/fdputs.c>
|
||||||
#include <mes/fdungetc.c>
|
#include <mes/fdungetc.c>
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
|
#undef open
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdarg.h>
|
||||||
// The Mes C Library defines and initializes these in crt1
|
// The Mes C Library defines and initializes these in crt1
|
||||||
int __stdin = STDIN;
|
int __stdin = STDIN;
|
||||||
int __stdout = STDOUT;
|
int __stdout = STDOUT;
|
||||||
|
@ -63,7 +66,7 @@ mes_open (char const *file_name, int flags, ...)
|
||||||
|
|
||||||
#include <mes/eputs.c>
|
#include <mes/eputs.c>
|
||||||
#include <mes/oputs.c>
|
#include <mes/oputs.c>
|
||||||
#endif // POSIX
|
#endif // WITH_GLIBC
|
||||||
|
|
||||||
#include <mes/eputc.c>
|
#include <mes/eputc.c>
|
||||||
#include <mes/oputc.c>
|
#include <mes/oputc.c>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
#if __GNUC__ && __x86_64__ && !POSIX
|
#if __GNUC__ && __x86_64__ && !WITH_GLIBC
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
int i = 42;
|
int i = 42;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
#if __GNUC__ && __x86_64__ && !POSIX
|
#if __GNUC__ && __x86_64__ && !WITH_GLIBC
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
char *s = "mes";
|
char *s = "mes";
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
#if __GNUC__ && __x86_64__ && !POSIX
|
#if __GNUC__ && __x86_64__ && !WITH_GLIBC
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
#error "POSIX not supported"
|
#error "WITH_GLIBC not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libmes.h>
|
#include <libmes.h>
|
||||||
|
|
|
@ -84,8 +84,8 @@
|
||||||
#:cpp-defs `(
|
#:cpp-defs `(
|
||||||
"NULL=0"
|
"NULL=0"
|
||||||
"__linux__=1"
|
"__linux__=1"
|
||||||
"POSIX=0"
|
|
||||||
"_POSIX_SOURCE=0"
|
"_POSIX_SOURCE=0"
|
||||||
|
"WITH_GLIBC=0"
|
||||||
"__STDC__=1"
|
"__STDC__=1"
|
||||||
"__MESC__=1"
|
"__MESC__=1"
|
||||||
,(if mes? "__MESC_MES__=1" "__MESC_MES__=0")
|
,(if mes? "__MESC_MES__=1" "__MESC_MES__=0")
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
#error "POSIX not supported"
|
#error "WITH_GLIBC not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
#error "POSIX not supported"
|
#error "WITH_GLIBC not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libmes.h>
|
#include <libmes.h>
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
#error "POSIX not supported"
|
#error "WITH_GLIBC not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
char *env[] = {"foo", "bar", "baz", 0};
|
char *env[] = {"foo", "bar", "baz", 0};
|
||||||
|
|
||||||
#if 0//!POSIX
|
#if 0//!WITH_GLIBC
|
||||||
#define getenv xgetenv
|
#define getenv xgetenv
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
#error "POSIX not supported"
|
#error "WITH_GLIBC not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libmes.h>
|
#include <libmes.h>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <libmes.h>
|
#include <libmes.h>
|
||||||
|
|
||||||
//#define MES_MINI 1
|
//#define MES_MINI 1
|
||||||
#if POSIX
|
#if WITH_GLIBC
|
||||||
long ARENA_SIZE = 100000000; // 2.3GiB
|
long ARENA_SIZE = 100000000; // 2.3GiB
|
||||||
#else
|
#else
|
||||||
long ARENA_SIZE = 300000; // 32b: 3MiB, 64b: 6 MiB
|
long ARENA_SIZE = 300000; // 32b: 3MiB, 64b: 6 MiB
|
||||||
|
|
Loading…
Reference in a new issue