diff --git a/maint/mc_glib2_compile b/maint/mc_glib2_compile new file mode 100755 index 000000000..08b43fa25 --- /dev/null +++ b/maint/mc_glib2_compile @@ -0,0 +1,68 @@ +#! /bin/sh + +# Compile GNU Midnight Commander against glib 2.x. +# Should be run from the top-level directory. + +GLIB_VERSION="2.2.1" +GLIB_DIR="glib-$GLIB_VERSION" +GLIB_TARBALL="glib-$GLIB_VERSION.tar.gz" +GLIB_URL="ftp://ftp.gtk.org/pub/gtk/v2.2/$GLIB_TARBALL" + +PKGC_VERSION="0.15.0" +PKGC_DIR="pkgconfig-$PKGC_VERSION" +PKGC_TARBALL="pkgconfig-$PKGC_VERSION.tar.gz" +PKGC_URL="http://www.freedesktop.org/software/pkgconfig/releases/$PKGC_TARBALL" + +MC_TOPDIR=`pwd` +TMP_INSTDIR="$MC_TOPDIR/glib-inst" + +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 "$PKGC_TARBALL"; then : ; else + wget "$PKGC_URL" || curl -o "$PKGC_TARBALL" "$PKGC_URL" || exit 1 +fi + +rm -rf "$PKGC_DIR" +gzip -cd "$PKGC_TARBALL" | tar xf - +cd "$PKGC_DIR" +if test -f pkg.c; then : ; else + echo "pkgconfig source is incomplete" 2>&1 + exit 1 +fi + +rm -rf "$TMP_INSTDIR" +./configure --disable-shared --prefix="$TMP_INSTDIR" || exit 1 +make all || exit 1 +make install || exit 1 + +cd "$MC_TOPDIR" +if gzip -vt "$GLIB_TARBALL"; then : ; else + wget "$GLIB_URL" || curl -o "$GLIB_TARBALL" "$GLIB_URL" || exit 1 +fi + +rm -rf "$GLIB_DIR" +gzip -cd "$GLIB_TARBALL" | tar xf - +cd "$GLIB_DIR" +if test -f glib/glist.c; then : ; else + echo "glib source is incomplete" 2>&1 + exit 1 +fi + +./configure --disable-shared --prefix="$TMP_INSTDIR" \ + PKG_CONFIG="$TMP_INSTDIR/bin/pkg-config" || exit 1 +make all || exit 1 +make install || exit 1 + +cd "$MC_TOPDIR" +./configure PKG_CONFIG="$TMP_INSTDIR/bin/pkg-config" || exit 1 +make clean || exit 1 +make || exit 1 + +echo "GNU Midnight Commander has been successfully compiled"