add patch for the Jehanne operating system, from Shamar on IRC

This commit is contained in:
tg 2017-12-22 16:30:00 +00:00
parent a685208b7f
commit 0faaab7bbc
2 changed files with 52 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.727 2017/08/29 13:38:28 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.728 2017/12/22 16:29:58 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014, 2015, 2016, 2017
@ -819,6 +819,21 @@ Interix)
IRIX*)
: "${HAVE_SETLOCALE_CTYPE=0}"
;;
Jehanne)
: "${HAVE_TERMIOS_H=1}"
: "${HAVE_GETRUSAGE=1}"
: "${LDSTATIC=-static}"
HAVE_ISSET_MKSH_ASSUME_UTF8=1
HAVE_ISOFF_MKSH_ASSUME_UTF8=0
add_cppflags -DMKSH_ASSUME_UTF8
add_cppflags -DMKSH_NO_CMDLINE_EDITING
add_cppflags -DMKSH_DISABLE_REVOKE_WARNING
add_cppflags '-D_PATH_DEFPATH=\"/cmd\"'
add_cppflags '-DMKSH_DEFAULT_EXECSHELL=\"/cmd/mksh\"'
add_cppflags '-DMKSH_DEFAULT_PROFILEDIR=\"/cfg/mksh\"'
add_cppflags '-DMKSH_ENVDIR=\"/env\"'
SRCS="$SRCS jehanne.c"
;;
Linux)
case $CC in
*tendracc*) ;;

36
jehanne.c Normal file
View File

@ -0,0 +1,36 @@
/*-
* Copyright (c) 2017
* Giacomo Tesio <giacomo@tesio.it>
*
* Provided that these terms and disclaimer and all copyright notices
* are retained or reproduced in an accompanying document, permission
* is granted to deal in this work without restriction, including un-
* limited rights to use, publicly perform, distribute, sell, modify,
* merge, give away, or sublicence.
*
* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
* the utmost extent permitted by applicable law, neither express nor
* implied; without malicious intent or gross negligence. In no event
* may a licensor, author or contributor be held liable for indirect,
* direct, other damage, loss, or other issues arising in any way out
* of dealing in the work, even if advised of the possibility of such
* damage or existence of a defect, except proven that it results out
* of said person's immediate fault when using the work as intended.
*-
* Initialisation code for the Jehanne operating system (a Plan 9 de-
* rivative, using GCC)
*/
static const char __rcsid[] __attribute__((__used__)) =
"$MirOS: src/bin/mksh/jehanne.c,v 1.1 2017/12/22 16:30:00 tg Exp $";
#include <u.h>
#include <lib9.h>
#include <posix.h>
void
__application_newlib_init(int argc, char *argv[])
{
rfork(RFFDG | RFREND | RFNOTEG);
libposix_emulate_SIGCHLD();
}