2 # Run this to generate all the initial makefiles, etc.
7 test -z "$srcdir" && srcdir=.
9 if test ! -f $srcdir/irssi.cvs -a -f $srcdir/configure; then
11 echo "Use ./configure instead"
13 echo "This script should only be run if you got sources from CVS."
14 echo "If you really want to do this, say:"
15 echo " touch irssi.cvs"
19 if test ! -f $srcdir/configure.in; then
20 echo -n "**Error**: Directory \`$srcdir\' does not look like the"
21 echo " top-level $PKG_NAME directory"
26 version_date=`date +%Y%m%d`
29 echo "Creating help files..."
32 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'`
33 cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am
35 files=`echo $files|sed 's/\.in//g'`
36 cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/Makefile.am
38 # .html -> .txt with lynx
39 echo "Documentation: html -> txt..."
40 lynx -dump -nolist docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt
42 echo "Checking auto* tools..."
44 # *********** a bit modified GNOME's macros/autogen.sh **********
47 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
49 echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
50 echo "Download the appropriate package for your distribution,"
51 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
55 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
56 (libtool --version) < /dev/null > /dev/null 2>&1 || {
58 echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
59 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
60 echo "(or a newer version if it is available)"
65 (automake --version) < /dev/null > /dev/null 2>&1 || {
67 echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
68 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
69 echo "(or a newer version if it is available)"
75 # if no automake, don't bother testing for aclocal
76 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
78 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
79 echo "installed doesn't appear recent enough."
80 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
81 echo "(or a newer version if it is available)"
85 if test "$DIE" -eq 1; then
89 #if test -z "$*"; then
90 # echo "**Warning**: I am going to run \`configure' with no arguments."
91 # echo "If you wish to pass any to it, please specify them on the"
92 # echo \`$0\'" command line."
98 am_opt=--include-deps;;
101 rm -f aclocal.m4 glib.m4 glib-2.0.m4
102 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
103 echo "Running libtoolize..."
104 libtoolize --force --copy
106 aclocalinclude="$ACLOCAL_FLAGS -I ."
107 echo "Running aclocal $aclocalinclude ..."
109 # see if we don't have glib.m4 or glib-2.0.m4 there yet
110 error=`aclocal $aclocalinclude 2>&1`
111 if test "x`echo $error|grep 'AM_PATH_GLIB[^_]'`" != "x"; then
113 error=`aclocal $aclocalinclude 2>&1`
115 if test "x`echo $error|grep AM_PATH_GLIB_2_0`" != "x"; then
116 cp glib-2.0.m4_ glib-2.0.m4
119 aclocal $aclocalinclude
121 # aclocal for some reason doesn't complain about glib2, so we still need
122 # to check it later again..
123 if grep "^AC_DEFUN.AM_PATH_GLIB_2_0" aclocal.m4 >/dev/null; then :;
125 cp glib-2.0.m4_ glib-2.0.m4
126 aclocal $aclocalinclude
129 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
130 echo "Running autoheader..."
133 echo "Running autoconf ..."
135 echo "Running automake --gnu $am_opt ..."
136 automake --add-missing --gnu $am_opt
138 #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
140 #if test x$NOCONFIGURE = x; then
141 # echo Running $srcdir/configure $conf_flags "$@" ...
142 # $srcdir/configure $conf_flags "$@" \
143 # && echo Now type \`make\' to compile $PKG_NAME || exit 1
145 # echo Skipping configure process.
148 # make sure perl hashes have correct length
149 find src/perl -name *.c -o -name *.xs | xargs grep -n hv_store | perl -ne 'if (/"(\w+)",\s*(\d+)/) { print unless $2 == length $1 }'