source: ThirdParty/ASL/releases/1.0.14/compile_MS_ASL.in @ 1036

Last change on this file since 1036 was 1019, checked in by andreasw, 12 years ago

synchronized stable/1.0 with trunk rev 1018

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