summaryrefslogtreecommitdiff
path: root/share/mk/compare-lib-lists
blob: a809b22f27db559b801ffbf0e028f3993125ae8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
# $NetBSD: compare-lib-lists,v 1.3 2019/11/18 16:23:28 christos Exp $
#
# Q+D script to print the library lists for comparison between whats in the
# bsd.prog.mk file and bsd.README (this matches)
#
# Also compare the list of LIB variables we create against the actually
# installed archives (this does *not* match -- yet)

prog=$(basename "$0")

RD=/tmp/${prog}.rd.$$
MK=/tmp/${prog}.mk.$$
IN=/tmp/${prog}.in.$$
LB=/tmp/${prog}.lb.$$

trap "rm -f ${MK} ${RD} ${IN} ${LB}" 0 1 2 3 15

make -f - all << \EOF > ${MK}
.include <bsd.prog.mk>

all:
.for l in ${_LIBLIST}
	@echo $l
.endfor
.for l in crt0.o crti.o crti.o crtn.o
	@echo $l
.endfor
.for l in ${_X11LIBLIST}
	@echo $l
.endfor
EOF

grep '	LIB' bsd.README | \
    grep DESTDIR | \
    sed -e 's/.*lib\([a-zA-Z0-9_+\-]*\)\.a$/\1/' > ${RD}

paste ${MK} ${RD}

echo "------"

cat << \EOF | make -f - xall | sort > ${IN}
.include <bsd.prog.mk>

xall:
.for _lib in ${_LIBLIST}
	@echo ${DESTDIR}/usr/lib/lib${_lib:S/xx/++/:S/atf_c/atf-c/}.a
.endfor
.for _lib in ${_X11LIBLIST}
	@echo ${DESTDIR}${X11USRLIBDIR}/lib${_lib}.a
.endfor
EOF

ls -1 /usr/lib/*.a /usr/X11R7/lib/*.a | \
    egrep -v '(_p|_pic|_g)\.a' | sort > ${LB}

paste ${IN} ${LB}