updates.
[silc.git] / apps / irssi / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 echo $0
6 test -z "$srcdir" && srcdir=.
7
8 PKG_NAME="Irssi SILC"
9
10 if test ! -f $srcdir/configure.in; then
11     echo -n "**Error**: Directory \`$srcdir\' does not look like the"
12     echo " top-level $PKG_NAME directory"
13     exit 1
14 fi
15
16 # get versions
17 version_date=`date +%Y%m%d`
18
19 echo "/* automatically created by autogen.sh */" > irssi-version.h.in
20 echo "#define IRSSI_VERSION \"@VERSION@\"" >> irssi-version.h.in
21 echo "#define IRSSI_VERSION_DATE \"$version_date\"" >> irssi-version.h.in
22
23 # create help files
24 echo "Creating help files..."
25 perl syntax.pl
26
27 files=`echo docs/help/in/*.in|sed -e 's,docs/help/in/Makefile.in ,,' -e 's,docs/help/in/,!,g' -e 's/\.in /.in ?/g'`
28 cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am
29
30 files=`echo $files|sed 's/\.in//g'`
31 cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/Makefile.am
32
33 # .html -> .txt with lynx
34 echo "Documentation: html -> txt..."
35 lynx -dump -nolist docs/startup-HOWTO.html > docs/startup-HOWTO.txt
36
37 echo "Checking auto* tools..."
38
39 # *********** a bit modified GNOME's macros/autogen.sh **********
40 DIE=0
41
42 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
43   echo
44   echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
45   echo "Download the appropriate package for your distribution,"
46   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
47   DIE=1
48 }
49
50 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
51   (libtool --version) < /dev/null > /dev/null 2>&1 || {
52     echo
53     echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
54     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
55     echo "(or a newer version if it is available)"
56     DIE=1
57   }
58 }
59
60 (automake --version) < /dev/null > /dev/null 2>&1 || {
61   echo
62   echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
63   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
64   echo "(or a newer version if it is available)"
65   DIE=1
66   NO_AUTOMAKE=yes
67 }
68
69
70 # if no automake, don't bother testing for aclocal
71 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
72   echo
73   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
74   echo "installed doesn't appear recent enough."
75   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
76   echo "(or a newer version if it is available)"
77   DIE=1
78 }
79
80 if test "$DIE" -eq 1; then
81   exit 1
82 fi
83
84 case $CC in
85 xlc )
86   am_opt=--include-deps;;
87 esac
88
89 rm -f aclocal.m4
90 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
91   echo "Running libtoolize..."
92   libtoolize --copy
93 fi
94 aclocalinclude="$ACLOCAL_FLAGS"
95 echo "Running aclocal $aclocalinclude ..."
96 aclocal $aclocalinclude
97 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
98   echo "Running autoheader..."
99   autoheader
100 fi
101 echo "Running autoconf ..."
102 autoconf
103 echo "Running automake $am_opt ..."
104 automake --add-missing --foreign $am_opt