On Wed, 24 Jul 2013 19:48:41 +0000 (UTC)
Thorsten Glaser <[email protected]> wrote:

> Jens Staal dixit:
> 
> >This was the R46 patch...
> >
> >I could adopt it for R47
> 
> And pleeeeease as unidiff… everything else is
> just illegible.
> 
> bye,
> //mirabilos

With the attached (unidiff) patch R47 builds out of the box on Plan9
(with "cc" under the APE environment, only tested i386). Just like
before, mksh "gets stuck" after executing an external command (like ls)
when built by only doing ./Build.sh (505668 bytes)

building with CFLAGS="-DMKSH_NOPROSPECTOFWORK" ./Build.sh results in a
working shell (503994 bytes).

As comparison, R46 was built with -DMKSH_NOPROSPECTOFWORK resulting in a
binary of 502780 bytes (no idea if it is due to updated APE libraries or
additional stuff compiled in from mksh).
--- Build.sh.orig	2013-07-21 20:47:39.000000000 +0200
+++ Build.sh	2013-07-24 22:08:32.592703449 +0200
@@ -692,6 +692,9 @@
 	add_cppflags -DMKSH_NO_CMDLINE_EDITING
 	oswarn=' and will currently not work'
 	add_cppflags -DMKSH_UNEMPLOYED
+	add_cppflags -DMKSH__NO_SETEUGID
+	#OK this one is only added to pick up plan9 in c-coded tests...
+	add_cppflags -DPLAN9
 	;;
 PW32*)
 	HAVE_SIG_T=0	# incompatible
@@ -880,6 +883,8 @@
 ct="uslc"
 #elif defined(__LCC__)
 ct="lcc"
+#elif defined(PLAN9) /* put last to give alternative compilers on Plan9 a chance */
+ct="plan9"
 #else
 ct="unknown"
 #endif
@@ -998,6 +1003,9 @@
     been tested for compatibility with mksh. Continue at your
     own risk, please report success/failure to the developers.'
 	;;
+plan9)
+	vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
+	;;
 sdcc)
 	echo >&2 'Warning: sdcc (http://sdcc.sourceforge.net), the small devices
     C compiler for embedded systems detected. This has not yet
@@ -1137,6 +1145,9 @@
 elif test $ct = watcom; then
 	save_NOWARN=
 	DOWARN=-Wc,-we
+elif test $ct = plan9; then
+	save_NOWARN=
+	DOWARN=
 else
 	test x"$save_NOWARN" = x"" && save_NOWARN=-Wno-error
 	ac_flags 0 wnoerror "$save_NOWARN"
@@ -1170,7 +1181,7 @@
 elif test $ct = xlc; then
 	ac_flags 1 othree "-O3 -qstrict"
 	test 1 = $HAVE_CAN_OTHREE || ac_flags 1 otwo -O2
-elif test $ct = tcc || test $ct = tendra; then
+elif test $ct = tcc || test $ct = tendra|| test $ct = plan9; then
 	: no special optimisation
 else
 	ac_flags 1 otwo -O2
@@ -1915,7 +1926,7 @@
 #else
 #define NUM 16
 #endif
-char ctasserts_dblcheck[sizeof(struct ctasserts) == NUM ? 1 : -1];
+char ctasserts_dblcheck[sizeof(struct ctasserts) >= NUM ? 1 : -1];
 	int main(void) { return (sizeof(ctasserts_dblcheck)); }
 EOF
 CFLAGS=$save_CFLAGS

Reply via email to