source: ThirdParty/Glpk/branches/autotools-update/captureConfigFiles @ 4056

Last change on this file since 4056 was 4056, checked in by lou, 16 months ago

Second try, rewriting glpk's configuration source files. Went with Stefan's
suggestion to stop trying to pass values and just add COIN macros to glpk's
configure.ac. More straightforward.

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/sh
2
3# Use this script to capture the changed configuration files after patching
4# glpk's configure.ac, src/Makefile.am, and examples/Makefile.am and running
5# run_autotools.
6# This assumes that the right run_autotools is found in your PATH!
7
8# Note that glpk's config.h.in is hand-crafted. We don't want the new,
9# autogenerated version.
10
11set -e
12
13wgetcmd=wget
14glpk_ver=4.65
15
16if [[ ! -r glpk_config.patch ]] ; then
17  echo "Cannot find configuration patch file glpk_config.patch. Aborting"
18  exit 1
19fi
20
21newConfigFiles=(configure.ac src/Makefile.am examples/Makefile.am)
22newConfigFiles+=(aclocal.m4 compile config.guess depcomp install-sh missing)
23newConfigFiles+=(ltmain.sh)
24newConfigFiles+=(configure Makefile.in src/Makefile.in examples/Makefile.in)
25
26# Pull down a fresh copy of glpk
27
28echo "Downloading the source code from ftp.gnu.org ..."
29$wgetcmd http://ftp.gnu.org/gnu/glpk/glpk-${glpk_ver}.tar.gz
30
31echo "Uncompressing the tarball..."
32gunzip -f glpk-${glpk_ver}.tar.gz
33
34if test -d glpk ; then
35  echo "Moving current glpk to glpk.OLD."
36  if test -d glpk.OLD ; then
37    rm -rf glpk.OLD
38  fi
39  mv glpk glpk.OLD
40fi
41
42echo "Unpacking the source code..."
43tar xf glpk-${glpk_ver}.tar
44
45echo "Deleting the tar file..."
46rm glpk-${glpk_ver}.tar
47
48mv glpk-${glpk_ver} glpk
49
50echo "Hiding glpk's m4 directory to avoid obsolete libtool macros."
51mv glpk/m4 glpk/m4.hidden
52
53echo "Patching configuration source files ..."
54patch -p0 < glpk_config.patch
55
56echo "Running autotools on patched source ..."
57run_autotools -f glpk
58
59echo "Capturing modified configuration files in glpk_config_files/..."
60for f in "${newConfigFiles[@]}" ; do
61  mkdir -p `dirname glpk_config_files/$f`
62  cp -f glpk/$f glpk_config_files/$f
63done
Note: See TracBrowser for help on using the repository browser.