File: configurehere

package info (click to toggle)
libamplsolver 0~20190702-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 3,156 kB
  • sloc: ansic: 40,471; asm: 76; sh: 72; fortran: 51; makefile: 16
file content (51 lines) | stat: -rwxr-xr-x 1,690 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

# "configurehere" for system-specific subdirectories of ampl/solvers
# Originally written by David M. Gay at Sandia National Labs, where it
# was Approved for Unclassified-Unlimited release: SAND Number 2005-7813P
# Modified to remove a now unnecessary test.

## Invoke ./configurehere
## (no args) to create makefile from makefile.u for compiling amplsolver.a
## in this directory.  Then invoke "make -r" to compile amplsolver.a
## Specify CC before ./configurehere to adjust the CC setting in makefile.
## Specify CFLAGS before ./configurehere to adjust CFLAGS setting in the
## makefile.  CFLAGS may be further adjusted by tests done below.

if [ -f makefile ]; then make clean; rm makefile; fi

case $CFLAGS in '') CFLAGS='-O';; esac

# For Cygwin or MinGW/MSYS...
EXEmodify=""
case $WINDIR in C:*)
	case $CC in "") CC=gcc;; esac
	EXEmodify=";s!a\\.out!a.exe!";;
	esac

${CC=cc} -c xectim.c 2>/dev/null && rm xectim.o || CFLAGS="$CFLAGS -DNO_RUSAGE"

SC="s!^CC = cc!CC = $CC!$EXEmodify"

case `uname -m` in
	alpha) if cc --version 2>/dev/null | sed 1q | grep -q GCC
		then CFLAGS="$CFLAGS -mieee"
		else CFLAGS="$CFLAGS -ieee_with_no_inexact"
		fi;;
	esac

case `uname -s` in
	AIX) CFLAGS="$CFLAGS -qnomaf";;
	Darwin) if cc -c -D_NONSTD_SOURCE arithchk.c 2>/dev/null; then
			CFLAGS="$CFLAGS -D_NONSTD_SOURCE";
			rm arithchk.o; fi;;
	SunOS) case `uname -i 2>/dev/null` in
		i386)  SC="$SC;s/^a = \\\\$/a = fpsetprec.s \\\\/";;
		i86pc) SC="$SC;s/^a = \\\\$/a = fpsetprec64.s \\\\/";;
		esac;;
	CYGWIN_*) case $EXEmodify in "") SC="$SC;s/a\.out/a.exe/";; esac;;
	esac

case $CFLAGS in -O);; *) SC="$SC;s@^CFLAGS = -O@CFLAGS = $CFLAGS@";; esac

sed "$SC" makefile.u >makefile