5ad69a2724375d696038fbb29bc27b8967ea7a45
[runtime.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 # create help files
19 echo "Creating help files..."
20 perl syntax.pl
21
22 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'`
23 cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am
24
25 files=`echo $files|sed 's/\.in//g'`
26 cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/Makefile.am
27
28 # .html -> .txt with lynx
29 echo "Documentation: html -> txt..."
30 lynx -dump -nolist docs/startup-HOWTO.html > docs/startup-HOWTO.txt
31
32 echo "Checking auto* tools..."
33
34 # *********** a bit modified GNOME's macros/autogen.sh **********
35 DIE=0
36
37 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
38   echo
39   echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
40   echo "Download the appropriate package for your distribution,"
41   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
42   DIE=1
43 }
44
45 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
46   (libtool --version) < /dev/null > /dev/null 2>&1 || {
47     echo
48     echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
49     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
50     echo "(or a newer version if it is available)"
51     DIE=1
52   }
53 }
54
55 (automake --version) < /dev/null > /dev/null 2>&1 || {
56   echo
57   echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
58   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
59   echo "(or a newer version if it is available)"
60   DIE=1
61   NO_AUTOMAKE=yes
62 }
63
64
65 # if no automake, don't bother testing for aclocal
66 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
67   echo
68   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
69   echo "installed doesn't appear recent enough."
70   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
71   echo "(or a newer version if it is available)"
72   DIE=1
73 }
74
75 if test "$DIE" -eq 1; then
76   exit 1
77 fi
78
79 #if test -z "$*"; then
80 #  echo "**Warning**: I am going to run \`configure' with no arguments."
81 #  echo "If you wish to pass any to it, please specify them on the"
82 #  echo \`$0\'" command line."
83 #  echo
84 #fi
85
86 case $CC in
87 xlc )
88   am_opt=--include-deps;;
89 esac
90
91 rm -f aclocal.m4
92 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
93   echo "Running libtoolize..."
94   libtoolize --force --copy
95 fi
96 aclocalinclude="$ACLOCAL_FLAGS -I ."
97 echo "Running aclocal $aclocalinclude ..."
98 aclocal $aclocalinclude
99 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
100   echo "Running autoheader..."
101   autoheader
102 fi
103 echo "Running autoconf ..."
104 autoconf
105 echo "Running automake --gnu $am_opt ..."
106 automake --add-missing --gnu $am_opt
107
108 #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
109
110 #if test x$NOCONFIGURE = x; then
111 #  echo Running $srcdir/configure $conf_flags "$@" ...
112 #  $srcdir/configure $conf_flags "$@" \
113 #  && echo Now type \`make\' to compile $PKG_NAME || exit 1
114 #else
115 #  echo Skipping configure process.
116 #fi