File: build-glib1.sh

package info (click to toggle)
mc 1:4.6.0-4.6.1-pre3-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 15,224 kB
  • ctags: 11,992
  • sloc: ansic: 93,654; sh: 5,102; perl: 1,961; makefile: 1,107; yacc: 316; cs: 43; sed: 16
file content (69 lines) | stat: -rwxr-xr-x 1,978 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /bin/sh

# Download and build glib 1.2.x statically and then compile GNU Midnight
# Commander against it.
# Copyright (C) 2003 Pavel Roskin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

: ${MC_TOPDIR=`pwd`}
: ${GLIB_VERSION=1.2.10}

GLIB_DIR="glib-$GLIB_VERSION"
GLIB_TARBALL="glib-$GLIB_VERSION.tar.gz"
GLIB_URL="ftp://ftp.gtk.org/pub/gtk/v1.2/$GLIB_TARBALL"
GLIB_INSTDIR="$MC_TOPDIR/glib-inst"

get_file() {
  curl --remote-name "$1" || \
  wget --passive-ftp "$1" || \
  wget "$1" || \
  ftp "$1" </dev/null || \
  exit 1
}

if test -f src/dir.c; then : ; else
  echo "Not in the top-level directory of GNU Midnight Commander." 2>&1
  exit 1
fi

if test -f configure; then : ; else
  ./autogen.sh --help >/dev/null || exit 1
fi

if gzip -vt "$GLIB_TARBALL"; then : ; else
  get_file "$GLIB_URL"
fi

rm -rf "$GLIB_DIR"
gzip -cd "$GLIB_TARBALL" | tar xf -
cd "$GLIB_DIR"
if test -f glist.c; then : ; else
  echo "glib source is incomplete" 2>&1
  exit 1
fi

rm -rf "$GLIB_INSTDIR"
./configure --disable-shared --with-glib12 --prefix="$GLIB_INSTDIR" || exit 1
make all || exit 1
make install || exit 1

cd "$MC_TOPDIR"
./configure GLIB_CONFIG="$GLIB_INSTDIR/bin/glib-config" \
	    PKG_CONFIG=/bin/false "$@" || exit 1
make clean || exit 1
make || exit 1

echo "GNU Midnight Commander has been successfully compiled"