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
|
#!/bin/sh
# "configure" for ampl/solvers (called ASL below)
# Originally written by David M. Gay at Sandia National Labs, where it
# was Approved for Unclassified-Unlimited release: SAND Number 2005-7812P
# Modified to permit "path/to/ASL/configure" invocations.
## When in the ASL (AMPL/Solver interface Library) source directory, invoke
## ./configure
## (no args) to make system-dependent files in directory $OBJDIR
## (default sys.`uname -m`.`uname -s`).
## Alternatively, when in another directory, invoke
## path/to/ASL/configure
## to make system-dependent files in the current directory,
## which becomes $OBJDIR.
## Among other things, create $OBJDIR/makefile there from makefile.u.
## Specify CC before invoking to adjust the CC setting in makefile.
## Specify CFLAGS before invoking to adjust CFLAGS setting in the makefile.
## CFLAGS may be further adjusted by tests done below.
## When invoked in the ASL directory, this script also adds there a
## short makefile that forwards "make" and
## "make clean" to $OBJDIR and that removes $OBJDIR with "make veryclean".
ASLdir=`dirname $0`
case $ASLdir in
.)
OBJDIR=${OBJDIR=sys.`uname -m`.`uname -s`}
rm -rf $OBJDIR makefile Makefile
cat <<\! >makefile
amplsolver:
cd $${OBJDIR=sys.`uname -m`.`uname -s`}; make
clean:
cd $${OBJDIR=sys.`uname -m`.`uname -s`}; make clean
veryclean:
rm -rf $${OBJDIR=sys.`uname -m`.`uname -s`}
distclean:
rm -rf sys.*.*
!
mkdir $OBJDIR
;; *)
OBJDIR=`pwd`
rm -f `sed 's/ .*//' $ASLdir/xsum0.out` makefile Makefile xsum0.out
cd $ASLdir
;; esac
ln `sed 's/ .*//' xsum0.out` xsum0.out $OBJDIR || \
cp -p `sed 's/ .*//' xsum0.out` xsum0.out $OBJDIR
# cp -p is for cygwin
cd $OBJDIR
./configurehere
|