comparison autogen.sh @ 25646:69d54f84350a

propagate from branch 'im.pidgin.pidgin' (head 9da7555026cd7b8456f95ae153a7852ddbcf6678) to branch 'im.pidgin.pidgin.vv' (head 3f8b4b5a421935e71b45c7b8260c8bb32a330384)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 13 Apr 2008 17:53:46 +0000
parents 185b37776140
children d146e87ba40d 3c26ef82d556
comparison
equal deleted inserted replaced
25645:0d41d271227b 25646:69d54f84350a
1 #!/bin/sh 1 #! /bin/sh
2 # Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
3 # Copyright (C) 2003-2008 Gary Kramlich <grim@reaperworld.com>
4 #
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # this program; if not, write to the Free Software Foundation, Inc., 51
17 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2 18
3 CONFIGURE_ARGS="" 19 ###############################################################################
4 if [ -f configure.args ] ; then 20 # Usage
5 . configure.args 21 ###############################################################################
22 # This script uses a config file that can be used to stash common arguments
23 # passed to configure or environment variables that need to be set before
24 # configure is called. The configuration file is a simple shell script that
25 # gets sourced.
26 #
27 # By default, the config file that is used is named 'autogen.args'. This can
28 # be configured below.
29 #
30 # Available options that are handled are as follow:
31 # ACLOCAL_FLAGS - command line arguments to pass to aclocal
32 # AUTOCONF_FLAGS - command line arguments to pass to autoconf
33 # AUTOHEADER_FLAGS - command line arguments to pass to autoheader
34 # AUTOMAKE_FLAGS - command line arguments to pass to automake flags
35 # CONFIGURE_FLAGS - command line arguments to pass to configure
36 # GLIB_GETTEXTIZE_FLAGS - command line arguments to pass to glib-gettextize
37 # INTLTOOLIZE_FLAGS - command line arguments to pass to intltoolize
38 # LIBTOOLIZE_FLAGS - command line arguments to pass to libtoolize
39 #
40 # Other helpfull notes:
41 # If you're using a different c compiler, you can override the environment
42 # variable in 'autogen.args'. For example, say you're using distcc, just add
43 # the following to 'autogen.args':
44 #
45 # CC="distcc"
46 #
47 # This will work for any influential environment variable to configure.
48 ###############################################################################
49 PACKAGE="Pidgin"
50 ARGS_FILE="autogen.args"
51
52 ###############################################################################
53 # Some helper functions
54 ###############################################################################
55 check () {
56 CMD=$1
57
58 echo -n "checking for ${CMD}... "
59 BIN=`which ${CMD} 2> /dev/null`
60
61 if [ x"${BIN}" = x"" ] ; then
62 echo "not found."
63 echo "${CMD} is required to build ${PACKAGE}!"
64 exit 1;
65 fi
66
67 echo "${BIN}"
68 }
69
70 run_or_die () { # beotch
71 CMD=$1
72 shift
73
74 echo -n "running ${CMD} ${@}... "
75 OUTPUT=`${CMD} ${@} 2>&1`
76 if [ $? != 0 ] ; then
77 echo "failed."
78 echo ${OUTPUT}
79 exit 1
80 else
81 echo "done."
82 if [ x"${OUTPUT}" != x"" ] ; then
83 echo ${OUTPUT}
84 fi
85 fi
86 }
87
88 ###############################################################################
89 # We really start here, yes, very sneaky!
90 ###############################################################################
91 FIGLET=`which figlet 2> /dev/null`
92 if [ x"${FIGLET}" != x"" ] ; then
93 ${FIGLET} -f small ${PACKAGE}
94 echo "build system is being generated"
95 else
96 echo "autogenerating build system for '${PACKAGE}'"
6 fi 97 fi
7 98
8 (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { 99 ###############################################################################
9 echo; 100 # Look for our args file
10 echo "You must have glib-gettextize installed to compile Pidgin."; 101 ###############################################################################
11 echo; 102 echo -n "checking for ${ARGS_FILE}: "
12 exit 1; 103 if [ -f ${ARGS_FILE} ] ; then
13 } 104 echo "found."
105 echo -n "sourcing ${ARGS_FILE}: "
106 . autogen.args
107 echo "done."
108 else
109 echo "not found."
110 fi
14 111
15 (intltoolize --version) < /dev/null > /dev/null 2>&1 || { 112 ###############################################################################
16 echo; 113 # Check for our required helpers
17 echo "You must have intltool installed to compile Pidgin."; 114 ###############################################################################
18 echo; 115 check "libtoolize"; LIBTOOLIZE=${BIN};
19 exit 1; 116 check "glib-gettextize"; GLIB_GETTEXTIZE=${BIN};
20 } 117 check "intltoolize"; INTLTOOLIZE=${BIN};
118 check "aclocal"; ACLOCAL=${BIN};
119 check "autoheader"; AUTOHEADER=${BIN};
120 check "automake"; AUTOMAKE=${BIN};
121 check "autoconf"; AUTOCONF=${BIN};
21 122
22 (libtoolize --version) < /dev/null > /dev/null 2>&1 || { 123 ###############################################################################
23 echo; 124 # Run all of our helpers
24 echo "You must have libtool installed to compile Pidgin."; 125 ###############################################################################
25 echo; 126 run_or_die ${LIBTOOLIZE} ${LIBTOOLIZE_FLAGS:-"-c -f --automake"}
26 exit 1; 127 run_or_die ${GLIB_GETTEXTIZE} ${GLIB_GETTEXTIZE_FLAGS:-"--force --copy"}
27 } 128 run_or_die ${INTLTOOLIZE} ${INTLTOOLIZE_FLAGS:-"-c -f --automake"}
129 run_or_die ${ACLOCAL} ${ACLOCAL_FLAGS:-"-I m4macros"}
130 run_or_die ${AUTOHEADER} ${AUTOHEADER_FLAGS}
131 run_or_die ${AUTOMAKE} ${AUTOMAKE_FLAGS:-"-a -c --gnu"}
132 run_or_die ${AUTOCONF} ${AUTOCONF_FLAGS}
28 133
29 (automake --version) < /dev/null > /dev/null 2>&1 || { 134 ###############################################################################
30 echo; 135 # Run configure
31 echo "You must have automake installed to compile Pidgin."; 136 ###############################################################################
32 echo; 137 echo "running ./configure ${CONFIGURE_FLAGS} $@"
33 exit 1; 138 ./configure ${CONFIGURE_FLAGS} $@
34 }
35
36 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
37 echo;
38 echo "You must have autoconf installed to compile Pidgin.";
39 echo;
40 exit 1;
41 }
42
43 echo "Generating configuration files for Pidgin, please wait...."
44 echo;
45
46 echo "Running libtoolize, please ignore non-fatal messages...."
47 echo n | libtoolize --copy --force || exit 1;
48
49 # Add other directories to this list if people continue to experience
50 # brokennesses ... Obviously the real answer is for them to fix it
51 # themselves, but for Luke's sake we have this.
52 for dir in "/usr/local/share/aclocal" \
53 "/opt/gnome-1.4/share/aclocal"
54 do
55 if test -d $dir ; then
56 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir"
57 fi
58 done
59
60 libtoolize -c -f --automake
61 glib-gettextize --force --copy
62 intltoolize --force --copy
63 aclocal $ACLOCAL_FLAGS || exit 1;
64 autoheader || exit 1;
65 automake --add-missing --copy;
66 autoconf || exit 1;
67 automake || exit 1;
68
69 echo;
70 echo "Running ./configure ${CONFIGURE_ARGS} $@"
71 echo;
72 ./configure ${CONFIGURE_ARGS} $@
73