Skip to content

Commit

Permalink
Make BINDIR and MANDIR depend on PREFIX.
Browse files Browse the repository at this point in the history
Noticed from a comment in Glaucus Linux.
  • Loading branch information
ibara committed May 9, 2020
1 parent 36850ce commit db1c369
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
28 changes: 14 additions & 14 deletions CVS/Entries
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
/main.c/1.87/Thu Jun 15 13:48:42 2017//
D/PSD.doc////
D/TEST////
/Makefile/1.16/Mon Sep 9 13:07:42 2019//
/NOTES/1.1.1.1/Mon Sep 9 13:04:12 2019//
/eval.c/1.78/Mon Sep 9 13:07:42 2019//
/expr.c/1.18/Mon Sep 9 13:04:12 2019//
/gnum4.c/1.52/Mon Sep 9 13:04:12 2019//
/look.c/1.24/Mon Sep 9 13:04:12 2019//
/m4.1/1.64/Mon Sep 9 13:04:12 2019//
/mdef.h/1.33/Mon Sep 9 13:04:12 2019//
/misc.c/1.47/Mon Sep 9 13:04:12 2019//
/parser.y/1.7/Mon Sep 9 13:04:12 2019//
/pathnames.h/1.6/Mon Sep 9 13:04:12 2019//
/stdd.h/1.6/Mon Sep 9 13:04:12 2019//
/tokenizer.l/1.10/Mon Sep 9 13:04:12 2019//
/trace.c/1.16/Mon Sep 9 13:04:12 2019//
/Makefile/1.16/Sat May 9 00:33:09 2020//
/NOTES/1.1.1.1/Sat May 9 00:33:03 2020//
/eval.c/1.78/Sat May 9 00:33:03 2020//
/expr.c/1.18/Sat May 9 00:33:03 2020//
/gnum4.c/1.52/Sat May 9 00:33:03 2020//
/look.c/1.24/Sat May 9 00:33:03 2020//
/m4.1/1.64/Sat May 9 00:33:03 2020//
/mdef.h/1.33/Sat May 9 00:33:03 2020//
/misc.c/1.47/Sat May 9 00:33:03 2020//
/parser.y/1.7/Sat May 9 00:33:03 2020//
/pathnames.h/1.6/Sat May 9 00:33:03 2020//
/stdd.h/1.6/Sat May 9 00:33:03 2020//
/tokenizer.l/1.10/Sat May 9 00:33:03 2020//
/trace.c/1.16/Sat May 9 00:33:03 2020//
4 changes: 2 additions & 2 deletions PSD.doc/CVS/Entries
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/Makefile/1.4/Mon Sep 9 13:04:12 2019//
/m4.ms/1.2/Mon Sep 9 13:04:12 2019//
/Makefile/1.4/Sat May 9 00:33:03 2020//
/m4.ms/1.2/Sat May 9 00:33:03 2020//
D
12 changes: 6 additions & 6 deletions TEST/CVS/Entries
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/ack.m4/1.3/Mon Sep 9 13:04:12 2019//
/hanoi.m4/1.3/Mon Sep 9 13:04:12 2019//
/hash.m4/1.3/Mon Sep 9 13:04:12 2019//
/sqroot.m4/1.3/Mon Sep 9 13:04:12 2019//
/string.m4/1.3/Mon Sep 9 13:04:12 2019//
/test.m4/1.3/Mon Sep 9 13:04:12 2019//
/ack.m4/1.3/Sat May 9 00:33:03 2020//
/hanoi.m4/1.3/Sat May 9 00:33:03 2020//
/hash.m4/1.3/Sat May 9 00:33:03 2020//
/sqroot.m4/1.3/Sat May 9 00:33:03 2020//
/string.m4/1.3/Sat May 9 00:33:03 2020//
/test.m4/1.3/Sat May 9 00:33:03 2020//
D
25 changes: 19 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ EOF
noreturncheck() {
cat << EOF > conftest.c
#include <stdlib.h>
__attribute__((__no_return__)) void usage(void){exit(1);}int main(void){usage();return 0;}
__attribute__((__noreturn__)) void usage(void){exit(1);}int main(void){usage();return 0;}
EOF
$cc $tflags -o conftest conftest.c > /dev/null 2>&1
if [ $? -eq 0 ] ; then
Expand Down Expand Up @@ -195,7 +195,10 @@ else
prefix="/usr/local"
fi

mandir="$prefix/man"
bindirset=0
mandirset=0
bindir="$prefix/bin"
mandir="$prefix/share/man"

instprog="om4"
static=0
Expand All @@ -206,6 +209,15 @@ do
case "$opt" in
--prefix=*)
prefix=`echo $opt | cut -d '=' -f 2`
if [ $bindirset -eq 0 ] ; then
bindir="$prefix/bin"
fi
if [ $mandirset -eq 0 ] ; then
mandir="$prefix/share/man"
fi
;;
--bindir=*)
bindir=`echo $opt | cut -d '=' -f 2`
;;
--mandir=*)
mandir=`echo $opt | cut -d '=' -f 2`
Expand Down Expand Up @@ -317,10 +329,10 @@ else
echo "yes"
else
echo "no"
printf "checking for __attribute__((__no_return__))... "
printf "checking for __attribute__((__noreturn__))... "
noreturncheck
if [ $? -eq 0 ] ; then
echo "#define __dead __attribute__((__no_return__))" >> config.h
echo "#define __dead __attribute__((__noreturn__))" >> config.h
echo "yes"
else
echo "#define __dead" >> config.h
Expand Down Expand Up @@ -390,6 +402,7 @@ fi

cat << EOF >> Makefile
PREFIX = $prefix
BINDIR = $bindir
MANDIR = $mandir
PROG = $instprog
Expand All @@ -407,9 +420,9 @@ parser.c parser.h: parser.y
tokenizer.o: parser.h
install:
install -d \${DESTDIR}\${PREFIX}/bin
install -d \${DESTDIR}\${BINDIR}
install -d \${DESTDIR}\${MANDIR}/man1
install -c -s -m 755 \${PROG} \${DESTDIR}\${PREFIX}/bin
install -c -s -m 755 \${PROG} \${DESTDIR}\${BINDIR}
install -c -m 644 m4.1 \${DESTDIR}\${MANDIR}/man1/\${PROG}.1
test:
Expand Down

0 comments on commit db1c369

Please sign in to comment.