# archive site. Check with Archie if you don't know where that can be.)
#
-# $Id: Head.U,v 3.0.1.6 1994/10/29 15:54:19 ram Exp $
+# $Id: Head.U,v 3.0.1.7 1995/03/21 08:46:15 ram Exp $
#
-# Generated on Fri Mar 10 09:48:55 EST 1995 [metaconfig 3.0 PL51]
+# Generated on Thu Apr 6 11:09:32 EDT 1995 [metaconfig 3.0 PL53]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
-paths=$paths:'/usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin'
-paths=$paths:'/sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb'
-paths=$paths:'/bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin'
-paths=$paths:'/etc /usr/lib /usr/ucblib /lib /usr/ccs/lib'
-paths=$paths:'/sbin /usr/sbin /usr/libexec'
+paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
+paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
+paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
+paths="$paths /sbin /usr/sbin /usr/libexec"
for p in $paths
do
d_attribut=''
d_bcmp=''
d_bcopy=''
-d_byacc=''
d_bzero=''
d_casti32=''
castflags=''
d_dlsymun=''
d_dosuid=''
d_suidsafe=''
-d_drem=''
d_dup2=''
d_fchmod=''
d_fchown=''
d_fgetpos=''
d_flexfnam=''
d_flock=''
-d_fmod=''
d_fork=''
d_fsetpos=''
d_Gconvert=''
ccdlflags=''
d_shrplib=''
dlsrc=''
+ld=''
lddlflags=''
shrpdir=''
usedl=''
al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
al="$al xenix z8000"
-gccversion=''
groupstype=''
i_whoami=''
: change the next line if compiling for Xenix/286 on Xenix/386
esac
shift
;;
- -V) echo "$me generated by metaconfig 3.0 PL51." >&2
+ -V) echo "$me generated by metaconfig 3.0 PL53." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
newmyuname="$myuname"
dflt=n
-if test "$fastread" = yes; then
- dflt=y
-elif test -f ../config.sh; then
+if test -f ../config.sh; then
if $contains myuname= ../config.sh >/dev/null 2>&1; then
eval "`grep myuname= ../config.sh`"
fi
hint=default
cd ..
if test -f config.sh; then
- echo " "
- rp="I see a config.sh file. Shall I use it to set the defaults?"
+ $cat <<EOM
+
+I see a config.sh file. Was it built on THIS system with THIS compiler?
+EOM
+ rp="Shall I use config.sh to set the defaults?"
. UU/myread
case "$ans" in
n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
$grep fprintf libc.tmp > libc.ptf
xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
-if com="$sed -n -e 's/__IO//' -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
+if com="$sed -n -e 's/__IO//' -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
eval $xscan;\
$contains '^fprintf$' libc.list >/dev/null 2>&1; then
eval $xrun
eval $xrun
else
nm -p $* 2>/dev/null >libc.tmp
- com="$sed -n -e 's/^.* [ADTSI] *_[_.]*//p' -e 's/^.* [ADTSI] //p'";\
+ com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
eval "<libc.tmp $com >libc.list"
if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
nm_opt='-p'
eval $setvar
$rm -f set set.c
-: Check if we really have byacc
-case "$byacc" in
-''|'byacc') val="$undef" ;;
-*) val="$define" ;;
-esac
-set d_byacc
-eval $setvar
-
: see if bzero exists
set bzero d_bzero
eval $inlibc
$cat >try.c <<EOCP
#include <sys/types.h>
#include <signal.h>
-$signal_t blech() { exit(3); }
+$signal_t blech() { exit(7); }
+$signal_t blech_in_list() { exit(4); }
+unsigned long dummy_long(p) unsigned long p; { return p; }
+unsigned int dummy_int(p) unsigned int p; { return p; }
+unsigned short dummy_short(p) unsigned short p; { return p; }
main()
{
- double f = -123;
+ double f = -123.;
unsigned long along;
unsigned int aint;
unsigned short ashort;
along = (unsigned long)f;
if (along != 0x80000001)
result |= 2;
+ if (result)
+ exit(result);
+ signal(SIGFPE, blech_in_list);
+ f = 123.;
+ along = dummy_long((unsigned long)f);
+ aint = dummy_int((unsigned int)f);
+ ashort = dummy_short((unsigned short)f);
+ if (along != (unsigned long)123)
+ result |= 4;
+ if (aint != (unsigned int)123)
+ result |= 4;
+ if (ashort != (unsigned short)123)
+ result |= 4;
exit(result);
}
castflags=$?
else
echo "(I can't seem to compile the test program--assuming it can't)"
- castflags=3
+ castflags=7
fi
case "$castflags" in
0) val="$define"
usedl="$define"
: emulate basename
dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
+
$cat << EOM
Some systems may require passing special flags to $cc -c to
EOM
case "$cccdlflags" in
- ''|' ') case "$cc" in
- *gcc*) dflt='-fpic' ;;
- *) case "$osname" in
+ '') case "$gccversion" in
+ '') case "$osname" in
hpux) dflt='+z' ;;
next) dflt='none' ;;
solaris) dflt='-K pic' ;;
svr4*|esix*) dflt='-Kpic' ;;
*) dflt='none' ;;
esac ;;
+ *) dflt='-fpic' ;;
esac ;;
- *) dflt="$cccdlflags" ;;
+ *) dflt="$cccdlflags" ;;
esac
rp="Any special flags to pass to $cc -c to compile shared library modules?"
. ./myread
*) cccdlflags="$ans" ;;
esac
- cat << 'EOM'
+ cat << EOM
+
+Some systems use ld to create libraries that can be dynamically loaded,
+while other systems (such as those using ELF) use $cc.
+
+EOM
+ case "$ld" in
+ '') $cat >try.c <<'EOM'
+/* Test for whether ELF binaries are produced */
+#include <fcntl.h>
+#include <stdlib.h>
+main() {
+ char b[4];
+ int i = open("a.out",O_RDONLY);
+ if(i == -1)
+ exit(1); /* fail */
+ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
+ exit(0); /* succeed (yes, it's ELF) */
+ else
+ exit(1); /* fail */
+}
+EOM
+ if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
+ cat <<EOM
+You appear to have ELF support. I'll use $cc to build dynamic libraries.
+EOM
+ dflt="$cc"
+ else
+ echo "I'll use ld to build dynamic libraries."
+ dflt='ld'
+ fi
+ rm -f try.c a.out
+ ;;
+ *) dflt=ld
+ ;;
+ esac
+
+ rp="What comnmand should be used to create dynamic libraries?"
+ . ./myread
+ ld="$ans"
+
+ cat << EOM
-Some systems may require passing special flags to ld to create a
+Some systems may require passing special flags to $ld to create a
library that can be dynamically loaded. If your ld flags include
-L/other/path options to locate libraries outside your loader's normal
search path, you may need to specify those -L options here as well. To
case "$lddlflags" in
''|' ') case "$osname" in
hpux) dflt='-b' ;;
+ linux) dflt='-shared' ;;
next) dflt='none' ;;
solaris) dflt='-G' ;;
sunos) dflt='-assert nodefinitions' ;;
;;
*) dflt="$lddlflags" ;;
esac
- rp="Any special flags to pass to ld to create a dynamically loaded library?"
+ rp="Any special flags to pass to $ld to create a dynamically loaded library?"
. ./myread
case "$ans" in
none) lddlflags='' ;;
EOM
case "$ccdlflags" in
''|' ') case "$osname" in
- hpux) dflt='none' ;;
+ hpux) dflt='-Wl,-E' ;;
+ linux) dflt='-rdynamic' ;;
next) dflt='none' ;;
sunos) dflt='none' ;;
*) dflt='none' ;;
esac
;;
*) usedl="$undef"
+ ld='ld'
dlsrc='dl_none.xs'
lddlflags=''
ccdlflags=''
}
EOM
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
- ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
+ $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 &&
$cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
set d_dosuid
eval $setvar
-: see if drem exists
-set drem d_drem
-eval $inlibc
-
: see if dup2 exists
set dup2 d_dup2
eval $inlibc
set flock d_flock
eval $inlibc
-: see if fmod exists
-set fmod d_fmod
-eval $inlibc
-
: see if fork exists
set fork d_fork
eval $inlibc
for (align = 7; align >= 0; align--) {
for (len = 36; len; len--) {
b = buf+align;
- memcpy(abc, b, len);
+ memcpy(b, abc, len);
for (off = 1; off <= len; off++) {
- memcpy(b, b+off, len);
memcpy(b+off, b, len);
+ memcpy(b, b+off, len);
if (memcmp(b, abc, len))
exit(1);
}
. ./myread
case "$ans" in
y*) hostcat='nidump hosts .';;
- *) ;;
+ *) case "$hostcat" in
+ nidump*) hostcat='';;
+ esac
+ ;;
esac
fi
case "$hostcat" in
define)
: Check the return type needed for hash
echo "Checking return type needed for hash for Berkeley DB ..." >&4
- cat >try.c <<'EOCP'
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
#include <db.h>
u_int32_t
echo "I can't seem to compile the test program." >&4
db_hashtype=int
fi
- $rm -f try.[co]
+ $rm -f try.*
echo "Your version of Berkeley DB uses $db_hashtype for hash."
;;
*) db_hashtype=int
echo "I can't seem to compile the test program." >&4
db_prefixtype='int'
fi
- $rm -f try.[co]
+ $rm -f try.*
echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
;;
*) db_prefixtype='int'
d_bcopy='$d_bcopy'
d_bsd='$d_bsd'
d_bsdpgrp='$d_bsdpgrp'
-d_byacc='$d_byacc'
d_bzero='$d_bzero'
d_casti32='$d_casti32'
d_castneg='$d_castneg'
d_dlopen='$d_dlopen'
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
-d_drem='$d_drem'
d_dup2='$d_dup2'
d_eunice='$d_eunice'
d_fchmod='$d_fchmod'
d_fgetpos='$d_fgetpos'
d_flexfnam='$d_flexfnam'
d_flock='$d_flock'
-d_fmod='$d_fmod'
d_fork='$d_fork'
d_fpathconf='$d_fpathconf'
d_fsetpos='$d_fsetpos'
known_extensions='$known_extensions'
ksh='$ksh'
large='$large'
+ld='$ld'
lddlflags='$lddlflags'
ldflags='$ldflags'
less='$less'
# I now supply perly.c with the kits, so don't remake perly.c without byacc
BYACC = $byacc
CC = $cc
+LD = $ld
bin = $installbin
scriptdir = $scriptdir
privlib = $installprivlib
case "$d_shrplib" in
*define*)
$spitshell >>Makefile <<'!NO!SUBS!'
- ld $(LDDLFLAGS) -o $@ perl.o $(obj)
+ $(LD) $(LDDLFLAGS) -o $@ perl.o $(obj)
!NO!SUBS!
;;
*)
# to run with precisely the same version of byacc as I use. You
# normally shouldn't remake perly.[ch].
-run_byacc:
+run_byacc: FORCE
@ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
$(BYACC) -d perly.y
sh $(shellflags) ./perly.fixer y.tab.c perly.c
# appear out-of-date after a patch is applied or a new distribution is
# made.
perly.c: perly.y
- - touch perly.c
+ -@touch perly.c
perly.h: perly.y
- - touch perly.h
+ -@touch perly.h
# Extensions:
# Names added to $(dynamic_ext) or $(static_ext) will automatically
rm -f config.h makefile makefile.old
rm -f $(private)
rm -rf lib/auto
+ rm -f lib/.exists
rm -f h2ph h2ph.man c2ph pstruct h2xs makeaperl
rm -rf .config
@echo "Note that make realclean does not delete config.sh"
Configure supports a number of useful options. Run Configure -h
to get a listing. To compile with gcc, for example, you can run
- Configure -Dcc=gcc, or answer 'gcc' at the cc prompt. If you
- change compilers or make other significant changes, you should
- probably _not_ re-use your old config.sh.
+ Configure -Dcc=gcc, or answer 'gcc' at the cc prompt. This is the
+ preferred way to invoke an alternate compiler, since the hints
+ files can then set appropriate defaults.
+
+ If you change compilers or make other significant changes, you should
+ probably _not_ re-use your old config.sh. Simply remove it or
+ rename it, e.g. mv config.sh config.sh.old.
By default, perl will be installed in /usr/local/{bin, lib, man}.
You can specify a different prefix for the default installation
If you get varags problems with gcc, be sure that gcc is installed
correctly. When using gcc, you should probably have i_stdarg='define'
and i_varags='undef' in config.sh.
+ If you wish to use dynamic loading on SunOS or Solaris, and you
+ have GNU as and GNU ld installed, you may need to add -B/bin/ to
+ your $ccflags and $ldflags so that the system's versions of as
+ and ld are used.
5) make test
s2p sed-to-perl translator
find2perl find-to-perl translator
h2xs Converts C .h header files to Perl extensions.
+ pod2html, Converters from perl's pod documentation format
+ pod2latex, and to other useful formats.
+ pod2man
library files in $privlib and $archlib specified to
Configure, usually under /usr/local/lib/perl5/.
* $Id: Config_h.U,v 3.0.1.3 1995/01/30 14:25:39 ram Exp $
*/
-/* Configuration time: Mon Feb 27 17:21:15 EST 1995
+/* Configuration time: Wed Apr 5 14:50:33 EDT 1995
* Configured by: andy
* Target system: crystal crystal 3.2 2 i386
*/
* 0 = ok
* 1 = couldn't cast < 0
* 2 = couldn't cast >= 0x80000000
+ * 4 = couldn't cast in argument expression list
*/
/*#define CASTNEGFLOAT /**/
-#define CASTFLAGS 3 /**/
+#define CASTFLAGS 7 /**/
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
/*#define DOSUID /**/
-/* HAS_DREM:
- * This symbol, if defined, indicates that the drem routine is
- * available. This routine is roughly the same as fmod, i.e. it
- * computes the remainder r=x-n*y, where n=rint(x/y), whereas fmod
- * uses n=trunc(x/y).
- */
-/*#define HAS_DREM /**/
-
/* HAS_DUP2:
* This symbol, if defined, indicates that the dup2 routine is
* available to duplicate file descriptors.
*/
/*#define HAS_FLOCK /**/
-/* HAS_FMOD:
- * This symbol, if defined, indicates that the fmod routine is
- * available to compute the remainder r=x-n*y where n=trunc(x/y).
- */
-#define HAS_FMOD /**/
-
/* HAS_FORK:
* This symbol, if defined, indicates that the fork routine is
* available.
* probably use memmove() or memcpy(). If neither is defined, roll your
* own version.
*/
-#define HAS_SAFE_MEMCPY /**/
+/*#define HAS_SAFE_MEMCPY /**/
/* HAS_SELECT:
* This symbol, if defined, indicates that the select routine is
#define Groups_t gid_t /* Type for 2nd arg to getgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
/* I_DIRENT:
* This symbol, if defined, indicates to the C program that it should
* include <dirent.h>. Using this symbol also triggers the definition
*/
/*#define I_MEMORY /**/
+/* I_NDBM:
+ * This symbol, if defined, indicates that ndbm.h exists and should
+ * be included.
+ */
+#define I_NDBM /**/
+
/* I_NET_ERRNO:
* This symbol, if defined, indicates that <net/errno.h> exists and
* should be included.
*/
/*#define USE_DYNAMIC_LOADING /**/
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
- */
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
- */
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
-
-/* I_NDBM:
- * This symbol, if defined, indicates that ndbm.h exists and should
- * be included.
- */
-#define I_NDBM /**/
-
/* I_SYS_STAT:
* This symbol, if defined, indicates to the C program that it should
* include <sys/stat.h>.
* 0 = ok
* 1 = couldn't cast < 0
* 2 = couldn't cast >= 0x80000000
+ * 4 = couldn't cast in argument expression list
*/
#$d_castneg CASTNEGFLOAT /**/
#define CASTFLAGS $castflags /**/
#$d_suidsafe SETUID_SCRIPTS_ARE_SECURE_NOW /**/
#$d_dosuid DOSUID /**/
-/* HAS_DREM:
- * This symbol, if defined, indicates that the drem routine is
- * available. This routine is roughly the same as fmod, i.e. it
- * computes the remainder r=x-n*y, where n=rint(x/y), whereas fmod
- * uses n=trunc(x/y).
- */
-#$d_drem HAS_DREM /**/
-
/* HAS_DUP2:
* This symbol, if defined, indicates that the dup2 routine is
* available to duplicate file descriptors.
*/
#$d_flock HAS_FLOCK /**/
-/* HAS_FMOD:
- * This symbol, if defined, indicates that the fmod routine is
- * available to compute the remainder r=x-n*y where n=trunc(x/y).
- */
-#$d_fmod HAS_FMOD /**/
-
/* HAS_FORK:
* This symbol, if defined, indicates that the fork routine is
* available.
#define Groups_t $groupstype /* Type for 2nd arg to getgroups() */
#endif
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t $db_hashtype /**/
+#define DB_Prefix_t $db_prefixtype /**/
+
/* I_DIRENT:
* This symbol, if defined, indicates to the C program that it should
* include <dirent.h>. Using this symbol also triggers the definition
*/
#$i_memory I_MEMORY /**/
+/* I_NDBM:
+ * This symbol, if defined, indicates that ndbm.h exists and should
+ * be included.
+ */
+#$i_ndbm I_NDBM /**/
+
/* I_NET_ERRNO:
* This symbol, if defined, indicates that <net/errno.h> exists and
* should be included.
*/
#$usedl USE_DYNAMIC_LOADING /**/
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
- */
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
- */
-#define DB_Hash_t $db_hashtype /**/
-#define DB_Prefix_t $db_prefixtype /**/
-
-/* I_NDBM:
- * This symbol, if defined, indicates that ndbm.h exists and should
- * be included.
- */
-#$i_ndbm I_NDBM /**/
-
/* I_SYS_STAT:
* This symbol, if defined, indicates to the C program that it should
* include <sys/stat.h>.
#include <sys/file.h>
#endif
+#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
+# include <sys/socket.h>
+# include <netdb.h>
+# ifndef ENOTSOCK
+# ifdef I_NET_ERRNO
+# include <net/errno.h>
+# endif
+# endif
+#endif
+
bool
do_open(gv,name,len,supplied_fp)
GV *gv;
#else
goto not_there;
#endif
- if (strEQ(name, "SETFL"))
-#ifdef SETFL
- return SETFL;
+ if (strEQ(name, "F_SETFL"))
+#ifdef F_SETFL
+ return F_SETFL;
#else
goto not_there;
#endif
#define Nullfp Null(FILE*)
#define Nullsv Null(SV*)
-/* bool is built-in for g++-2.6.3, which might be used for an extension. */
-#if !defined(HAS_BOOL) && !defined(_G_HAVE_BOOL)
+/* bool is built-in for g++-2.6.3, which might be used for an extension.
+ gcc-2.6.2 under Linux defines _G_HAVE_BOOL to 0, and does not
+ define bool. */
+#if !defined(HAS_BOOL) && !(_G_HAVE_BOOL)
#ifdef UTS
#define bool int
#else
#define bool char
#endif
-#endif /* !defined(HAS_BOOL) && !defined(_G_HAVE_BOOL) */
+#endif /* !defined(HAS_BOOL) && !(_G_HAVE_BOOL) */
#ifdef TRUE
#undef TRUE
+# If this doesn't work, try specifying 'none' for hints.
d_castneg=undef
libswanted=`echo $libswanted | sed -e 's/socket /socket seq /'`
;;
esac
libswanted='m dld'
-# ldflags="-Wl,-E -Wl,-a,shared" # Force all shared?
-ldflags="-Wl,-E"
+# ccdlflags="-Wl,-E -Wl,-a,shared $ccdlflags" # Force all shared?
+ccdlflags="-Wl,-E $ccdlflags"
usemymalloc='y'
alignbytes=8
selecttype='int *'
# Original version by rsanders
# Additional support by Kenneth Albanowski <kjahds@kjahds.com>
#
-# First pass at ELF support by Andy Dougherty <doughera@lafcol.lafayette.edu>
-# Fri Feb 3 14:05:00 EST 1995
-# Use sh Configure -Dcc=gcc-elf to try using gcc-elf. It might work.
+# ELF support by H.J. Lu <hjl@nynexst.com>
+# Additional info from Nigel Head <nhead@ESOC.bitnet>
+# and Kenneth Albanowski <kjahds@kjahds.com>
#
-# Last updated Mon Mar 6 10:18:10 EST 1995
+# Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
#
+# Last updated Thu Apr 6 12:22:03 EDT 1995
+#
+
+# 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.
+# This used to be
+# bin='/usr/bin'
+# but it doesn't seem sensible to put the binary in /usr and all the
+# rest of the support stuff (lib, man pages) into /usr/local.
+# However, allow a command line override, e.g. Configure -Dprefix=/foo/bar
+case "$prefix" in
+'') prefix='/usr' ;;
+esac
-# Why is this needed?
-bin='/usr/bin'
+# Perl expects BSD style signal handling.
+ccflags="-D__USE_BSD_SIGNAL $ccflags"
-# Apparently some versions of gcc 2.6.2 are picking up _G_HAVE_BOOL
-# from somewhere (_G_config.h maybe?) but not actually defining bool.
-# Anyone really know what's going on?
-ccflags='-Dbool=char -DHAS_BOOL'
+# The following functions are gcc built-ins, but the Configure test
+# may fail because it doesn't supply a proper prototype.
+d_memcmp=define
+d_memcpy=define
+
+# Configure may fail to find lstat() since it's a static/inline
+# function in <sys/stat.h>.
+d_lstat=define
d_dosuid='define'
'') optimize='-O2' ;;
esac
-case "$cc" in
-*cc-elf*)
+# Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
+# for this test.
+cat >try.c <<'EOM'
+/* Test for whether ELF binaries are produced */
+#include <fcntl.h>
+#include <stdlib.h>
+main() {
+ char buffer[4];
+ int i=open("a.out",O_RDONLY);
+ if(i==-1)
+ exit(1); /* fail */
+ if(read(i,&buffer[0],4)<4)
+ exit(1); /* fail */
+ if(buffer[0] != 127 || buffer[1] != 'E' ||
+ buffer[2] != 'L' || buffer[3] != 'F')
+ exit(1); /* fail */
+ exit(0); /* succeed (yes, it's ELF) */
+}
+EOM
+if gcc try.c >/dev/null 2>&1 && ./a.out; then
+ cat <<'EOM'
+
+You appear to have ELF support. I'll try to use it for dynamic loading.
+EOM
+ # Be careful not to overwrite lddlflags, since the user might
+ # have specified some -L/path options on the Configure command line.
+ lddlflags="-shared $lddlflags"
+ ccdlflags='-rdynamic'
so='so'
dlext='so'
- # Configure might not understand nm output for ELF.
- usenm=false
- ;;
-*)
- lddlflags='-r'
+ ld=gcc
+else
+ echo "You don't have an ELF gcc, using dld if available."
+ # We might possibly have a version of DLD around.
+ lddlflags="-r $lddlflags"
so='sa'
dlext='o'
## If you are using DLD 3.2.4 which does not support shared libs,
## uncomment the next two lines:
#ldflags="-static"
#so='none'
- ;;
-esac
+fi
+rm -rf try.c a.out
-cat <<EOM
+cat <<'EOM'
You should take a look at hints/linux.sh. There are a some lines you
-may wish to change near the bottom.
+may wish to change.
EOM
+
+# And -- reported by one user:
+# We need to get -lc away from the link lines.
+# If we leave it there we get SEGV from miniperl during the build.
+# This may have to do with bugs in the pre-release version of libc for ELF.
+# Uncomment the next two lines to remove -lc from the link line.
+# set `echo " $libswanted " | sed -e 's@ c @ @'`
+# libswanted="$*"
# hints/netbsd.sh
+# netbsd keeps dynamic loading dl*() functions in /lib/crt0.o,
+# so Configure doesn't find them (unless you abandon the nm scan).
case "$osvers" in
-0.9|0.8)
+0.9*|0.8*)
usedl="$undef"
;;
-*) d_dlopen="$define"
- cccdlflags='-DPIC -fpic'
- lddlflags='-Bforcearchive -Bshareable'
+*) d_dlopen=$define
+ d_dlerror=$define
+ cccdlflags="-DPIC -fpic $cccdlflags"
+ lddlflags="-Bforcearchive -Bshareable $lddlflags"
;;
esac
+
+# Avoid telldir prototype conflict in pp_sys.c (NetBSD uses const DIR *)
+# Configure should test for this. Volunteers?
+pp_sys_cflags='ccflags="$ccflags -DHAS_TELLDIR_PROTOTYPE"'
# Created by: JT McDuffie (jt@kpc.com) 26 DEC 1991
# p5ed by: Jarkko Hietaniemi <jhi@hut.fi> Aug 27 1994
# NOTE: You should run Configure with tcsh (yes, tcsh).
+# Comments by Andy Dougherty <doughera@lafcol.lafayette.edu> 28 Mar 1995
alignbytes="8"
byteorder="4321"
castflags='0'
models='none'
ccflags="$ccflags -I/usr/include/net -DDEBUGGING -DSTANDARD_C"
cppflags="$cppflags -I/usr/include/net -DDEBUGGING -DSTANDARD_C"
-libs='-lnsl -ldbm -lPW -lmalloc -lm'
stdchar='unsigned char'
-static_ext='DynaLoader NDBM_File Socket'
+#
+# Apparently there are some harmful libs in Configure's $libswanted.
+# Perl5.000 had: libs='-lnsl -ldbm -lPW -lmalloc -lm'
+# Unfortunately, this line prevents users from including things like
+# -lgdbm and -ldb, which they may or may not have or want.
+# We should probably fiddle with libswanted instead of libs.
+# And even there, we should only bother to delete harmful libraries.
+# However, I don't know what they are or why they should be deleted,
+# so this will have to do for now. --AD 28 Mar 1995
+libswanted='nsl dbm gdbm db PW malloc m'
+#
+# Extensions: This system can not compile POSIX. We'll let Configure
+# figure out the others. Certainly Fcntl, Socket, and at least one *DB*
+# extension should be included.
+# perl5.000 had: static_ext='DynaLoader NDBM_File Socket'
+useposix='n'
+#
uidtype='ushort'
voidflags='7'
inclwanted='/usr/include /usr/include/net'
umask 022;
-@scripts = ('cppstdin', 'c2ph', 'h2xs', 'pstruct', 'x2p/s2p', 'x2p/find2perl');
+@scripts = ('cppstdin', 'c2ph', 'h2xs', 'pstruct', 'x2p/s2p', 'x2p/find2perl',
+ 'pod/pod2man', 'pod/pod2html', 'pod/pod2latex' );
@manpages = (<pod/*.man>, 'x2p/a2p.man', 'x2p/s2p.man');
# Read in the config file.
package ExtUtils::MakeMaker;
-$Version = 4.086; # Last edited 9 Mar 1995 by Andy Dougherty
+$Version = 4.091; # Last edited 31 Mar 1995 by Andreas Koenig
use Config;
check_hints();
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(&WriteMakefile &mkbootstrap &mksymlists $Verbose);
+@EXPORT = qw(&WriteMakefile $Verbose);
@EXPORT_OK = qw($Version %att %skip %Recognized_Att_Keys
@MM_Sections %MM_Sections
- &help &lsdir &neatvalue);
+ &help &lsdir &neatvalue &mkbootstrap &mksymlists);
$Is_VMS = $Config{'osname'} eq 'VMS';
require ExtUtils::MM_VMS if $Is_VMS;
$Verbose = 0;
$^W=1;
-
=head1 NAME
ExtUtils::MakeMaker - create an extension Makefile
perl Makefile.PL INST_LIB=~/myperllib INST_EXE=~/bin
Note, that in this example MakeMaker does the tilde expansion for you
-and INST_ARCHLIB is set to either C<INST_LIB/$Config{"osname"}> if
+and INST_ARCHLIB is set to either C<INST_LIB/$Config{"archname"}> if
that directory exists and otherwise to INST_LIB.
Other interesting targets in the generated Makefile are
H: Ref to array of *.h file names. Similar to C: above.
+ PL_FILES: Ref to hash of files to be processed as perl programs. MakeMaker
+ will default to any found C<*.PL> file (except C<Makefile.PL>) being
+ keys and the basename of the file being the value. E.g.
+ C<{ 'foobar.PL' => 'foobar' }>. The C<*.PL> files are expected to
+ produce output to the target files themselves.
+
EXE_FILES: Ref to array of executable files. The files will be copied to
the INST_EXE directory. The installed files will be deleted
by a make realclean.
'tool_xsubpp' => {},
'tools_other' => {},
'post_constants' => {},
+ 'pasthru' => {},
'c_o' => {},
'xs_c' => {},
'xs_o' => {},
'static' => {},
'static_lib' => {},
'installpm' => {},
+ 'processPL' => {},
'installbin' => {},
'subdirs' => {},
'clean' => {},
parse_args(\%att, @ARGV);
my(%initial_att) = %att; # record initial attributes
+ my($key);
MY->init_main();
# build hash for SKIP to make testing easy
%skip = map( ($_,1), @{$att{'SKIP'} || []});
+ my $section;
foreach $section ( @MM_Sections ){
print "Processing Makefile '$section' section" if ($Verbose >= 2);
my($skipit) = skipcheck($section);
return "{ ".join(', ',@m)." }";
}
-
# ------ Define the MakeMaker default methods in package MM_Unix ------
package MM_Unix;
# --- Initialize PERL_LIB, INST_LIB, PERL_SRC
# *Real* information: where did we get these two from? ...
- $inc_config_dir = dirname($INC{'Config.pm'});
- $inc_carp_dir = dirname($INC{'Carp.pm'});
+ my $inc_config_dir = dirname($INC{'Config.pm'});
+ my $inc_carp_dir = dirname($INC{'Carp.pm'});
# Typically PERL_* and INST_* will be identical but that need
# not be the case (e.g., installing into project libraries etc).
unless ($att{PERL_SRC}){
foreach(qw(../.. ../../.. ../../../..)){
- ($att{PERL_SRC}=$_, last) if -f "$_/config.sh";
+ if ( -f "$_/config.sh" && -f "$_/perl.h" && -f "$_/lib/Exporter.pm") {
+ $att{PERL_SRC}=$_ ;
+ last;
+ }
}
}
unless ($att{PERL_SRC}){
$att{PERL_LIB} = "$att{PERL_SRC}/lib" unless $att{PERL_LIB};
$att{PERL_ARCHLIB} = $att{PERL_LIB};
$att{PERL_INC} = $att{PERL_SRC};
+ # catch an situation that has occurred a few times in the past:
+ warn <<EOM unless -s "$att{PERL_SRC}/cflags";
+You cannot build extensions below the perl source tree after executing
+a 'make clean' in the perl source tree.
+
+To rebuild extensions distributed with the perl source you should
+simply Configure (to include those extensions) and then build perl as
+normal. After installing perl the source tree can be deleted. It is not
+needed for building extensions.
+
+It is recommended that you unpack and build additional extensions away
+from the perl source tree.
+EOM
}
# INST_LIB typically pre-set if building an extension after
if (defined $att{PERL_SRC}) {
$att{INST_LIB} = $att{PERL_LIB};
} else {
- $att{INST_LIB} = "$pwd/blib";
+ $att{INST_LIB} = "./blib";
}
}
# Try to work out what INST_ARCHLIB should be if not set:
unless ($att{INST_ARCHLIB}){
my(%archmap) = (
- "$pwd/blib" => "$pwd/blib", # our private build lib
+ "./blib" => "./blib", # our private build lib
$att{PERL_LIB} => $att{PERL_ARCHLIB},
$Config{'privlib'} => $Config{'archlib'},
$Config{'installprivlib'} => $Config{'installarchlib'},
sub init_dirscan { # --- File and Directory Lists (.xs .pm etc)
- my($name, %dir, %xs, %c, %h, %ignore);
+ my($name, %dir, %xs, %c, %h, %ignore, %pl_files);
local(%pm); #the sub in find() has to see this hash
$ignore{'test.pl'} = 1;
$ignore{'makefile.pl'} = 1 if $Is_VMS;
$h{$name} = 1;
} elsif ($name =~ /\.p[ml]$/){
$pm{$name} = "\$(INST_LIBDIR)/$name";
+ } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
+ ($pl_files{$name} = $name) =~ s/\.PL$// ;
}
}
my($sufx) = $Is_VMS ? '.obj' : '.o';
$att{O_FILES} = [grep s/\.c$/$sufx/, @o_files] ;
$att{H} = [sort keys %h] unless $att{H};
+ $att{PL_FILES} = \%pl_files unless $att{PL_FILES};
}
}
sub init_others { # --- Initialize Other Attributes
-
+ my($key);
for $key (keys(%Recognized_Att_Keys), keys(%Other_Att_Keys)){
# avoid warnings for uninitialized vars
next if exists $att{$key};
join('',@m);
}
+$Const_cccmd=0; # package global
sub const_cccmd{
my($self,$libperl)=@_;
# e.g., do both and compare results during the transition period.
my($cc,$ccflags,$optimize,$large,$split, $shflags)
= @Config{qw(cc ccflags optimize large split shellflags)};
+ my($optdebug)="";
+
$shflags = '' unless $shflags;
my($prog, $old, $uc, $perltype);
- chop($old = `cd $att{PERL_SRC}; sh $shflags ./cflags $libperl $att{BASEEXT}.c 2>/dev/null`)
- if $att{PERL_SRC};
+ unless ($Const_cccmd++){
+ chop($old = `cd $att{PERL_SRC}; sh $shflags ./cflags $libperl $att{BASEEXT}.c`)
+ if $att{PERL_SRC};
+ $Const_cccmd++; # shut up typo warning
+ }
my(%map) = (
D => '-DDEBUGGING',
echo large=\$large
echo split=\$split
`;
- my(%cflags);
+ my(%cflags,$line);
foreach $line (@o){
chomp $line;
if ($line =~ /(.*?)=\s*(.*)\s*$/){
"";
}
+sub pasthru {
+ my(@m,@pasthru,$key);
+ # It has to be considered carefully, which variables are apt to be passed through, e.g. PERL_SRC
+ # is not suited for subdirectories, as it might be relativ to the parent directory.
+ # Probably we need a PASTHRU2 variable. PASTHRU1 is a conservative approach, that hardly changes
+ # MakeMaker between version 4.086 and 4.09.
+ push @m, "\nPASTHRU1 = ";
+ foreach $key (qw(INST_ARCHLIB INST_EXE INST_LIB LIBPERL_A LINKTYPE)){
+ push @pasthru, "$key=\"\$($key)\"";
+ }
+ push @m, join "\\\n\t", @pasthru;
+ join "", @m;
+}
# --- Translation Sections ---
all :: config linkext $(INST_PM)
'.$att{NOOP}.'
-config :: '.$att{MAKEFILE}.'
- @ $(MKPATH) $(INST_LIBDIR) $(INST_ARCHAUTODIR)
+config :: '.$att{MAKEFILE}.' $(INST_LIBDIR)/.exists $(INST_ARCHAUTODIR)/.exists
';
+ push @m, MM->dir_target('$(INST_LIBDIR)', '$(INST_ARCHAUTODIR)');
+
push @m, '
$(O_FILES): $(H_FILES)
' if @{$att{O_FILES} || []} && @{$att{H} || []};
push(@m,"
$att{BASEEXT}.exp: Makefile.PL
-",' $(PERL) $(I_PERL_LIBS) -e \'use ExtUtils::MakeMaker; \\
- mksymlists(DL_FUNCS => ',
+",' $(PERL) $(I_PERL_LIBS) -e \'use ExtUtils::MakeMaker qw(&mksymlists); \\
+ &mksymlists(DL_FUNCS => ',
%$funcs ? neatvalue($funcs) : '""',', DL_VARS => ',
@$vars ? neatvalue($vars) : '""', ", NAME => \"$att{NAME}\")'
");
$(BOOTSTRAP): '."$att{MAKEFILE} $att{BOOTDEP}".'
@ echo "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))"
@ $(PERL) $(I_PERL_LIBS) \
- -e \'use ExtUtils::MakeMaker; &mkbootstrap("$(BSLOADLIBS)");\' \
+ -e \'use ExtUtils::MakeMaker qw(&mkbootstrap); &mkbootstrap("$(BSLOADLIBS)");\' \
INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) PERL_SRC=$(PERL_SRC) NAME=$(NAME)
@ $(TOUCH) $(BOOTSTRAP)
ARMAYBE = '.$armaybe.'
OTHERLDFLAGS = '.$otherldflags.'
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP)
- @ $(MKPATH) $(INST_ARCHAUTODIR)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
');
if ($armaybe ne ':'){
$ldfrom = "tmp.a";
$ldfrom = "-all $ldfrom -none" if ($osname eq 'dec_osf');
push(@m,' $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS)'."\n");
+
+ push @m, MM->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
sub static_lib{
my(@m);
push(@m, <<'END');
-$(INST_STATIC): $(OBJECT) $(MYEXTLIB)
- @ $(MKPATH) $(INST_ARCHAUTODIR)
+$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
END
# If this extension has it's own library (eg SDBM_File)
# then copy that to $(INST_STATIC) and add $(OBJECT) into it.
push(@m, <<'END') if $att{PERL_SRC};
@ echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs
END
+ push @m, MM->dir_target('$(INST_ARCHAUTODIR)');
join('', "\n",@m);
}
my($instdir) = $inst =~ m|(.*)/|;
my(@m);
push(@m,"
-$inst: $dist Makefile
+$inst: $dist Makefile $instdir/.exists
".' @ '.$att{RM_F}.' $@
- @ $(MKPATH) '.$instdir.'
'."$att{CP} $dist".' $@
');
push(@m, "\t\@\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
if ($splitlib and $inst =~ m/\.pm$/);
+
+ push @m, MM->dir_target($instdir);
join('', @m);
}
+sub processPL {
+ return "" unless $att{PL_FILES};
+ my(@m, $plfile);
+ foreach $plfile (sort keys %{$att{PL_FILES}}) {
+ push @m, "
+all :: $att{PL_FILES}->{$plfile}
+
+$att{PL_FILES}->{$plfile} :: $plfile
+ \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
+";
+ }
+ join "", @m;
+}
+
sub installbin {
return "" unless $att{EXE_FILES} && ref $att{EXE_FILES} eq "ARRAY";
my(@m, $from, $to, %fromto, @to);
# MY::subdir_x() method to override this one.
qq{
config :: $subdir/$att{MAKEFILE}
- cd $subdir ; \$(MAKE) config INST_LIB=\$(INST_LIB) INST_ARCHLIB=\$(INST_ARCHLIB) \\
- INST_EXE=\$(INST_EXE) LINKTYPE=\$(LINKTYPE) LIBPERL_A=\$(LIBPERL_A) \$(SUBDIR_MAKEFILE_PL_ARGS)
+ cd $subdir && \$(MAKE) config \$(PASTHRU1) \$(SUBDIR_MAKEFILE_PL_ARGS)
$subdir/$att{MAKEFILE}: $subdir/Makefile.PL \$(CONFIGDEP)
}.' @echo "Rebuilding $@ ..."
$(PERL) $(I_PERL_LIBS) \\
-e "use ExtUtils::MakeMaker; MM->runsubdirpl(qw('.$subdir.'))" \\
- INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) \\
- INST_EXE=$(INST_EXE) LINKTYPE=\$(LINKTYPE) LIBPERL_A=$(LIBPERL_A) $(SUBDIR_MAKEFILE_PL_ARGS)
+ $(PASTHRU1) $(SUBDIR_MAKEFILE_PL_ARGS)
@echo "Rebuild of $@ complete."
'.qq{
subdirs ::
- cd $subdir ; \$(MAKE) all LINKTYPE=\$(LINKTYPE)
+ cd $subdir && \$(MAKE) all \$(PASTHRU1)
};
}
realclean purge :: clean
');
# realclean subdirectories first (already cleaned)
- $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
+ my $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
foreach(@{$att{DIR}}){
push(@m, sprintf($sub,$_,"$att{MAKEFILE}.old","-f $att{MAKEFILE}.old"));
push(@m, sprintf($sub,$_,"$att{MAKEFILE}",''));
distclean: clean
$preop
$att{RM_F} $mkfiles
- cd ..; tar $tarflags $tarname.tar \$(BASEEXT)
- cd ..; $compress $tarname.tar
+ cd .. && tar $tarflags $tarname.tar \$(BASEEXT)
+ cd .. && $compress $tarname.tar
$postop
";
}
push(@m, <<'END') if -f "test.pl";
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) test.pl
END
- push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test LINKTYPE=\$(LINKTYPE)\n",
+ push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
@{$att{DIR}}));
push(@m, "\t\@echo 'No tests defined for \$(NAME) extension.'\n") unless @m > 1;
join("", @m);
push @m, q{
doc_install ::
@ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \\
- -e 'use ExtUtils::MakeMaker; MM->writedoc("Module", "$(NAME)", \\
- "LINKTYPE=$(LINKTYPE)", "VERSION=$(VERSION)", "EXE_FILES=$(EXE_FILES)")'
+ -e "use ExtUtils::MakeMaker; MM->writedoc('Module', '$(NAME)', \\
+ 'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', 'EXE_FILES=$(EXE_FILES)')"
};
push(@m, "
$(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
@echo "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
- cd $(PERL_SRC); $(MAKE) lib/Config.pm
+ cd $(PERL_SRC) && $(MAKE) lib/Config.pm
') if $att{PERL_SRC};
push(@m, join(" ", values %{$att{XS}})." : \$(XSUBPPDEPS)\n")
@echo "Cleaning current config before rebuilding Makefile..."
-@mv '."$att{MAKEFILE} $att{MAKEFILE}.old".'
-$(MAKE) -f '.$att{MAKEFILE}.'.old clean >/dev/null 2>&1 || true
- $(PERL) $(I_PERL_LIBS) Makefile.PL
+ $(PERL) $(I_PERL_LIBS) Makefile.PL '."@ARGV".'
@echo "Now you must rerun make."; false
';
}
-
sub postamble{
"";
}
+# --- Make-Directories section (internal method) ---
+# dir_target(@array) returns a Makefile entry for the file .exists in each
+# named directory. Returns nothing, if the entry has already been processed.
+# We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
+# Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
+# prerequisite, because there has to be one, something that doesn't change
+# too often :)
+%Dir_Target = (); # package global
+
+sub dir_target {
+ my($self,@dirs)=@_;
+ my(@m,$dir);
+ foreach $dir (@dirs) {
+ next if $Dir_Target{$dir};
+ push @m, "
+$dir/.exists :: \$(PERL)
+ \@ \$(MKPATH) $dir
+ \@ \$(TOUCH) $dir/.exists
+";
+ $Dir_Target{$dir}++;
+ }
+ join "", @m;
+}
+
# --- Make-A-Perl section ---
sub staticmake {
File::Find::find(sub {
return unless m/\.a$/;
return if m/^libperl/;
+ # don't include the installed version of this extension
+ return if $File::Find::name =~ m:auto/$att{FULLEXT}/$att{BASEEXT}.a$:;
$static{fastcwd() . "/" . $_}++;
}, grep( -d $_, @{$searchdirs || []}) );
MAP_EXTRA = @{$extra}
MAP_PRELIBS = $Config{'libs'} $Config{'cryptlib'}
";
- if ($libperl) {
- unless (-f $libperl || -f ($libperl = "$Config{'installarchlib'}/CORE/$libperl")){
- print STDOUT "Warning: $libperl not found";
- undef $libperl;
- }
- }
- unless ($libperl) {
- if (defined $att{PERL_SRC}) {
- $libperl = "$att{PERL_SRC}/libperl.a";
- } elsif ( -f ( $libperl = "$Config{'installarchlib'}/CORE/libperl.a" )) {
- } else {
- print STDOUT "Warning: $libperl not found";
- }
+
+ unless ($libperl && -f $libperl) {
+ my $dir = (defined $att{PERL_SRC}) ? $att{PERL_SRC}
+ : "$Config{'installarchlib'}/CORE";
+ $libperl = "libperl.a" unless $libperl;
+ $libperl = "$dir/$libperl";
+ print STDOUT "Warning: $libperl not found"
+ unless (-f $libperl || defined($att{PERL_SRC}));
}
push @m, "
# We write MAP_EXTRA outside the perl program to have it eval'd by the shell
push @m, q{
doc_inst_perl:
- @ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary", \\
- "$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)", \\
- "MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- $(MAP_EXTRA)
+ @ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary",' \\
+ -e '"$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)",' \\
+ -e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- $(MAP_EXTRA)
};
push @m, qq{
sub mksymlists {
my($self) = shift;
+ my($pkg);
# only AIX requires a symbol list at this point
# (so does VMS, but that's handled by the MM_VMS package)
print EXP join("\n",@{$att{DL_VARS}}) if $att{DL_VARS};
foreach $pkg (keys %{$att{DL_FUNCS}}) {
(my($prefix) = $pkg) =~ s/\W/_/g;
+ my $func;
foreach $func (@{$att{DL_FUNCS}->{$pkg}}) {
$func = "XS_${prefix}_$func" unless $func =~ /^boot_/;
print EXP "$func\n";
close POD;
}
+
=head1 AUTHORS
Andy Dougherty F<E<lt>doughera@lafcol.lafayette.eduE<gt>>, Andreas
v4.04 Februeary 5th 1995 By Andreas Koenig
v4.05 February 8th 1995 By Andreas Koenig
v4.06 February 10th 1995 By Andreas Koenig
-
-Cleaning up the new interface. Suggestion to freeze now until 5.001.
-
v4.061 February 12th 1995 By Andreas Koenig
-
-Fixes of some my() declarations and of @extra computing in makeaperl().
-
v4.08 - 4.085 February 14th-21st 1995 by Andreas Koenig
Introduces EXE_FILES and INST_EXE for installing executable scripts
Fixed some AIX buglets. Fixed DLD support for Linux with gcc 2.6.2.
+v4.09 March 31 1995 by Andreas Koenig
+
+Patches from Tim (/usr/local/lib/perl5/hpux/CORE/libperl.a not found
+message eliminated, and a small makeaperl patch).
+
+blib now is a relative directory (./blib).
+
+Documentation bug fixed.
+
+Chdir in the Makefile always followed by "&&", not by ";".
+
+The output of cflags is no longer directed to /dev/null, but the shell
+version of cflags is now only called once.
+
+The result of MakeMaker's cflags takes precedence over
+shell-cflags.
+
+Introduced a $(PASTHRU) variable, that doesn't have much effect yet,
+but now it's easier to add variables that have to be passed to
+recursive makes.
+
+'make config' will now always reapply the original arguments to the
+'perl Makefile.PL'.
+
+MKPATH will be called only once for any directory (should speed up Tk
+building and installation considerably).
+
+"Subroutine mkbootstrap redefined" message eliminated. It was
+necessary to move &mkbootstrap and &mksymlists from @EXPORT to
+@EXPORT_OK.
+
+C<*.PL> files will be processed by C<$(PERL)>.
+
+Turned some globals into my() variables, where it was obvious to be an
+oversight.
+
+Changed some continuation lines so that they work on Solaris and Unicos.
+
+v4.091 April 3 1995 by Andy Dougherty
+
+Another attempt to fix writedoc() from Dean Roehrich.
+
=head1 NOTES
MakeMaker development work still to be done:
uname='$myuname'
hint=$hint
Compiler:
- cc='$cc', optimize='$optimize'
+ cc='$cc', optimize='$optimize', ld='$ld'
cppflags='$cppflags'
ccflags ='$ccflags'
ldflags ='$ldflags'
#if defined(DOSISH)
# define PERLLIB_SEP ';'
-#elif defined(VMS)
-# define PERLLIB_SEP '|'
#else
+# if defined(VMS)
+# define PERLLIB_SEP '|'
+# else
# define PERLLIB_SEP ':'
+# endif
#endif
static void
#define U_L(what) ((U32)(what))
#else
U32 cast_ulong _((double));
-#define U_S(what) ((U16)cast_ulong(what))
-#define U_I(what) ((unsigned int)cast_ulong(what))
-#define U_L(what) (cast_ulong(what))
+#define U_S(what) ((U16)cast_ulong((double)(what)))
+#define U_I(what) ((unsigned int)cast_ulong((double)(what)))
+#define U_L(what) (cast_ulong((double)(what)))
#endif
#ifdef CASTI32
#define I_V(what) ((IV)(what))
#else
I32 cast_i32 _((double));
-#define I_32(what) (cast_i32(what))
+#define I_32(what) (cast_i32((double)(what)))
IV cast_iv _((double));
-#define I_V(what) (cast_iv(what))
+#define I_V(what) (cast_iv((double)(what)))
#endif
struct Outrec {
extern "C" {
# endif
double exp _((double));
- double fmod _((double,double));
double log _((double));
double sqrt _((double));
double modf _((double,double*));
# endif
#endif
-#ifndef HAS_FMOD
-# ifdef HAS_DREM
-# define fmod(x,y) drem((x),(y))
-# else
-# define USE_MY_FMOD
-# define fmod(x,y) my_fmod(x,y)
-# endif
-#endif
-
#ifndef __cplusplus
char *crypt _((const char*, const char*));
char *getenv _((const char*));
char* my_bzero _((char* loc, I32 len));
#endif
void my_exit _((U32 status)) __attribute__((noreturn));
-#ifdef USE_MY_FMOD
-double my_fmod _((double x, double y));
-#endif
I32 my_lstat _((void));
#ifndef HAS_MEMCMP
I32 my_memcmp _((unsigned char* s1, unsigned char* s2, I32 len));
};
struct cv {
- XPVGV* sv_any; /* pointer to something */
+ XPVCV* sv_any; /* pointer to something */
U32 sv_refcnt; /* how many references to us */
U32 sv_flags; /* what we are */
};
cast_i32(f)
double f;
{
-# define BIGDOUBLE 2147483648.0 /* Assume 32 bit int's ! */
+# define BIGDOUBLE 2147483647.0 /* Assume 32 bit int's ! */
# define BIGNEGDOUBLE (-2147483648.0)
if (f >= BIGDOUBLE)
- return (I32)fmod(f, BIGDOUBLE);
+ return (I32) BIGDOUBLE;
if (f <= BIGNEGDOUBLE)
- return (I32)fmod(f, BIGNEGDOUBLE);
+ return (I32) BIGNEGDOUBLE;
return (I32) f;
}
# undef BIGDOUBLE
double f;
{
/* XXX This should be fixed. It assumes 32 bit IV's. */
-# define BIGDOUBLE 2147483648.0 /* Assume 32 bit IV's ! */
+# define BIGDOUBLE 2147483647.0 /* Assume 32 bit IV's ! */
# define BIGNEGDOUBLE (-2147483648.0)
if (f >= BIGDOUBLE)
- return (IV)fmod(f, BIGDOUBLE);
+ return (IV) BIGDOUBLE;
if (f <= BIGNEGDOUBLE)
- return (IV)fmod(f, BIGNEGDOUBLE);
+ return (IV) BIGNEGDOUBLE;
return (IV) f;
}
# undef BIGDOUBLE
*retlen = s - start;
return retval;
}
-
-/* Amazingly enough, some systems (e.g. Dynix 3) don't have fmod.
- This is a slow, stupid, but working emulation. (AD)
-*/
-#ifdef USE_MY_FMOD
-double
-my_fmod(x, y)
-double x, y;
-{
- double i = 0.0; /* Can't use int because it can overflow */
- if ((x == 0) || (y == 0))
- return 0;
- /* The sign of fmod is the same as the sign of x. */
- if ( (x < 0 && y > 0) || (x > 0 && y < 0) )
- y = -y;
- if (x > 0) {
- while (x - i*y > y)
- i++;
- } else {
- while (x - i*y < y)
- i++;
- }
- return x - i * y;
-}
-#endif
#undef SETUID_SCRIPTS_ARE_SECURE_NOW /**/
#undef DOSUID /**/
-/* HAS_DREM:
- * This symbol, if defined, indicates that the drem routine is
- * available. This is a Pyramid routine that is the same as
- * fmod.
- */
-#undef HAS_DREM /**/
-
-/* HAS_FMOD:
- * This symbol, if defined, indicates that the fmod routine is
- * available.
- */
-#define HAS_FMOD /**/
-
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
* number to a string without a trailing decimal point. This
# used only if you force byacc to run by saying
# make run_byacc
-run_byacc:
+run_byacc: FORCE
@ echo Expect many shift/reduce and reduce/reduce conflicts
$(BYACC) a2p.y
mv y.tab.c a2p.c
# We don't want to regenerate a2p.c, but it might appear out-of-date
# after a patch is applied or a new distribution is made.
a2p.c: a2p.y
- - touch a2p.c
+ -@touch a2p.c
a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
$(CCCMD) $(LARGE) a2p.c