# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Sep 30 02:04:24 EET DST 1998 [metaconfig 3.0 PL70]
+# Generated on Wed Oct 14 17:00:29 EET DST 1998 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by jhi@iki.fi)
cat >/tmp/c1$$ <<EOF
d_portable=''
d_pthread_yield=''
d_sched_yield=''
+sched_yield=''
d_pthreads_created_joinable=''
d_readdir=''
d_rewinddir=''
loclibpth=''
plibpth=''
xlibpth=''
+ignore_versioned_solibs=''
libs=''
lns=''
lseeksize=''
privlib=''
privlibexp=''
prototype=''
+pthread_setdetachstate_pointer=''
ptrsize=''
drand01=''
randbits=''
: machines, like the mips. Usually, it should be empty.
plibpth=''
-: default library list
-libswanted=''
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
: Extra object files, if any, needed on this platform.
archobjs=''
groupstype=''
+: default library list
+libswanted=''
+ignore_versioned_solibs=''
: full support for void wanted by default
defvoidused=15
ABC.XYZ
EOT
cd ..
-echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+if test ! -f cppstdin; then
+ echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+else
+ echo "Keeping your $hint cppstdin wrapper."
+fi
chmod 755 cppstdin
wrapper=`pwd`/cppstdin
ok='false'
esac
for thislib in $libswanted; do
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
echo "Found -l$thislib (shared)."
case " $dflt " in
*"-l$thislib "*);;
set poll d_poll
eval $inlibc
-
-: see whether the various POSIXish _yields exist within given cccmd
-$cat >try.c <<EOP
-#include <pthread.h>
-main() {
- YIELD();
- exit(0);
-}
-EOP
-: see if pthread_yield exists within given cccmd,
-: if we do not usethreads this may well end up undef.
-set try -DYIELD=pthread_yield
-if eval $compile; then
- val="$define"
- echo 'pthread_yield() found.' >&4
-else
- val="$undef"
- echo 'pthread_yield() NOT found.' >&4
-fi
-set d_pthread_yield
-eval $setvar
-
-: see if sched_yield exists within given cccmd,
-: if we do not usethreads this may well end up undef.
-set try -DYIELD=sched_yield
-if eval $compile; then
- val="$define"
- echo 'sched_yield() found.' >&4
-else
- val="$undef"
- echo 'sched_yield() NOT found.' >&4
-fi
-set d_sched_yield
-eval $setvar
-$rm -f try try.*
-
: test whether pthreads are created in joinable -- aka undetached -- state
if test "X$usethreads" = "X$define"; then
echo $n "Checking whether pthreads are created joinable. $c" >&4
set pid_t pidtype int stdio.h sys/types.h
eval $typedef_ask
+
+: see whether the state of pthread_attr_setdetachstate is an int pointer
+$cat >try.c <<EOP
+#include <pthread.h>
+main() {
+ pthread_attr_t attr;
+ int state = 0;
+ pthread_attr_init(&attr);
+#ifdef POINTER
+ pthread_attr_setdetachstate(&attr, &state);
+#else
+ pthread_attr_setdetachstate(&attr, state);
+#endif
+}
+EOP
+set try
+if eval $compile; then
+ val="$undef"
+else
+ set try -DPOINTER
+ if eval $compile; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+fi
+set pthread_setdetachstate_pointer
+eval $setvar
+
+$rm -f try try.*
+
: check for length of pointer
echo " "
case "$ptrsize" in
fi
$rm -f foo* bar*
+
+: see whether the various POSIXish _yields exist within given cccmd
+$cat >try.c <<EOP
+#include <pthread.h>
+#include <stdio.h>
+main() {
+#ifdef SCHED_YIELD
+ sched_yield();
+#else
+#ifdef PTHREAD_YIELD
+ pthread_yield();
+#else
+#ifdef PTHREAD_YIELD_NULL
+ pthread_yield(NULL);
+#endif
+#endif
+#endif
+}
+EOP
+: see if sched_yield exists
+set try -DSCHED_YIELD
+if eval $compile; then
+ val="$define"
+ echo 'sched_yield() found.' >&4
+ sched_yield='sched_yield()'
+else
+ val="$undef"
+ echo 'sched_yield() NOT found.' >&4
+fi
+set d_sched_yield
+eval $setvar
+
+: see if pthread_yield exists
+set try -DPTHREAD_YIELD
+if eval $compile; then
+ val="$define"
+ case "$sched_yield" in
+ '') sched_yield='pthread_yield()' ;;
+ esac
+else
+ set try -DPTHREAD_YIELD_NULL
+ if eval $compile; then
+ val="$define"
+ case "$sched_yield" in
+ '') sched_yield='pthread_yield(NULL)' ;;
+ esac
+ else
+ val="$undef"
+ fi
+fi
+case "$val" in
+$define) echo 'pthread_yield() found.' >&4 ;;
+*) echo 'pthread_yield() NOT found.' >&4 ;;
+esac
+set d_pthread_yield
+eval $setvar
+
+case "$sched_yield" in
+'') sched_yield=undef ;;
+esac
+
+$rm -f try try.*
+
: see if sys/select.h has to be included
set sys/select.h i_sysselct
eval $inhdr
: The first arg can be int, unsigned, or size_t
: The last arg may or may not be 'const'
val=''
- for xxx in 'fd_set *' 'int *'; do
- for nfd in 'int' 'size_t' 'unsigned' ; do
+ for xxx in 'fd_set *' 'int *' 'void *'; do
+ for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
for tmo in 'struct timeval *' 'const struct timeval *'; do
case "$val" in
'') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
i_varargs='$i_varargs'
i_varhdr='$i_varhdr'
i_vfork='$i_vfork'
+ignore_versioned_solibs='$ignore_versioned_solibs'
incpath='$incpath'
inews='$inews'
installarchlib='$installarchlib'
privlib='$privlib'
privlibexp='$privlibexp'
prototype='$prototype'
+pthread_setdetachstate_pointer='$pthread_setdetachstate_pointer'
ptrsize='$ptrsize'
randbits='$randbits'
randfunc='$randfunc'
rm='$rm'
rmail='$rmail'
runnm='$runnm'
+sched_yield='$sched_yield'
scriptdir='$scriptdir'
scriptdirexp='$scriptdirexp'
sed='$sed'
ext/DynaLoader/dl_next.xs Next implementation
ext/DynaLoader/dl_none.xs Stub implementation
ext/DynaLoader/dl_vms.xs VMS implementation
+ext/DynaLoader/dl_vmesa.xs VM/ESA implementation
ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files
ext/Errno/ChangeLog Errno perl module change log
ext/Errno/Errno_pm.PL Errno perl module create script
rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
rm -f perl.exp ext.libs
-rm -f perl.export perl.dll perl.libexp perl.map perl.def
+ -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
rm -f perl suidperl miniperl $(LIBPERL)
# Do not 'make _tidy' directly.
#define BIN "$bin" /**/
#define BIN_EXP "$binexp" /**/
-/* CPPSTDIN:
- * This symbol contains the first part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. Typical value of "cc -E" or "/lib/cpp", but it can also
- * call a wrapper. See CPPRUN.
- */
-/* CPPMINUS:
- * This symbol contains the second part of the string which will invoke
- * the C preprocessor on the standard input and produce to standard
- * output. This symbol will have the value "-" if CPPSTDIN needs a minus
- * to specify standard input, otherwise the value is "".
- */
-#define CPPSTDIN "$cppstdin"
-#define CPPMINUS "$cppminus"
-
/* HAS_ALARM:
* This symbol, if defined, indicates that the alarm routine is
* available.
#include "Bletch: How does this C preprocessor catenate tokens?"
#endif
+/* CPPSTDIN:
+ * This symbol contains the first part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. Typical value of "cc -E" or "/lib/cpp", but it can also
+ * call a wrapper. See CPPRUN.
+ */
+/* CPPMINUS:
+ * This symbol contains the second part of the string which will invoke
+ * the C preprocessor on the standard input and produce to standard
+ * output. This symbol will have the value "-" if CPPSTDIN needs a minus
+ * to specify standard input, otherwise the value is "".
+ */
+#define CPPSTDIN "$cppstdin"
+#define CPPMINUS "$cppminus"
+
/* HAS_ACCESS:
* This manifest constant lets the C program know that the access()
* system call is available to check for accessibility using real UID/GID.
*/
#define ARCHNAME "$archname" /**/
-/* HAS_PTHREAD_YIELD:
- * This symbol, if defined, indicates that the pthread_yield
- * routine is available to yield the execution of the current
- * thread.
- */
-/* HAS_SCHED_YIELD:
- * This symbol, if defined, indicates that the sched_yield
- * routine is available to yield the execution of the current
- * thread.
+/* SCHED_YIELD:
+ * This symbol defines the way to yield the execution of
+ * the current thread. Known ways are sched_yield,
+ * pthread_yield, and pthread_yield with NULL.
*/
-#$d_pthread_yield HAS_PTHREAD_YIELD /**/
-#$d_sched_yield HAS_SCHED_YIELD /**/
+#define SCHED_YIELD $sched_yield /**/
/* PTHREADS_CREATED_JOINABLE:
* This symbol, if defined, indicates that pthreads are created
*/
#$d_pthreads_created_joinable PTHREADS_CREATED_JOINABLE /**/
+/* PTHREAD_SETDETACHSTATE_POINTER:
+ * This symbol, if defined, indicates that the second argument of
+ * pthread_attr_setdetachstate is a pointer to an int, as opposed
+ * to an int.
+ */
+#$pthread_setdetachstate_pointer PTHREAD_SETDETACHSTATE_POINTER /**/
+
/* MULTIPLICITY:
* This symbol, if defined, indicates that Perl should
* be built to use multiplicity.
--- /dev/null
+/* dl_vmesa.xs
+ *
+ * Platform: VM/ESA, possibly others which use dllload etc.
+ * Author: Neale Ferguson (neale@mailbox.tabnsw.com.au)
+ * Created: 23rd Septemer, 1998
+ *
+ *
+ */
+
+/* Porting notes:
+
+
+ Definition of VM/ESA dynamic Linking functions
+ ==============================================
+ In order to make this implementation easier to understand here is a
+ quick definition of the VM/ESA Dynamic Linking functions which are
+ used here.
+
+ dlopen
+ ------
+ void *
+ dlopen(const char *path)
+
+ This function takes the name of a dynamic object file and returns
+ a descriptor which can be used by dlsym later. It returns NULL on
+ error.
+
+
+ dllsym
+ ------
+ void *
+ dlsym(void *handle, char *symbol)
+
+ Takes the handle returned from dlopen and the name of a symbol to
+ get the address of. If the symbol was found a pointer is
+ returned. It returns NULL on error.
+
+ dlerror
+ -------
+ char * dlerror()
+
+ Returns a null-terminated string which describes the last error
+ that occurred with the other dll functions. After each call to
+ dlerror the error message will be reset to a null pointer. The
+ SaveError function is used to save the error as soo as it happens.
+
+
+ Return Types
+ ============
+ In this implementation the two functions, dl_load_file &
+ dl_find_symbol, return void *. This is because the underlying SunOS
+ dynamic linker calls also return void *. This is not necessarily
+ the case for all architectures. For example, some implementation
+ will want to return a char * for dl_load_file.
+
+ If void * is not appropriate for your architecture, you will have to
+ change the void * to whatever you require. If you are not certain of
+ how Perl handles C data types, I suggest you start by consulting
+ Dean Roerich's Perl 5 API document. Also, have a look in the typemap
+ file (in the ext directory) for a fairly comprehensive list of types
+ that are already supported. If you are completely stuck, I suggest you
+ post a message to perl5-porters, comp.lang.perl.misc or if you are really
+ desperate to me.
+
+ Remember when you are making any changes that the return value from
+ dl_load_file is used as a parameter in the dl_find_symbol
+ function. Also the return value from find_symbol is used as a parameter
+ to install_xsub.
+
+
+ Dealing with Error Messages
+ ============================
+ In order to make the handling of dynamic linking errors as generic as
+ possible you should store any error messages associated with your
+ implementation with the StoreError function.
+
+ In the case of VM/ESA the function dlerror returns the error message
+ associated with the last dynamic link error. As the VM/ESA dynamic
+ linker functions return NULL on error every call to a VM/ESA dynamic
+ dynamic link routine is coded like this
+
+ RETVAL = dlopen(filename) ;
+ if (RETVAL == NULL)
+ SaveError("%s",dlerror()) ;
+
+ Note that SaveError() takes a printf format string. Use a "%s" as
+ the first parameter if the error may contain and % characters.
+
+*/
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include <dll.h>
+
+
+#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:
+ if (flags & 0x01)
+ warn("Can't make loaded symbols global on this platform while loading %s",filename);
+ DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "dl_load_file(%s,%x):\n", filename,flags));
+ RETVAL = dlopen(filename) ;
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), " libref=%lx\n", (unsigned long) RETVAL));
+ ST(0) = sv_newmortal() ;
+ if (RETVAL == NULL)
+ SaveError("%s",dlerror()) ;
+ else
+ sv_setiv( ST(0), (IV)RETVAL);
+
+
+void *
+dl_find_symbol(libhandle, symbolname)
+ void * libhandle
+ char * symbolname
+ CODE:
+ DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ "dl_find_symbol(handle=%lx, symbol=%s)\n",
+ (unsigned long) libhandle, symbolname));
+ RETVAL = dlsym(libhandle, symbolname);
+ DLDEBUG(2, PerlIO_printf(PerlIO_stderr(),
+ " symbolref = %lx\n", (unsigned long) RETVAL));
+ ST(0) = sv_newmortal() ;
+ if (RETVAL == NULL)
+ SaveError("%s",dlerror()) ;
+ 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.
static int attr_inited = 0;
sigset_t fullmask, oldmask;
#endif
-
+#ifdef PTHREAD_SETDETACHSTATE_ARG2_POINTER
+ static int attr_joinable = ATTR_JOINABLE;
+#endif
+
savethread = thr;
thr = new_struct_thread(thr);
SPAGAIN;
#ifdef OLD_PTHREADS_API
#ifdef VMS
/* This is available with the old pthreads API, but only with */
-/* DecThreads (VMS and Digital Unix) */
+/* DecThreads (VMS and Digital Unix (which has and uses the new one)) */
if (err == 0)
err = pthread_attr_setdetach_np(&attr, ATTR_JOINABLE);
#endif
-#else
+#else /* !defined(VMS) */
+#ifdef ATTR_JOINABLE
if (err == 0)
err = pthread_attr_setdetachstate(&attr, ATTR_JOINABLE);
-#endif
+#else /* !defined(ATTR_JOINABLE) */
+#ifdef __UNDETACHED
+ if (err == 0)
+ err = pthread_attr_setdetachstate(&attr, &__undetached);
+#else /* !defined(__UNDETACHED) */
+ croak("panic: can't pthread_attr_setdetachstate");
+#endif /* __UNDETACHED */
+#endif /* ATTR_JOINABLE */
+#endif /* VMS */
+#endif /* OLD_PTHREADS_API */
}
if (err == 0)
#ifdef OLD_PTHREADS_API
CvSTASH(GvCV(gv)) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(GvCV(gv)) = 0;
- if (!CvMUTEXP(GvCV(gv)))
+ if (!CvMUTEXP(GvCV(gv))) {
New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
- MUTEX_INIT(CvMUTEXP(GvCV(gv)));
+ MUTEX_INIT(CvMUTEXP(GvCV(gv)));
+ }
#endif /* USE_THREADS */
if (proto) {
sv_setpv((SV*)GvCV(gv), proto);
selecttype='int *'
fi
-# Under 10.X, a threaded perl can be built, but it needs
-# libcma and OLD_PTHREADS_API. Also <pthread.h> needs to
-# be #included before any other includes (in perl.h)
-if [ "$xxOsRevMajor" -eq 10 -a "X$usethreads" = "X$define" ]; then
- # HP-UX 10.X uses the old pthreads API
- case "$d_oldpthreads" in
- '') d_oldpthreads="$define" ;;
- esac
- # include libcma before all the others
- libswanted="cma $libswanted"
- # tell perl.h to include <pthread.h> before other include files
- ccflags="$ccflags -DPTHREAD_H_FIRST"
- # CMA redefines select to cma_select, and cma_select expects int *
- # instead of fd_set * (just like 9.X)
- selecttype='int *'
-fi
-
# Remove bad libraries that will cause problems
# (This doesn't remove libraries that don't actually exist)
# -lld is unneeded (and I can't figure out what it's used for anyway)
exit 1
fi
ccflags="$ccflags +DD64 -D_FILE_OFFSET_BITS=64"
+ ldflags="$ldflags +DD64"
+ ld=/usr/bin/ld
+ set `echo " $libswanted " | sed -e 's@ dl @ @'`
+ libswanted="$*"
+ glibpth="/lib/pa20_64"
fi
cat << 'EOM' >&2
You will see a *** WHOA THERE!!! *** message from Configure for
-d_open64. Keep the recommended value. See hints/irix6_2.sh
+d_open64. Keep the recommended value. See hints/irix6.sh
for more information.
EOM
# No version of Linux supports setuid scripts.
d_suidsafe='undef'
+# Debian and Red Hat, and perhaps other vendors, provide both runtime and
+# development packages for some libraries. The runtime packages contain shared
+# libraries with version information in their names (e.g., libgdbm.so.1.7.3);
+# the development packages supplement this with versionless shared libraries
+# (e.g., libgdbm.so).
+#
+# If you want to link against such a library, you must install the development
+# version of the package.
+#
+# These packages use a -dev naming convention in both Debian and Red Hat:
+# libgdbmg1 (non-development version of GNU libc 2-linked GDBM library)
+# libgdbmg1-dev (development version of GNU libc 2-linked GDBM library)
+# So make sure that for any libraries you wish to link Perl with under
+# Debian or Red Hat you have the -dev packages installed.
+#
+# Some operating systems (e.g., Solaris 2.6) will link to a versioned shared
+# library implicitly. For example, on Solaris, `ld foo.o -lgdbm' will find an
+# appropriate version of libgdbm, if one is available; Linux, however, doesn't
+# do the implicit mapping.
+ignore_versioned_solibs='y'
+
# perl goes into the /usr tree. See the Filesystem Standard
# available via anonymous FTP at tsx-11.mit.edu in
# /pub/linux/docs/linux-standards/fsstnd.
esac
archobjs=ebcdic.o
+
+# We have our own cppstdin.
+echo 'cat >.$$.c; '"$cc"' -E -Wc,NOLOC ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
CvSTASH(cv) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(cv) = 0;
- if (!CvMUTEXP(cv))
+ if (!CvMUTEXP(cv)) {
New(666, CvMUTEXP(cv), 1, perl_mutex);
- MUTEX_INIT(CvMUTEXP(cv));
+ MUTEX_INIT(CvMUTEXP(cv));
+ }
#endif /* USE_THREADS */
if (ps)
#ifdef WIN32
# include <win32thread.h>
#else
-
-#ifndef DJGPP
-/* POSIXish threads */
-#ifdef OLD_PTHREADS_API
-# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
-# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
-# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
-# define YIELD pthread_yield()
-# define DETACH(t) \
+# if defined(OLD_PTHREADS_API) && !defined(DJGPP)
+ /* POSIXish threads */
+# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
+# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
+# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
+# define DETACH(t) \
STMT_START { \
if (pthread_detach(&(t)->self)) { \
MUTEX_UNLOCK(&(t)->mutex); \
croak("panic: DETACH"); \
} \
} STMT_END
-#else
-# define pthread_mutexattr_default NULL
-# define pthread_condattr_default NULL
-#endif /* OLD_PTHREADS_API */
+# else
+# define pthread_mutexattr_default NULL
+# define pthread_condattr_default NULL
+# endif /* OLD_PTHREADS_API */
#endif
+
+#ifndef YIELD
+# define YIELD SCHED_YIELD
#endif
-#ifdef PTHREADS_CREATED_JOINABLE
+#ifdef PTHREAD_CREATE_JOINABLE
# define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
#else
# ifdef PTHREAD_CREATE_UNDETACHED
# define ATTR_JOINABLE PTHREAD_CREATE_UNDETACHED
# else
-# define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
-# endif
-#endif
-
-#ifndef YIELD
-# ifdef HAS_SCHED_YIELD
-# define YIELD sched_yield()
-# else
-# ifdef HAS_PTHREAD_YIELD
-# define YIELD pthread_yield()
+# ifdef __UNDETACHED
+# define ATTR_JOINABLE __UNDETACHED
# endif
# endif
#endif
plextract = find2perl s2p
plexe = find2perl.exe s2p.exe
plc = find2perl.c s2p.c
+plm = a2p.loadmap
addedbyconf = $(shextract) $(plextract)
$(CCCMD) $(LARGE) a2p.c
clean:
- rm -f a2p *$(OBJ_EXT) $(plexe) $(plc)
+ rm -f a2p *$(OBJ_EXT) $(plexe) $(plc) $(plm)
realclean: clean
rm -f *.orig core $(addedbyconf) all malloc.c