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..."
41 echo "Checking auto* tools..."
43 # *********** a bit modified GNOME's macros/autogen.sh **********
46 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
48 echo "**Error**: You must have \`autoconf' installed to compile $PKG_NAME."
49 echo "Download the appropriate package for your distribution,"
50 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
54 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
55 (libtool --version) < /dev/null > /dev/null 2>&1 || {
57 echo "**Error**: You must have \`libtool' installed to compile $PKG_NAME."
58 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
59 echo "(or a newer version if it is available)"
64 (automake --version) < /dev/null > /dev/null 2>&1 || {
66 echo "**Error**: You must have \`automake' installed to compile $PKG_NAME."
67 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
68 echo "(or a newer version if it is available)"
74 # if no automake, don't bother testing for aclocal
75 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
77 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
78 echo "installed doesn't appear recent enough."
79 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
80 echo "(or a newer version if it is available)"
84 if test "$DIE" -eq 1; then
88 #if test -z "$*"; then
89 # echo "**Warning**: I am going to run \`configure' with no arguments."
90 # echo "If you wish to pass any to it, please specify them on the"
91 # echo \`$0\'" command line."
97 am_opt=--include-deps;;
100 rm -f aclocal.m4 glib.m4 glib-2.0.m4
101 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
102 echo "Running libtoolize..."
103 libtoolize --force --copy
105 aclocalinclude="$ACLOCAL_FLAGS -I ."
106 echo "Running aclocal $aclocalinclude ..."
108 # see if we don't have glib.m4 or glib-2.0.m4 there yet
109 error=`aclocal $aclocalinclude 2>&1`
110 if test "x`echo $error|grep 'AM_PATH_GLIB[^_]'`" != "x"; then
112 error=`aclocal $aclocalinclude 2>&1`
114 if test "x`echo $error|grep AM_PATH_GLIB_2_0`" != "x"; then
115 cp glib-2.0.m4_ glib-2.0.m4
118 aclocal $aclocalinclude
120 # aclocal for some reason doesn't complain about glib2, so we still need
121 # to check it later again..
122 if grep "^AC_DEFUN.AM_PATH_GLIB_2_0" aclocal.m4 >/dev/null; then :;
124 cp glib-2.0.m4_ glib-2.0.m4
125 aclocal $aclocalinclude
128 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
129 echo "Running autoheader..."
132 echo "Running autoconf ..."
134 echo "Running automake --gnu $am_opt ..."
135 automake --add-missing --gnu $am_opt
137 #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
139 #if test x$NOCONFIGURE = x; then
140 # echo Running $srcdir/configure $conf_flags "$@" ...
141 # $srcdir/configure $conf_flags "$@" \
142 # && echo Now type \`make\' to compile $PKG_NAME || exit 1
144 # echo Skipping configure process.
147 # make sure perl hashes have correct length
148 find src/perl -name *.c -o -name *.xs | xargs grep -n hv_store | perl -ne 'if (/"(\w+)",\s*(\d+)/) { print unless $2 == length $1 }'