summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/djgpp
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-10-27 22:15:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-10-27 22:15:15 +0000
commit74cfb115ac810480c0000dc742b20383c1578bac (patch)
tree316d96e5123617976f1637b143570c309a662045 /gnu/usr.bin/perl/djgpp
parent453ade492b8e06c619009d6cd52a85cb04e8cf17 (diff)
stock perl 5.8.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/djgpp')
-rw-r--r--gnu/usr.bin/perl/djgpp/config.over19
-rw-r--r--gnu/usr.bin/perl/djgpp/configure.bat2
-rw-r--r--gnu/usr.bin/perl/djgpp/djgpp.c62
-rw-r--r--gnu/usr.bin/perl/djgpp/djgpp.h55
-rw-r--r--gnu/usr.bin/perl/djgpp/djgppsed.sh9
-rw-r--r--gnu/usr.bin/perl/djgpp/fixpmain4
6 files changed, 122 insertions, 29 deletions
diff --git a/gnu/usr.bin/perl/djgpp/config.over b/gnu/usr.bin/perl/djgpp/config.over
index f9c167ec247..f385f55369f 100644
--- a/gnu/usr.bin/perl/djgpp/config.over
+++ b/gnu/usr.bin/perl/djgpp/config.over
@@ -25,7 +25,7 @@ repair()
-e 's/posix/POSIX/'\
-e 's/sdbm_fil/SDBM_File/'\
-e 's/socket/Socket/'\
- -e 's/thread/Thread/'\
+ -e 's=[tT]hread[/a-zA-Z]*==g'\
-e 's/byteload/ByteLoader/'\
-e 's=devel/peek=Devel/Peek='\
-e 's=devel/dprof=Devel/DProf='\
@@ -35,7 +35,22 @@ repair()
-e 's=File/=='\
-e 's=glob=='\
-e 's=Glob=='\
- -e 's/storable/Storable/'
+ -e 's/storable/Storable/'\
+ -e 's/encode/Encode/'\
+ -e 's=filter/util/call=Filter/Util/Call=' \
+ -e 's=digest/md5=Digest/MD5=' \
+ -e 's=perlio/scalar=PerlIO/scalar=' \
+ -e 's=mime/base64=MIME/Base64=' \
+ -e 's=time/hires=Time/HiRes=' \
+ -e 's=list/util=List/Util=' \
+ -e 's=cwd=Cwd=' \
+ -e 's=perlio/via=PerlIO/via=' \
+ -e 's=perlio/encoding=PerlIO/encoding=' \
+ -e 's=xs/apitest=XS/APItest=' \
+ -e 's=xs/typemap=XS/Typemap=' \
+ -e 's=unicode/normaliz=Unicode/Normalize=' \
+ -e 's=i18n/langinfo=I18N/Langinfo=' \
+ -e 's=devel/ppport=Devel/PPPort='
}
static_ext=$(repair "$static_ext")
extensions=$(repair "$extensions")
diff --git a/gnu/usr.bin/perl/djgpp/configure.bat b/gnu/usr.bin/perl/djgpp/configure.bat
index 64b46ec34f7..db08fc256d7 100644
--- a/gnu/usr.bin/perl/djgpp/configure.bat
+++ b/gnu/usr.bin/perl/djgpp/configure.bat
@@ -27,7 +27,7 @@ goto end
:shell_ok
sh -c 'if test ! -d /tmp; then mkdir /tmp; fi'
-cp djgpp.c config.over ..
+cp djgpp.[hc] config.over ..
cd ..
echo Running sed...
sh djgpp/djgppsed.sh
diff --git a/gnu/usr.bin/perl/djgpp/djgpp.c b/gnu/usr.bin/perl/djgpp/djgpp.c
index 4e390cfc59e..d770cefb969 100644
--- a/gnu/usr.bin/perl/djgpp/djgpp.c
+++ b/gnu/usr.bin/perl/djgpp/djgpp.c
@@ -1,19 +1,5 @@
-#include <libc/stubs.h>
-#include <io.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <libc/file.h>
-#include <process.h>
-#include <fcntl.h>
-#include <glob.h>
-#include <sys/fsext.h>
-#include <crt0.h>
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
+#define PERLIO_NOT_STDIO 0
+#include "djgpp.h"
/* hold file pointer, command, mode, and the status of the command */
struct pipe_list {
@@ -27,7 +13,7 @@ struct pipe_list {
static struct pipe_list *pl = NULL;
FILE *
-popen (const char *cm, const char *md) /* program name, pipe mode */
+djgpp_popen (const char *cm, const char *md) /* program name, pipe mode */
{
struct pipe_list *l1;
int fd;
@@ -75,7 +61,7 @@ popen (const char *cm, const char *md) /* program name, pipe mode */
}
int
-pclose (FILE *pp)
+djgpp_pclose (FILE *pp)
{
struct pipe_list *l1, **l2; /* list pointers */
int retval=-1; /* function return value */
@@ -120,7 +106,7 @@ static int
convretcode (pTHX_ int rc,char *prog,int fl)
{
if (rc < 0 && ckWARN(WARN_EXEC))
- Perl_warner(aTHX_ WARN_EXEC,"Can't %s \"%s\": %s",
+ Perl_warner(aTHX_ packWARN(WARN_EXEC),"Can't %s \"%s\": %s",
fl ? "exec" : "spawn",prog,Strerror (errno));
if (rc >= 0)
return rc << 8;
@@ -366,6 +352,9 @@ XS(dos_GetCwd)
ST(0)=sv_newmortal ();
if (getcwd (tmp,PATH_MAX+1)!=NULL)
sv_setpv ((SV*)ST(0),tmp);
+#ifndef INCOMPLETE_TAINTS
+ SvTAINTED_on(ST(0));
+#endif
}
XSRETURN (1);
}
@@ -377,6 +366,24 @@ XS(dos_UseLFN)
XSRETURN_IV (_USE_LFN);
}
+XS(XS_Cwd_sys_cwd)
+{
+ dXSARGS;
+ if (items != 0)
+ Perl_croak_nocontext("Usage: Cwd::sys_cwd()");
+ {
+ char p[MAXPATHLEN];
+ char * RETVAL;
+ RETVAL = getcwd(p, MAXPATHLEN);
+ ST(0) = sv_newmortal();
+ sv_setpv((SV*)ST(0), RETVAL);
+#ifndef INCOMPLETE_TAINTS
+ SvTAINTED_on(ST(0));
+#endif
+ }
+ XSRETURN(1);
+}
+
void
Perl_init_os_extras(pTHX)
{
@@ -386,6 +393,7 @@ Perl_init_os_extras(pTHX)
newXS ("Dos::GetCwd",dos_GetCwd,file);
newXS ("Dos::UseLFN",dos_UseLFN,file);
+ newXS ("Cwd::sys_cwd",XS_Cwd_sys_cwd,file);
/* install my File System Extension for globbing */
__FSEXT_add_open_handler (glob_handler);
@@ -396,7 +404,8 @@ static char *perlprefix;
#define PERL5 "/perl5"
-char *djgpp_pathexp (const char *p)
+char *
+djgpp_pathexp (const char *p)
{
static char expp[PATH_MAX];
strcpy (expp,perlprefix);
@@ -451,3 +460,16 @@ djgpp_fflush (FILE *fp)
return res;
}
+
+int djgpp_get_stream_mode(FILE *f)
+{
+ extern char *__file_handle_modes;
+
+ int mode = __file_handle_modes[fileno(f)];
+ if (f->_flag & _IORW)
+ return mode | O_RDWR;
+ if (f->_flag & _IOWRT)
+ return mode | O_WRONLY;
+ return mode | O_RDONLY;
+}
+
diff --git a/gnu/usr.bin/perl/djgpp/djgpp.h b/gnu/usr.bin/perl/djgpp/djgpp.h
new file mode 100644
index 00000000000..a020ae91a1a
--- /dev/null
+++ b/gnu/usr.bin/perl/djgpp/djgpp.h
@@ -0,0 +1,55 @@
+#ifndef PERL_DJGPP_DJGPP_H
+#define PERL_DJGPP_DJGPP_H
+
+#include <libc/stubs.h>
+#include <io.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <libc/file.h>
+#include <process.h>
+#include <fcntl.h>
+#include <glob.h>
+#include <sys/fsext.h>
+#include <crt0.h>
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+FILE *
+djgpp_popen (const char *cm, const char *md);
+
+int
+djgpp_pclose (FILE *pp);
+
+int
+do_aspawn (pTHX_ SV *really,SV **mark,SV **sp);
+
+int
+do_spawn2 (pTHX_ char *cmd,int execf);
+
+int
+do_spawn (pTHX_ char *cmd);
+
+bool
+Perl_do_exec (pTHX_ char *cmd);
+
+void
+Perl_init_os_extras(pTHX);
+
+char
+*djgpp_pathexp (const char *p);
+
+void
+Perl_DJGPP_init (int *argcp,char ***argvp);
+
+int
+djgpp_fflush (FILE *fp);
+
+/* DJGPP utility functions without prototypes? */
+
+int _is_unixy_shell(char *s);
+
+#endif
diff --git a/gnu/usr.bin/perl/djgpp/djgppsed.sh b/gnu/usr.bin/perl/djgpp/djgppsed.sh
index bb95ad8538e..02c44169669 100644
--- a/gnu/usr.bin/perl/djgpp/djgppsed.sh
+++ b/gnu/usr.bin/perl/djgpp/djgppsed.sh
@@ -17,7 +17,7 @@ SCOR='s=c\\\.c|=c\_c|=g'
SHSED='s=\.\(hsed\)=_\1=g'
SDEPTMP='s=\.\(deptmp\)=_\1=g'
SCPP='s=\.\(cpp\.\)=_\1=g'
-SARGV='s=\.\(argv\)\.=_\1_=g'
+SARGV='s=Io_argv\(.\)\.=i\1_=g'
SABC='s=\.\([abc][^a]\)=_\1=g'
SDBMX='s=\.\(dbmx\)=_\1=g'
SDBHASH='s=dbhash\.tmp=dbhash_tmp=g'
@@ -36,9 +36,7 @@ sed -e $SCC -e $SLIST -e $SFILEC -e $SCOR -e $SDEPTMP -e $SHSED makedepend.SH |t
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 t/lib/anydbm.t >s; mv -f s t/lib/anydbm.t
-sed -e $SDBMX -e $SDBHASH t/lib/gdbm.t >s; mv -f s t/lib/gdbm.t
-sed -e $SDBMX -e $SDBHASH t/lib/sdbm.t >s; mv -f s t/lib/sdbm.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
@@ -46,5 +44,6 @@ 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
sed -e $SPACKLIST lib/ExtUtils/Packlist.pm >s; mv -f s lib/ExtUtils/Packlist.pm
-sed -e $SPACKLIST lib/ExtUtils/inst >s; mv -f s lib/ExtUtils/inst
sed -e $SABC t/io/iprefix.t >s; mv -f s t/io/iprefix.t
+sed -e 's=L_ctermid==g' ext/POSIX/Makefile.PL >s; mv -f s ext/POSIX/Makefile.PL
+sed -e $SPACKLIST lib/ExtUtils/t/Installed.t >s; mv -f s lib/ExtUtils/t/Installed.t
diff --git a/gnu/usr.bin/perl/djgpp/fixpmain b/gnu/usr.bin/perl/djgpp/fixpmain
index 6b0591c40f4..3f965f1c5be 100644
--- a/gnu/usr.bin/perl/djgpp/fixpmain
+++ b/gnu/usr.bin/perl/djgpp/fixpmain
@@ -20,7 +20,9 @@ for $realname (@exts)
{
$dosname=join ("__",map {lc substr ($_,0,8)} split /\//,$realname);
$realname =~ s!/!__!g;
- $perlmain =~ s/\bboot_$dosname/boot_$realname/gm;
+ $perlmain =~ s/\bboot_$dosname\b/boot_$realname/gm;
+ $dosname =~ s/__/::/;
+ $realname =~ s/__/::/;
$perlmain =~ s/\b$dosname(::bootstrap)/$realname$1/gm;
}