quvi_api.c: Rename func params to match nd description
[quvi.git] / autogen.sh
blobb8a610a9109b75f7f02669c91fb73dac0c0c8f87
1 #!/bin/sh
2 # autogen.sh for quvi.
4 source=.gitignore
5 cachedir=autom4te.cache
7 gen_cmdline()
9 echo "Generate cmdline..."
10 gengetopt < src/quvi/cmdline.ggo \
11 -C --unamed-opts=URL --output-dir src/quvi --no-version
14 gen_manual()
16 echo "Generate manual..."
17 M4=m4/version.m4 ; MAN=doc/man1/quvi.1 ; POD=$MAN.pod
18 VER=`perl -n -e'/(\d+)\.(\d+)\.(\d+)/ && print "$1.$2.$3"' < $M4` \
19 && pod2man -c "quvi manual" -n quvi -s 1 -r $VER $POD $MAN
20 return $?
23 cleanup()
25 echo "WARNING!
26 Removes _files_ listed in $source and $cachedir directory.
27 Last chance to bail out (^C) before we continue."
28 read n1
29 for file in `cat $source`; do # Remove files only.
30 [ -e "$file" ] && [ -f "$file" ] && rm -f "$file"
31 done
32 [ -e "$cachedir" ] && rm -rf "$cachedir"
33 exit 0
36 help()
38 echo "Usage: $0 [-c|-h]
39 -h Show this help and exit
40 -c Make the source tree 'maintainer clean'
41 Run without options to (re)generate the configuration files."
42 exit 0
45 clean_flag=off
46 while [ $# -gt 0 ]
48 case "$1" in
49 -c) cleanup;;
50 -h) help;;
51 *) break;;
52 esac
53 shift
54 done
56 echo "Generate configuration files..."
57 autoreconf -if \
58 && gen_cmdline \
59 && gen_manual \
60 && echo "You can now run 'configure'"