* user.c (check_format_var): Use more suitable function
[midnight-commander.git] / build-glib1.sh
blob2b7db44225da753bea8d2fbca65a7012bd8de5c2
1 #! /bin/sh
3 # Download and build glib 1.2.x statically and then compile GNU Midnight
4 # Commander against it.
5 # Copyright (C) 2003 Pavel Roskin
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 : ${MC_TOPDIR=`pwd`}
22 : ${GLIB_VERSION=1.2.10}
24 GLIB_DIR="glib-$GLIB_VERSION"
25 GLIB_TARBALL="glib-$GLIB_VERSION.tar.gz"
26 GLIB_URL="ftp://ftp.gtk.org/pub/gtk/v1.2/$GLIB_TARBALL"
27 GLIB_INSTDIR="$MC_TOPDIR/glib-inst"
29 get_file() {
30 curl --remote-name "$1" || \
31 wget --passive-ftp "$1" || \
32 wget "$1" || \
33 ftp "$1" </dev/null || \
34 exit 1
37 if test -f src/dir.c; then : ; else
38 echo "Not in the top-level directory of GNU Midnight Commander." 2>&1
39 exit 1
42 if test -f configure; then : ; else
43 ./autogen.sh --help >/dev/null || exit 1
46 if gzip -vt "$GLIB_TARBALL"; then : ; else
47 get_file "$GLIB_URL"
50 rm -rf "$GLIB_DIR"
51 gzip -cd "$GLIB_TARBALL" | tar xf -
52 cd "$GLIB_DIR"
53 if test -f glist.c; then : ; else
54 echo "glib source is incomplete" 2>&1
55 exit 1
58 rm -rf "$GLIB_INSTDIR"
59 ./configure --disable-shared --with-glib12 --prefix="$GLIB_INSTDIR" || exit 1
60 make all || exit 1
61 make install || exit 1
63 cd "$MC_TOPDIR"
64 ./configure GLIB_CONFIG="$GLIB_INSTDIR/bin/glib-config" \
65 PKG_CONFIG=/bin/false "$@" || exit 1
66 make clean || exit 1
67 make || exit 1
69 echo "GNU Midnight Commander has been successfully compiled"