build-glib1.sh 2.0 KB

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