Commit 5ab42a44 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(VALGRIND_FD): New constant, set to 21. Added a comment that refers

	to PROTECTED_FDS in unix.exp.
(site.exp): Set lyskomd_host to whatever 127.0.0.1 resolves to,
	or 127.0.0.1 if it cannot be looked up at all.  Set
	valgrind_fd to the constant defined in VALGRIND_FD.
(valgrind.wrap): Use VALGRIND_FD, instead of hardcoding the value
	in two places.  Changed the valgrind file descriptor to 21,
	which is currently the highest reserved file descriptor.
parent a8aa4192
# $Id: Makefile.am,v 1.58 2003/08/05 10:03:54 ceder Exp $
# $Id: Makefile.am,v 1.59 2003/08/07 19:38:09 ceder Exp $
# Copyright (C) 1998-2002 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -30,6 +30,9 @@ check_PROGRAMS = test-l2g bignum testfd test-select test-sigjmp \
noinst_DATA = site.exp .gdbinit valgrind.wrap
## The proper value of this depends on PROTECTED_FDS. See config/unix.exp.
VALGRIND_FD = 21
EXTRA_DIST = .cvsignore \
l2g.0/00.exp l2g.0/01.exp l2g.0/02.exp l2g.0/03.exp \
l2g.0/04.exp l2g.0/05.exp l2g.0/06.exp l2g.0/07.exp \
......@@ -149,24 +152,30 @@ check-test-sigjmp: test-sigjmp
sleep 6|./test-sigjmp --no-sa-restart
site.exp: Makefile
echo "# this file is automatically generated" > site.exp
echo "set l2g ./test-l2g" >> site.exp
echo "set top_srcdir $(top_srcdir)" >> site.exp
$(RM) $@ $@.tmp
echo "# this file is automatically generated by Makefile.am" > $@.tmp
echo "set l2g ./test-l2g" >> $@.tmp
echo "set top_srcdir $(top_srcdir)" >> $@.tmp
if [ "$(VALGRIND)" ] ; \
then \
echo "set valgrind \"$(VALGRIND)\"" >> site.exp ; \
echo "set valgrind \"$(VALGRIND)\"" >> $@.tmp ; \
else \
echo "set valgrind \"\"" >> site.exp ; \
echo "set valgrind \"\"" >> $@.tmp ; \
fi
(../../libraries/adns/client/adnshost -i 127.0.0.1 2>/dev/null \
|| echo 1.0.0.127.in-addr.arpa PTR 127.0.0.1) \
| sed -e 's/.*PTR /set lyskomd_host "/' -e 's/$$/"/' -e q >> $@.tmp
echo set valgrind_fd $(VALGRIND_FD) >> $@.tmp
chmod 444 $@.tmp
mv $@.tmp $@
valgrind.wrap: Makefile
$(RM) $@ $@.tmp
echo "#!/bin/sh" > $@.tmp
echo "# This file is generated by Makefile. Do not edit." >> $@.tmp
## If you change the "25", you also have to change config/unix.exp.
echo 'exec 25>$$1' >> $@.tmp
echo "# This file is generated by Makefile.am. Do not edit." >> $@.tmp
echo 'exec $(VALGRIND_FD)>$$1' >> $@.tmp
echo 'shift' >> $@.tmp
echo 'echo $(VALGRIND) "$$@" >&25' >> $@.tmp
echo 'echo $(VALGRIND) "$$@" >&$(VALGRIND_FD)' >> $@.tmp
echo 'exec $(VALGRIND) "$$@"' >> $@.tmp
chmod 555 $@.tmp
mv $@.tmp $@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment