source: ThirdParty/HSL/trunk/configure.ac @ 1758

Last change on this file since 1758 was 1758, checked in by stefan, 11 years ago

restoring BuildTools/ThirdParty?/HSL/trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.1 KB
Line 
1# Copyright (C) 2006, 2009 International Business Machines.
2# All Rights Reserved.
3# This file is distributed under the Common Public License.
4
5## $Id: configure.ac 1758 2010-11-03 07:07:29Z stefan $
6
7# Author:  Andreas Waechter            IBM    2006-04-13
8
9#############################################################################
10#                       Names and other basic things                        #
11#############################################################################
12
13AC_PREREQ(2.59)
14
15AC_INIT([ThirdPartyHSL],[trunk],[http://projects.coin-or.org/BuildTools/newticket])
16
17AC_COPYRIGHT([
18Copyright 2006, 2009 International Business Machines and others.
19All Rights Reserved.
20This file is part of the open source package Coin which is distributed
21under the Common Public License.])
22
23# List one file in the package so that the configure script can test
24# whether the package is actually there
25# Here we don't know yet which files are actually provided...
26AC_CONFIG_SRCDIR(configure.ac)
27
28# Where should everything be installed by default?  Here, we want it
29# to be installed directly in 'bin', 'lib', 'include' subdirectories
30# of the directory where configure is run.  The default would be
31# /usr/local.
32AC_PREFIX_DEFAULT([`pwd`])
33
34AC_COIN_PROJECTDIR_INIT(HSL)
35
36#############################################################################
37#                         Standard build tool stuff                         #
38#############################################################################
39
40# Get the system type
41AC_CANONICAL_BUILD
42
43# turn off warnings and pedantic mode since they could make trouble on some platforms,
44# and we couldn't fix them anyway
45coin_skip_warn_fflags=yes
46
47# provide flag to allow compilation of a stand-alone shared library
48AC_ARG_ENABLE([loadable-library],
49[AC_HELP_STRING([--enable-loadable-library],
50                [compile stand-alone shared library for delayed loading])])
51
52# Check if user wants to produce debugging code
53AC_COIN_DEBUG_COMPILE(HSL)
54
55# Get the name of the C compiler (for a dummy program)
56AC_COIN_PROG_CC
57
58# Get the name of the Fortran compiler and appropriate compiler options
59AC_COIN_PROG_F77
60
61# Check if pkg-config is available (to setup addlibs file)
62AC_COIN_HAS_PKGCONFIG
63
64# Get the linker flags (FLIBS) that are required for linking against this blas library
65AC_COIN_F77_WRAPPERS
66
67# Add FLIBS to HSL_PCLIBS, so that they get into the .pc files
68HSL_PCLIBS="$FLIBS"
69AC_SUBST(HSL_PCLIBS)
70
71# Need egrep later on
72AC_PROG_EGREP
73
74# Also set up the FC compiler variable, required to compile .f90
75# files.  We use the same compile and flags as F77 and FFLAGS, unless
76# the user has set FC and FCFLAGS explicitly.
77if test "$FC" = ""; then
78  FC="$F77"
79fi
80if test "$FCFLAGS" = ""; then
81  FCFLAGS="$FFLAGS"
82fi
83AC_PROG_FC
84
85# Initialize autotools
86
87if test x$enable_loadable_library = xyes; then
88  flag=force_shared
89fi
90AC_COIN_INIT_AUTO_TOOLS([$flag])
91
92#############################################################################
93#                    Find out which files are available                     #
94#############################################################################
95
96AC_MSG_CHECKING([whether we can compile Fortran 90 code])
97AC_LANG_PUSH(Fortran 77)
98AC_COMPILE_IFELSE([        MODULE BLA
99      DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: BLUBB
100      END MODULE BLA],[have_f90=yes ; rm -f bla.mod],[have_f90=no])
101AC_MSG_RESULT([$have_f90])
102AC_LANG_POP(Fortran 77)
103
104AC_DEFUN([MY_CHECK_HSLFILE],
105[AC_COIN_CHECK_FILE([$srcdir/$1.f],
106                    [hsl_files="$hsl_files $1.f"
107                     coin_has_$1=yes],
108                    [coin_has_$1=no])
109AM_CONDITIONAL([COIN_HAS_$2],[test $coin_has_$1 = yes])])
110
111AC_DEFUN([MY_CHECK_HSLFILE_F90],
112[if test $have_f90 = yes; then
113   AC_COIN_CHECK_FILE([$srcdir/$1.f90],
114                      [hsl_files="$hsl_files $1.f"
115                       coin_has_$1=yes],
116                      [coin_has_$1=no])
117else
118  coin_has_$1=no
119fi
120AM_CONDITIONAL([COIN_HAS_$2],[test $coin_has_$1 = yes])])
121
122MY_CHECK_HSLFILE(ma27ad,MA27)
123if test $coin_has_ma27ad = yes; then
124  AC_MSG_CHECKING([whether MA27 is threadsafe])
125  if $EGREP MA27UD $srcdir/ma27ad.f >/dev/null 2>&1; then
126    AC_MSG_RESULT(yes)
127  else
128    AC_MSG_RESULT(no)
129    AC_MSG_ERROR([Please obtain the threadsafe (newer) version of MA27])
130  fi
131fi
132MY_CHECK_HSLFILE(mc19ad,MC19)
133MY_CHECK_HSLFILE(ma57ad,MA57)
134MY_CHECK_HSLFILE(ma28ad,MA28)
135MY_CHECK_HSLFILE_F90(hsl_ma77d,MA77)
136
137HAVE_MXXX_CFLAGS=
138if test $coin_has_ma27ad = yes; then
139  HAVE_MXXX_CFLAGS="-DHAVE_MA27 $HAVE_MXXX_CFLAGS"
140fi
141if test $coin_has_mc19ad = yes; then
142  HAVE_MXXX_CFLAGS="-DHAVE_MC19 $HAVE_MXXX_CFLAGS"
143fi
144if test $coin_has_ma57ad = yes; then
145  HAVE_MXXX_CFLAGS="-DHAVE_MA57 $HAVE_MXXX_CFLAGS"
146fi
147if test $coin_has_ma28ad = yes; then
148  HAVE_MXXX_CFLAGS="-DHAVE_MA28 $HAVE_MXXX_CFLAGS"
149fi
150if test $coin_has_hsl_ma77d = yes; then
151  HAVE_MXXX_CFLAGS="-DHAVE_MA77 $HAVE_MXXX_CFLAGS"
152fi
153AC_SUBST(HAVE_MXXX_CFLAGS)
154
155if test x$enable_loadable_library = xyes; then
156  case $build in
157    *-cygwin* | *-mingw*)
158      HSL_SHARED_LIB=libhsl.dll
159      F77_SHARED_CMD='$(F77) -shared $(FFLAGS)'
160      case $F77 in
161        compile_f2c*)
162          EXPORT_SYMBOLS=
163          if test $coin_has_ma27ad = yes; then
164            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma27id_ ma27ad_ ma27bd_ ma27cd_"
165          fi
166          if test $coin_has_ma28ad = yes; then
167            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma28ad_"
168          fi
169          if test $coin_has_ma57ad = yes; then
170            EXPORT_SYMBOLS="$EXPORT_SYMBOLS ma57id_ ma57ad_ ma57bd_ ma57cd_ ma57ed_"
171          fi
172          if test $coin_has_mc19ad = yes; then
173            EXPORT_SYMBOLS="$EXPORT_SYMBOLS mc19ad_"
174          fi
175          F77_SHARED_CMD='$(F77) -shared $(FFLAGS) -def:$(DEFFILE)'
176          DEFFILE='Export.def'
177          ;;
178        ifort* | IFORT*)
179          EXPORT_SYMBOLS=
180          if test $coin_has_ma27ad = yes; then
181            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA27ID MA27AD MA27BD MA27CD"
182          fi
183          if test $coin_has_ma28ad = yes; then
184            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA28AD"
185          fi
186          if test $coin_has_ma57ad = yes; then
187            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MA57ID MA57AD MA57BD MA57CD MA57ED"
188          fi
189          if test $coin_has_mc19ad = yes; then
190            EXPORT_SYMBOLS="$EXPORT_SYMBOLS MC19AD"
191          fi
192          DEFFILE='Export.def'
193          F77_SHARED_CMD='$(F77) $(FFLAGS)'
194          F77_DLL_LINKFLAGS='-link -dll -def:$(DEFFILE)'
195          ;;
196        *)
197          F77_SHARED_CMD='$(F77) -shared $(FFLAGS)'
198          ;;
199      esac
200      ;;
201  esac
202fi
203AC_SUBST(F77_SHARED_CMD)
204AC_SUBST(F77_DLL_LINKFLAGS)
205AC_SUBST(HSL_SHARED_LIB)
206AC_SUBST(EXPORT_SYMBOLS)
207AC_SUBST(DEFFILE)
208AM_CONDITIONAL([INSTALL_LOADABLE_LIBRARY],[test x$flag = xforce_shared])
209AM_CONDITIONAL([NEED_DEFFILE], [test ! x"$DEFFILE" = x])
210
211AM_CONDITIONAL([EXTRA_SHARED_COMMAND],[test ! x"$F77_SHARED_CMD" = x])
212#AM_CONDITIONAL([EXTRA_SHARED_COMMAND],[test "$F77_SHARED_CMD" = x])
213
214#############################################################################
215#                              Write the output                             #
216#############################################################################
217
218AC_CONFIG_FILES([Makefile coinhsl.pc coinhsl-uninstalled.pc])
219
220AC_CONFIG_HEADER([config_hsl.h])
221
222AC_COIN_FINALIZE
Note: See TracBrowser for help on using the repository browser.