summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure167
-rw-r--r--MANIFEST2
-rw-r--r--Porting/Glossary12
-rw-r--r--Porting/config.sh19
-rw-r--r--Porting/config_H40
-rw-r--r--config_h.SH34
-rw-r--r--doio.c57
-rw-r--r--ext/POSIX/hints/sunos_4.pl6
-rw-r--r--hints/solaris_2.sh64
-rw-r--r--hints/sunos_4_1.sh6
-rw-r--r--perl.h22
-rw-r--r--vms/config.vms22
-rw-r--r--win32/config.bc3
-rw-r--r--win32/config.gc4
-rw-r--r--win32/config.vc3
15 files changed, 354 insertions, 107 deletions
diff --git a/Configure b/Configure
index 79b7a5d885..38072f0e5e 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu May 14 12:19:05 EDT 1998 [metaconfig 3.0 PL70]
+# Generated on Thu May 28 12:01:39 EDT 1998 [metaconfig 3.0 PL70]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
@@ -481,6 +481,9 @@ d_times=''
d_truncate=''
d_tzname=''
d_umask=''
+d_semctl_semid_ds=''
+d_semctl_semun=''
+d_union_semun=''
d_vfork=''
usevfork=''
d_voidsig=''
@@ -7945,6 +7948,165 @@ fi
set d_sem
eval $setvar
+: see whether sys/sem.h defines union semun
+echo " "
+$cat > try.c <<'END'
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+int main () { union semun semun; semun.buf = 0; }
+END
+set try
+if eval $compile; then
+ echo "You have union semun in <sys/sem.h>." >&4
+ val="$define"
+else
+ echo "You do not have union semun in <sys/sem.h>." >&4
+ val="$undef"
+fi
+$rm -f try try.c
+set d_union_semun
+eval $setvar
+
+: see how to do semctl IPC_STAT
+case "$d_sem" in
+$define)
+ : see whether semctl IPC_STAT can use union semun
+ echo " "
+ $cat > try.c <<END
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#$d_union_semun HAS_UNION_SEMUN
+int main() {
+ union semun
+#ifndef HAS_UNION_SEMUN
+ {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ }
+#endif
+ arg;
+ int sem, st;
+
+#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
+ sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
+ if (sem > -1) {
+ struct semid_ds argbuf;
+ arg.buf = &argbuf;
+# ifdef IPC_STAT
+ st = semctl(sem, 0, IPC_STAT, arg);
+ if (st == 0)
+ printf("semun\n");
+ else
+# endif /* IPC_STAT */
+ printf("semctl IPC_STAT failed: errno = %d\n", errno);
+# ifdef IPC_RMID
+ if (semctl(sem, 0, IPC_RMID, arg) != 0)
+# endif /* IPC_RMID */
+ printf("semctl IPC_RMID failed: errno = %d\n", errno);
+ } else
+#endif /* IPC_PRIVATE && ... */
+ printf("semget failed: errno = %d\n", errno);
+ return 0;
+}
+END
+ val="$undef"
+ set try
+ if eval $compile; then
+ xxx=`./try`
+ case "$xxx" in
+ semun) val="$define" ;;
+ esac
+ fi
+ $rm -f try try.c
+ set d_semctl_semun
+ eval $setvar
+ case "$d_semctl_semun" in
+ $define)
+ echo "You can use union semun for semctl IPC_STAT." >&4
+ also='also'
+ ;;
+ *) echo "You cannot use union semun for semctl IPC_STAT." >&4
+ also=''
+ ;;
+ esac
+
+ : see whether semctl IPC_STAT can use struct semid_ds pointer
+ $cat > try.c <<'END'
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+int main() {
+ struct semid_ds arg;
+ int sem, st;
+
+#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
+ sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
+ if (sem > -1) {
+# ifdef IPC_STAT
+ st = semctl(sem, 0, IPC_STAT, &arg);
+ if (st == 0)
+ printf("semid_ds\n");
+ else
+# endif /* IPC_STAT */
+ printf("semctl IPC_STAT failed: errno = %d\n", errno);
+# ifdef IPC_RMID
+ if (semctl(sem, 0, IPC_RMID, &arg) != 0)
+# endif /* IPC_RMID */
+ printf("semctl IPC_RMID failed: errno = %d\n", errno);
+ } else
+#endif /* IPC_PRIVATE && ... */
+ printf("semget failed: errno = %d\n", errno);
+
+ return 0;
+}
+END
+ val="$undef"
+ set try
+ if eval $compile; then
+ xxx=`./try`
+ case "$xxx" in
+ semid_ds) val="$define" ;;
+ esac
+ fi
+ $rm -f try try.c
+ set d_semctl_semid_ds
+ eval $setvar
+ case "$d_semctl_semid_ds" in
+ $define)
+ echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4
+ ;;
+ *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4
+ ;;
+ esac
+ ;;
+*) val="$undef"
+
+ # We do not have the full sem*(2) library, so assume we can not
+ # use either.
+
+ set d_semctl_semun
+ eval $setvar
+
+ set d_semctl_semid_ds
+ eval $setvar
+ ;;
+esac
+
: see if setegid exists
set setegid d_setegid
eval $inlibc
@@ -11132,6 +11294,8 @@ d_seekdir='$d_seekdir'
d_select='$d_select'
d_sem='$d_sem'
d_semctl='$d_semctl'
+d_semctl_semid_ds='$d_semctl_semid_ds'
+d_semctl_semun='$d_semctl_semun'
d_semget='$d_semget'
d_semop='$d_semop'
d_setegid='$d_setegid'
@@ -11196,6 +11360,7 @@ d_truncate='$d_truncate'
d_tzname='$d_tzname'
d_umask='$d_umask'
d_uname='$d_uname'
+d_union_semun='$d_union_semun'
d_vfork='$d_vfork'
d_void_closedir='$d_void_closedir'
d_voidsig='$d_voidsig'
diff --git a/MANIFEST b/MANIFEST
index 1bd0206e17..fb1e96f8c6 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -916,10 +916,10 @@ utils/c2ph.PL program to translate dbx stabs to perl
utils/h2ph.PL A thing to turn C .h files into perl .ph files
utils/h2xs.PL Program to make .xs files from C header files
utils/perlbug.PL A simple tool to submit a bug report
+utils/perlcc.PL Front-end for compiler
utils/perldoc.PL A simple tool to find & display perl's documentation
utils/pl2pm.PL A pl to pm translator
utils/splain.PL Stand-alone version of diagnostics.pm
-utils/perlcc.PL Front-end for compiler
vms/config.vms default config.h for VMS
vms/descrip.mms MM[SK] description file for build
vms/ext/DCLsym/0README.txt ReadMe file for VMS::DCLsym
diff --git a/Porting/Glossary b/Porting/Glossary
index acc1d2ff4a..8e7514e10a 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -792,6 +792,14 @@ d_semctl (d_semctl.U):
This variable conditionally defines the HAS_SEMCTL symbol, which
indicates to the C program that the semctl() routine is available.
+d_semctl_semid_ds (d_union_senum.U):
+ This variable conditionally defines USE_SEMCTL_SEMID_DS, which
+ indicates that struct semid_ds * is to be used for semctl IPC_STAT.
+
+d_semctl_semun (d_union_senum.U):
+ This variable conditionally defines USE_SEMCTL_SEMUN, which
+ indicates that union semun is to be used for semctl IPC_STAT.
+
d_semget (d_semget.U):
This variable conditionally defines the HAS_SEMGET symbol, which
indicates to the C program that the semget() routine is available.
@@ -1079,6 +1087,10 @@ d_uname (d_gethname.U):
indicates to the C program that the uname() routine may be
used to derive the host name.
+d_union_semun (d_union_senum.U):
+ This variable conditionally defines HAS_UNION_SEMUN if the
+ union semun is defined by including <sys/sem.h>.
+
d_vfork (d_vfork.U):
This variable conditionally defines the HAS_VFORK symbol, which
indicates the vfork() routine is available.
diff --git a/Porting/config.sh b/Porting/config.sh
index 60db390df7..5a417ae2f0 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Thu May 14 11:18:05 EDT 1998
+# Configuration time: Thu May 28 12:44:36 EDT 1998
# Configured by : doughera
# Target system : linux fractal 2.0.33 #1 tue feb 3 10:11:46 est 1998 i686 unknown
@@ -31,8 +31,8 @@ alignbytes='4'
ansi2knr=''
aphostname=''
ar='ar'
-archlib='/opt/perl/lib/i686-linux-thread/5.00464'
-archlibexp='/opt/perl/lib/i686-linux-thread/5.00464'
+archlib='/opt/perl/lib/i686-linux-thread/5.00465'
+archlibexp='/opt/perl/lib/i686-linux-thread/5.00465'
archname='i686-linux-thread'
archobjs=''
awk='awk'
@@ -52,7 +52,7 @@ ccdlflags='-rdynamic'
ccflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
cf_by='doughera'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Thu May 14 11:18:05 EDT 1998'
+cf_time='Thu May 28 12:44:36 EDT 1998'
chgrp=''
chmod=''
chown=''
@@ -207,6 +207,8 @@ d_seekdir='define'
d_select='define'
d_sem='define'
d_semctl='define'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
d_semget='define'
d_semop='define'
d_setegid='define'
@@ -271,6 +273,7 @@ d_truncate='define'
d_tzname='define'
d_umask='define'
d_uname='define'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
@@ -373,7 +376,7 @@ i_varhdr='stdarg.h'
i_vfork='undef'
incpath=''
inews=''
-installarchlib='/opt/perl/lib/i686-linux-thread/5.00464'
+installarchlib='/opt/perl/lib/i686-linux-thread/5.00465'
installbin='/opt/perl/bin'
installman1dir='/opt/perl/man/man1'
installman3dir='/opt/perl/man/man3'
@@ -393,7 +396,7 @@ lib_ext='.a'
libc=''
libperl='libperl.a'
libpth='/usr/local/lib /lib /usr/lib'
-libs='-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt'
+libs='-lnsl -lgdbm -ldbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt'
libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m pthread c cposix posix ndir dir crypt ucb BSD PW x'
line='line'
lint=''
@@ -519,7 +522,7 @@ stdio_filbuf=''
stdio_ptr='((fp)->_IO_read_ptr)'
strings='/usr/include/string.h'
submit=''
-subversion='64'
+subversion='65'
sysman='/usr/man/man1'
tail=''
tar=''
@@ -552,5 +555,5 @@ xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
PATCHLEVEL=4
-SUBVERSION=64
+SUBVERSION=65
CONFIG=true
diff --git a/Porting/config_H b/Porting/config_H
index f586a6155b..0b1de0855f 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Thu May 14 11:18:05 EDT 1998
+ * Configuration time: Thu May 28 12:44:36 EDT 1998
* Configured by : doughera
* Target system : linux fractal 2.0.33 #1 tue feb 3 10:11:46 est 1998 i686 unknown
*/
@@ -982,6 +982,12 @@
*/
#define I_SYS_TIMES /**/
+/* I_SYS_TYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/types.h>.
+ */
+#define I_SYS_TYPES /**/
+
/* I_SYS_UN:
* This symbol, if defined, indicates to the C program that it should
* include <sys/un.h> to get UNIX domain socket definitions.
@@ -1461,8 +1467,8 @@
* This symbol contains the ~name expanded version of ARCHLIB, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define ARCHLIB "/opt/perl/lib/i686-linux-thread/5.00464" /**/
-#define ARCHLIB_EXP "/opt/perl/lib/i686-linux-thread/5.00464" /**/
+#define ARCHLIB "/opt/perl/lib/i686-linux-thread/5.00465" /**/
+#define ARCHLIB_EXP "/opt/perl/lib/i686-linux-thread/5.00465" /**/
/* CAT2:
* This macro catenates 2 tokens together.
@@ -1669,6 +1675,28 @@
#define HAS_SOCKET /**/
#define HAS_SOCKETPAIR /**/
+/* HAS_UNION_SEMUN:
+ * This symbol, if defined, indicates that the union semun is
+ * defined by including <sys/sem.h>. If not, the user code
+ * probably needs to define it as:
+ * union semun {
+ * int val;
+ * struct semid_ds *buf;
+ * unsigned short *array;
+ * }
+ */
+/* USE_SEMCTL_SEMUN:
+ * This symbol, if defined, indicates that union semun is
+ * used for semctl IPC_STAT.
+ */
+/* USE_SEMCTL_SEMID_DS:
+ * This symbol, if defined, indicates that struct semid_ds * is
+ * used for semctl IPC_STAT.
+ */
+#define HAS_UNION_SEMUN /**/
+#define USE_SEMCTL_SEMUN /**/
+#define USE_SEMCTL_SEMID_DS /**/
+
/* Signal_t:
* This symbol's value is either "void" or "int", corresponding to the
* appropriate return type of a signal handler. Thus, you can declare
@@ -1737,12 +1765,6 @@
/*#define PWCOMMENT / **/
#define PWGECOS /**/
-/* I_SYS_TYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/types.h>.
- */
-#define I_SYS_TYPES /**/
-
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
* The library is private in the sense that it needn't be in anyone's
diff --git a/config_h.SH b/config_h.SH
index 78486bacae..6b01b975e6 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -996,6 +996,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$i_systimes I_SYS_TIMES /**/
+/* I_SYS_TYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/types.h>.
+ */
+#$i_systypes I_SYS_TYPES /**/
+
/* I_SYS_UN:
* This symbol, if defined, indicates to the C program that it should
* include <sys/un.h> to get UNIX domain socket definitions.
@@ -1683,6 +1689,28 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_socket HAS_SOCKET /**/
#$d_sockpair HAS_SOCKETPAIR /**/
+/* HAS_UNION_SEMUN:
+ * This symbol, if defined, indicates that the union semun is
+ * defined by including <sys/sem.h>. If not, the user code
+ * probably needs to define it as:
+ * union semun {
+ * int val;
+ * struct semid_ds *buf;
+ * unsigned short *array;
+ * }
+ */
+/* USE_SEMCTL_SEMUN:
+ * This symbol, if defined, indicates that union semun is
+ * used for semctl IPC_STAT.
+ */
+/* USE_SEMCTL_SEMID_DS:
+ * This symbol, if defined, indicates that struct semid_ds * is
+ * used for semctl IPC_STAT.
+ */
+#$d_union_semun HAS_UNION_SEMUN /**/
+#$d_semctl_semun USE_SEMCTL_SEMUN /**/
+#$d_semctl_semid_ds USE_SEMCTL_SEMID_DS /**/
+
/* Signal_t:
* This symbol's value is either "void" or "int", corresponding to the
* appropriate return type of a signal handler. Thus, you can declare
@@ -1751,12 +1779,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_pwcomment PWCOMMENT /**/
#$d_pwgecos PWGECOS /**/
-/* I_SYS_TYPES:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/types.h>.
- */
-#$i_systypes I_SYS_TYPES /**/
-
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
* The library is private in the sense that it needn't be in anyone's
diff --git a/doio.c b/doio.c
index bbf3837e1b..37d6167451 100644
--- a/doio.c
+++ b/doio.c
@@ -1389,21 +1389,6 @@ do_ipcget(I32 optype, SV **mark, SV **sp)
return -1; /* should never happen */
}
-#if defined(__sun) && defined(__svr4__) /* XXX Need metaconfig test */
-/* Solaris manpage says that it uses (like linux)
- int semctl (int semid, int semnum, int cmd, union semun arg)
- but the system include files do not define union semun !!!!
- Note: Linux/glibc *does* declare union semun in <sys/sem_buf.h>
- but, unlike the older Linux libc and Solaris, it has an extra
- struct seminfo * on the end.
-*/
-union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
-};
-#endif
-
I32
do_ipcctl(I32 optype, SV **mark, SV **sp)
{
@@ -1412,26 +1397,6 @@ do_ipcctl(I32 optype, SV **mark, SV **sp)
char *a;
I32 id, n, cmd, infosize, getinfo;
I32 ret = -1;
-/* XXX REALLY need metaconfig test */
-/* linux and Solaris2 use:
- int semctl (int semid, int semnum, int cmd, union semun arg)
- instead of:
- int semctl (int semid, int semnum, int cmd, struct semid_ds *arg);
- Solaris and Linux (pre-glibc) use
- union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
- };
- but Solaris doesn't declare it in a header file (we declared it
- explicitly earlier). Linux/glibc declares a *different* union semun
- so we just refer to "union semun" here.
-
-*/
-#if defined(__linux__) || (defined(__sun__) && defined(__svr4__))
-# define SEMCTL_SEMUN
- union semun unsemds, semun;
-#endif
id = SvIVx(*++mark);
n = (optype == OP_SEMCTL) ? SvIVx(*++mark) : 0;
@@ -1461,13 +1426,9 @@ do_ipcctl(I32 optype, SV **mark, SV **sp)
else if (cmd == GETALL || cmd == SETALL)
{
struct semid_ds semds;
-#ifdef SEMCTL_SEMUN
+ union semun semun;
+
semun.buf = &semds;
- if (semctl(id, 0, IPC_STAT, semun) == -1)
-#else
- if (semctl(id, 0, IPC_STAT, &semds) == -1)
-#endif
- return -1;
getinfo = (cmd == GETALL);
infosize = semds.sem_nsems * sizeof(short);
/* "short" is technically wrong but much more portable
@@ -1511,14 +1472,12 @@ do_ipcctl(I32 optype, SV **mark, SV **sp)
break;
#endif
#ifdef HAS_SEM
- case OP_SEMCTL:
-#ifdef SEMCTL_SEMUN
- /* XXX Need metaconfig test */
- unsemds.buf = (struct semid_ds *)a;
- ret = semctl(id, n, cmd, unsemds);
-#else
- ret = semctl(id, n, cmd, (struct semid_ds *)a);
-#endif
+ case OP_SEMCTL: {
+ union semun unsemds;
+
+ unsemds.buf = (struct semid_ds *)a;
+ ret = Semctl(id, n, cmd, unsemds);
+ }
break;
#endif
#ifdef HAS_SHM
diff --git a/ext/POSIX/hints/sunos_4.pl b/ext/POSIX/hints/sunos_4.pl
index 59b45bc4f2..32b3558a5e 100644
--- a/ext/POSIX/hints/sunos_4.pl
+++ b/ext/POSIX/hints/sunos_4.pl
@@ -3,4 +3,8 @@
# This state of affairs also persists in glibc2, found
# on linux systems running libc6.
# XXX A Configure test is needed.
-$self->{CCFLAGS} = $Config{ccflags} . ' -DSTRUCT_TM_HASZONE' ;
+
+# Although <unistd.h> is inappropriate in general for SunOS, we need it
+# in POSIX.xs to get the correct prototype for ttyname().
+
+$self->{CCFLAGS} = $Config{ccflags} . ' -DSTRUCT_TM_HASZONE -DI_UNISTD' ;
diff --git a/hints/solaris_2.sh b/hints/solaris_2.sh
index 744b131fad..9a1ccb9027 100644
--- a/hints/solaris_2.sh
+++ b/hints/solaris_2.sh
@@ -1,5 +1,5 @@
# hints/solaris_2.sh
-# Last modified: Thu Feb 8 11:38:12 EST 1996
+# Last modified: Wed May 27 13:04:45 EDT 1998
# Andy Dougherty <doughera@lafcol.lafayette.edu>
# Based on input from lots of folks, especially
# Dean Roehrich <roehrich@ironwood-fddi.cray.com>
@@ -53,11 +53,12 @@ esac
# Here's another draft of the perl5/solaris/gcc sanity-checker.
-case $PATH in
-*/usr/ucb*:/usr/bin:*|*/usr/ucb*:/usr/bin) cat <<END >&4
+case `type ${cc:-cc}` in
+*/usr/ucb/cc*) cat <<END >&4
NOTE: Some people have reported problems with /usr/ucb/cc.
-Remove /usr/ucb from your PATH if you have difficulties.
+If you have difficulties, please make sure the directory
+containing your C compiler is before /usr/ucb in your PATH.
END
;;
@@ -95,13 +96,22 @@ END
;;
esac
+# Use shell built-in 'type' command instead of /usr/bin/which to
+# avoid possible csh start-up problems and also to use the same shell
+# we'll be using to Configure and make perl.
+# The path name is the last field in the output, but the type command
+# has an annoying array of possible outputs, e.g.:
+# make is hashed (/opt/gnu/bin/make)
+# cc is /usr/ucb/cc
+# foo not found
+# use a command like type make | awk '{print $NF}' | sed 's/[()]//g'
# See if make(1) is GNU make(1).
# If it is, make sure the setgid bit is not set.
make -v > make.vers 2>&1
if grep GNU make.vers > /dev/null 2>&1; then
- tmp=`/usr/bin/which make`
- case "`/usr/bin/ls -l $tmp`" in
+ tmp=`type make | awk '{print $NF}' | sed 's/[()]//g'`
+ case "`/usr/bin/ls -lL $tmp`" in
??????s*)
cat <<END >&2
@@ -123,17 +133,17 @@ cat > UU/cc.cbu <<'EOSH'
# If the C compiler is gcc:
# - check the fixed-includes
# - check as(1) and ld(1), they should not be GNU
-# (GNU ad and ld 2.8.1 and later are reportedly ok, however.)
+# (GNU as and ld 2.8.1 and later are reportedly ok, however.)
# If the C compiler is not gcc:
# - check as(1) and ld(1), they should not be GNU
-# (GNU ad and ld 2.8.1 and later are reportedly ok, however.)
+# (GNU as and ld 2.8.1 and later are reportedly ok, however.)
#
# Watch out in case they have not set $cc.
# Get gcc to share its secrets.
echo 'main() { return 0; }' > try.c
-verbose=`${cc:-cc} -v -o try try.c 2>&1`
-rm -f try try.c
+ # Indent to avoid propagation to config.sh
+ verbose=`${cc:-cc} -v -o try try.c 2>&1`
if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
#
@@ -154,24 +164,24 @@ if echo "$verbose" | grep '^Reading specs from' >/dev/null 2>&1; then
cat <<END >&2
NOTE: You are using GNU as(1). GNU as(1) will not build Perl.
-I'm arranging to use /usr/ccs/bin/as by setting including
--B/usr/ccs/bin/ in your ${cc:-cc} command.
-(Note that the trailing "/" is required.)
+I'm arranging to use /usr/ccs/bin/as by including -B/usr/ccs/bin/
+in your ${cc:-cc} command. (Note that the trailing "/" is required.)
END
cc="${cc:-cc} -B/usr/ccs/bin/"
fi
# See if ld(1) is GNU ld(1). GNU ld(1) won't work for this job.
- if echo "$verbose" | grep ' /usr/ccs/bin/as ' >/dev/null 2>&1; then
+ # Recompute $verbose since we may have just changed $cc.
+ verbose=`${cc:-cc} -v -o try try.c 2>&1`
+ if echo "$verbose" | grep ' /usr/ccs/bin/ld ' >/dev/null 2>&1; then
:
else
cat <<END >&2
-NOTE: You are using GNU as(1). GNU as(1) will not build Perl.
-I'm arranging to use /usr/ccs/bin/as by setting including
--B/usr/ccs/bin/ in your ${cc:-cc} command.
-(Note that the trailing "/" is required.)
+NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl.
+I'm arranging to use /usr/ccs/bin/ld by including -B/usr/ccs/bin/
+in your ${cc:-cc} command. (Note that the trailing "/" is required.)
END
cc="${cc:-cc} -B/usr/ccs/bin/"
@@ -189,8 +199,8 @@ else
cat <<END >&2
NOTE: You are using GNU as(1). GNU as(1) will not build Perl.
-You must arrange to use /usr/ccs/bin, perhaps by adding it to the
-beginning of your PATH.
+You must arrange to use /usr/ccs/bin/as, perhaps by adding /usr/ccs/bin
+to the beginning of your PATH.
END
;;
@@ -207,19 +217,18 @@ END
esac
if $gnu_ld ; then :
else
- case `which ld` in
- no\ ld\ in*|[Cc]ommand\ not\ found*)
- ;;
- /*gnu*/ld|/*GNU*/ld)
+ # Try to guess from path
+ case `type ld | awk '{print $NF}'` in
+ *gnu*|*GNU*|*FSF*)
gnu_ld=true ;;
esac
fi
if $gnu_ld ; then
cat <<END >&2
-NOTE: You are using GNU ld(1). GNU ld(1) will not build Perl.
-You must arrange to use /usr/ccs/bin, perhaps by adding it to the
-beginning of your PATH.
+NOTE: You are apparently using GNU ld(1). GNU ld(1) will not build Perl.
+You must arrange to use /usr/ccs/bin/ld, perhaps by adding /usr/ccs/bin
+to the beginning of your PATH.
END
fi
@@ -227,6 +236,7 @@ END
fi
# as --version or ld --version might dump core.
+rm -f try try.c
rm -f core
# XXX
diff --git a/hints/sunos_4_1.sh b/hints/sunos_4_1.sh
index 9f342d100b..4585d793d7 100644
--- a/hints/sunos_4_1.sh
+++ b/hints/sunos_4_1.sh
@@ -1,5 +1,5 @@
# hints/sunos_4_1.sh
-# Last modified: Thu Feb 8 11:46:05 EST 1996
+# Last modified: Wed May 27 11:00:02 EDT 1998
# Andy Dougherty <doughera@lafcol.lafayette.edu>
case "$cc" in
@@ -25,9 +25,7 @@ d_tzname='undef'
# The gcc fix-includes script exposes those incorrect prototypes.
# There may be other examples as well. Volunteers are welcome to
# track them all down :-). In the meantime, we'll just skip unistd.h
-# for SunOS in most of the code. The POSIX extension is built with
-# unistd.h because, even though unistd.h has problems, if used with
-# care, it helps create a better POSIX extension.
+# for SunOS in most of the code. (However, see ext/POSIX/hints/sunos_4.pl.)
i_unistd='undef'
cat << 'EOM' >&4
diff --git a/perl.h b/perl.h
index fc9606438a..8645c393fb 100644
--- a/perl.h
+++ b/perl.h
@@ -2090,6 +2090,26 @@ enum {
UNLOCK_SV_MUTEX; \
} while (0)
+#ifdef HAS_SEM
+# include <sys/ipc.h>
+# include <sys/sem.h>
+# ifndef HAS_UNION_SEMUN /* Provide the union semun. */
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ };
+# endif
+# ifdef USE_SEMCTL_SEMUN
+# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
+# else
+# ifdef USE_SEMCTL_SEMID_DS
+# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun.buf)
+# endif
+# endif
+# ifndef Semctl /* Place our bets on the semun horse. */
+# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
+# endif
+#endif
#endif /* Include guard */
-
diff --git a/vms/config.vms b/vms/config.vms
index bfc5bb2060..839c7ee00f 100644
--- a/vms/config.vms
+++ b/vms/config.vms
@@ -691,6 +691,28 @@
*/
#define HAS_VFORK /**/
+/* HAS_UNION_SEMUN:
+ * This symbol, if defined, indicates that the union semun is
+ * defined by including <sys/sem.h>. If not, the user code
+ * probably needs to define it as:
+ * union semun {
+ * int val;
+ * struct semid_ds *buf;
+ * unsigned short *array;
+ * }
+ */
+/* USE_SEMCTL_SEMUN:
+ * This symbol, if defined, indicates that union semun is
+ * used for semctl IPC_STAT.
+ */
+/* USE_SEMCTL_SEMID_DS:
+ * This symbol, if defined, indicates that struct semid_ds * is
+ * used for semctl IPC_STAT.
+ */
+#undef HAS_UNION_SEMUN /**/
+#undef USE_SEMCTL_SEMUN /**/
+#undef USE_SEMCTL_SEMID_DS /**/
+
/* Signal_t:
* This symbol's value is either "void" or "int", corresponding to the
* appropriate return type of a signal handler. Thus, you can declare
diff --git a/win32/config.bc b/win32/config.bc
index 933a22f017..94d4297450 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -197,6 +197,8 @@ d_seekdir='define'
d_select='define'
d_sem='undef'
d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
d_setegid='undef'
@@ -261,6 +263,7 @@ d_truncate='undef'
d_tzname='define'
d_umask='define'
d_uname='undef'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
diff --git a/win32/config.gc b/win32/config.gc
index aec30ccea6..295009daf7 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -182,6 +182,7 @@ d_pwchange='undef'
d_pwclass='undef'
d_pwcomment='undef'
d_pwexpire='undef'
+d_pwgecos='undef'
d_pwquota='undef'
d_readdir='define'
d_readlink='undef'
@@ -196,6 +197,8 @@ d_seekdir='define'
d_select='define'
d_sem='undef'
d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
d_setegid='undef'
@@ -260,6 +263,7 @@ d_truncate='undef'
d_tzname='define'
d_umask='define'
d_uname='undef'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
diff --git a/win32/config.vc b/win32/config.vc
index 8451f9bc00..0f8152d772 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -197,6 +197,8 @@ d_seekdir='define'
d_select='define'
d_sem='undef'
d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
d_semget='undef'
d_semop='undef'
d_setegid='undef'
@@ -261,6 +263,7 @@ d_truncate='undef'
d_tzname='define'
d_umask='define'
d_uname='undef'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'