xref: /minix/external/bsd/nvi/dist/dist/distrib (revision 84d9c625)
1#! /bin/sh
2# Id: distrib,v 8.24 2001/06/25 11:20:24 skimo Exp  (Berkeley) Date: 2001/06/25 11:20:24
3
4echo "Running libtoolize"
5libtoolize -c --force
6
7echo "Building aclocal.m4"
8rm -f aclocal.m4
9aclocal -I m4
10
11# Build autoconf structure.
12echo "Running autoheader"
13autoheader 2>&1 | sed '/warning: AC_TRY_RUN called without default/d'
14chmod 444 config.h.in
15echo "Running automake"
16automake -a -c --foreign $@
17rm -f configure
18echo "Running autoconf"
19autoconf 2>&1 | sed '/warning: AC_TRY_RUN called without default/d'
20chmod 555 configure config.guess config.sub install-sh
21
22msg="/* Do not edit: automatically built by build/distrib. */"
23# Build automatically generated header files.
24f=../ipc/ipc_def.h
25echo "Building $f"
26rm -f $f
27(echo "$msg" && \
28    awk -f ../ipc/ipc.awk ../ipc/ipc_cmd.c &&
29    awk -f ../ipc/vipc.awk ../ip/ip_read.c) > $f
30chmod 444 $f
31
32f=../ipc/ipc_gen.c
33echo "Building $f"
34rm -f $f
35(echo "$msg" && \
36    perl -n ../ip/vipc.pl ../ip/ip_read.c) > $f
37chmod 444 $f
38
39f=../ex/ex_def.h
40echo "Building $f"
41rm -f $f
42(echo "$msg" && \
43    awk -f ../ex/ex.awk ../ex/ex_cmd.c) > $f
44chmod 444 $f
45
46f=../common/options_def.h
47echo "Building $f"
48rm -f $f
49(echo "$msg" && \
50    awk -f ../common/options.awk ../common/options.c) > $f
51chmod 444 $f
52
53# Build the automatically generated function prototype files.
54for i in cl common ex gtk ip ipc motif motif_l tcl_api vi; do
55	f=../$i/extern.h
56	rm -f $f
57	echo "Building $f"
58	(echo "$msg" && \
59	    sed -n "s/^ \* PUBLIC: \(.*\)/\1/p" ../$i/*.c) > $f
60	chmod 444 $f
61done
62
63# Build the automatically generated function prototype files.
64for i in perl_api ; do
65	f=../$i/extern.h
66	rm -f $f
67	echo "Building $f"
68	(echo "$msg" && \
69	    sed -n "s/^ \* PUBLIC: \(.*\)/\1/p" ../$i/*.c ../$i/*.xs) > $f
70	chmod 444 $f
71done
72
73# Build tags files.
74echo "Building tags files"
75f=tags
76rm -f $f
77if test $USER = 'bostic'; then ctagsopt = '-d'; fi
78ctags $ctagsopt -w \
79	../cl/*.[ch] ../common/*.[ch] ../ex/*.[ch] ../gtk/*.[ch] ../ip/*.[ch] \
80	../ipc/*.[ch] ../motif/*.[ch] ../motif_l/*.[ch] ../perl_api/*.[ch] \
81	../tcl_api/*.[ch] ../vi/*.[ch]
82chmod 444 $f
83
84date=`date +%Y-%m-%d`
85echo "Building ../ex/version.h"
86echo '#define VI_VERSION "'`git-describe` '('$date')"' > ../ex/version.h
87
88touch stamp-h.in
89