summaryrefslogtreecommitdiff
path: root/Makefile.SH
diff options
context:
space:
mode:
authorLarry Wall <larry@wall.org>1988-06-28 03:41:16 +0000
committerLarry Wall <larry@wall.org>1988-06-28 03:41:16 +0000
commit13281fa4f8547e0eb31d1986b865d9b7ec7d0dcc (patch)
treef506dd49e16d31e3f5d297122f9a478550d9f6d2 /Makefile.SH
parent378cc40b38293ffc7298c6a7ed3cd740ad79be52 (diff)
downloadperl-13281fa4f8547e0eb31d1986b865d9b7ec7d0dcc.tar.gz
perl 2.0 patch 1: removed redundant debugging code in regexp.c
If you used ++ on a variable that had the value '' (as opposed to being undefined) it would increment the numeric part but not invalidate the string part, which could then give false results. Berkeley recently sent out a patch that disables setuid #! scripts because of an inherent problem in the semantics as they are currently defined. If you have installed that patch, your setuid and setgid bits are useless on scripts. I've added a means for perl to examine those bits and emulate setuid/setgid scripts itself in what I believe is a secure manner. If normal perl detects such a script, it passes it off to another version of perl that runs setuid root, and can run the script under the desired uid/gid. This feature is optional, and Configure will ask if you want to do it. Some machines didn't like config.h when it said #/*undef SYMBOL. Config.h.SH now is smart enough to tuck the # inside the comment. There were several small problems in Configure: the return code from ar was hidden by a piped call to sed, so if ar failed it went undetected. The Cray uses a program called bld instead of ar. Let's hear it for compatibilty. At least one version of gnucpp adds a space after symbol interpolation, which was giving the C preprocessor detector fits. There was a call to grep '-i' that needed to have the -i protected by a backslash. Also, Configure should remove the UU subdirectory that it makes while running. "make realclean" now knows about the alternate patch extension ~. In the manual page, I fixed some quotes that were ugly in troff, and did some clarification of LIST, study, tr and unlink. regexp.c had some redundant debugging code. tr/x/y/ could dump core if y is shorter than x. I found this out when I tried translating a bunch of characters to space by saying something like y/a-z/ /.
Diffstat (limited to 'Makefile.SH')
-rw-r--r--Makefile.SH60
1 files changed, 50 insertions, 10 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 25ad1f838b..931a3af78c 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -18,11 +18,20 @@ case "$d_symlink" in
*) sln='ln';;
esac
+case "$d_dosuid" in
+*define*) suidperl='suidperl' ;;
+*) suidperl='';;
+esac
+
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
-# $Header: Makefile.SH,v 2.0 88/06/05 00:07:54 root Exp $
+# $Header: Makefile.SH,v 2.0.1.1 88/06/28 16:26:04 root Exp $
#
# $Log: Makefile.SH,v $
+# Revision 2.0.1.1 88/06/28 16:26:04 root
+# patch1: support for DOSUID
+# patch1: realclean now knows about ~ extension
+#
# Revision 2.0 88/06/05 00:07:54 root
# Baseline version 2.0.
#
@@ -42,12 +51,12 @@ mallocobj = $mallocobj
SLN = $sln
libs = $libnm -lm
-!GROK!THIS!
-cat >>Makefile <<'!NO!SUBS!'
+public = perl perldb $suidperl
-public = perl perldb
+!GROK!THIS!
+cat >>Makefile <<'!NO!SUBS!'
private =
manpages = perl.man perldb.man
@@ -67,7 +76,7 @@ c2 = perly.c regexp.c stab.c str.c toke.c util.c version.c
c = $(c1) $(c2)
obj1 = arg.o array.o cmd.o dump.o eval.o form.o hash.o $(mallocobj)
-obj2 = perly.o regexp.o stab.o str.o toke.o util.o version.o
+obj2 = regexp.o stab.o str.o toke.o util.o version.o
obj = $(obj1) $(obj2)
@@ -84,8 +93,28 @@ SHELL = /bin/sh
all: $(public) $(private) $(util)
touch all
-perl: $(obj) perl.o
- $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl
+perl: perly.o $(obj) perl.o
+ $(CC) $(LDFLAGS) $(LARGE) perly.o $(obj) perl.o $(libs) -o perl
+
+!NO!SUBS!
+
+case "$d_dosuid" in
+*define*)
+ cat >>Makefile <<'!NO!SUBS!'
+
+suidperl: sperly.o $(obj) perl.o
+ $(CC) $(LDFLAGS) $(LARGE) sperly.o $(obj) perl.o $(libs) -o suidperl
+
+sperly.o: perly.c
+ /bin/rm -f sperly.c
+ ln perly.c sperly.c
+ $(CC) -c -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
+ /bin/rm -f sperly.c
+!NO!SUBS!
+ ;;
+esac
+
+cat >>Makefile <<'!NO!SUBS!'
perl.c perly.h: perl.y
@ echo Expect 37 shift/reduce errors...
@@ -108,10 +137,21 @@ install: perl perl.man
export PATH || exit 1
- mv $(bin)/perl $(bin)/perl.old 2>/dev/null
- if test `pwd` != $(bin); then cp $(public) $(bin); fi
- cd $(bin); \
+ - cd $(bin); \
for pub in $(public); do \
chmod +x `basename $$pub`; \
done
+!NO!SUBS!
+
+case "$d_dosuid" in
+*define*)
+ cat >>Makefile <<'!NO!SUBS!'
+ - chmod 4711 $(bin)/suidperl 2>/dev/null
+!NO!SUBS!
+ ;;
+esac
+
+cat >>Makefile <<'!NO!SUBS!'
- test $(bin) = /usr/bin || rm -f /usr/bin/perl
- test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
chmod +x makedir
@@ -134,7 +174,7 @@ clean:
rm -f *.o
realclean:
- rm -f perl *.orig */*.orig *.o core $(addedbyconf)
+ rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf)
# The following lint has practically everything turned on. Unfortunately,
# you have to wade through a lot of mumbo jumbo that can't be suppressed.
@@ -163,7 +203,7 @@ shlist:
echo $(sh) | tr ' ' '\012' >.shlist
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
-$(obj):
+perly.o $(obj):
@ echo "You haven't done a "'"make depend" yet!'; exit 1
makedepend: makedepend.SH
/bin/sh makedepend.SH