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