--- /dev/c/develop/ports/orig/perl-5.8.0/dosish.h 2002-06-01 17:02:50.000000000 +0000 +++ /dev/c/develop/ports/gnu.dev/perl.580/dosish.h 2003-04-09 19:43:18.000000000 +0000 @@ -135,3 +135,48 @@ # define HAS_WAIT # define HAS_CHOWN #endif /* WIN32 */ + +/* + * : The DJGPP port has code that converts + * the return code of system() into the form that Unixy wait usually + * returns: + * + * - signal number in bits 0-6; + * - core dump flag in bit 7; + * - exit code in bits 8-15. + * + * Bits 0-7 are always zero for DJGPP, because it uses system(). + * See djgpp.c. + * + * POSIX::W* use the W* macros from to decode + * the return code. Unfortunately the W* macros for DJGPP use + * a different format than Unixy wait does. So there's a mismatch + * and, say, WEXITSTATUS($?) will return bogus values. + * + * So here we add hack to redefine the W* macros from DJGPP's + * to work with our return-code conversion. + */ + +#ifdef DJGPP + +#include + +#undef WEXITSTATUS +#undef WIFEXITED +#undef WIFSIGNALED +#undef WIFSTOPPED +#undef WNOHANG +#undef WSTOPSIG +#undef WTERMSIG +#undef WUNTRACED + +#define WEXITSTATUS(stat_val) ((stat_val) >> 8) +#define WIFEXITED(stat_val) 0 +#define WIFSIGNALED(stat_val) 0 +#define WIFSTOPPED(stat_val) 0 +#define WNOHANG 0 +#define WSTOPSIG(stat_val) 0 +#define WTERMSIG(stat_val) 0 +#define WUNTRACED 0 + +#endif --- /dev/c/develop/ports/orig/perl-5.8.0/perl.c 2002-07-09 19:41:42.000000000 +0000 +++ /dev/c/develop/ports/gnu.dev/perl.580/perl.c 2003-01-20 19:41:40.000000000 +0000 @@ -3619,11 +3619,16 @@ S_init_postdump_symbols(pTHX_ register i for (; *env; env++) { if (!(s = strchr(*env,'='))) continue; +/* : MS-DOS does support case-sensitive + * environment variable names. Don't capitalise + * the environment variable names. */ +#if 0 #if defined(MSDOS) *s = '\0'; (void)strupr(*env); *s = '='; #endif +#endif sv = newSVpv(s+1, 0); (void)hv_store(hv, *env, s - *env, sv, 0); if (env != environ) --- /dev/c/develop/ports/orig/perl-5.8.0/pp_sys.c 2002-07-18 04:58:48.000000000 +0000 +++ /dev/c/develop/ports/gnu.dev/perl.580/pp_sys.c 2003-01-20 19:58:30.000000000 +0000 @@ -18,6 +18,10 @@ #define PERL_IN_PP_SYS_C #include "perl.h" +#if defined(__DJGPP__) +#include "djgpp.h" +#endif + #ifdef I_SHADOW /* Shadow password support for solaris - pdo@cs.umd.edu * Not just Solaris: at least HP-UX, IRIX, Linux. @@ -4153,14 +4157,14 @@ PP(pp_system) result = 0; if (PL_op->op_flags & OPf_STACKED) { SV *really = *++MARK; -# ifdef WIN32 +# if defined(WIN32) || defined(__DJGPP__) value = (I32)do_aspawn(really, MARK, SP); # else value = (I32)do_aspawn(really, (void **)MARK, (void **)SP); # endif } else if (SP - MARK != 1) { -# ifdef WIN32 +# if defined(WIN32) || defined(__DJGPP__) value = (I32)do_aspawn(Nullsv, MARK, SP); # else value = (I32)do_aspawn(Nullsv, (void **)MARK, (void **)SP); --- /dev/c/develop/ports/orig/perl-5.8.0/djgpp/djgpp.h 2002-06-01 17:02:50.000000000 +0000 +++ /dev/c/develop/ports/gnu.dev/perl.580/djgpp/djgpp.h 2003-01-20 19:55:28.000000000 +0000 @@ -1,7 +1,6 @@ #ifndef PERL_DJGPP_DJGPP_H #define PERL_DJGPP_DJGPP_H -#include #include #include #include --- /dev/c/develop/ports/orig/perl-5.8.0/djgpp/djgppsed.sh 2002-06-01 17:02:50.000000000 +0000 +++ /dev/c/develop/ports/gnu.dev/perl.580/djgpp/djgppsed.sh 2003-01-20 20:11:24.000000000 +0000 @@ -25,21 +25,27 @@ SSTAT='s=\.\(stat\.\)=_\1=g' STMP2='s=tmp2=tm2=g' SPACKLIST='s=\.\(packlist\)=_\1=g' SDOTTMP='s=\.tmp=_tmp=g' +SDEPENDING='s=\.depending=_depending=g' sed -e $SCONFIG -e $SGREPTMP -e $SECHOTMP -e $SDDC -e $SOUT -e 's=\.\( \./\$file\)$=sh\1=g' Configure |tr -d '\r' >s; mv -f s Configure -sed -e $SEXISTS -e $SLIST -e $SCONFIG Makefile.SH |tr -d '\r' >s; mv -f s Makefile.SH +sed -e $SEXISTS -e $SLIST -e $SCONFIG -e $SDEPENDING Makefile.SH |tr -d '\r' >s; mv -f s Makefile.SH sed -e $SEXISTS -e $SPACKLIST lib/ExtUtils/Install.pm |tr -d '\r' >s; mv -f s lib/ExtUtils/Install.pm sed -e $SEXISTS -e $SPACKLIST lib/ExtUtils/MM_Unix.pm |tr -d '\r' >s; mv -f s lib/ExtUtils/MM_Unix.pm sed -e $SEXISTS -e $SPACKLIST installperl >s; mv -f s installperl sed -e $SPOD2HTML lib/Pod/Html.pm |tr -d '\r' >s; mv -f s lib/Pod/Html.pm -sed -e $SCC -e $SLIST -e $SFILEC -e $SCOR -e $SDEPTMP -e $SHSED makedepend.SH |tr -d '\r' >s; mv -f s makedepend.SH +sed -e $SCC -e $SLIST -e $SFILEC -e $SCOR -e $SDEPTMP -e $SHSED -e $SDEPENDING makedepend.SH |tr -d '\r' >s; mv -f s makedepend.SH sed -e $SCPP t/comp/cpp.aux |tr -d '\r' >s; mv -f s t/comp/cpp.aux sed -e $SARGV -e $SDOTTMP t/io/argv.t >s; mv -f s t/io/argv.t sed -e $SABC t/io/inplace.t >s; mv -f s t/io/inplace.t sed -e $SDBMX -e $SDBHASH ext/GDBM_File/gdbm.t >s; mv -f s ext/GDBM_File/gdbm.t sed -e $SSTAT -e $STMP2 t/op/stat.t >s; mv -f s t/op/stat.t sed -e $SLIST x2p/Makefile.SH |tr -d '\r' >s; mv -f s x2p/Makefile.SH -sed -e 's=^#define.\([A-Z]\+\)_EXP.*$=#define \1_EXP djgpp_pathexp("\1")=g' config_h.SH >s; mv -f s config_h.SH +# : This DJGPP-specific path expansion +# is obsolete now, since we can install Perl under /dev/env/DJDIR +# and have it independent of the physical path of the install. +# Just use Perl's normal prefix mechanisms. +# +#sed -e 's=^#define.\([A-Z]\+\)_EXP.*$=#define \1_EXP djgpp_pathexp("\1")=g' config_h.SH >s; mv -f s config_h.SH sed -e 's=:^/:={^([a-z]:)?[\\\\/]}=g' lib/termcap.pl >s; mv -f s lib/termcap.pl sed -e $SPACKLIST installman >s; mv -f s installman sed -e $SPACKLIST lib/ExtUtils/Installed.pm >s; mv -f s lib/ExtUtils/Installed.pm