This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add missing file from change 25953
[perl5.git] / hints / beos.sh
index 8017dce..a83b4af 100644 (file)
@@ -38,20 +38,46 @@ 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_gethbyaddr='undef'
-d_gethbyname='undef'
-d_getsbyname='undef'
+# Sockets didn't use to be real sockets but BONE changes this.
+if [ ! -f /boot/develop/headers/be/bone/sys/socket.h ]; then
+    d_socket='undef'
+    d_gethbyaddr='undef'
+    d_gethbyname='undef'
+    d_getsbyname='undef'
 
-ld='gcc'
+       libs='-lnet'
+fi
+
+# There's a third party flock() emulation. Check, if it is available.
+echo "#include <flock.h>" > try.c
+if cc -E $CFLAGS try.c 2> /dev/null | grep "flock.*("; then
+    d_flock='define'
+    d_flockproto='define'
+    libs="$libs -lflock"
+    ldflags="$ldflags -L/boot/home/config/lib"
+else
+       cat << 'EOM' >&4
+
+I couldn't find a <flock.h> header defining a flock() prototype. That header
+comes with the flock server package (available on BeBits). You have to add
+the path to the directory containing the header via the environment variable
+CFLAGS (should contain -I</path/to/dir/of/flock/header>). Perl will be compiled
+without flock() support, if the flock server package is not installed or the
+header not found.
+
+EOM
 
-# 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.
+fi
+rm try.c
+
+ld='gcc'
 
 export PATH="$PATH:$PWD/beos"
 
 case "$ldlibpthname" in
 '') ldlibpthname=LIBRARY_PATH ;;
 esac
+
+# the waitpid() wrapper (among other things)
+archobjs="beos.o"
+test -f beos.c || cp beos/beos.c .