source: ThirdParty/Glpk/trunk/get.Glpk

Last change on this file was 4061, checked in by stefan, 6 weeks ago

merge branch autotools-update

File size: 1.3 KB
Line 
1#!/bin/sh
2
3set -e
4glpk_ver=4.65
5
6wgetcmd=wget
7wgetcount=`which wget 2>/dev/null | wc -l`
8if test ! $wgetcount = 1; then
9  echo "Utility wget not found in your PATH."
10  if test `uname` = Darwin; then
11    wgetcmd="curl -L -O"
12    echo "Using curl instead."
13  elif test `uname` = FreeBSD; then
14    wgetcmd=fetch
15    echo "Using fetch instead."
16  else
17    exit -1
18  fi
19fi
20
21echo " "
22echo "Running script to download the source code for GLPK $glpk_ver."
23echo " "
24
25rm -f glpk*.tar.gz
26
27echo "Downloading the source code from ftp.gnu.org..."
28$wgetcmd http://ftp.gnu.org/gnu/glpk/glpk-${glpk_ver}.tar.gz
29
30echo "Uncompressing the tarball..."
31gunzip -f glpk-${glpk_ver}.tar.gz
32
33if test -d glpk ; then
34  echo "Moving current glpk to glpk.OLD."
35  if test -d glpk.OLD ; then
36    rm -rf glpk.OLD
37  fi
38  mv glpk glpk.OLD
39fi
40
41echo "Unpacking the source code..."
42tar xf glpk-${glpk_ver}.tar
43
44echo "Deleting the tar file..."
45rm glpk-${glpk_ver}.tar
46
47mv glpk-${glpk_ver} glpk
48
49echo " "
50echo "Done downloading the source code for GLPK."
51
52echo "Installing modified configuration files."
53cp -r glpk_config_files/* glpk/
54
55echo "Touch every source file to force rebuild of whole package."
56
57if ls glpk/src/*.c &>/dev/null ; then
58  touch glpk/src/*.c
59fi
60if ls glpk/src/*/*.c &>/dev/null ; then
61  touch glpk/src/*/*.c
62fi
63
64echo " "
65echo "Verify that there are no error message in the output above."
Note: See TracBrowser for help on using the repository browser.