summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-02-02 10:38:08 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-02-02 10:38:08 +0000
commit4619340914cc8b5438e9411eca00b9f6a4805995 (patch)
tree5e83f990cc7d3e8ad0cb3151c94a0bfb616b1d45
parent5aa42fc08283e46e20fe921726867c6b4a8b3151 (diff)
downloadperl-4619340914cc8b5438e9411eca00b9f6a4805995.tar.gz
BeOS update (Mirror maint-5.005 change #2727).
p4raw-link: @2727 on //depot/maint-5.005/perl: 4a34ea11e0df7a07fe7fad105c20b8547c401da9 p4raw-id: //depot/cfgperl@2756
-rwxr-xr-xConfigure21
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.SH2
-rw-r--r--README.beos78
-rw-r--r--ext/DynaLoader/dl_beos.xs115
-rw-r--r--hints/beos.sh14
-rw-r--r--lib/ExtUtils/MM_Unix.pm1
7 files changed, 166 insertions, 66 deletions
diff --git a/Configure b/Configure
index 2995765f05..67ed607f7b 100755
--- a/Configure
+++ b/Configure
@@ -20,8 +20,8 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Jan 22 10:52:50 EET 1999 [metaconfig 3.0 PL70]
-# (with additional metaconfig patches by jhi@iki.fi)
+# Generated on Tue Feb 2 12:38:43 EET 1999 [metaconfig 3.0 PL70]
+# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
@@ -960,7 +960,7 @@ case "$sh" in
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
-Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and
+Please contact me (Perl Maintainers) at perlbug@perl.com and
we'll try to straighten this all out.
EOM
exit 1
@@ -1429,7 +1429,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE.
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
-and contact the author (jhi@iki.fi).
+and contact the author (perlbug@perl.com).
EOM
echo $n "Continue? [n] $c" >&4
@@ -1654,7 +1654,7 @@ Much effort has been expended to ensure that this shell script will run on any
Unix system. If despite that it blows up on yours, your best bet is to edit
Configure and run it again. If you can't run Configure for some reason,
you'll have to generate a config.sh file by hand. Whatever problems you
-have, let me (jhi@iki.fi) know how I blew it.
+have, let me (perlbug@perl.com) know how I blew it.
This installation script affects things in two ways:
@@ -2017,7 +2017,7 @@ EOM
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
dflt=''
: Half the following guesses are probably wrong... If you have better
- : tests or hints, please send them to jhi@iki.fi
+ : tests or hints, please send them to perlbug@perl.com
: The metaconfig authors would also appreciate a copy...
$test -f /irix && osname=irix
$test -f /xenix && osname=sco_xenix
@@ -5169,6 +5169,7 @@ use no flags, say "none".
EOM
case "$lddlflags" in
'') case "$osname" in
+ beos) dflt='-nostart' ;;
hpux) dflt='-b' ;;
linux|irix*) dflt='-shared' ;;
next) dflt='none' ;;
@@ -5249,7 +5250,7 @@ $undef)
;;
*) case "$useshrplib" in
'') case "$osname" in
- svr4*|dgux|dynixptx|esix|powerux)
+ svr4*|dgux|dynixptx|esix|powerux|beos)
dflt=y
also='Building a shared libperl is required for dynamic loading to work on your system.'
;;
@@ -5294,6 +5295,7 @@ EOM
case "${osname}${osvers}" in
next4*) xxx='DYLD_LIBRARY_PATH' ;;
os2*) xxx='' ;; # Nothing special needed.
+ beos*) xxx='' ;;
*) xxx='LD_LIBRARY_PATH' ;;
esac
if test X"$xxx" != "X"; then
@@ -5380,7 +5382,7 @@ case "$shrpdir" in
*) $cat >&4 <<EOM
WARNING: Use of the shrpdir variable for the installation location of
the shared $libperl is not supported. It was never documented and
-will not work in this version. Let me (jhi@iki.fi)
+will not work in this version. Let me (perlbug@perl.com)
know of any problems this may cause.
EOM
@@ -5426,6 +5428,9 @@ if "$useshrplib"; then
next)
# next doesn't like the default...
;;
+ beos)
+ # beos doesn't like the default, either.
+ ;;
*)
tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
;;
diff --git a/MANIFEST b/MANIFEST
index 39d727bdad..f10fac4c43 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -207,6 +207,7 @@ ext/DynaLoader/DynaLoader_pm.PL Dynamic Loader perl module
ext/DynaLoader/Makefile.PL Dynamic Loader makefile writer
ext/DynaLoader/README Dynamic Loader notes and intro
ext/DynaLoader/dl_aix.xs AIX implementation
+ext/DynaLoader/dl_beos.xs BeOS implementation
ext/DynaLoader/dl_cygwin32.xs Cygwin32 implementation
ext/DynaLoader/dl_dld.xs GNU dld style implementation
ext/DynaLoader/dl_dlopen.xs BSD/SunOS4&5 dlopen() style implementation
diff --git a/Makefile.SH b/Makefile.SH
index 22bb3357cd..967b9527e2 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -68,6 +68,8 @@ true)
hpux10*|hpux11*)
linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+b$archlibexp/CORE -lperl"
;;
+ beos*) ldlibpth="LIBRARY_PATH=`pwd`:$LIBRARY_PATH"
+ ;;
esac
;;
*) pldlflags=''
diff --git a/README.beos b/README.beos
index 8c24393d6e..ccd9cbc6c6 100644
--- a/README.beos
+++ b/README.beos
@@ -1,75 +1,43 @@
-$Id: README.beos,v 1.2 1998/05/02 01:55:04 dogcow Exp dogcow $
-
Notes on building perl under BeOS:
GENERAL ISSUES
--------------
-perl will almost compile straight out of the box with ./Configure -d, but
-there are a few gotchas:
-
-Currently, you have to edit config.sh and remove SDBM_File from the
-dynamic_ext= and extensions= lines. SDBM_File does not build properly
-at this time. You need to run ./Configure -S after editing config.sh.
-
-In addition, with mwcc, after doing `make depend`, you need to edit
-makefile and x2p/makefile and remove the lines that mention 'Bletch:'.
-This is not necessary if you're using gnu cpp.
+how to compile perl:
-in short:
-./Configure -d
-remove SDBM_File from config.sh
-./Configure -S
-make depend
-remove Bletch: from makefile and x2p/makefile
-make
+To compile perl under BeOS R4 x86:
-Other than that, perl should build without problems. There are some
-technical comments in hints/beos.sh.
-
-OS RELEASE-SPECIFIC NOTES
--------------------------
+`./Configure -d` and hit ^C when it asks you if you want to make changes
+to config.sh;
-PR1/PPC:
-See R3/X86. Same bug, different form.
+edit config.sh and do the following:
+change d_socket='define' to ='undef';
+remove SDBM, Errno, and Socket from dynamic_ext= and nonxs_ext=;
-PR2/PPC:
-Signals are somewhat unreliable, but they can work. Use caution.
-The POSIX module is still somewhat buggy.
+add '#define bool short' to x2p/a2p.h;
-R3/X86:
-Under R3 x86, there are some serious problems with the math routines
-such that numbers are incorrectly printed. This causes problems with
-modules that encode their version numbers - in particular, IO.pm will
-probably not work properly. This should be fixed under R3.1.
+../Configure -S; make; make install
-The problem has manifested itself if you see something similar to the
-following during the compile:
+cd ~/config/lib; ln -s 5.00502/BeOS-BePC/CORE/libperl.so .
+(substitute 5.00502 with the appropriate filename)
-cc -c -I/usr/local/include -O -DVERSION=\"1.1504\" -DXS_VERSION=\"1.1499999999\" -fpic -I../.. IO.c
-(lots of 9's are the indication of the problem.)
-
-In the meantime, you can use the following workaround:
-
-make perl
-cd ext/IO
-cc -c -I/usr/local/include -O -DVERSION=\"1.1504\" -DXS_VERSION=\"1.15\" -fpic -I../.. IO.c
-cd ..
-make
-
-(Substitute the correct numbers if IO has been updated.)
+OS RELEASE-SPECIFIC NOTES
+-------------------------
+R4 x86 - dynamic loading finally works! Yay! This means you can compile
+your own modules into perl. However, Sockets and Errno still don't work.
+(Hopefully, sockets will at least work by R5, if not sooner.)
-R3/PPC-
-There's math problems, but of a different kind. In particular,
-perl -e 'print (240000 - (3e4<<3))' gives a non-zero answer.
-I'm looking into this. There is no workaround as yet. Hopefully,
-this will be fixed in R3.1.
+R4 PPC - I have not tested this. I rather severely doubt that dynamic
+loading will work. (My BeBox is in pieces right now, following a nasty
+disk crash.) You may have to disable dynamic loading to get the thing
+to compile at all. (use `./Configure` without -d, and say 'no' to
+'Build a shared libperl.so'.)
CONTACT INFORMATION
-------------------
If you have comments, problem reports, or even patches or bugfixes (gasp!)
please email me.
-1 May 1998
+28 Jan 1999
Tom Spindler
-dogcow@merit.edu
+dogcow@isi.net
diff --git a/ext/DynaLoader/dl_beos.xs b/ext/DynaLoader/dl_beos.xs
new file mode 100644
index 0000000000..515d187260
--- /dev/null
+++ b/ext/DynaLoader/dl_beos.xs
@@ -0,0 +1,115 @@
+/*
+ * dl_beos.xs, by Tom Spindler
+ * based on dl_dlopen.xs, by Paul Marquess
+ * $Id:$
+ */
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include <be/kernel/image.h>
+#include <OS.h>
+#include <stdlib.h>
+#include <limits.h>
+
+#define dlerror() strerror(errno)
+
+#include "dlutils.c" /* SaveError() etc */
+
+static void
+dl_private_init()
+{
+ (void)dl_generic_private_init();
+}
+
+MODULE = DynaLoader PACKAGE = DynaLoader
+
+BOOT:
+ (void)dl_private_init();
+
+
+void *
+dl_load_file(filename, flags=0)
+ char * filename
+ int flags
+ CODE:
+{ image_id bogo;
+ char *path;
+ path = malloc(PATH_MAX);
+ if (*filename != '/') {
+ getcwd(path, PATH_MAX);
+ strcat(path, "/");
+ strcat(path, filename);
+ } else {
+ strcpy(path, filename);
+ }
+
+ DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", path, flags));
+ bogo = load_add_on(path);
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%lx\n", (unsigned long) RETVAL));
+ ST(0) = sv_newmortal() ;
+ if (bogo < 0) {
+ SaveError("%s", strerror(bogo));
+ fprintf(stderr, "load_add_on(%s) : %d (%s)\n", path, bogo, strerror(bogo));
+ } else {
+ RETVAL = (void *) bogo;
+ sv_setiv( ST(0), (IV)RETVAL);
+ }
+ free(path);
+}
+
+void *
+dl_find_symbol(libhandle, symbolname)
+ void * libhandle
+ char * symbolname
+ CODE:
+ status_t retcode;
+ void *adr = 0;
+#ifdef DLSYM_NEEDS_UNDERSCORE
+ symbolname = form("_%s", symbolname);
+#endif
+ RETVAL = NULL;
+ DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ "dl_find_symbol(handle=%lx, symbol=%s)\n",
+ (unsigned long) libhandle, symbolname));
+ retcode = get_image_symbol((image_id) libhandle, symbolname,
+ B_SYMBOL_TYPE_TEXT, (void **) &adr);
+ RETVAL = adr;
+ DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ " symbolref = %lx\n", (unsigned long) RETVAL));
+ ST(0) = sv_newmortal() ;
+ if (RETVAL == NULL) {
+ SaveError("%s", strerror(retcode)) ;
+ fprintf(stderr, "retcode = %p (%s)\n", retcode, strerror(retcode));
+ } else
+ sv_setiv( ST(0), (IV)RETVAL);
+
+
+void
+dl_undef_symbols()
+ PPCODE:
+
+
+
+# These functions should not need changing on any platform:
+
+void
+dl_install_xsub(perl_name, symref, filename="$Package")
+ char * perl_name
+ void * symref
+ char * filename
+ CODE:
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n",
+ perl_name, (unsigned long) symref));
+ ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)_((CV *)))symref, filename)));
+
+
+char *
+dl_error()
+ CODE:
+ RETVAL = LastError ;
+ OUTPUT:
+ RETVAL
+
+# end.
diff --git a/hints/beos.sh b/hints/beos.sh
index ab752769b6..8d76bc5146 100644
--- a/hints/beos.sh
+++ b/hints/beos.sh
@@ -1,11 +1,12 @@
# BeOS hints file
# $Id: beos.sh,v 1.1 1998/02/16 03:51:45 dogcow Exp $
-if [ ! -f beos/nm ]; then mwcc -w all -o beos/nm beos/nm.c; fi
+if [ ! -f beos/nm ]; then mwcc -w all -o beos/nm beos/nm.c 2>/dev/null; fi
+# If this fails, that's all right - it's only for PPC.
prefix="/boot/home/config"
-cpp="mwcc -e"
+#cpp="mwcc -e"
libpth='/boot/beos/system/lib /boot/home/config/lib'
usrinc='/boot/develop/headers/posix'
@@ -37,9 +38,16 @@ d_syserrlst='undef'
# the array syserrlst[] is useless for the most part.
# large negative numbers really kind of suck in arrays.
-#d_socket='undef'
+d_socket='undef'
+d_gethbyaddr='undef'
+d_gethbyname='undef'
+d_getsbyname='undef'
+
+ld='gcc'
+
# Sockets really don't work with the current version of perl and the
# current BeOS sockets; I suspect that a new module a la GSAR's WIN32 port
# will be required.
+# Of course, this may also change with R5.
export PATH="$PATH:$PWD/beos"
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 43d37ffd4d..1197cd639a 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -3539,6 +3539,7 @@ and Win32 do.
sub perl_archive
{
+ return '$(PERL_INC)' . "/$Config{libperl}" if $^O eq "beos";
return "";
}