source: ThirdParty/ASL/releases/1.0.7/compile_MS_ASL.in @ 2507

Last change on this file since 2507 was 590, checked in by andreasw, 14 years ago

synchronizing ASL stable/1.0 with trunk rev 589

  • Property svn:executable set to *
File size: 1.5 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
28clver=`cl 2>&1 | egrep '^Microsoft' | sed -e 's/.*Version \(.*\)/\1/'`
29clver="Microsoft cl $clver"
30
31sed -e "s/System_details/$clver/" details.c0 > details.c
32
33# Do the build. CFLAGS specified on the command line (as a result of autoconf
34# replacing ASLMAKEFLAGS) will override the specs in makefile.vc, ensuring
35# that ASL is built with the same compiler flags as other code. It turns out
36# that Gnu make always sets MAKEFLAGS to --unix, and nmake tries to process
37# this, resulting in error U1065. Clear MAKEFLAGS to fix the problem.
38
39libampl=@AMPLSOLVER_A@
40MAKEFLAGS=
41nmake -f makefile.vc @ASLMAKEFLAGS@
42mv amplsolv.lib ../$libampl
43mv stdio1.h arith.h funcadd0.obj ..
44cd ..
45rm -rf $compdir
Note: See TracBrowser for help on using the repository browser.