source: ThirdParty/ASL/trunk/ @ 1548

Last change on this file since 1548 was 1269, checked in by andreasw, 12 years ago

make sure an error causes make to stop when compile_* script commands file

  • Property svn:executable set to *
File size: 2.1 KB
[1269]3set -e
[588]5# Script to compile the Ampl Solver Library using cl/link. Why this approach?
6# Well, we don't want to get into the business of creating (and maintaining)
7# the full set of autotools source files for the ASL. This approach tries to
8# leverage, which comes with ASL.
10# To support VPATH builds, the strategy is to copy the sources to the build
11# directory, build, and then erase the sources when we're done. Start by
12# copying the sources.
14# set -x
[72]15mkinstalldirs="@install_sh@ -d"
19rm -rf $compdir
20$mkinstalldirs $compdir
21files=`cd $abs_source_dir/solvers; ls *.[chs] *.[ch]0 *.hd arith.* makefile* *.bat amplsolv.lbc`
22cd $compdir
23for file in $files
25  cp $abs_source_dir/solvers/$file $file;\
28# Acquire the cl version and create details.c
[900]29# (This is not doing to right thing if we are using the Microsoft compiler)
31clver=`cl 2>&1 | egrep '^Microsoft' | sed -e 's/.*Version \(.*\)/\1/'`
32clver="Microsoft cl $clver"
34sed -e "s/System_details/$clver/" details.c0 > details.c
[725]36# Adjust solvers/ for the situation at hand. When building with cl
37# under cygwin, we can't execute comptry.bat. The sole purpose of comptry.bat
38# is to retry the compile with -DNO_LONG_LONG in an environment where long long
39# does not exist. Since we've already tested for long long in configure and set
40# ASLMAKEFLAGS accordingly, we can discard comptry.bat without worry.
42sed -e 's/comptry\.bat \$(CC)/$(CC)/' > makefile.coin
[588]44# Do the build. CFLAGS specified on the command line (as a result of autoconf
[725]45# replacing ASLMAKEFLAGS) will override the specs in, ensuring that
46# ASL is built with the same compiler flags as other code. also
47# forces CC=cl, but since Coin only uses for the cl compiler,
48# there's no need to override it here.
[725]50# It turns out that Gnu make always sets MAKEFLAGS to --unix, and nmake tries
51# to process this, resulting in error U1065. Clear MAKEFLAGS to fix the
52# problem.
[900]56nmake -f makefile.coin @ASLMAKEFLAGS@ CC="@CC@"
[72]57mv amplsolv.lib ../$libampl
58mv stdio1.h arith.h funcadd0.obj ..
59cd ..
60rm -rf $compdir
Note: See TracBrowser for help on using the repository browser.