source: stable/0.6/coin.m4 @ 1579

Last change on this file since 1579 was 1579, checked in by lou, 11 years ago

Change semantics of PROJECTDIR_INIT to ease transition to trunk version. First
parameter now project name; defines PROJ_VERSION. Second (optional) paramter is
libtool library version number.

  • Property svn:keywords set to Author Date Id Revision
File size: 114.0 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: coin.m4 1579 2010-06-16 14:36:24Z lou $
6#
7# Author: Andreas Wachter    IBM      2006-04-14
8
9# This file defines the common autoconf macros for COIN
10#
11
12# Check requirements
13AC_PREREQ(2.59)
14
15###########################################################################
16#                           COIN_MAIN_SUBDIRS                             #
17###########################################################################
18
19# This macro sets up the recursion into configure scripts into
20# subdirectories.  Each possible subdirectory should be provided as a
21# new argument to this macro.  The current limit is 10 subdirectories.
22# This automatically also checks for the Data subdirectory.
23
24AC_DEFUN([AC_COIN_MAIN_SUBDIRS],
25[AC_ARG_VAR([COIN_SKIP_PROJECTS],[Set to the subdirectories of projects that should be skipped in the configuration])
26
27m4_ifvaln([$1],[AC_MSG_CHECKING(whether directory $1 is available)
28                coin_skip=no
29                if test x"$COIN_SKIP_PROJECTS" != x; then
30                  for dir in $COIN_SKIP_PROJECTS; do
31                    if test $dir = $1; then
32                      coin_skip=yes
33                    fi
34                  done
35                fi
36                if test $coin_skip = yes; then
37                  AC_MSG_RESULT(skipping)
38                elif test -r $srcdir/$1/configure; then
39                  coin_subdirs="$coin_subdirs $1"
40                  AC_MSG_RESULT(yes)
41                  AC_CONFIG_SUBDIRS($1)
42                else
43                  AC_MSG_RESULT(no)
44                fi])
45m4_ifvaln([$2],[AC_MSG_CHECKING(whether directory $2 is available)
46                coin_skip=no
47                if test x"$COIN_SKIP_PROJECTS" != x; then
48                  for dir in $COIN_SKIP_PROJECTS; do
49                    if test $dir = $2; then
50                      coin_skip=yes
51                    fi
52                  done
53                fi
54                if test $coin_skip = yes; then
55                  AC_MSG_RESULT(skipping)
56                elif test -r $srcdir/$2/configure; then
57                  coin_subdirs="$coin_subdirs $2"
58                  AC_MSG_RESULT(yes)
59                  AC_CONFIG_SUBDIRS($2)
60                else
61                  AC_MSG_RESULT(no)
62                fi])
63m4_ifvaln([$3],[AC_MSG_CHECKING(whether directory $3 is available)
64                coin_skip=no
65                if test x"$COIN_SKIP_PROJECTS" != x; then
66                  for dir in $COIN_SKIP_PROJECTS; do
67                    if test $dir = $3; then
68                      coin_skip=yes
69                    fi
70                  done
71                fi
72                if test $coin_skip = yes; then
73                  AC_MSG_RESULT(skipping)
74                elif test -r $srcdir/$3/configure; then
75                  coin_subdirs="$coin_subdirs $3"
76                  AC_MSG_RESULT(yes)
77                  AC_CONFIG_SUBDIRS($3)
78                else
79                  AC_MSG_RESULT(no)
80                fi])
81m4_ifvaln([$4],[AC_MSG_CHECKING(whether directory $4 is available)
82                coin_skip=no
83                if test x"$COIN_SKIP_PROJECTS" != x; then
84                  for dir in $COIN_SKIP_PROJECTS; do
85                    if test $dir = $4; then
86                      coin_skip=yes
87                    fi
88                  done
89                fi
90                if test $coin_skip = yes; then
91                  AC_MSG_RESULT(skipping)
92                elif test -r $srcdir/$4/configure; then
93                  coin_subdirs="$coin_subdirs $4"
94                  AC_MSG_RESULT(yes)
95                  AC_CONFIG_SUBDIRS($4)
96                else
97                  AC_MSG_RESULT(no)
98                fi])
99m4_ifvaln([$5],[AC_MSG_CHECKING(whether directory $5 is available)
100                coin_skip=no
101                if test x"$COIN_SKIP_PROJECTS" != x; then
102                  for dir in $COIN_SKIP_PROJECTS; do
103                    if test $dir = $5; then
104                      coin_skip=yes
105                    fi
106                  done
107                fi
108                if test $coin_skip = yes; then
109                  AC_MSG_RESULT(skipping)
110                elif test -r $srcdir/$5/configure; then
111                  coin_subdirs="$coin_subdirs $5"
112                  AC_MSG_RESULT(yes)
113                  AC_CONFIG_SUBDIRS($5)
114                else
115                  AC_MSG_RESULT(no)
116                fi])
117m4_ifvaln([$6],[AC_MSG_CHECKING(whether directory $6 is available)
118                coin_skip=no
119                if test x"$COIN_SKIP_PROJECTS" != x; then
120                  for dir in $COIN_SKIP_PROJECTS; do
121                    if test $dir = $6; then
122                      coin_skip=yes
123                    fi
124                  done
125                fi
126                if test $coin_skip = yes; then
127                  AC_MSG_RESULT(skipping)
128                elif test -r $srcdir/$6/configure; then
129                  coin_subdirs="$coin_subdirs $6"
130                  AC_MSG_RESULT(yes)
131                  AC_CONFIG_SUBDIRS($6)
132                else
133                  AC_MSG_RESULT(no)
134                fi])
135m4_ifvaln([$7],[AC_MSG_CHECKING(whether directory $7 is available)
136                coin_skip=no
137                if test x"$COIN_SKIP_PROJECTS" != x; then
138                  for dir in $COIN_SKIP_PROJECTS; do
139                    if test $dir = $7; then
140                      coin_skip=yes
141                    fi
142                  done
143                fi
144                if test $coin_skip = yes; then
145                  AC_MSG_RESULT(skipping)
146                elif test -r $srcdir/$7/configure; then
147                  coin_subdirs="$coin_subdirs $7"
148                  AC_MSG_RESULT(yes)
149                  AC_CONFIG_SUBDIRS($7)
150                else
151                  AC_MSG_RESULT(no)
152                fi])
153m4_ifvaln([$8],[AC_MSG_CHECKING(whether directory $8 is available)
154                coin_skip=no
155                if test x"$COIN_SKIP_PROJECTS" != x; then
156                  for dir in $COIN_SKIP_PROJECTS; do
157                    if test $dir = $8; then
158                      coin_skip=yes
159                    fi
160                  done
161                fi
162                if test $coin_skip = yes; then
163                  AC_MSG_RESULT(skipping)
164                elif test -r $srcdir/$8/configure; then
165                  coin_subdirs="$coin_subdirs $8"
166                  AC_MSG_RESULT(yes)
167                  AC_CONFIG_SUBDIRS($8)
168                else
169                  AC_MSG_RESULT(no)
170                fi])
171m4_ifvaln([$9],[AC_MSG_CHECKING(whether directory $9 is available)
172                coin_skip=no
173                if test x"$COIN_SKIP_PROJECTS" != x; then
174                  for dir in $COIN_SKIP_PROJECTS; do
175                    if test $dir = $9; then
176                      coin_skip=yes
177                    fi
178                  done
179                fi
180                if test $coin_skip = yes; then
181                  AC_MSG_RESULT(skipping)
182                elif test -r $srcdir/$9/configure; then
183                  coin_subdirs="$coin_subdirs $9"
184                  AC_MSG_RESULT(yes)
185                  AC_CONFIG_SUBDIRS($9)
186                else
187                  AC_MSG_RESULT(no)
188                fi])
189m4_ifvaln([$10],[AC_MSG_CHECKING(whether directory $10 is available)
190                coin_skip=no
191                if test x"$COIN_SKIP_PROJECTS" != x; then
192                  for dir in $COIN_SKIP_PROJECTS; do
193                    if test $dir = $10; then
194                      coin_skip=yes
195                    fi
196                  done
197                fi
198                if test $coin_skip = yes; then
199                  AC_MSG_RESULT(skipping)
200                elif test -r $srcdir/$10/configure; then
201                  coin_subdirs="$coin_subdirs $10"
202                  AC_MSG_RESULT(yes)
203                  AC_CONFIG_SUBDIRS($10)
204                else
205                  AC_MSG_RESULT(no)
206                fi])
207]) # AC_COIN_MAIN_SUBDIRS
208
209###########################################################################
210#                            COIN_CHECK_FILE                              #
211###########################################################################
212
213# A simple replacement for AC_CHECK_FILE that works for cross compilation
214
215AC_DEFUN([AC_COIN_CHECK_FILE],
216[if test -r $1; then
217  $2
218  :
219else
220  $3
221  :
222fi
223])
224
225###########################################################################
226#                        COIN_THIRDPARTY_SUBDIRS                          #
227###########################################################################
228
229# This macro sets up the recursion into the configure script in a
230# subdirectory for compilation of third party code.  The first
231# argument is just the string that appears in the configure output.
232# The second argument is the directory with the configure script, and
233# the third one is a file that should exists in that directory.  If
234# this file does not exist, we assume that the user has not downloaded
235# the code, and we are not going to compile it
236
237AC_DEFUN([AC_COIN_THIRDPARTY_SUBDIRS],
238[AC_MSG_CHECKING(whether code for third party package $1 is available)
239coin_skip=no
240if test x"$COIN_SKIP_PROJECTS" != x; then
241  for dir in $COIN_SKIP_PROJECTS; do
242    if test $dir = $2; then
243      coin_skip=yes
244    fi
245  done
246fi
247if test $coin_skip = yes; then
248  AC_MSG_RESULT(skipping)
249else
250  coin_tmp=`echo $srcdir/$2/$3`
251  # There is probably a more elegant way to get the first thing out here...
252  for i in $coin_tmp; do
253    coin_tmp2=$i
254    #break 1
255  done
256  if test -r $coin_tmp2; then
257    coin_subdirs="$coin_subdirs $2"
258    AC_MSG_RESULT(yes)
259    AC_CONFIG_SUBDIRS($2)
260  else
261    AC_MSG_RESULT(no)
262  fi
263fi
264]) # AC_COIN_THIRDPARTY_SUBDIRS
265
266###########################################################################
267#                           COIN_CHECK_VPATH                              #
268###########################################################################
269
270# This macro sets the variable coin_vpath_config to true if this is a
271# VPATH configuration, otherwise it sets it to false.
272AC_DEFUN([AC_COIN_CHECK_VPATH],
273[AC_MSG_CHECKING(whether this is a VPATH configuration)
274if test `cd $srcdir; pwd` != `pwd`; then
275  coin_vpath_config=yes;
276else
277  coin_vpath_config=no;
278fi
279AC_MSG_RESULT($coin_vpath_config)
280]) # AC_COIN_CHECK_VPATH
281
282###########################################################################
283#                         COIN_PROJECTDIR_INIT                            #
284###########################################################################
285
286# This macro does everything that is required in the early part in the
287# configure script, such as defining a few variables.  This should only be used
288# in the main directory of a project directory (the one which holds the src
289# directory for the project). The first parameter is the project name. The
290# second (optional) is the libtool library version (important for releases,
291# less so for stable or trunk).
292
293AC_DEFUN([AC_COIN_PROJECTDIR_INIT],
294[# Initialize the ADDLIBS variable
295ADDLIBS="-lm $LIBS"
296AC_SUBST(ADDLIBS)
297
298# As backup, we make sure we don't loose an FLIBS if it has been set
299# by the user
300save_FLIBS="$FLIBS"
301
302# Initialize the FADDLIBS variable (which is to be used with a fortran
303# compiler and will not include FLIBS)
304FADDLIBS="$LIBS"
305AC_SUBST(FADDLIBS)
306
307# A useful makefile conditional that is always false
308AM_CONDITIONAL(ALWAYS_FALSE, false)
309
310# We set the following variable so that we know later in AC_COIN_FINALIZE
311# that we are in a project main directory
312coin_projectdir=yes
313
314# Set the project's version number.
315if test "x$1" != x; then
316  # temporary hack to avoid breaking lapack 1.0.20;
317  # do not propagate to BuildTools trunk!  --lh, 100615--
318  if expr "$1" : '.*:.*' >/dev/null 2>&1 ; then
319    coin_libversion="$1"
320  else
321    AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION), ["$PACKAGE_VERSION"],
322                       [Version number of project])
323  fi
324fi
325
326# Capture libtool library version, if given.
327m4_ifvaln([$2],[coin_libversion=$2],[])
328]) # AC_COIN_PROJECTDIR_INIT
329
330###########################################################################
331#                          COIN_DEBUG_COMPILE                             #
332###########################################################################
333
334# enable the configure flags --enable-debug and --enable-debug-prjct
335# (where prcjt is the name of the project in lower case) and set the
336# variable coin_debug_compile to true or false This is used by
337# COIN_PROG_CXX, COIN_PROG_CC and COIN_PROG_F77 to determine the
338# compilation flags.  This macro also makes the switches
339# --with-prjct-verbosity and --with-prjct-checklevel available, which
340# define the preprocessor macros COIN_PRJCT_VERBOSITY and
341# COIN_PRJCT_CHECKLEVEL to the specified value (default is 0).
342#
343# The project specific flags are only made available, if one gives the
344# name of the project as first argument to this macro.
345
346AC_DEFUN([AC_COIN_DEBUG_COMPILE],
347[AC_BEFORE([$0],[AC_COIN_PROG_CXX])dnl
348AC_BEFORE([$0],[AC_COIN_PROG_CC])dnl
349AC_BEFORE([$0],[AC_COIN_PROG_F77])dnl
350
351AC_MSG_CHECKING([whether we want to compile in debug mode])
352
353AC_ARG_ENABLE([debug],
354[AC_HELP_STRING([--enable-debug],
355                [compile all projects with debug options tests])],
356[case "${enableval}" in
357   yes) coin_debug_compile=true
358        if test "${enable_shared+set}" = set; then :; else
359          enable_shared=no
360        fi
361        ;;
362   no)  coin_debug_compile=false
363        ;;
364   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug)
365        ;;
366esac],
367[coin_debug_compile=false])
368
369m4_ifvaln([$1],
370[AC_ARG_ENABLE(debug-m4_tolower($1),
371 [AC_HELP_STRING([--enable-debug-m4_tolower($1)],
372                 [compile this project ($1) with debug options])],
373 [case "${enableval}" in
374    yes) coin_debug_compile=true
375         enable_shared=no
376         ;;
377    no)  coin_debug_compile=false
378         ;;
379    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-m4_tolower($1))
380         ;;
381 esac],[:])
382]) # m4_ifvaln([$1],
383
384if test $coin_debug_compile = true; then
385  AC_MSG_RESULT([yes])
386else
387  AC_MSG_RESULT([no])
388fi
389
390m4_ifvaln([$1],
391[AC_ARG_WITH(m4_tolower($1)-verbosity,
392             AC_HELP_STRING([--with-m4_tolower($1)-verbosity],
393                            [specify the debug verbosity level for project $1]),
394             [if test "$withval" = yes; then
395                withval=1
396              fi
397              m4_tolower(coin_$1_verbosity)=$withval],
398             [m4_tolower(coin_$1_verbosity)=0])
399 AC_DEFINE_UNQUOTED(m4_toupper(COIN_$1_VERBOSITY),
400                    m4_tolower($coin_$1_verbosity),
401                    [Define to the debug verbosity level (0 is no output)])
402
403 AC_ARG_WITH(m4_tolower($1)-checklevel,
404             AC_HELP_STRING([--with-m4_tolower($1)-checklevel],
405                            [specify the sanity check level for project $1]),
406             [if test "$withval" = yes; then
407                withval=1
408              fi
409              m4_tolower(coin_$1_checklevel)=$withval],
410             [m4_tolower(coin_$1_checklevel)=0])
411 AC_DEFINE_UNQUOTED(m4_toupper(COIN_$1_CHECKLEVEL),
412                    m4_tolower($coin_$1_checklevel),
413                    [Define to the debug sanity check level (0 is no test)])
414
415# We use the following variable to have a string with the upper case
416# version of the project name
417COIN_PRJCT=m4_toupper($1)
418
419]) # m4_ifvaln([$1],
420 
421]) # AC_COIN_DEBUG_COMPILE
422
423###########################################################################
424#                          COIN_MINGW_LD_FIX                              #
425###########################################################################
426
427# This macro is included by any PROG_compiler macro, to set the LD
428# environment variable on MinGW to the correct value (link). But note that
429# if we're building in cygwin with -mno-cygwin, we still want ld! If we're
430# building from cygwin with MSVC tools (cl/link), then we do want link and
431# you'd better have your PATH variable straight, else you'll be doing file
432# links instead of code links! Arguably, LDFLAGS should include -mno-cygwin
433# but in practice all linking seems to be handled through the compilers, so
434# CFLAGS and CXXFLAGS suffice.
435
436AC_DEFUN([AC_COIN_MINGW_LD_FIX],
437[case $build in
438  *-mingw*)
439    if test "${LD+set}" = set; then :; else
440      LD=link
441    fi
442    ;;
443 esac
444 case $enable_doscompile in
445   msvc)
446     if test "x${LD+set}" = xset; then :; else
447       LD=link
448     fi
449     ;;
450 esac
451])
452
453###########################################################################
454#                        COIN_ENABLE_DOSCOMPILE                           #
455###########################################################################
456
457# This macro is invoked by any PROG_compiler macro to establish the
458# --enable-doscompile option, used when one wants to compile an executable
459# under Cygwin which also runs directly under DOS (without requiring
460# Cygwin1.dll). The job of this macro is to make sure the option is correct and
461# to set enable_doscompile. Legal values are mingw, msvc, and no (disabled).
462# mingw: Fake mingw under cygwin, using GCC tools and -mno-cygwin. The most
463#        important thing here is that preprocess, compile, and link steps
464#        *all* see -mno-cygwin.
465# msvc:  Assume the presence of cl/link. It's the user's responsibility to
466#        make sure their PATH is correct. In particular, that MSVC link is
467#        found and not cygwin link (we want to do code linking, not file
468#        linking).
469# It's the responsibility of individual PROG_compiler macros to ensure that
470# they correctly set the compiler search list and preprocess, compile, and
471# link flags. This is tied to compiler setup because in practice invocations
472# of the preprocessor and linker are made through the compiler.
473
474AC_DEFUN([AC_COIN_ENABLE_DOSCOMPILE],
475[AC_REQUIRE([AC_CANONICAL_BUILD])
476 AC_ARG_ENABLE([doscompile],
477  [AC_HELP_STRING([--enable-doscompile],
478                  [Under Cygwin, compile so that executables run under DOS.
479                   Set to mingw to use gcc/g++/ld with -mno-cygwin.
480                   Set to msvc to use cl/link (or icl/link).
481                   Default when mentioned: mingw.
482                   Default when not mentioned: disabled.])],
483  [if test "$enable_doscompile" != no; then
484     case $build in
485       *-cygwin* | *-mingw*) ;;
486       *) AC_MSG_ERROR([--enable-doscompile option makes sense only under Cygwin or MinGW]) ;;
487     esac
488   fi],
489  [enable_doscompile=no])
490 case "$enable_doscompile" in
491   mingw)
492     case $build in
493       *-mingw*) enable_doscompile=no ;;
494     esac
495     ;;
496   msvc|no) ;;
497   yes) enable_doscompile=mingw ;;
498   *) AC_MSG_ERROR([Invalid value $enable_doscompile for --enable-doscompile.
499                    Try configure --help=recursive.])
500      ;;
501  esac
502  if test "$enable_doscompile" != no ; then
503    AC_MSG_NOTICE([DOS compile style is: $enable_doscompile])
504  fi
505])
506
507###########################################################################
508#                             COIN_PROG_CXX                               #
509###########################################################################
510
511# Find the compile command by running AC_PROG_CXX (with compiler names for
512# different operating systems) and put it into CXX (unless it was given by the
513# user). Then find an appropriate value for CXXFLAGS. If either of CXXFLAGS or
514# PRJCT_CXXFLAGS is defined, that value is used (replace PRJCT with the upper
515# case name of this project).  It is possible to provide additional -D flags
516# in the variable CXXDEFS, and additional compilation flags with ADD_CXXFLAGS.
517
518AC_DEFUN([AC_COIN_PROG_CXX],
519[AC_REQUIRE([AC_COIN_PROG_CC]) #Let's try if that overcomes configuration problem with VC++ 6.0
520AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
521AC_LANG_PUSH(C++)
522
523AC_ARG_VAR(CXXDEFS,[Additional -D flags to be used when compiling C++ code.])
524AC_ARG_VAR(ADD_CXXFLAGS,[Additional C++ compiler options])
525AC_ARG_VAR(DBG_CXXFLAGS,[Debug C++ compiler options])
526AC_ARG_VAR(OPT_CXXFLAGS,[Optimize C++ compiler options])
527
528coin_has_cxx=yes
529
530save_cxxflags="$CXXFLAGS"
531# For *-*-solaris*, promote Studio/Workshop compiler to front of list.
532case $build in
533  *-cygwin* | *-mingw*)
534             if test "$enable_doscompile" = msvc ; then
535               comps="icl cl"
536             else
537               comps="g++ cl"
538             fi ;;
539  *-*-solaris*)
540             comps="CC xlC_r aCC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
541  *-darwin*) comps="g++ c++ CC" ;;
542          *) comps="xlC_r aCC CC g++ c++ pgCC icpc gpp cxx cc++ cl FCC KCC RCC" ;;
543esac
544
545# We delete the cached value, since the test might not have been
546# performed with our choice of compilers earlier
547$as_unset ac_cv_prog_CXX || test "${ac_cv_prog_CXX+set}" != set || { ac_cv_prog_CXX=; export ac_cv_prog_CXX; }
548# AC_MSG_NOTICE([C++ compiler candidates: $comps])
549AC_PROG_CXX([$comps])
550
551#AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler
552#thus, we test here whether $CXX is actually working
553AC_LANG_PUSH(C++)
554AC_MSG_CHECKING([whether C++ compiler $CXX works]);
555AC_COMPILE_IFELSE(
556  [AC_LANG_PROGRAM(, [int i=0;])],
557  [AC_MSG_RESULT(yes)],
558  [AC_MSG_RESULT(no)
559   AC_MSG_ERROR(failed to find a C++ compiler or C++ compiler $CXX does not work)]
560)
561AC_LANG_POP(C++)
562
563# It seems that we need to cleanup something here for the Windows
564case "$CXX" in
565  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
566    sed -e 's/^void exit (int);//' confdefs.h >> confdefs.hh
567    mv confdefs.hh confdefs.h
568    ;;
569esac
570
571# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
572case "$CXX" in
573  cl* | */cl* | CL* | */CL* )
574    if test "$ac_cv_prog_cxx_g" = yes ; then
575      ac_cv_prog_cxx_g=no
576      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
577    fi ;;
578esac
579CXXFLAGS="$save_cxxflags"
580
581# Check if a project specific CXXFLAGS variable has been set
582if test x$COIN_PRJCT != x; then
583  eval coin_tmp=\${${COIN_PRJCT}_CXXFLAGS+set}
584  if test x$coin_tmp = xset; then
585    eval CXXFLAGS=\${${COIN_PRJCT}_CXXFLAGS}
586  fi
587fi
588
589if test x"$CXXFLAGS" = x; then
590
591# ToDo decide whether we want -DNDEBUG for optimization
592  coin_add_cxxflags=
593  coin_opt_cxxflags=
594  coin_dbg_cxxflags=
595  coin_warn_cxxflags=
596
597  if test "$GXX" = "yes"; then
598    case "$CXX" in
599      icpc* | */icpc*)
600        ;;
601      *)
602# ToDo decide about unroll-loops
603        coin_opt_cxxflags="-O3 -fomit-frame-pointer"
604        coin_add_cxxflags="-pipe"
605        coin_dbg_cxxflags="-g"
606        coin_warn_cxxflags="-Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas"
607        case $build in
608          *-darwin*)
609            ;;
610          *)
611            coin_warn_cxxflags="-pedantic-errors $coin_warn_cxxflags"
612            ;;
613        esac
614
615        case $enable_doscompile in
616          mingw)
617            CXXFLAGS="-mno-cygwin"
618            AC_TRY_LINK(,[int i=0; i++;],[coin_add_cxxflags="-mno-cygwin $coin_add_cxxflags"])
619            CXXFLAGS=
620          ;;
621        esac
622    esac
623  fi
624
625# Note that we do not need to cover GCC in the following tests.
626
627  if test -z "$coin_opt_cxxflags"; then
628    case $build in
629      *-cygwin* | *-mingw*)
630        case "$CXX" in
631          cl* | */cl* | CL* | */CL*)
632            # The MT and MTd options are mutually exclusive
633            coin_opt_cxxflags='-MT -O2'
634            coin_add_cxxflags='-nologo -EHsc -GR -wd4996 -D_CRT_SECURE_NO_DEPRECATE'
635            coin_dbg_cxxflags='-MTd'
636            ;;
637          icl* | */icl* | ICL* | */ICL*)
638            # The MT and MTd options are mutually exclusive
639            coin_opt_cxxflags='-MT -Ox'
640            coin_add_cxxflags='-nologo -EHsc -GR -D_CRT_SECURE_NO_DEPRECATE'
641            coin_dbg_cxxflags='-MTd -debug'
642            ;;
643        esac
644        ;;
645      *-linux-*)
646        case "$CXX" in
647          icpc* | */icpc*)
648            coin_opt_cxxflags="-O3 -ip -mp1"
649            coin_add_cxxflags=""
650            coin_dbg_cxxflags="-g"
651            # Check if -i_dynamic is necessary (for new glibc library)
652            CXXFLAGS=
653            AC_TRY_LINK(,[int i=0; i++;],[],
654                        [coin_add_cxxflags="-i_dynamic $coin_add_cxxflags"])
655            ;;
656          pgCC* | */pgCC*)
657            coin_opt_cxxflags="-fast"
658            coin_add_cxxflags="-Kieee -pc 64"
659            coin_dbg_cxxflags="-g"
660            ;;
661        esac
662        ;;
663      *-ibm-*)
664        case "$CXX" in
665          xlC* | */xlC* | mpxlC* | */mpxlC*)
666            coin_opt_cxxflags="-O -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1"
667            coin_add_cxxflags="-bmaxdata:0x80000000 -qrtti=dyna -qsuppress=1500-036 -qsuppress=1500-029 -qsourcetype=c++"
668            coin_dbg_cxxflags="-g"
669            ;;
670        esac
671        ;;
672      *-hp-*)
673        case "$CXX" in
674          aCC* | */aCC* )
675            coin_opt_cxxflags="-O"
676            coin_add_cxxflags="-AA"
677            coin_dbg_cxxflags="-g"
678            ;;
679        esac
680        ;;
681      *-*-solaris*)
682          coin_opt_cxxflags="-O4"
683          coin_dbg_cxxflags="-g"
684        ;;
685    esac
686  fi
687
688# Generic flag settings. If these don't work, add a case above.
689
690  if test "$ac_cv_prog_cxx_g" = yes && test -z "$coin_dbg_cxxflags" ; then
691    coin_dbg_cxxflags="-g"
692  fi
693
694  if test -z "$coin_opt_cxxflags"; then
695    # Try if -O option works if nothing else is set
696    CXXFLAGS=-O
697    AC_TRY_LINK([],[int i=0; i++;],[coin_opt_cxxflags="-O"])
698  fi
699
700  # if PM doesn't want the warning messages, take them out
701  if test x"$coin_skip_warn_cxxflags" = xyes; then
702    coin_warn_cxxflags=
703  fi
704
705# Do final setup of flags based on values determined above.
706
707  if test x${DBG_CXXFLAGS+set} != xset; then
708    DBG_CXXFLAGS="$coin_dbg_cxxflags $coin_add_cxxflags $coin_warn_cxxflags"
709  fi
710  if test x${OPT_CXXFLAGS+set} != xset; then
711    OPT_CXXFLAGS="$coin_opt_cxxflags $coin_add_cxxflags -DNDEBUG $coin_warn_cxxflags"
712  fi
713
714  DBG_CXXFLAGS="$DBG_CXXFLAGS $ADD_CXXFLAGS $CXXDEFS"
715  OPT_CXXFLAGS="$OPT_CXXFLAGS $ADD_CXXFLAGS $CXXDEFS"
716
717  if test "$coin_debug_compile" = "true"; then
718    CXXFLAGS="$DBG_CXXFLAGS"
719  else
720    CXXFLAGS="$OPT_CXXFLAGS"
721  fi
722
723# Handle the case where CXXFLAGS was set externally.
724else
725  CXXFLAGS="$CXXFLAGS $ADD_CXXFLAGS $CXXDEFS"
726  if test x${DBG_CXXFLAGS+set} != xset; then
727    DBG_CXXFLAGS="$CXXFLAGS"
728  fi
729  if test x${OPT_CXXFLAGS+set} != xset; then
730    OPT_CXXFLAGS="$CXXFLAGS"
731  fi
732fi
733
734# If CXXFLAGS contains -mno-cygwin, CPPFLAGS must also have it.
735
736case "$CXXFLAGS" in
737  *-mno-cygwin*)
738    if test x${CPPFLAGS+set} != xset ; then
739      CPPFLAGS="-mno-cygwin"
740    else
741      case "$CPPFLAGS" in
742        *-mno-cygwin*)
743          ;;
744        *)
745          CPPFLAGS="$CPPFLAGS -mno-cygwin"
746          ;;
747      esac
748    fi ;;
749esac
750
751# Try if CXXFLAGS works
752save_CXXFLAGS="$CXXFLAGS"
753AC_TRY_LINK([],[int i=0; i++;],[],[CXXFLAGS=])
754if test -z "$CXXFLAGS"; then
755  AC_MSG_WARN([The flags CXXFLAGS="$save_CXXFLAGS" do not work.  I will now just try '-O', but you might want to set CXXFLAGS manually.])
756  CXXFLAGS='-O'
757  AC_TRY_LINK([],[int i=0; i++;],[],[CXXFLAGS=])
758  if test -z "$CXXFLAGS"; then
759    AC_MSG_WARN([This value for CXXFLAGS does not work.  I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually.])
760  fi
761fi
762
763AC_MSG_NOTICE([C++ compiler options are: $CXXFLAGS])
764
765AC_ARG_VAR(MPICXX,[C++ MPI Compiler])
766if test x"$MPICXX" = x; then :; else
767  AC_MSG_NOTICE([Will use MPI C++ compiler $MPICXX])
768  CXX="$MPICXX"
769fi
770
771case "$CXX" in
772  cl* | */cl* | CL* | */CL* )
773    AC_COIN_MINGW_LD_FIX
774    ;;
775esac
776
777AC_LANG_POP(C++)
778]) # AC_COIN_PROG_CXX
779
780
781###########################################################################
782#                             COIN_CXXLIBS                                #
783###########################################################################
784
785# Determine the C++ runtime libraries required for linking a C++ library
786# with a Fortran or C compiler.  The result is available in CXXLIBS.
787
788AC_DEFUN([AC_COIN_CXXLIBS],
789[AC_REQUIRE([AC_PROG_CXX])dnl
790AC_LANG_PUSH(C++)
791AC_ARG_VAR(CXXLIBS,[Libraries necessary for linking C++ code with Fortran compiler])
792if test -z "$CXXLIBS"; then
793  if test "$GXX" = "yes"; then
794    case "$CXX" in
795      icpc* | */icpc*)
796        CXXLIBS="-lstdc++"
797        ;;
798      *)
799        CXXLIBS="-lstdc++ -lm" # -lgcc"
800        ;;
801    esac
802  else
803    case $build in
804     *-mingw32 | *-cygwin* )
805      case "$CXX" in
806      cl* | */cl* | CL* | */CL*)
807        CXXLIBS=nothing;;
808      esac;;
809     *-linux-*)
810      case "$CXX" in
811      icpc* | */icpc*)
812        CXXLIBS="-lstdc++"
813             ;;
814      pgCC* | */pgCC*)
815        CXXLIBS="-lstd -lC -lc"
816             ;;
817      esac;;
818    *-ibm-*)
819      CXXLIBS="-lC -lc"
820      ;;
821    *-hp-*)
822      CXXLIBS="-L/opt/aCC/lib -l++ -lstd_v2 -lCsup_v2 -lm -lcl -lc"
823      ;;
824    *-*-solaris*)
825      CXXLIBS="-lCstd -lCrun"
826    esac
827  fi
828fi
829if test -z "$CXXLIBS"; then
830  AC_MSG_WARN([Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran or C).])
831else
832  AC_MSG_NOTICE([Assuming that CXXLIBS is \"$CXXLIBS\".])
833fi
834if test x"$CXXLIBS" = xnothing; then
835  CXXLIBS=
836fi
837AC_LANG_POP(C++)
838]) # AC_COIN_CXXLIBS
839
840###########################################################################
841#                           COIN_CHECK_HEADER                             #
842###########################################################################
843
844# This macro checks for a header file, but it does so without the
845# standard header.  This avoids warning messages like:
846#
847# configure: WARNING: dlfcn.h: present but cannot be compiled
848# configure: WARNING: dlfcn.h:     check for missing prerequisite headers?
849# configure: WARNING: dlfcn.h: see the Autoconf documentation
850# configure: WARNING: dlfcn.h:     section "Present But Cannot Be Compiled"
851# configure: WARNING: dlfcn.h: proceeding with the preprocessor's result
852# configure: WARNING: dlfcn.h: in the future, the compiler will take precedence
853
854# My guess that the problem lay with CPPFLAGS seems to be correct. With this
855# macro reduced to a direct call to AC_CHECK_HEADERS, there are no warnings
856# now that CPPFLAGS contains -mno-cygwin when it needs it. -- lh, 061214 --
857
858# AW 070609: I restored the previous version, since otherwise the warnings
859# still pop up for the cl compiler
860
861AC_DEFUN([AC_COIN_CHECK_HEADER],
862[#if test x"$4" = x; then
863#  hdr="#include <$1>"
864#else
865#  hdr="$4"
866#fi
867#AC_CHECK_HEADERS([$1],[$2],[$3],[$hdr])
868AC_CHECK_HEADERS([$1],[$2],[$3],[$4])
869]) # AC_COIN_CHECK_HEADER
870
871###########################################################################
872#                       COIN_CHECK_CXX_CHEADER                             #
873###########################################################################
874
875# This macro checks for C header files that are used from C++.  For a give
876# stub (e.g., math), it first checks if the C++ library (cmath) is available.
877# If it is, it defines HAVE_CMATH (or whatever the stub is).  If it is not
878# available, it checks for the old C head (math.h) and defines HAVE_MATH_H
879# if that one exists.
880
881AC_DEFUN([AC_COIN_CHECK_CXX_CHEADER],
882[AC_LANG_PUSH(C++)
883AC_COIN_CHECK_HEADER([c$1],[$2],[$3],[$4])
884if test "$ac_cv_header_c$1" != "yes"; then
885  AC_COIN_CHECK_HEADER([$1.h],[$2],[$3],[$4])
886fi
887AC_LANG_POP(C++)
888]) # AC_COIN_CHECK_CXX_CHEADER
889
890###########################################################################
891#                             COIN_PROG_CC                                #
892###########################################################################
893
894# Find the compile command by running AC_PROG_CC (with compiler names
895# for different operating systems) and put it into CC (unless it was
896# given my the user), and find an appropriate value for CFLAGS.  It is
897# possible to provide additional -D flags in the variable CDEFS.
898
899AC_DEFUN([AC_COIN_PROG_CC],
900[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
901AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
902AC_LANG_PUSH(C)
903
904# For consistency, we set the C compiler to the same value of the C++
905# compiler, if the C++ is set, but the C compiler isn't (only for CXX=cl)
906if test x"$CXX" != x; then
907  case "$CXX" in
908    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
909      if test x"$CC" = x; then
910        CC="$CXX"
911        AC_MSG_WARN([C++ compiler name provided as $CXX, but CC is unset. Setting CC to $CXX])
912      fi
913      ;;
914  esac
915fi
916
917AC_ARG_VAR(CDEFS,[Additional -D flags to be used when compiling C code.])
918AC_ARG_VAR(ADD_CFLAGS,[Additional C compiler options])
919AC_ARG_VAR(DBG_CFLAGS,[Debug C compiler options])
920AC_ARG_VAR(OPT_CFLAGS,[Optimize C compiler options])
921
922coin_has_cc=yes
923
924save_cflags="$CFLAGS"
925
926# For *-*-solaris*, promote Studio/Workshop cc compiler to front of list.
927# Depending on the user's PATH, when Studio/Workshop cc is not present we may
928# find /usr/ucb/cc, which is almost certainly not a good choice for the C
929# compiler. In this case, put cc after gcc.
930
931case $build in
932  *-cygwin* | *-mingw*)
933             if test "$enable_doscompile" = msvc ; then
934               comps="icl cl"
935             else
936               comps="gcc cl"
937             fi ;;
938  *-*-solaris*)
939             AC_CHECK_PROG(sol_cc_compiler,cc,cc,[],[],/usr/ucb/cc)
940             if test "$sol_cc_compiler" = "cc" ; then
941               comps="cc xlc gcc pgcc icc"
942             else
943               comps="xlc gcc pgcc icc cc"
944             fi
945             ;;
946  *-linux-*) comps="xlc gcc cc pgcc icc" ;;
947  *)         comps="xlc_r xlc cc gcc pgcc icc" ;;
948esac
949
950# We delete the cached value, since the test might not have been
951# performed with our choice of compilers earlier
952$as_unset ac_cv_prog_CC || test "${ac_cv_prog_CC+set}" != set || { ac_cv_prog_CC=; export ac_cv_prog_CC; }
953# AC_MSG_NOTICE([C compiler candidates: $comps])
954AC_PROG_CC([$comps])
955if test -z "$CC" ; then
956  AC_MSG_ERROR([Failed to find a C compiler!])
957fi
958# Autoconf incorrectly concludes that cl recognises -g. It doesn't.
959case "$CC" in
960  cl* | */cl* | CL* | */CL* )
961    if test "$ac_cv_prog_cc_g" = yes ; then
962      ac_cv_prog_cc_g=no
963      AC_MSG_NOTICE([Overruling autoconf; cl does not recognise -g.])
964    fi ;;
965esac
966CFLAGS="$save_cflags"
967
968# Check if a project specific CFLAGS variable has been set
969if test x$COIN_PRJCT != x; then
970  eval coin_tmp=\${${COIN_PRJCT}_CFLAGS+set}
971  if test x$coin_tmp = xset; then
972    eval CFLAGS=\${${COIN_PRJCT}_CFLAGS}
973  fi
974fi
975
976if test x"$CFLAGS" = x; then
977
978  coin_add_cflags=
979  coin_opt_cflags=
980  coin_dbg_cflags=
981  coin_warn_cflags=
982
983  if test "$GCC" = "yes"; then
984    case "$CC" in
985      icc* | */icc*)
986        ;;
987      *)
988        coin_opt_cflags="-O3 -fomit-frame-pointer"
989        coin_add_cflags="-pipe"
990        coin_dbg_cflags="-g"
991        coin_warn_cflags="-Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wno-unknown-pragmas"
992        case $build in
993          *-darwin*)
994            ;;
995          *)
996            coin_warn_cflags="-pedantic-errors $coin_warn_cflags"
997            ;;
998        esac
999        case $enable_doscompile in
1000          mingw)
1001            CFLAGS="-mno-cygwin"
1002            AC_TRY_LINK([],[int i=0; i++;],
1003                        [coin_add_cflags="-mno-cygwin $coin_add_cflags"])
1004            CFLAGS=
1005          ;;
1006        esac
1007    esac
1008  fi
1009  if test -z "$coin_opt_cflags"; then
1010    case $build in
1011      *-cygwin* | *-mingw*)
1012        case "$CC" in
1013          cl* | */cl* | CL* | */CL*)
1014            coin_opt_cflags='-MT -O2'
1015            coin_add_cflags='-nologo -wd4996 -D_CRT_SECURE_NO_DEPRECATE'
1016            coin_dbg_cflags='-MTd'
1017            ;;
1018          icl* | */icl* | ICL* | */ICL*)
1019            coin_opt_cflags='-MT -Ox'
1020            coin_add_cflags='-nologo -D_CRT_SECURE_NO_DEPRECATE'
1021            coin_dbg_cflags='-MTd -debug'
1022            ;;
1023        esac
1024        ;;
1025      *-linux-*)
1026        case "$CC" in
1027          icc* | */icc*)
1028            coin_opt_cflags="-O3 -ip -mp1"
1029            coin_add_cflags=""
1030            coin_dbg_cflags="-g"
1031            # Check if -i_dynamic is necessary (for new glibc library)
1032            CFLAGS=
1033            AC_TRY_LINK([],[int i=0; i++;],[],
1034                        [coin_add_cflags="-i_dynamic $coin_add_cflags"])
1035            ;;
1036          pgcc* | */pgcc*)
1037            coin_opt_cflags="-fast"
1038            coin_add_cflags="-Kieee -pc 64"
1039            coin_dbg_cflags="-g"
1040            ;;
1041        esac
1042        ;;
1043      *-ibm-*)
1044        case "$CC" in
1045          xlc* | */xlc* | mpxlc* | */mpxlc*)
1046            coin_opt_cflags="-O -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1"
1047            coin_add_cflags="-bmaxdata:0x80000000 -qsuppress=1500-036 -qsuppress=1500-029"
1048            coin_dbg_cflags="-g"
1049          ;;
1050        esac
1051        ;;
1052      *-hp-*)
1053        coin_opt_cflags="-O"
1054        coin_add_cflags="-Ae"
1055        coin_dbg_cflags="-g"
1056        ;;
1057      *-*-solaris*)
1058        coin_opt_cflags="-xO4"
1059        coin_dbg_cflags="-g"
1060        ;;
1061      *-sgi-*)
1062        coin_opt_cflags="-O -OPT:Olimit=0"
1063        coin_dbg_cflags="-g"
1064        ;;
1065    esac
1066  fi
1067
1068  if test "$ac_cv_prog_cc_g" = yes && test -z "$coin_dbg_cflags" ; then
1069    coin_dbg_cflags="-g"
1070  fi
1071
1072  if test -z "$coin_opt_cflags"; then
1073    # Try if -O option works if nothing else is set
1074    CFLAGS="-O"
1075    AC_TRY_LINK([],[int i=0; i++;],[coin_opt_cflags="-O"])
1076  fi
1077
1078  # if PM doesn't want the warning messages, take them out
1079  if test x"$coin_skip_warn_cflags" = xyes; then
1080    coin_warn_cflags=
1081  fi
1082
1083  if test x${DBG_CFLAGS+set} != xset; then
1084    DBG_CFLAGS="$coin_dbg_cflags $coin_add_cflags $coin_warn_cflags"
1085  fi
1086  if test x${OPT_CFLAGS+set} != xset; then
1087    OPT_CFLAGS="$coin_opt_cflags $coin_add_cflags -DNDEBUG $coin_warn_cflags"
1088  fi
1089
1090  DBG_CFLAGS="$DBG_CFLAGS $ADD_CFLAGS $CDEFS"
1091  OPT_CFLAGS="$OPT_CFLAGS $ADD_CFLAGS $CDEFS"
1092
1093  if test "$coin_debug_compile" = "true"; then
1094    CFLAGS="$DBG_CFLAGS"
1095  else
1096    CFLAGS="$OPT_CFLAGS"
1097  fi
1098else
1099  CFLAGS="$CFLAGS $ADD_CFLAGS $CDEFS"
1100  if test x${DBG_CFLAGS+set} != xset; then
1101    DBG_CFLAGS="$CFLAGS"
1102  fi
1103  if test x${OPT_CFLAGS+set} != xset; then
1104    OPT_CFLAGS="$CFLAGS"
1105  fi
1106fi
1107
1108# If CFLAGS contains -mno-cygwin, CPPFLAGS must also have it.
1109
1110case "$CFLAGS" in
1111  *-mno-cygwin*)
1112    if test x${CPPFLAGS+set} != xset ; then
1113      CPPFLAGS="-mno-cygwin"
1114    else
1115      case "$CPPFLAGS" in
1116        *-mno-cygwin*)
1117          ;;
1118        *)
1119          CPPFLAGS="$CPPFLAGS -mno-cygwin"
1120          ;;
1121      esac
1122    fi ;;
1123esac
1124
1125# Try if CFLAGS works
1126save_CFLAGS="$CFLAGS"
1127AC_TRY_LINK([],[int i=0; i++;],[],[CFLAGS=])
1128if test -z "$CFLAGS"; then
1129  AC_MSG_WARN([The value CFLAGS="$save_CFLAGS" do not work.  I will now just try '-O', but you might want to set CFLAGS manually.])
1130  CFLAGS='-O'
1131  AC_TRY_LINK([],[int i=0; i++;],[],[CFLAGS=])
1132  if test -z "$CFLAGS"; then
1133    AC_MSG_WARN([This value for CFLAGS does not work.  I will continue with empty CFLAGS, but you might want to set CFLAGS manually.])
1134  fi
1135fi
1136
1137AC_MSG_NOTICE([C compiler options are: $CFLAGS])
1138
1139AC_ARG_VAR(MPICC,[C MPI Compiler])
1140if test x"$MPICC" = x; then :; else
1141  AC_MSG_NOTICE([Will use MPI C compiler $MPICC])
1142  CC="$MPICC"
1143fi
1144
1145# Correct ADDLIBS initialization if we are using the MS compiler
1146case "$CC" in
1147  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
1148    ADDLIBS=
1149    AC_COIN_MINGW_LD_FIX
1150    ;;
1151esac
1152
1153AC_LANG_POP(C)
1154]) # AC_COIN_PROG_CC
1155
1156###########################################################################
1157#                             COIN_PROG_F77                               #
1158###########################################################################
1159
1160# Find the compile command by running AC_PROG_F77 (with compiler names
1161# for different operating systems) and put it into F77 (unless it was
1162# given by the user), and find an appropriate value for FFLAGS
1163
1164AC_DEFUN([AC_COIN_PROG_F77],
1165[AC_REQUIRE([AC_COIN_MINGW_LD_FIX])
1166AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
1167AC_REQUIRE([AC_COIN_PROG_CC])
1168AC_REQUIRE([AC_COIN_F77_COMPS])
1169AC_LANG_PUSH([Fortran 77])
1170
1171AC_ARG_VAR(ADD_FFLAGS,[Additional Fortran compiler options])
1172AC_ARG_VAR(DBG_FFLAGS,[Debug Fortran compiler options])
1173AC_ARG_VAR(OPT_FFLAGS,[Optimize Fortran compiler options])
1174
1175coin_has_f77=yes
1176
1177save_fflags="$FFLAGS"
1178
1179# We delete the cached value, since the test might not have been
1180# performed with our choice of compilers earlier
1181$as_unset ac_cv_prog_F77 || test "${ac_cv_prog_F77+set}" != set || { ac_cv_prog_F77=; export ac_cv_prog_F77; }
1182
1183# This is a real belt-and-suspenders approach. AC_COIN_FIND_F77 will use
1184# coin_f77_comps to see if there's a program that matches one of the names.
1185# If there's no such program, F77 = unavailable. If we match the name,
1186# feed AC_PROG_F77 the same search list, just to be sure it's a functioning
1187# compiler.
1188# AC_MSG_NOTICE([Fortran compiler candidates: $coin_f77_comps])
1189AC_COIN_FIND_F77
1190if test "$F77" != "unavailable" ; then
1191  AC_PROG_F77($coin_f77_comps)
1192else
1193  AC_MSG_WARN([Failed to find a Fortran compiler!])
1194fi
1195
1196FFLAGS="$save_fflags"
1197
1198# Check if a project specific FFLAGS variable has been set
1199if test x$COIN_PRJCT != x; then
1200  eval coin_tmp=\${${COIN_PRJCT}_FFLAGS+set}
1201  if test x$coin_tmp = xset; then
1202    eval FFLAGS=\${${COIN_PRJCT}_FFLAGS}
1203  fi
1204fi
1205
1206if test "$F77" != "unavailable" && test x"$FFLAGS" = x ; then
1207
1208  coin_add_fflags=
1209  coin_opt_fflags=
1210  coin_dbg_fflags=
1211  coin_warn_fflags=
1212
1213  if test "$G77" = "yes"; then
1214    coin_opt_fflags="-O3 -fomit-frame-pointer"
1215    coin_add_fflags="-pipe"
1216    coin_dbg_fflags="-g"
1217    case $enable_doscompile in
1218      mingw)
1219        FFLAGS="-mno-cygwin"
1220        AC_TRY_LINK(,[      write(*,*) 'Hello world'],
1221                    [coin_add_fflags="-mno-cygwin $coin_add_fflags"])
1222        FFLAGS=
1223      ;;
1224    esac
1225  else
1226    case $build in
1227      *-cygwin* | *-mingw*)
1228        case $F77 in
1229          ifort* | */ifort* | IFORT* | */IFORT* )
1230            coin_opt_fflags='-MT -O3'
1231            coin_add_fflags='-fpp -nologo'
1232            coin_dbg_fflags='-MTd -debug'
1233          ;;
1234          compile_f2c*)
1235            coin_opt_fflags='-MT -O2'
1236            coin_add_fflags='-nologo -wd4996'
1237            coin_dbg_fflags='-MTd'
1238          ;;
1239        esac
1240        ;;
1241      *-linux-*)
1242        case $F77 in
1243          ifc* | */ifc* | ifort* | */ifort*)
1244            coin_opt_fflags="-O3 -ip"
1245            coin_add_fflags="-cm -w90 -w95"
1246            coin_dbg_fflags="-g -CA -CB -CS"
1247            # Check if -i_dynamic is necessary (for new glibc library)
1248            FFLAGS=
1249            AC_TRY_LINK(,[      write(*,*) 'Hello world'],[],
1250                        [coin_add_fflags="-i_dynamic $coin_add_fflags"])
1251            ;;
1252          pgf77* | */pgf77* | pgf90* | */pgf90*)
1253            coin_opt_fflags="-fast"
1254            coin_add_fflags="-Kieee -pc 64"
1255            coin_dbg_fflags="-g"
1256          ;;
1257        esac
1258        ;;
1259      *-ibm-*)
1260        case "$F77" in
1261          xlf* | */xlf* | mpxlf* | */mpxlf* )
1262            coin_opt_fflags="-O -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1"
1263            coin_add_fflags="-bmaxdata:0x80000000 -qsuppress=1500-036 -qsuppress=1500-029"
1264            coin_dbg_fflags="-g -C"
1265            ;;
1266        esac
1267        ;;
1268      *-hp-*)
1269        coin_opt_fflags="+O3"
1270        coin_add_fflags="+U77"
1271        coin_dbg_fflags="-C -g"
1272        ;;
1273      *-*-solaris*)
1274        coin_opt_fflags="-O4"
1275        coin_dbg_fflags="-g"
1276        ;;
1277      *-sgi-*)
1278        coin_opt_fflags="-O5 -OPT:Olimit=0"
1279        coin_dbg_fflags="-g"
1280        ;;
1281    esac
1282  fi
1283
1284  if test "$ac_cv_prog_f77_g" = yes && test -z "$coin_dbg_fflags" ; then
1285    coin_dbg_fflags="-g"
1286  fi
1287
1288  if test -z "$coin_opt_fflags"; then
1289    # Try if -O option works if nothing else is set
1290    FFLAGS=-O
1291    AC_TRY_LINK(,[      integer i], [coin_opt_fflags="-O"])
1292  fi
1293
1294  # if PM doesn't want the warning messages, take them out
1295  if test x"$coin_skip_warn_fflags" = xyes; then
1296    coin_warn_fflags=
1297  fi
1298
1299  if test x${DBG_FFLAGS+set} != xset; then
1300    DBG_FFLAGS="$coin_dbg_fflags $coin_add_fflags $coin_warn_fflags"
1301  fi
1302  if test x${OPT_FFLAGS+set} != xset; then
1303    OPT_FFLAGS="$coin_opt_fflags $coin_add_fflags $coin_warn_fflags"
1304  fi
1305
1306  DBG_FFLAGS="$DBG_FFLAGS $ADD_FFLAGS"
1307  OPT_FFLAGS="$OPT_FFLAGS $ADD_FFLAGS"
1308
1309  if test "$coin_debug_compile" = "true"; then
1310    FFLAGS="$DBG_FFLAGS"
1311  else
1312    FFLAGS="$OPT_FFLAGS"
1313  fi
1314else
1315  FFLAGS="$FFLAGS $ADD_FFLAGS"
1316  if test x${DBG_FFLAGS+set} != xset; then
1317    DBG_FFLAGS="$FFLAGS"
1318  fi
1319  if test x${OPT_FFLAGS+set} != xset; then
1320    OPT_FFLAGS="$FFLAGS"
1321  fi
1322fi
1323
1324# If FFLAGS contains -mno-cygwin, CPPFLAGS must have it.
1325case "$FFLAGS" in
1326  *-mno-cygwin*)
1327    if test x${CPPFLAGS+set} != xset ; then
1328      CPPFLAGS="-mno-cygwin"
1329    else
1330      case "$CPPFLAGS" in
1331        *-mno-cygwin*)
1332          ;;
1333        *)
1334          CPPFLAGS="$CPPFLAGS -mno-cygwin"
1335          ;;
1336      esac
1337    fi ;;
1338esac
1339
1340# Try if FFLAGS works
1341if test "$F77" != "unavailable" ; then
1342  AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
1343  if test -z "$FFLAGS"; then
1344    AC_MSG_WARN([The flags FFLAGS="$FFLAGS" do not work.  I will now just try '-O', but you might want to set FFLAGS manually.])
1345    FFLAGS='-O'
1346    AC_TRY_LINK(,[      integer i],[],[FFLAGS=])
1347    if test -z "$FFLAGS"; then
1348      AC_MSG_WARN([This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually.])
1349    fi
1350  fi
1351fi
1352
1353AC_MSG_NOTICE([Fortran compiler options are: $FFLAGS])
1354
1355AC_ARG_VAR(MPIF77,[Fortran MPI Compiler])
1356if test x"$MPIF77" = x; then :; else
1357  AC_MSG_NOTICE([Will use MPI Fortran compiler $MPIF77])
1358  F77="$MPIF77"
1359fi
1360
1361case "$F77" in
1362  ifort* | */ifort* | IFORT* | */IFORT*)
1363    AC_COIN_MINGW_LD_FIX
1364    ;;
1365esac
1366
1367AC_LANG_POP([Fortran 77])
1368]) # AC_COIN_PROG_F77
1369
1370###########################################################################
1371#                           COIN_F77_WRAPPERS                             #
1372###########################################################################
1373
1374# Calls autoconfs AC_F77_WRAPPERS and does additional corrections to FLIBS
1375
1376AC_DEFUN([AC_COIN_F77_WRAPPERS],
1377[AC_BEFORE([AC_COIN_PROG_F77],[$0])dnl
1378AC_BEFORE([AC_PROG_F77],[$0])dnl
1379
1380AC_LANG_PUSH([Fortran 77])
1381
1382AC_F77_WRAPPERS
1383
1384# If FLIBS has been set by the user, we just restore its value here
1385if test x"$save_FLIBS" != x; then
1386  FLIBS="$save_FLIBS"
1387else
1388  # This is to correct a missing exclusion in autoconf 2.59
1389  if test x"$FLIBS" != x; then
1390    my_flibs=
1391    for flag in $FLIBS; do
1392      case $flag in
1393        -lcrt*.o) ;;
1394        -lcygwin) ;;
1395               *) my_flibs="$my_flibs $flag" ;;
1396      esac
1397    done
1398    FLIBS="$my_flibs"
1399  fi
1400
1401  case $build in
1402  # The following is a fix to define FLIBS for ifort on Windows
1403  # In its original version, it linked in libifcorert.lib or libifcorertd.lib on Windows/ifort explicitly.
1404  # However, this seem to create a dependency on libifcorert.dll (or libifcorertd.dll) in the executables.
1405  # This is seem to be unnecessary, libifcorert(d).lib has been removed from the link line.
1406     *-cygwin* | *-mingw*)
1407       case "$F77" in
1408         ifort* | */ifort* | IFORT* | */IFORT*)
1409           FLIBS="-link $LIBS /NODEFAULTLIB:libc.lib"
1410#           if "$coin_debug_compile" = true ; then
1411#             FLIBS="-link $LIBS /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib"
1412#           else
1413#             FLIBS="-link $LIBS /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmtd.lib"
1414#           fi
1415           ;;
1416         compile_f2c*)
1417           FLIBS=`$F77 -FLIBS` ;;
1418       esac;;
1419     *-hp-*)
1420         FLIBS="$FLIBS -lm";;
1421     *-ibm-*)
1422         FLIBS=`echo $FLIBS | sed 's/-lc)/-lc/g'` ;;
1423     *-linux-*)
1424       case "$F77" in
1425         pgf77* | */pgf77* | pgf90* | */pgf90*)
1426# ask linker to go through the archives multiple times
1427# (the Fortran compiler seems to do that automatically...
1428           FLIBS="-Wl,--start-group $FLIBS -Wl,--end-group" ;;
1429       esac
1430  esac
1431  ac_cv_f77_libs="$FLIBS"
1432fi
1433
1434AC_LANG_POP([Fortran 77])
1435
1436]) # AC_COIN_F77_WRAPPERS
1437
1438###########################################################################
1439#                             COIN_FIND_F77                               #
1440###########################################################################
1441
1442# Attempt to preempt autoconf by locating an appropriate F77 program. This
1443# macro will not trigger a fatal error if a suitable compiler cannot be
1444# found. It should be called before COIN_PROG_F77 or COIN_TRY_FLINK.
1445
1446AC_DEFUN([AC_COIN_FIND_F77],
1447[AC_REQUIRE([AC_COIN_ENABLE_DOSCOMPILE])
1448AC_REQUIRE([AC_COIN_F77_COMPS])
1449AC_MSG_NOTICE([Trying to determine Fortran compiler name])
1450AC_CHECK_PROGS([F77],[$coin_f77_comps],[unavailable])
1451])
1452
1453# Auxilliary macro to make sure both COIN_PROG_F77 and COIN_FIND_F77 use
1454# the same search lists for compiler names.
1455# For *-*-solaris*, promote Studio/Workshop compilers to front of list.
1456AC_DEFUN([AC_COIN_F77_COMPS],
1457[case $build in
1458  *-cygwin* | *-mingw*)
1459     if test "$enable_doscompile" = msvc ; then
1460       coin_f77_comps="ifort fl32 compile_f2c"
1461     else
1462       coin_f77_comps="gfortran g77 ifort fl32 compile_f2c"
1463     fi ;;
1464  *-*-solaris*)
1465     coin_f77_comps="f95 f90 f77 xlf_r fort77 gfortran g77 pgf90 pgf77 ifort ifc frt af77" ;;
1466  *) coin_f77_comps="xlf_r fort77 gfortran f77 g77 pgf90 pgf77 ifort ifc frt af77" ;;
1467 esac
1468])
1469
1470###########################################################################
1471#                          COIN_INIT_AUTOMAKE                             #
1472###########################################################################
1473
1474# This macro calls the regular INIT_AUTOMAKE and MAINTAINER_MODE
1475# macros, and defines additional variables and makefile conditionals,
1476# that are used in the maintainer parts of the makfile.  It also
1477# checks if the correct versions of the autotools are used.
1478#
1479# This also defines the AC_SUBST variables:
1480# abs_source_dir     absolute path to source code for this package
1481# abs_bin_dir        absolute path to the directory where binaries are
1482#                    going to be installed (prefix/bin)
1483# abs_lib_dir        absolute path to the directory where libraries are
1484#                    going to be installed (prefix/lib)
1485# abs_include_dir    absolute path to the directory where the header files
1486#                    are installed (prefix/include)
1487
1488AC_DEFUN([AC_COIN_INIT_AUTOMAKE],
1489[AC_REQUIRE([AC_PROG_EGREP])
1490
1491# AC_MSG_NOTICE([Beginning automake initialisation.])
1492# Stuff for automake
1493AM_INIT_AUTOMAKE
1494AM_MAINTAINER_MODE
1495
1496coin_have_externals=no
1497if test "$enable_maintainer_mode" = yes; then
1498
1499  # If maintainer mode is chosen, we make sure that the correct versions
1500  # of the tools are used, and that we know where libtool.m4 is (to
1501  # recreate acinclude.m4)
1502
1503  AC_SUBST(LIBTOOLM4)
1504  LIBTOOLM4=
1505  # Normally, $HOME
1506  AUTOTOOLS_DFLT=$HOME
1507
1508  AC_CACHE_CHECK([whether we are using the correct autotools],
1509                 [ac_cv_use_correct_autotools],
1510                 [ac_cv_use_correct_autotools=check])
1511
1512  if test $ac_cv_use_correct_autotools = check; then
1513    ac_cv_use_correct_autotools=yes
1514    # Check if we have autoconf
1515    AC_CHECK_PROG([have_autoconf],[autoconf],[yes],[no])
1516    if test $have_autoconf = no; then
1517      AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find autoconf in your path.])
1518    fi
1519
1520    # Check whether autoconf is the correct version
1521    correct_version='2.59'
1522    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
1523    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of autoconf])
1524    autoconf --version > confauto.out 2>&1
1525    if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
1526      AC_MSG_RESULT([yes])
1527    else
1528      rm -f confauto.out
1529      AC_MSG_RESULT([no])
1530      AC_MSG_ERROR([You don't have the correct version of autoconf as the first one in your path.])
1531    fi
1532    rm -f confauto.out
1533
1534    # Check if the executable autoconf is picked up from the correct location
1535    AC_MSG_CHECKING([whether autoconf is coming from the correct location])
1536    autoconf_dir=`which autoconf | sed -e 's=/autoconf=='`
1537    autoconf_dir=`cd $autoconf_dir; pwd`
1538    if test x$AUTOTOOLS_DIR = x; then
1539      want_dir=$AUTOTOOLS_DFLT/bin
1540    else
1541      want_dir=$AUTOTOOLS_DIR/bin
1542    fi
1543    if test $autoconf_dir = `cd $want_dir; pwd`; then
1544      AC_MSG_RESULT([yes])
1545    else
1546      rm -f confauto.out
1547      AC_MSG_RESULT([no])
1548      AC_MSG_ERROR([The autoconf executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
1549    fi
1550
1551    # Check if we have automake
1552    AC_CHECK_PROG([have_automake],[automake],[yes],[no])
1553    if test $have_automake = no; then
1554      AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find automake in your path.])
1555    fi
1556 
1557    # Check whether automake is the correct version
1558    correct_version='1.9.6'
1559    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
1560    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of automake])
1561    automake --version > confauto.out 2>&1
1562    if $EGREP $grep_version confauto.out >/dev/null 2>&1; then
1563      AC_MSG_RESULT([yes])
1564    else
1565      rm -f confauto.out
1566      AC_MSG_RESULT([no])
1567      AC_MSG_ERROR([You don't have the correct version of automake as the first one in your path.])
1568    fi
1569    rm -f confauto.out
1570
1571    # Check if the executable automake is picked up from the correct location
1572    AC_MSG_CHECKING([whether automake is coming from the correct location])
1573    automake_dir=`which automake | sed -e 's=/automake=='`
1574    automake_dir=`cd $automake_dir; pwd`
1575    if test x$AUTOTOOLS_DIR = x; then
1576      want_dir=$AUTOTOOLS_DFLT/bin
1577    else
1578      want_dir=$AUTOTOOLS_DIR/bin
1579    fi
1580    if test $automake_dir = `cd $want_dir; pwd`; then
1581      AC_MSG_RESULT([yes])
1582    else
1583      rm -f confauto.out
1584      AC_MSG_RESULT([no])
1585      AC_MSG_ERROR([The automake executable should be picked up from \$AUTOTOOLS_DFLT/bin or \$AUTOTOOLS_DIR/bin.])
1586    fi
1587
1588    # Check if this is the correct version of libtool (with escaped dots)
1589    if test x$AUTOTOOLS_DIR = x; then
1590      want_dir=$AUTOTOOLS_DFLT/share
1591    else
1592      want_dir=$AUTOTOOLS_DIR/share
1593    fi
1594    correct_version='1.5.22'
1595    grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
1596    AC_COIN_CHECK_FILE([$want_dir/libtool/ltmain.sh],
1597                       [have_ltmain=yes],
1598                       [have_ltmain=no])
1599    AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of libtool.])
1600    if test $have_ltmain = yes; then
1601    if $EGREP $grep_version $want_dir/libtool/ltmain.sh >/dev/null 2>&1; then
1602        AC_MSG_RESULT([yes])
1603      else
1604        AC_MSG_RESULT([no])
1605        AC_MSG_ERROR([You don't have the correct version of libtool.])
1606      fi
1607    else
1608      AC_MSG_RESULT([no])
1609      AC_MSG_ERROR([I cannot find the ltmain.sh file.])
1610    fi
1611  fi
1612
1613  # Check if we can find the libtool file
1614  if test x$AUTOTOOLS_DIR = x; then
1615    want_dir=$AUTOTOOLS_DFLT/share
1616  else
1617    want_dir=$AUTOTOOLS_DIR/share
1618  fi
1619  AC_COIN_CHECK_FILE([$want_dir/aclocal/libtool.m4],
1620                     [LIBTOOLM4="$want_dir/aclocal/libtool.m4"],
1621                     [AC_MSG_ERROR([I cannot find the libtool.m4 file.])])
1622
1623  # Check if we have an Externals file
1624  if test -r $srcdir/Externals; then
1625    coin_have_externals=yes
1626  fi
1627  # Check if subversion is installed and understands https
1628  AC_CHECK_PROG([have_svn],[svn],[yes],[no])
1629  if test x$have_svn = xyes; then
1630    AC_CACHE_CHECK([whether svn understands https],
1631                   [ac_cv_svn_understands_https],
1632                   [svn --version > confauto.out 2>&1
1633                    if $EGREP https confauto.out >/dev/null 2>&1; then
1634                      ac_cv_svn_understands_https=yes
1635                    else
1636                      ac_cv_svn_understands_https=no
1637                      have_svn=no
1638                      ac_cv_prog_have_svn=no
1639                    fi
1640                    rm -f confauto.out])
1641  fi
1642
1643  # Find the location of the BuildTools directory
1644  BUILDTOOLSDIR=
1645  if test -r $srcdir/BuildTools/coin.m4; then
1646    BUILDTOOLSDIR=$srcdir/BuildTools
1647  else
1648    if test -r $srcdir/../BuildTools/coin.m4; then
1649      BUILDTOOLSDIR=$srcdir/../BuildTools
1650    else
1651      if test -r $srcdir/../../BuildTools/coin.m4; then
1652        BUILDTOOLSDIR=$srcdir/../../BuildTools
1653      else
1654        AC_MSG_ERROR(Cannot find the BuildTools directory)
1655      fi
1656    fi
1657  fi
1658  AC_SUBST(BUILDTOOLSDIR)
1659
1660  # The following variable is set to the name of the directory where
1661  # the autotool scripts are located
1662  AC_SUBST(AUX_DIR)
1663  AUX_DIR=$ac_aux_dir
1664fi
1665
1666# helpful variable for the base directory of this package
1667abs_source_dir=`cd $srcdir; pwd`
1668AC_SUBST(abs_source_dir)
1669
1670# Stuff for example Makefiles
1671if test x$prefix = xNONE; then
1672  full_prefix=$ac_default_prefix
1673else
1674  full_prefix=$prefix
1675fi
1676full_prefix=`cd $full_prefix ; pwd`
1677AC_SUBST(abs_lib_dir)
1678abs_lib_dir=$full_prefix/lib
1679AC_SUBST(abs_include_dir)
1680abs_include_dir=$full_prefix/include
1681AC_SUBST(abs_bin_dir)
1682abs_bin_dir=$full_prefix/bin
1683
1684AM_CONDITIONAL(HAVE_EXTERNALS,
1685               test $coin_have_externals = yes && test x$have_svn = xyes)
1686
1687# AC_MSG_NOTICE([End automake initialisation.])
1688
1689]) # AC_COIN_INIT_AUTOMAKE
1690
1691###########################################################################
1692#                          COIN_CREATE_LIBTOOL                            #
1693###########################################################################
1694
1695# This does all the tests necessary to create the libtool script in the
1696# package base directory.  If this is used, then the COIN_INIT_AUTO_TOOLS
1697# test in the subdirectories will be able to skip the libtool tests and
1698# just use the one in the package base directory.
1699
1700m4_define([AC_COIN_CREATE_LIBTOOL],
1701[AC_CANONICAL_BUILD
1702
1703# Check if user wants to produce debugging code
1704AC_COIN_DEBUG_COMPILE
1705
1706# Get the name of the C compiler and appropriate compiler options
1707AC_COIN_PROG_CC
1708
1709# Get the name of the C++ compiler and appropriate compiler options
1710AC_COIN_PROG_CXX
1711
1712# Get the name of the Fortran compiler and appropriate compiler options
1713AC_COIN_PROG_F77
1714
1715# Initialize automake and libtool
1716# AC_MSG_NOTICE([Calling INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
1717AC_COIN_INIT_AUTO_TOOLS
1718# AC_MSG_NOTICE([Finished INIT_AUTO_TOOLS from CREATE_LIBTOOL.])
1719])
1720
1721###########################################################################
1722#                         COIN_INIT_AUTO_TOOLS                            #
1723###########################################################################
1724
1725# Initialize the auto tools automake and libtool, with all
1726# modifications we want for COIN packages.
1727#
1728# RPATH_FLAGS        link flags for hardcoding path to shared objects
1729
1730# This is a trick to have this code before AC_COIN_PROG_LIBTOOL
1731AC_DEFUN([AC_COIN_DISABLE_STATIC],
1732[
1733# Test if force_shared has been set
1734if test "x$1" = xforce_shared; then
1735  if test x$enable_shared = xno; then
1736    AC_MSG_ERROR([Shared libraries are disabled by user, but this is not feasible with the given options])
1737  fi
1738  enable_shared=yes;
1739else
1740  # On Cygwin and AIX, building DLLs doesn't work
1741  case $build in
1742    *-cygwin*)
1743      coin_disable_shared=yes
1744      platform=Cygwin
1745    ;;
1746    *-aix*)
1747      coin_disable_shared=yes
1748      platform=AIX
1749    ;;
1750    *-mingw*)
1751      coin_disable_shared=yes
1752      platform="Msys"
1753#      case "$CXX" in
1754#        cl*)
1755#          coin_disable_shared=yes
1756#          platform="Msys with cl"
1757#      ;;
1758#      esac
1759    ;;
1760  esac
1761fi
1762if test x"$coin_disable_shared" = xyes; then
1763  if test x"$enable_shared" = xyes; then
1764    AC_MSG_WARN([On $platform, shared objects are not supported. I'm disabling your choice.])
1765  fi
1766  enable_shared=no
1767fi
1768# By default, we only want the shared objects to be compiled
1769AC_DISABLE_STATIC
1770])
1771
1772m4_define([AC_COIN_INIT_AUTO_TOOLS],
1773[{AC_BEFORE([AC_COIN_PROG_CXX],[$0])
1774AC_BEFORE([AC_COIN_PROG_CC],[$0])
1775AC_BEFORE([AC_COIN_PROG_F77],[$0])
1776
1777# START
1778AC_COIN_DISABLE_STATIC([$1])
1779
1780# Initialize automake
1781AC_COIN_INIT_AUTOMAKE
1782
1783LIBTOOL=
1784if test -r ../libtool; then
1785  coin_config_dir=..
1786  LIBTOOL='$(SHELL) $(top_builddir)/../libtool'
1787fi
1788if test "x$LIBTOOL" = x; then
1789  if test -r ../../libtool; then
1790    coin_config_dir=../..
1791    LIBTOOL='$(SHELL) $(top_builddir)/../../libtool'
1792  fi
1793fi
1794
1795if test "x$LIBTOOL" = x; then
1796# AC_MSG_NOTICE([Creating libtool script (calling COIN_PROG_LIBTOOL).])
1797  # Stuff for libtool
1798  AC_COIN_PROG_LIBTOOL
1799# AC_MSG_NOTICE([Finished COIN_PROG_LIBTOOL.])
1800  # set RPATH_FLAGS to the compiler link flags required to hardcode location
1801  # of the shared objects
1802  AC_COIN_RPATH_FLAGS($abs_lib_dir)
1803
1804else
1805
1806  AC_MSG_NOTICE([Using libtool script in directory $coin_config_dir])
1807  # get all missing information from the config.log file
1808
1809  # output variables and defines
1810  as_save_IFS=$IFS
1811  IFS='
1812'
1813  for oneline in `cat $coin_config_dir/config.status`; do
1814    case "$oneline" in
1815         # First some automake conditionals
1816      s,@am__fastdep* | s,@AR@* | s,@CPP@*  | s,@CPPFLAGS@* | s,@CXXCPP@*  | \
1817      s,@RANLIB@* | s,@STRIP@* | s,@ac_ct_AR@* | s,@ac_ct_RANLIB@* | \
1818      s,@ac_ct_STRIP@* | s,@host* | s,@LN_S@* | s,@RPATH_FLAGS@* | \
1819      s,@ac_c_preproc_warn_flag@* |  s,@ac_cxx_preproc_warn_flag@* )
1820        command=`echo $oneline | sed -e 's/^s,@//' -e 's/@,/="/' -e 's/,;t t/"/'`
1821#        echo "$command"
1822        eval "$command"
1823        ;;
1824      s,@DEFS@* )
1825        command=`echo $oneline | sed -e 's/^s,@DEFS@,/defsline="/' -e 's/,;t t/"/'`
1826#        echo "$command"
1827        eval "$command"
1828        ;;
1829    esac
1830  done
1831  IFS=$as_save_IFS
1832
1833  # And some defines (assuming here that the packages base dir
1834  # doesn't have a config.h file
1835  for word in $defsline; do
1836#    echo word $word
1837    case $word in
1838      -DHAVE_@<:@A-Z_@:>@*_H=1 | -DSTDC_HEADERS=1 )
1839        i=`echo $word | sed -e 's/-D/#define /' -e 's/=/ /'`
1840#        echo dd $i
1841        echo $i >>confdefs.h
1842        ;;
1843    esac
1844  done
1845fi
1846
1847# AC_MSG_NOTICE([End of INIT_AUTO_TOOLS.])
1848
1849# ToDo
1850# For now, don't use the -no-undefined flag, since the Makefiles are
1851# not yet set up that way.  But we need to fix this, when we want
1852# to comile DLLs under Windows.
1853LT_LDFLAGS=
1854
1855# Check if we want to set the library version
1856AC_MSG_CHECKING([if library version is set])
1857if test x"$coin_libversion" != x; then
1858  LT_LDFLAGS="$LT_LDFLAGS -version-info $coin_libversion"
1859  AC_MSG_RESULT([$coin_libversion])
1860else
1861  AC_MSG_RESULT([no])
1862fi
1863
1864AC_SUBST(LT_LDFLAGS)
1865
1866#END
1867}])
1868
1869
1870###########################################################################
1871#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
1872###########################################################################
1873
1874# Patches to libtool for cygwin. Lots for cl, a few for GCC.
1875# For cl:
1876# - cygpath is not correctly quoted in fix_srcfile_path
1877# - paths generated for .lib files is not run through cygpath -w
1878
1879
1880AC_DEFUN([AC_COIN_PATCH_LIBTOOL_CYGWIN],
1881[ case "$CXX" in
1882    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
1883      AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
1884      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
1885          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
1886          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
1887          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
1888          -e 's%lib /OUT:%lib -OUT:%' \
1889          -e "s%cygpath -w%$CYGPATH_W%" \
1890          -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
1891          -e 's/$AR t/lib -nologo -list/' \
1892          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
1893          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
1894          -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
1895      libtool > conftest.bla
1896
1897      mv conftest.bla libtool
1898      chmod 755 libtool
1899      ;;
1900    *)
1901      AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
1902      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
1903          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
1904          -e 's|libext="lib"|libext="a"|' \
1905      libtool > conftest.bla
1906
1907      mv conftest.bla libtool
1908      chmod 755 libtool
1909      ;;
1910  esac ]) # COIN_PATCH_LIBTOOL_CYGWIN
1911
1912###########################################################################
1913#                    COIN_PATCH_LIBTOOL_SOLARIS                           #
1914###########################################################################
1915# If we want to do a 64-bit build with GCC on Solaris, the system search
1916# libraries need to point to 64-bit subdirectories. If they do not already do
1917# that, fix them. This patch is evolving, as are GCC compilers.  GCC 4.2.1
1918# reports the correct search list, given the correct call. GCC 4.1.1 does not.
1919# `Correct call' means -m64 is specified. `Correct search list' seems to amount
1920# to prepending the list of 64-bit subdirectories to the 32-bit directories.
1921# Both SPARC and x86 have this issue, but a different hardware id string is
1922# required depending on the underlying CPU. The macro executes isainfo to get
1923# the string. This will fail, of course, if we're cross-compiling. The
1924# alternative is to fail on a regular basis each time a new CPU identifier is
1925# needed. This macro will also fail if the search list reported with
1926# -print-search-dirs differs between the C, C++, and Fortran compilers; each
1927# have their own setting in libtool.  If GCC reports the correct search list
1928# given the -m64 flag, the best solution is to define CC='gcc -m64', and
1929# similarly for CXX, F77, so that libtool will make the correct call.
1930###########################################################################
1931AC_DEFUN([AC_COIN_PATCH_LIBTOOL_SOLARIS],
1932[ if test "$GCC" = yes && \
1933     (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm64' >/dev/null 2>&1) ; then
1934    hdwisa=`isainfo | sed -e 's/\(@<:@^ @:>@*\) .*$/\1/'`
1935    if `$EGREP 'sys_lib_search_path_spec=' libtool | $EGREP -v $hdwisa >/dev/null 2>&1` ; then
1936      AC_MSG_NOTICE([Applying patches to libtool for 64-bit GCC compilation])
1937      fixlibtmp=`$CC -m64 -print-search-dirs | $EGREP '^libraries:'`
1938      fixlibtmp=`echo $fixlibtmp | sed -e 's/libraries: =//' -e 's/:/ /g'`
1939      if `echo "$fixlibtmp" | $EGREP -v $hdwisa  >/dev/null 2>&1` ; then
1940        # AC_MSG_NOTICE(Compensating for broken gcc)
1941        for lib in $fixlibtmp ; do
1942          if test -d "${lib}${hdwisa}" ; then
1943            syslibpath64="$syslibpath64 ${lib}${hdwisa}/"
1944          fi
1945        done
1946        syslibpath64="${syslibpath64} ${fixlibtmp}"
1947      else
1948        syslibpath64="$fixlibtmp"
1949      fi
1950      sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="'"$syslibpath64"'"|' libtool > conftest.bla
1951      mv conftest.bla libtool
1952      chmod 755 libtool 
1953    fi
1954    # AC_MSG_NOTICE(Result is )
1955    # $EGREP 'sys_lib_search_path_spec=' libtool
1956  fi ]) # COIN_PATCH_LIBTOOL_SOLARIS
1957
1958###########################################################################
1959#                           COIN_PROG_LIBTOOL                             #
1960###########################################################################
1961
1962# Setup the libtool stuff together with any modifications to make it
1963# work on additional platforms
1964
1965AC_DEFUN([AC_COIN_LIBTOOL_WRAPPER],
1966[AC_BEFORE([AC_COIN_BLA],[$0])
1967AC_PROG_LIBTOOL])
1968
1969AC_DEFUN([AC_COIN_BLA],[echo bla])
1970
1971AC_DEFUN([AC_COIN_PROG_LIBTOOL],
1972[# No longer needed now that CPPFLAGS is correctly set -- lh, 061214 --
1973 # AC_REQUIRE([AC_COIN_DLFCN_H])
1974
1975# NEW: If libtool exists in the directory higher up, we use that one
1976#      instead of creating a new one
1977
1978# It turns out that the code for AC_PROG_LIBTOOL is somehow AC_REQUIRED
1979# out in front of this macro body. You'll notice that LIBTOOL is already
1980# defined here.  We'll have to count on this macro not being called if libtool
1981# already exists, or at least move the libtool fixes outside the conditional.
1982# AC_MSG_NOTICE([Entering coin_prog_libtool, LIBTOOL = "$LIBTOOL".])
1983# This test is therefore removed.  -- lh, 061214 --
1984# if test "x$LIBTOOL" = x; then
1985
1986# AC_MSG_NOTICE([Calling PROG_LIBTOOL.])
1987  AC_PROG_LIBTOOL
1988# AC_MSG_NOTICE([Finished PROG_LIBTOOL.])
1989  AC_SUBST(ac_c_preproc_warn_flag)
1990  AC_SUBST(ac_cxx_preproc_warn_flag)
1991
1992  AC_MSG_NOTICE([Build is "$build".])
1993  mydos2unix='| dos2unix'
1994  case $build in
1995    *-mingw*)
1996      CYGPATH_W=echo
1997      mydos2unix=
1998      ;;
1999  esac
2000
2001  case $build in
2002    # Here we need to check if -m32 is specified.  If so, we need to correct
2003    # sys_lib_search_path_spec
2004    *x86_64-*)
2005      if test "$GCC" = yes && (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm32' >& /dev/null); then
2006        AC_MSG_NOTICE(Applying patches to libtool for 32bit compilation)
2007        sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="/lib /usr/lib"|' libtool > conftest.bla
2008        mv conftest.bla libtool
2009        chmod 755 libtool 
2010      fi
2011      ;;
2012
2013    *-solaris*)
2014      AC_COIN_PATCH_LIBTOOL_SOLARIS
2015      ;;
2016    # Cygwin. Ah, cygwin. Too big and ugly to inline; see the macro.
2017    *-cygwin* | *-mingw*)
2018      AC_COIN_PATCH_LIBTOOL_CYGWIN
2019      ;;
2020    *-darwin*)
2021      AC_MSG_NOTICE(Applying patches to libtool for Darwin)
2022      sed -e 's/verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"/verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"/' \
2023        -e 's/ -dynamiclib / -dynamiclib -single_module /g' \
2024      libtool > conftest.bla
2025
2026      mv conftest.bla libtool
2027      chmod 755 libtool
2028      ;;
2029  esac
2030# This fi matches the commented `if test "x$LIBTOOL" = x;' up at the head of
2031# the macro. -- lh, 061214 --
2032# fi
2033
2034# AC_MSG_NOTICE([End libtool initialisation.])
2035]) # AC_COIN_PROG_LIBTOOL
2036
2037# This is a trick to force the check for the dlfcn header to be done before
2038# the checks for libtool
2039# No longer needed now that CPPFLAGS is correctly set.  -- lh, 061214 --
2040# ACDEFUN([AC_COIN_DLFCN_H],
2041# [AC_LANG_PUSH(C)
2042# AC_COIN_CHECK_HEADER([dlfcn.h])
2043# AC_LANG_POP(C)
2044# ]) # AC_COIN_DLFCN_H
2045
2046###########################################################################
2047#                            COIN_RPATH_FLAGS                             #
2048###########################################################################
2049
2050# This macro, in case shared objects are used, defines a variable
2051# RPATH_FLAGS that can be used by the linker to hardwire the library
2052# search path for the given directories.  This is useful for example
2053# Makefiles
2054
2055AC_DEFUN([AC_COIN_RPATH_FLAGS],
2056[RPATH_FLAGS=
2057
2058if test $enable_shared = yes; then
2059  case $build in
2060    *-linux-*)
2061      if test "$GXX" = "yes"; then
2062        RPATH_FLAGS=
2063        for dir in $1; do
2064          RPATH_FLAGS="$RPATH_FLAGS -Wl,--rpath -Wl,$dir"
2065        done
2066      fi ;;
2067    *-darwin*)
2068        RPATH_FLAGS=nothing ;;
2069    *-ibm-*)
2070      case "$CXX" in
2071      xlC* | */xlC* | mpxlC* | */mpxlC*)
2072        RPATH_FLAGS=nothing ;;
2073      esac ;;
2074    *-hp-*)
2075        RPATH_FLAGS=nothing ;;
2076    *-mingw32)
2077        RPATH_FLAGS=nothing ;;
2078    *-*-solaris*)
2079        RPATH_FLAGS=
2080        for dir in $1; do
2081          RPATH_FLAGS="$RPATH_FLAGS -R$dir"
2082        done
2083  esac
2084
2085  if test "$RPATH_FLAGS" = ""; then
2086    AC_MSG_WARN([Could not automatically determine how to tell the linker about automatic inclusion of the path for shared libraries.  The test examples might not work if you link against shared objects.  You will need to set the LD_LIBRARY_PATH, DYLP_LIBRARY_PATH, or LIBDIR variable manually.])
2087  fi
2088  if test "$RPATH_FLAGS" = "nothing"; then
2089    RPATH_FLAGS=
2090  fi
2091fi
2092
2093AC_SUBST(RPATH_FLAGS)
2094]) # AC_COIN_RPATH_FLAGS
2095
2096###########################################################################
2097#                        COIN_LINK_INPUT_CMD                              #
2098###########################################################################
2099
2100# This macro determines which command should be used to "link" files
2101# that are input to the generated executables.  On Windows, the codes
2102# using the native Windows system libraries, cannot understand symbolic
2103# links, and a copy should be used instead of 'ln -s'.
2104# The result is stored in coin_link_input_cmd
2105
2106AC_DEFUN([AC_COIN_LINK_INPUT_CMD],
2107[AC_REQUIRE([AC_PROG_LN_S])
2108AC_BEFORE([AC_COIN_PROG_CC], [$0])
2109AC_BEFORE([AC_COIN_ENABLE_DOSCOMPILE], [$0])
2110
2111AC_MSG_CHECKING([which command should be used to link input files])
2112coin_link_input_cmd="$LN_S"
2113if test "$enable_doscompile" = mingw; then
2114  coin_link_input_cmd=cp
2115fi
2116case "$CC" in
2117  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
2118    coin_link_input_cmd=cp ;;
2119esac
2120AC_MSG_RESULT($coin_link_input_cmd)
2121])
2122
2123###########################################################################
2124#                              COIN_FINALIZE                              #
2125###########################################################################
2126
2127# This macro should be called at the very end of the configure.ac file.
2128# It creates the output files (by using AC_OUTPUT), and might do some other
2129# things (such as generating links to data files in a VPATH configuration).
2130# It also prints the "success" message.
2131# Note: If the variable coin_skip_ac_output is set to yes, then no output
2132# files are written.
2133
2134AC_DEFUN([AC_COIN_FINALIZE],
2135[
2136AC_REQUIRE([AC_COIN_LINK_INPUT_CMD])
2137if test x$coin_skip_ac_output != xyes; then
2138
2139  FADDLIBS="$ADDLIBS"
2140  if test x"$coin_need_flibs" = xyes; then
2141    ADDLIBS="$ADDLIBS $FLIBS"
2142  fi
2143
2144  # library extension
2145  AC_SUBST(LIBEXT)
2146  case "$CC" in
2147    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
2148         LIBEXT=lib ;;
2149      *) LIBEXT=a ;;
2150  esac
2151
2152  # Define VPATH_DISTCLEANFILES to be everything that needs to be
2153  # cleaned for distclean in a vpath configuration
2154  AC_SUBST(VPATH_DISTCLEANFILES)
2155  VPATH_DISTCLEANFILES="$coin_vpath_link_files"
2156
2157  # Take out subdirectories if their configuration concluded that they
2158  # don't need to be compiled
2159  if test x"$coin_ac_skip_subdirs" != x; then
2160    new_subdirs=
2161    for i in $subdirs; do
2162      skipme=no
2163      for j in $coin_ac_skip_subdirs; do
2164        if test $i = $j; then
2165          skipme=yes;
2166        fi
2167      done
2168      if test $skipme = no; then
2169        new_subdirs="$new_subdirs $i"
2170      fi
2171    done
2172    subdirs="$new_subdirs"
2173  fi
2174
2175  AC_OUTPUT
2176
2177  if test x"$coin_vpath_link_files" = x; then : ; else
2178    lnkcmd="$coin_link_input_cmd"
2179    if test "$lnkcmd" = cp; then
2180      AC_MSG_NOTICE(Copying data files for VPATH configuration)
2181    else
2182      AC_MSG_NOTICE(Creating VPATH links for data files)
2183    fi
2184    for file in $coin_vpath_link_files; do
2185      dir=`AS_DIRNAME(["./$file"])`
2186      if test -d $dir; then : ; else
2187        AS_MKDIR_P($dir)
2188      fi
2189      rm -f $file
2190      $lnkcmd $abs_source_dir/$file $file
2191    done
2192  fi
2193
2194  if test x$coin_projectdir = xyes; then
2195    AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful])
2196  else
2197    AC_MSG_NOTICE([Main configuration of $PACKAGE_NAME successful])
2198  fi
2199else
2200  AC_MSG_NOTICE([No configuration of $PACKAGE_NAME necessary])
2201fi
2202
2203]) #AC_COIN_FINALIZE
2204
2205###########################################################################
2206#                             COIN_VPATH_LINK                             #
2207###########################################################################
2208
2209# This macro makes sure that a symbolic link is created to a file in
2210# the source code directory tree if we are in a VPATH compilation, and
2211# if this package is the main package to be installed
2212
2213AC_DEFUN([AC_COIN_VPATH_LINK],
2214[AC_REQUIRE([AC_COIN_CHECK_VPATH])
2215if test $coin_vpath_config = yes; then
2216  coin_vpath_link_files="$coin_vpath_link_files $1"
2217fi
2218]) #AC_COIN_VPATH_LINK
2219
2220###########################################################################
2221#                       COIN_ENABLE_GNU_PACKAGES                          #
2222###########################################################################
2223
2224# This macro defined the --enable-gnu-packages flag.  This can be used
2225# to check if a user wants to compile GNU packges (such as readline or
2226# zlib) into the executable.  By default, GNU packages are disabled.
2227# This also defines the automake conditional COIN_ENABLE_GNU_PACKAGES
2228
2229AC_DEFUN([AC_COIN_ENABLE_GNU_PACKAGES],
2230[AC_ARG_ENABLE([gnu-packages],
2231               [AC_HELP_STRING([--enable-gnu-packages],
2232                               [compile with GNU packages (disabled by default)])],
2233               [coin_enable_gnu=$enableval],
2234               [coin_enable_gnu=no])
2235]) # AC_COIN_ENABLE_GNU_PACKAGES
2236
2237###########################################################################
2238#                           COIN_CHECK_GNU_ZLIB                           #
2239###########################################################################
2240
2241# This macro checks for the libz library.
2242
2243AC_DEFUN([AC_COIN_CHECK_GNU_ZLIB],
2244[AC_REQUIRE([AC_COIN_ENABLE_GNU_PACKAGES])
2245AC_BEFORE([AC_COIN_PROG_CXX],[$0])
2246AC_BEFORE([AC_COIN_PROG_CC],[$0])
2247AC_BEFORE([AC_COIN_PROG_F77],[$0])
2248AC_BEFORE([$0],[AC_COIN_FINALIZE])
2249
2250coin_has_zlib=no
2251if test $coin_enable_gnu = yes; then
2252  AC_COIN_CHECK_HEADER([zlib.h],[coin_has_zlib=yes])
2253
2254  if test $coin_has_zlib = yes; then
2255    AC_CHECK_LIB([z],[gzopen],
2256                 [ADDLIBS="-lz $ADDLIBS"],
2257                 [coin_has_zlib=no])
2258  fi
2259
2260  if test $coin_has_zlib = yes; then
2261    AC_DEFINE([COIN_HAS_ZLIB],[1],[Define to 1 if zlib is available])
2262  fi
2263fi
2264
2265AM_CONDITIONAL(COIN_HAS_ZLIB,test x$coin_has_zlib = xyes)
2266]) # AC_COIN_CHECK_GNU_ZLIB
2267
2268
2269###########################################################################
2270#                          COIN_CHECK_GNU_BZLIB                           #
2271###########################################################################
2272
2273# This macro checks for the libbz2 library.
2274
2275AC_DEFUN([AC_COIN_CHECK_GNU_BZLIB],
2276[AC_REQUIRE([AC_COIN_ENABLE_GNU_PACKAGES])
2277AC_BEFORE([AC_COIN_PROG_CXX],[$0])
2278AC_BEFORE([AC_COIN_PROG_CC],[$0])
2279AC_BEFORE([AC_COIN_PROG_F77],[$0])
2280AC_BEFORE([$0],[AC_COIN_FINALIZE])
2281
2282coin_has_bzlib=no
2283if test $coin_enable_gnu = yes; then
2284  AC_COIN_CHECK_HEADER([bzlib.h],[coin_has_bzlib=yes])
2285
2286  if test $coin_has_bzlib = yes; then
2287    AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],
2288                 [ADDLIBS="-lbz2 $ADDLIBS"],
2289                 [coin_has_bzlib=no])
2290  fi
2291
2292  if test $coin_has_bzlib = yes; then
2293    AC_DEFINE([COIN_HAS_BZLIB],[1],[Define to 1 if bzlib is available])
2294  fi
2295fi
2296]) # AC_COIN_CHECK_GNU_BZLIB
2297
2298
2299###########################################################################
2300#                         COIN_CHECK_GNU_READLINE                         #
2301###########################################################################
2302
2303# This macro checks for GNU's readline.  It verifies that the header
2304# readline/readline.h is available, and that the -lreadline library
2305# contains "readline".  It is assumed that #include <stdio.h> is included
2306# in the source file before the #include<readline/readline.h>
2307
2308AC_DEFUN([AC_COIN_CHECK_GNU_READLINE],
2309[AC_REQUIRE([AC_COIN_ENABLE_GNU_PACKAGES])
2310AC_BEFORE([AC_COIN_PROG_CXX],[$0])
2311AC_BEFORE([AC_COIN_PROG_CC],[$0])
2312AC_BEFORE([AC_COIN_PROG_F77],[$0])
2313AC_BEFORE([$0],[AC_COIN_FINALIZE])
2314
2315coin_has_readline=no
2316if test $coin_enable_gnu = yes; then
2317  AC_COIN_CHECK_HEADER([readline/readline.h],
2318                       [coin_has_readline=yes],[],
2319                       [#include <stdio.h>])
2320
2321  coin_save_LIBS="$LIBS"
2322  LIBS=
2323  # First we check if tputs and friends are available
2324  if test $coin_has_readline = yes; then
2325    AC_SEARCH_LIBS([tputs],[ncurses termcap curses],[],
2326                   [coin_has_readline=no])
2327  fi
2328
2329  # Now we check for readline
2330  if test $coin_has_readline = yes; then
2331    AC_CHECK_LIB([readline],[readline],
2332                 [ADDLIBS="-lreadline $LIBS $ADDLIBS"],
2333                 [coin_has_readline=no])
2334  fi
2335
2336  if test $coin_has_readline = yes; then
2337    AC_DEFINE([COIN_HAS_READLINE],[1],[Define to 1 if readline is available])
2338  fi
2339
2340  LIBS="$coin_save_LIBS"
2341fi
2342]) # AC_COIN_CHECK_GNU_READLINE
2343
2344###########################################################################
2345#                             COIN_DATA_PATH                              #
2346###########################################################################
2347
2348# This macro defines a preprocessor macro with the absolute path to a
2349# subdirectory of Data.  The argument of this macro is the name of the
2350# subdirectory (in correct case), and the name of the macro is
2351# COIN_DATA_DIR_PATH, where dir is replaced by the capitalized name of
2352# the directory.  The path ends with a separator ("/" for linux and
2353# '\\' for Windows).  The default value for this path can be
2354# overwritten with the input variable with the same name
2355# (COIN_DATA_DIR_PATH).  At this point we chech only for the
2356# $srcdir/../Data subdirectory.
2357
2358AC_DEFUN([AC_COIN_DATA_PATH],
2359[AC_MSG_CHECKING([absolute path to data directory $1])
2360
2361AC_ARG_VAR(m4_toupper(COIN_DATA_$1_PATH),[Set to absolute path to Data/$1 subdirectory])
2362
2363if test x"$m4_toupper(COIN_DATA_$1_PATH)" = x; then
2364  m4_toupper(COIN_DATA_$1_PATH)=`cd $srcdir/../Data/$1; pwd`
2365fi
2366
2367# Under Cygwin, use Windows path.  Add separator
2368case $build in
2369  *-cygwin*)
2370    m4_toupper(COIN_DATA_$1_PATH)=`cygwin -w $m4_toupper(COIN_DATA_$1_PATH)`\\
2371    ;;
2372  *)
2373    m4_toupper(COIN_DATA_$1_PATH)="$m4_toupper(COIN_DATA_$1_PATH)/"
2374    ;;
2375esac
2376
2377if test -r $m4_toupper(COIN_DATA_$1_PATH); then
2378  AC_DEFINE_UNQUOTED(m4_toupper(COIN_DATA_$1_PATH),["$m4_toupper(COIN_DATA_$1_PATH)"],
2379            [Define to absolute path for Data subdirectory $1])
2380  AC_MSG_RESULT($m4_toupper(COIN_DATA_$1_PATH))
2381else
2382  AC_MSG_ERROR(Directory $m4_toupper(COIN_DATA_$1_PATH) does not exist)
2383fi
2384]) # AC_COIN_HAS_DATA
2385
2386###########################################################################
2387#                       COIN_LINK_FROM_FILELIST                           #
2388###########################################################################
2389
2390# This macro creates links (or copies, if necessary) to files listed
2391# as content in a text file (second argument) into a target directory
2392# (first argument), which is created if it doesn't exist yet.  If s link
2393# already exists, nothing happens.
2394
2395AC_DEFUN([AC_COIN_LINKCOPY_FROM_FILELIST],
2396[cmd="$3"
2397if test -e $srcdir/$2 ; then
2398  my_target_dir="$1"
2399  my_link_files=`cat $srcdir/$2`
2400  my_dirname=`AS_DIRNAME($2)`
2401#  if test -e $my_target_dir; then : ; else
2402#    AS_MKDIR_P($my_target_dir)
2403#  fi
2404  for i in $my_link_files; do
2405    #rm -rf $my_target_dir/$i
2406    if test -e $my_target_dir/$i; then : ; else
2407      dirn2=`AS_DIRNAME($my_target_dir/$i)`
2408      if test -e $dirn2; then : ; else
2409        AS_MKDIR_P($dirn2)
2410      fi
2411      $cmd $abs_source_dir/$my_dirname/$i $my_target_dir/$i
2412    fi
2413  done
2414else
2415  AC_MSG_WARN([File list file $2 missing!])
2416fi
2417])
2418
2419AC_DEFUN([AC_COIN_LINK_FROM_FILELIST],
2420[
2421AC_REQUIRE([AC_COIN_LINK_INPUT_CMD])
2422echo Creating links in $1 ...
2423AC_COIN_LINKCOPY_FROM_FILELIST($1, $2, $coin_link_input_cmd)
2424])
2425
2426###########################################################################
2427#                       COIN_COPY_FROM_FILELIST                           #
2428###########################################################################
2429
2430# Like COIN_LINK_FROM_FILELIST, but copies the files.
2431
2432AC_DEFUN([AC_COIN_COPY_FROM_FILELIST],
2433[
2434echo Creating copies in $1 ...
2435AC_COIN_LINKCOPY_FROM_FILELIST($1, $2, [cp])
2436])
2437
2438###########################################################################
2439#                          COIN_EXAMPLE_FILES                             #
2440###########################################################################
2441
2442# This macro determines the names of the example files (using the
2443# argument in an "ls" command) and sets up the variables EXAMPLE_FILES
2444# and EXAMPLE_CLEAN_FILES.  If this is a VPATH configuration, it also
2445# creates soft links to the example files.
2446
2447AC_DEFUN([AC_COIN_EXAMPLE_FILES],
2448[AC_REQUIRE([AC_COIN_CHECK_GNU_ZLIB])
2449AC_REQUIRE([AC_COIN_CHECK_VPATH])
2450files=`cd $srcdir; ls $1`
2451# We need to do the following loop to make sure that are no newlines
2452# in the variable
2453for file in $files; do
2454  EXAMPLE_FILES="$EXAMPLE_FILES $file"
2455done
2456if test $coin_vpath_config = yes; then
2457  lnkcmd=
2458  if test "$enable_doscompile" != no; then
2459    lnkcmd=cp
2460  fi
2461  case "$CC" in
2462    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
2463      lnkcmd=cp ;;
2464  esac
2465  if test "$lnkcmd" = cp; then
2466    AC_MSG_NOTICE([Copying example files ($1)])
2467  else
2468    AC_PROG_LN_S
2469    AC_MSG_NOTICE([Creating links to the example files ($1)])
2470    lnkcmd="$LN_S"
2471  fi
2472  for file in $EXAMPLE_FILES; do
2473    rm -f $file
2474    $lnkcmd $srcdir/$file $file
2475  done
2476  EXAMPLE_CLEAN_FILES="$EXAMPLE_CLEAN_FILES $1"
2477else
2478  EXAMPLE_CLEAN_FILES="$EXAMPLE_CLEAN_FILES"
2479fi
2480
2481# In case there are compressed files, we create a variable with the
2482# uncompressed names
2483EXAMPLE_UNCOMPRESSED_FILES=
2484for file in $EXAMPLE_FILES; do
2485  case $file in
2486    *.gz)
2487      EXAMPLE_UNCOMPRESSED_FILES="$EXAMPLE_UNCOMPRESSED_FILES `echo $file | sed -e s/.gz//`"
2488      ;;
2489  esac
2490done
2491
2492AC_SUBST(EXAMPLE_UNCOMPRESSED_FILES)
2493AC_SUBST(EXAMPLE_FILES)
2494AC_SUBST(EXAMPLE_CLEAN_FILES)
2495]) #AC_COIN_EXAMPLE_FILES
2496
2497###########################################################################
2498#                            COIN_HAS_PROJECT                             #
2499###########################################################################
2500
2501# This macro sets up usage of a Coin package.  It defines the
2502# PKGSRCDIR and PKGOBJDIR variables, refering to the main source and
2503# object directory of the package, respectively.  It also defines
2504# a COIN_HAS_PKG preprocessor macro and makefile conditional.  The
2505# argument should be the name (Pkg) of the project (in correct lower
2506# and upper case)
2507
2508AC_DEFUN([AC_COIN_HAS_PROJECT],
2509[AC_MSG_CHECKING([for COIN project $1])
2510
2511# First check, if the sub-project is actually available (ToDo: allow
2512# other locations)
2513
2514m4_tolower(coin_has_$1)=unavailable
2515if test x"$COIN_SKIP_PROJECTS" != x; then
2516  for dir in $COIN_SKIP_PROJECTS; do
2517    if test $dir = $1; then
2518      m4_tolower(coin_has_$1)=skipping
2519    fi
2520  done
2521fi
2522
2523if test $m4_tolower(coin_has_$1) != skipping; then
2524  if test $PACKAGE_TARNAME = m4_tolower($1); then
2525    m4_tolower(coin_has_$1)=.
2526  else
2527    if test -d $srcdir/../$1; then
2528      m4_tolower(coin_has_$1)=../$1
2529    fi
2530  fi
2531fi
2532
2533if test $m4_tolower(coin_has_$1) != unavailable &&
2534   test $m4_tolower(coin_has_$1) != skipping; then
2535  # Set the #define if the component is available
2536  AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],[Define to 1 if the $1 package is used])
2537
2538  # Set the variables for source and object code location
2539  AC_SUBST(m4_toupper($1SRCDIR))
2540  m4_toupper($1SRCDIR)=`cd $srcdir/$m4_tolower(coin_has_$1); pwd`
2541  AC_SUBST(m4_toupper($1OBJDIR))
2542  m4_toupper($1OBJDIR)=`pwd`/$m4_tolower(coin_has_$1)
2543  AC_SUBST(m4_toupper($1DOCDIR))
2544  m4_toupper($1DOCDIR)=$abs_lib_dir/../share/doc/coin/$1
2545fi
2546
2547  # Define the Makefile conditional
2548AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
2549               [test $m4_tolower(coin_has_$1) != unavailable &&
2550                test $m4_tolower(coin_has_$1) != skipping])
2551AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
2552]) # AC_COIN_HAS_PROJECT
2553
2554###########################################################################
2555#                        COIN_HAS_USER_LIBRARY                            #
2556###########################################################################
2557# This macro sets up usage of a user library with header files. The assumption
2558# is that the header file(s) and library do not reside in standard system
2559# directories, hence both the include directory and link flags must be
2560# specified. There are two mandatory arguments and two optional arguments.
2561#
2562# The first argument (mandatory) should be a name (LibraryName) for the
2563# library.  The second argument (mandatory) should be an abbreviation in
2564# upper case letters (LBRY) for the library. Ultimately, the macro will
2565# specify two variables, LBRYINCDIR and LBRYLIB, to be substituted in files
2566# generated during configuration; a preprocessor symbol COIN_HAS_LBRY; and a
2567# matching automake conditional COIN_HAS_LBRY. LBRYINCDIR should specify the
2568# directory containing include files for the library. LBRYLIB should specify
2569# the flags necessary to link to the library. A variable coin_has_lbry will
2570# be set to true or false, as appropriate. A variable lbry_libcheck will be
2571# be set to yes or no; no indicates link checks should not be attempted.
2572#
2573# The macro defines three configure arguments, --with-libraryname-incdir,
2574# --with-libraryname-lib, and --disable-libraryname-libcheck, by converting
2575# LibraryName to lower case.
2576#
2577# LBRYINCDIR and LBRYLIB can be specified as environment variables or as
2578# part of the configure command using --with-libraryname-incdir and
2579# --with-libraryname-lib, respectively. Command line arguments override
2580# environment variables.
2581#
2582# If a third argument is given, it should specify a file in LBRYINCDIR.  The
2583# macro will check for the presence of the file. If a fourth argument is given,
2584# it should specify a function name, `fname'.  The macro will attempt to link a
2585# trivial program containing a parameterless call to the function, `fname()',
2586# using the LBRYLIB flags. The link check uses C as the language; this has been
2587# adequate to date but has limitations. It is possible to disable the link
2588# check by specifying --disable-libraryname-libcheck. This is a workaround for
2589# instances where the link check does not work properly, for whatever reason.
2590# If you're trying to link to a Fortran library, consider using F77_FUNC or
2591# FC_FUNC to obtain a mangled fname appropriate for use from C code. For a C++
2592# library, you're on your own unless the library declares some function with
2593# extern "C" linkage. Otherwise, you'll have to somehow find the mangled C++
2594# name.
2595
2596AC_DEFUN([AC_COIN_HAS_USER_LIBRARY],
2597[ AC_REQUIRE([AC_COIN_PROJECTDIR_INIT])
2598  AC_MSG_CHECKING(if user provides library for $1)
2599
2600# Check for header file directory
2601
2602  AC_ARG_WITH(m4_tolower($1)-incdir,
2603      AS_HELP_STRING([--with-m4_tolower($1)-incdir],
2604                     [specify the header file directory for library $1]),
2605      [$2INCDIR=`cd $withval; pwd`])
2606
2607# Check for library directory
2608
2609  AC_ARG_WITH(m4_tolower($1)-lib,
2610      AS_HELP_STRING([--with-m4_tolower($1)-lib],
2611                     [specify the flags used to link with the library $1]),
2612      [$2LIB=$withval])
2613
2614# Switch to disable library check if requested
2615
2616  AC_ARG_ENABLE(m4_tolower($1)-libcheck,
2617      AS_HELP_STRING([--enable-m4_tolower($1)-libcheck],
2618                     [use disable-m4_tolower($1)-libcheck to skip the link
2619                      check at configuration time]),
2620      [m4_tolower($1)_libcheck=$enableval],
2621      [m4_tolower($1)_libcheck=yes])
2622
2623# At this point, if we're going to use the library, both LBRYINCDIR and
2624# LBRYLIB must be defined and not empty.
2625
2626  if test x"$$2INCDIR" != x || test x"$$2LIB" != x; then
2627    if test x"$$2INCDIR" = x || test x"$$2LIB" = x; then
2628      AC_MSG_ERROR([You need to specify both an include directory and link flags to use library $1. Use --with-m4_tolower($1)-incdir of environment variable $$2INCDIR to specify the include directory. Use --with-m4_tolower($1)-lib or environment variable $$2LIB to specify link flags.])
2629    fi
2630    m4_tolower(coin_has_$2)=true
2631    AC_MSG_RESULT(yes)
2632  else
2633    m4_tolower(coin_has_$2)=false
2634    AC_MSG_RESULT(no)
2635  fi
2636
2637# If we have instructions for use, consider header and link checks.
2638
2639  if test $m4_tolower(coin_has_$2) = true; then
2640
2641# If argument 3 (file) is given, check for the file. Typically this will be a
2642# header file, but that's not assumed.
2643
2644    m4_ifval([$3],
2645        [AC_COIN_CHECK_FILE([$$2INCDIR/$3],[],
2646             [AC_MSG_ERROR([Cannot find file $3 in $$2INCDIR])])])
2647
2648# Now see if we can link the function. There are arguments for and against
2649# assuming argument 3 is a header file declaring the function. A correct
2650# function declaration is the main argument in favour. Having to cope with
2651# possible dependencies or other oddities are the main arguments against.
2652# Force the use of C as the best single choice amongst C++, C, and Fortran.
2653# Obviously, this has limits.
2654
2655    m4_ifvaln([$4],
2656        [if test x"$m4_tolower($1)_libcheck" != xno; then
2657           coin_save_LIBS="$LIBS"
2658           LIBS="$$2LIB $ADDLIBS"
2659           coin_$2_link=no
2660           AC_LANG_PUSH(C)
2661           for fnm in $4 ; do
2662             AC_MSG_CHECKING([whether symbol $fnm is available with $2])
2663             AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[$fnm()]])],
2664                 [AC_MSG_RESULT(yes)
2665                  coin_$2_link=yes
2666                  break],
2667                 [AC_MSG_RESULT(no)])
2668           done
2669           AC_LANG_POP(C)
2670           if test x"$coin_$2_link" = xyes ; then
2671             LIBS="$coin_save_LIBS"
2672           else
2673             AC_MSG_ERROR([Cannot find symbol(s) $4 with $2])
2674           fi
2675         fi])
2676
2677# If we make it this far, we've verified the file and linked the function. Add
2678# the necessary link flags to ADDLIBS and define the preprocessor symbol
2679# COIN_HAS_LBRY.
2680
2681    ADDLIBS="$$2LIB $ADDLIBS"
2682    AC_DEFINE(COIN_HAS_$2,[1],[Define to 1 if the $1 package is available])
2683  fi
2684
2685# Arrange for configure to substitute LBRYINCDIR and LBRYLIB and create the
2686# automake conditional. These actions must occur unconditionally.
2687
2688  AC_SUBST($2INCDIR)
2689  AC_SUBST($2LIB)
2690  AM_CONDITIONAL(COIN_HAS_$2, test $m4_tolower(coin_has_$2) = true)
2691]) #AC_COIN_HAS_USER_LIBRARY
2692
2693###########################################################################
2694#                               COIN_HAS_ASL                              #
2695###########################################################################
2696
2697# This macro checks if the user has provide arguments that say where
2698# the precompiled ASL files should be found (with the --with-asldir
2699# flag).  If this is not the case, we check if the ThirdParty/ASL
2700# directory has been configured, which indicates that the files will
2701# be in that directory and can be used.
2702
2703AC_DEFUN([AC_COIN_HAS_ASL],
2704[coin_aslobjdir=../ThirdParty/ASL
2705coin_aslsrcdir=$srcdir/$coin_aslobjdir
2706
2707# Determine the name of the ASL library
2708case "$CC" in
2709  cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
2710    ampllib=amplsolv.lib ;;
2711  *)
2712    ampllib=amplsolver.a ;;
2713esac
2714
2715AC_ARG_WITH([asldir],
2716            AC_HELP_STRING([--with-asldir],
2717                           [specify path to AMPL solver directory (or BUILD for compilation, or "no" for disabling AMPL)]),
2718            [use_asldir=$withval], [use_asldir=])
2719
2720if test "$use_asldir" = BUILD; then
2721  if test "$PACKAGE_NAME" != ThirdPartyASL; then
2722    # If we are configuring ThirdParty/ASL, don't check
2723    if test -r $coin_aslobjdir/.MakeOk; then :; else
2724      AC_MSG_ERROR([option \"BUILD\" specified for asldir, but directory is not configure (sources missing?)])
2725    fi
2726  fi
2727elif test -z "$use_asldir"; then
2728 # try to find sources - if not given don't compile
2729  if test "$PACKAGE_NAME" != ThirdPartyASL; then
2730    if test -r $coin_aslobjdir/.MakeOk; then
2731      use_asldir=BUILD
2732    else
2733      use_asldir=no
2734    fi
2735  else
2736    use_asldir=no
2737  fi
2738elif test "$use_asldir" != "no"; then
2739  AC_COIN_CHECK_FILE([$use_asldir/$ampllib],[],
2740                     [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but library missing])])
2741  AC_COIN_CHECK_FILE([$use_asldir/asl.h],[],
2742                     [AC_MSG_ERROR([ASL directory \"$use_asldir\" specified, but header files are missing])])
2743  use_asldir=`cd $use_asldir; pwd`
2744  case $build in
2745    *-cygwin*) use_asldir=`cygpath -w $use_asldir | sed -e sX\\\\\\\\X/Xg` ;;
2746  esac
2747fi
2748
2749# Variable containing ASL library (including full path)
2750AC_SUBST(ASLLIB)
2751# Variable containing flags for including ASL header files
2752AC_SUBST(ASL_CPPFLAGS)
2753
2754if test "$use_asldir" = BUILD; then
2755  coin_aslobjdir=`cd $coin_aslobjdir; pwd`
2756  ASLLIB=`$CYGPATH_W $coin_aslobjdir/$ampllib | sed -e sX\\\\\\\\X/Xg`
2757  coin_aslsrcdir=`cd $coin_aslsrcdir; pwd`
2758  ASL_CPPFLAGS="-I"`$CYGPATH_W $coin_aslobjdir | sed -e sX\\\\\\\\X/Xg`" -I"`$CYGPATH_W $coin_aslsrcdir/solvers | sed -e sX\\\\\\\\X/Xg`
2759elif test "$use_asldir" != no; then
2760  ASLLIB=`$CYGPATH_W $use_asldir/$ampllib | sed -e sX\\\\\\\\X/Xg`
2761  ASL_CPPFLAGS="-I"`$CYGPATH_W $use_asldir | sed -e sX\\\\\\\\X/Xg`
2762fi
2763
2764if test "$use_asldir" != no; then
2765  AC_LANG_PUSH(C)
2766  AC_CHECK_LIB(dl,[dlopen],[ASLLIB="$ASLLIB -ldl"],[])
2767  coin_has_asl=yes
2768  AC_DEFINE([COIN_HAS_ASL],[1],
2769            [If defined, the Ampl Solver Library is available.])
2770  AC_LANG_POP(C)
2771else
2772  coin_has_asl=no
2773fi
2774AM_CONDITIONAL(COIN_HAS_ASL, test $coin_has_asl = yes)
2775]) # AC_COIN_HAS_ASL
2776
2777###########################################################################
2778#                            COIN_TRY_FLINK                               #
2779###########################################################################
2780
2781# Auxilliary macro to test if a Fortran function name can be linked,
2782# given the current settings of LIBS.  We determine from the context, what
2783# the currently active programming language is, and cast the name accordingly.
2784# The first argument is the name of the function/subroutine, in small letters,
2785# the second argument are the actions taken when the test works, and the
2786# third argument are the actions taken if the test fails.
2787
2788AC_DEFUN([AC_COIN_TRY_FLINK],
2789[case $ac_ext in
2790  f)
2791    AC_TRY_LINK(,[      call $1],[$2],[$3])
2792    ;;
2793  c)
2794    AC_F77_FUNC($1,cfunc$1)
2795    if test x"$coin_need_flibs" = xyes; then
2796      flink_try=no;
2797    else
2798      AC_TRY_LINK([void $cfunc$1();],[$cfunc$1()],
2799                  [flink_try=yes],[flink_try=no])
2800    fi
2801    if test $flink_try = yes; then
2802      $2
2803    else
2804      if test x"$FLIBS" != x; then
2805        flink_save_libs="$LIBS"
2806        LIBS="$LIBS $FLIBS"
2807        AC_TRY_LINK([void $cfunc$1();],[$cfunc$1()],
2808                    [LIBS="$flink_save_libs"
2809                     $2
2810                     coin_need_flibs=yes],
2811                    [LIBS="$flink_save_libs"
2812                     $3])
2813      else
2814        $3
2815      fi
2816    fi
2817    ;;
2818  cc|cpp)
2819    AC_F77_FUNC($1,cfunc$1)
2820    if test x"$coin_need_flibs" = xyes; then
2821      flink_try=no;
2822    else
2823      AC_TRY_LINK([extern "C" {void $cfunc$1();}],[$cfunc$1()],
2824                  [flink_try=yes],[flink_try=no])
2825    fi
2826    if test $flink_try = yes; then
2827      $2
2828    else
2829      if test x"$FLIBS" != x; then
2830        flink_save_libs="$LIBS"
2831        LIBS="$LIBS $FLIBS"
2832        AC_TRY_LINK([extern "C" {void $cfunc$1();}],[$cfunc$1()],
2833                    [LIBS="$flink_save_libs"
2834                     $2
2835                     coin_need_flibs=yes],
2836                    [LIBS="$flink_save_libs"
2837                     $3])
2838      else
2839        $3
2840      fi
2841    fi
2842    ;;
2843esac
2844]) # AC_COIN_TRY_FLINK
2845
2846###########################################################################
2847#                             COIN_HAS_BLAS                               #
2848###########################################################################
2849
2850# This macro checks for a library containing the BLAS library.  It
2851# tries standard libraries, and if none is found to be working, it
2852# checks whether the BLAS ThirdParty/Blas directory has been configured.
2853# It adds to ADDLIBS any flags required to link with an externally provided
2854# BLAS.  It defines the makefile conditional and preprocessor macro
2855# COIN_HAS_BLAS, if blas is available, and it defines the makefile conditional
2856# COIN_BUILD_BLAS, if blas is compiled within COIN.
2857
2858AC_DEFUN([AC_COIN_HAS_BLAS],
2859[if test "$PACKAGE_NAME" = ThirdPartyBlas || test "$PACKAGE_NAME" = ThirdPartyLapack || test "$PACKAGE_NAME" = ThirdPartyMumps; then
2860  coin_blasobjdir=../Blas
2861else
2862  coin_blasobjdir=../ThirdParty/Blas
2863fi
2864coin_blassrcdir=$srcdir/$coin_blasobjdir
2865
2866AC_ARG_WITH([blas],
2867            AC_HELP_STRING([--with-blas],
2868                           [specify BLAS library (or BUILD for compilation)]),
2869            [use_blas=$withval], [use_blas=])
2870
2871MAKEOKFILE=.MakeOk
2872# Check if user supplied option makes sense
2873if test x"$use_blas" != x; then
2874  if test "$use_blas" = "BUILD"; then
2875    # Don't check for course code if this is executed in ThirdParty/Blas
2876    if test "$PACKAGE_NAME" != ThirdPartyBlas; then
2877      if test -r $coin_blasobjdir/.MakeOk; then :; else
2878        AC_MSG_ERROR([option \"BUILD\" specified for Blas, but $coin_blasobjdir directory is not properly configured])
2879      fi
2880    fi
2881  elif test "$use_blas" != no ; then
2882    AC_MSG_CHECKING([whether user supplied BLASLIB=\"$use_blas\" works])
2883    LIBS="$use_blas $LIBS"
2884    ADDLIBS="$use_blas $ADDLIBS"
2885    AC_COIN_TRY_FLINK([daxpy],
2886                      [AC_MSG_RESULT([yes])],
2887                      [AC_MSG_RESULT([no])
2888                       AC_MSG_ERROR([user supplied BLAS library \"$use_blas\" does not work])])
2889  fi
2890else
2891# Try to autodetect the library for blas based on build system
2892  #AC_MSG_CHECKING([default locations for BLAS])
2893  skip_lblas_check=no
2894  case $build in
2895    *-sgi-*)
2896      SAVE_LIBS="$LIBS"
2897      AC_MSG_CHECKING([whether -lcomplib.sgimath has BLAS])
2898      LIBS="-lcomplib.sgimath $LIBS"
2899      AC_COIN_TRY_FLINK([daxpy],
2900                        [AC_MSG_RESULT([yes])
2901                         use_blas=-lcomplib.sgimath;
2902                         ADDLIBS="-lcomplib.sgimath $ADDLIBS"],
2903                        [AC_MSG_RESULT([no])
2904                         SAVE_LIBS="$LIBS"])
2905      ;;
2906
2907# Ideally, we'd use -library=sunperf, but it's an imperfect world. Studio
2908# cc doesn't recognise -library, it wants -xlic_lib. Studio 12 CC doesn't
2909# recognise -xlic_lib. Libtool doesn't like -xlic_lib anyway. Sun claims
2910# that CC and cc will understand -library in Studio 13. The main extra
2911# function of -xlic_lib and -library is to arrange for the Fortran run-time
2912# libraries to be linked for C++ and C. We can arrange that explicitly.
2913    *-*-solaris*)
2914      SAVE_LIBS="$LIBS"
2915      AC_MSG_CHECKING([for BLAS in libsunperf])
2916      LIBS="-lsunperf $FLIBS $LIBS"
2917      AC_COIN_TRY_FLINK([daxpy],
2918                        [AC_MSG_RESULT([yes])
2919                         use_blas='-lsunperf'
2920                         ADDLIBS="-lsunperf $ADDLIBS"
2921                         coin_need_flibs=yes],
2922                        [AC_MSG_RESULT([no])
2923                         LIBS="$SAVE_LIBS"])
2924      ;;
2925    *-cygwin* | *-mingw*)
2926# On cygwin, consider -lblas only if doscompile is disabled. The prebuilt
2927# library will want to link with cygwin, hence won't run standalone in DOS.
2928      if test "$enable_doscompile" = mingw; then
2929        skip_lblas_check=yes
2930      fi
2931      case "$CC" in
2932        cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
2933          SAVE_LIBS="$LIBS"
2934          AC_MSG_CHECKING([for BLAS in MKL])
2935          LIBS="mkl_intel_c.lib mkl_sequential.lib mkl_core.lib $LIBS"
2936          AC_COIN_TRY_FLINK([daxpy],
2937                            [AC_MSG_RESULT([yes])
2938                             use_blas='mkl_intel_c.lib mkl_sequential.lib mkl_core.lib'
2939                             ADDLIBS="mkl_intel_c.lib mkl_sequential.lib mkl_core.lib $ADDLIBS"],
2940                            [AC_MSG_RESULT([no])
2941                             LIBS="$SAVE_LIBS"])
2942          ;;
2943      esac
2944      ;;
2945  esac
2946
2947  if test -z "$use_blas" && test $skip_lblas_check = no; then
2948    SAVE_LIBS="$LIBS"
2949    AC_MSG_CHECKING([whether -lblas has BLAS])
2950    LIBS="-lblas $LIBS"
2951    AC_COIN_TRY_FLINK([daxpy],
2952                      [AC_MSG_RESULT([yes])
2953                       ADDLIBS="-lblas $ADDLIBS"
2954                       use_blas='-lblas'],
2955                      [AC_MSG_RESULT([no])
2956                       LIBS="$SAVE_LIBS"])
2957  fi
2958
2959# If we have no other ideas, consider building BLAS.
2960  if test -z "$use_blas"; then
2961    if test "$PACKAGE_NAME" != ThirdPartyBlas; then
2962      if test -r $coin_blasobjdir/.MakeOk; then
2963        use_blas=BUILD
2964      fi
2965    fi
2966  fi
2967fi
2968
2969if test "$use_blas" = BUILD; then
2970  coin_need_flibs=yes
2971fi
2972
2973AM_CONDITIONAL([COIN_HAS_BLAS],[test x"$use_blas" != x])
2974AM_CONDITIONAL([COIN_BUILD_BLAS],[test "$use_blas" = BUILD])
2975
2976if test x"$use_blas" = x || test "$use_blas" = no; then
2977  coin_has_blas=no
2978else
2979  coin_has_blas=yes
2980  AC_DEFINE([COIN_HAS_BLAS],[1],
2981            [If defined, the BLAS Library is available.])
2982fi
2983]) # AC_COIN_HAS_BLAS
2984
2985###########################################################################
2986#                            COIN_HAS_LAPACK                              #
2987###########################################################################
2988
2989# This macro checks for a library containing the LAPACK library.  It
2990# tries standard libraries, and if none is found to be working, it
2991# checks whether the LAPACK ThirdParty/Lapack directory has been
2992# configured.  It adds to ADDLIBS any flags required to link with an
2993# externally provided LAPACK.  It defines the makefile conditional and
2994# preprocessor macro COIN_HAS_LAPACK, if lapack is available, and it
2995# defines the makefile conditional COIN_BUILD_LAPACK, if lapack is
2996# compiled within COIN.
2997
2998AC_DEFUN([AC_COIN_HAS_LAPACK],
2999[coin_lapackobjdir=../ThirdParty/Lapack
3000coin_lapacksrcdir=$srcdir/$coin_lapackobjdir
3001
3002AC_ARG_WITH([lapack],
3003            AC_HELP_STRING([--with-lapack],
3004                           [specify LAPACK library (or BUILD for compilation)]),
3005            [use_lapack=$withval], [use_lapack=])
3006
3007# Check if user supplied option makes sense
3008if test x"$use_lapack" != x; then
3009  if test "$use_lapack" = "BUILD"; then
3010    # Don't check for course code if this is executed in ThirdParty/Lapack
3011    if test "$PACKAGE_NAME" != ThirdPartyLapack; then
3012      if test -r $coin_lapackobjdir/.MakeOk; then :; else
3013        AC_MSG_ERROR([option \"BUILD\" specified for LAPACK, but $coin_lapackobjdir directory is not configured])
3014      fi
3015    fi
3016  elif test "$use_lapack" != no; then
3017    AC_MSG_CHECKING([whether user supplied LAPACKLIB=\"$use_lapack\" works])
3018    LIBS="$use_lapack $LIBS"
3019    ADDLIBS="$use_lapack $ADDLIBS"
3020    AC_COIN_TRY_FLINK([dsyev],
3021                      [AC_MSG_RESULT([yes])],
3022                      [AC_MSG_RESULT([no])
3023                       AC_MSG_ERROR([user supplied LAPACK library \"$use_lapack\" does not work])])
3024  fi
3025else
3026  if test x$coin_has_blas = xyes; then
3027    # First try to see if LAPACK is already available with BLAS library
3028    AC_MSG_CHECKING([whether LAPACK is already available with BLAS library])
3029    AC_COIN_TRY_FLINK([dsyev],
3030                      [AC_MSG_RESULT([yes]); use_lapack=ok],
3031                      [AC_MSG_RESULT([no])])
3032  fi
3033  skip_llapack_check=no
3034  if test -z "$use_lapack"; then
3035    # Try to autodetect the library for lapack based on build system
3036    case $build in
3037      *-sgi-*)
3038        SAVE_LIBS="$LIBS"
3039        AC_MSG_CHECKING([whether -lcomplib.sgimath has LAPACK])
3040        LIBS="-lcomplib.sgimath $LIBS"
3041        AC_COIN_TRY_FLINK([dsyev],
3042                          [AC_MSG_RESULT([yes])
3043                           use_lapack=-lcomplib.sgimath;
3044                           ADDLIBS="-lcomplib.sgimath $ADDLIBS"],
3045                          [AC_MSG_RESULT([no])
3046                           SAVE_LIBS="$LIBS"])
3047        ;;
3048
3049# See comments in COIN_HAS_BLAS.
3050      *-*-solaris*)
3051      SAVE_LIBS="$LIBS"
3052      AC_MSG_CHECKING([for LAPACK in libsunperf])
3053      LIBS="-lsunperf $FLIBS $LIBS"
3054      AC_COIN_TRY_FLINK([dsyev],
3055                        [AC_MSG_RESULT([yes])
3056                         use_blas='-lsunperf'
3057                         ADDLIBS="-lsunperf $ADDLIBS"
3058                         coin_need_flibs=yes],
3059                        [AC_MSG_RESULT([no])
3060                         LIBS="$SAVE_LIBS"])
3061        ;;
3062# On cygwin, do this check only if doscompile is disabled. The prebuilt library
3063# will want to link with cygwin, hence won't run standalone in DOS.
3064      *-cygwin*)
3065        if test "$enable_doscompile" = mingw; then
3066          skip_llapack_check=yes
3067        fi
3068        ;;
3069    esac
3070  fi
3071
3072  if test -z "$use_lapack" && test $skip_llapack_check = no; then
3073    SAVE_LIBS="$LIBS"
3074    AC_MSG_CHECKING([whether -llapack has LAPACK])
3075    LIBS="-llapack $LIBS"
3076    AC_COIN_TRY_FLINK([dsyev],
3077                      [AC_MSG_RESULT([yes])
3078                       ADDLIBS="-llapack $ADDLIBS"
3079                       use_lapack='-llapack'],
3080                      [AC_MSG_RESULT([no])
3081                       LIBS="$SAVE_LIBS"])
3082  fi
3083
3084# If we have no other ideas, consider building LAPACK.
3085  if test -z "$use_lapack"; then
3086    if test "$PACKAGE_NAME" != ThirdPartyLapack; then
3087      if test -r $coin_lapackobjdir/.MakeOk; then
3088        use_lapack=BUILD
3089      fi
3090    fi
3091  fi
3092fi
3093
3094if test "$use_lapack" = BUILD; then
3095  coin_need_flibs=yes
3096fi
3097
3098AM_CONDITIONAL([COIN_HAS_LAPACK],[test x"$use_lapack" != x])
3099AM_CONDITIONAL([COIN_BUILD_LAPACK],[test "$use_lapack" = BUILD])
3100
3101if test x"$use_lapack" = x || test "$use_lapack" = no; then
3102  coin_has_lapack=no
3103else
3104  coin_has_lapack=yes
3105  AC_DEFINE([COIN_HAS_LAPACK],[1],
3106            [If defined, the LAPACK Library is available.])
3107fi
3108]) # AC_COIN_HAS_LAPACK
3109
3110###########################################################################
3111#                            COIN_HAS_MUMPS                               #
3112###########################################################################
3113
3114# This macro checks for a library containing the MUMPS library.  It
3115# checks if the user has provided an argument for the MUMPS library,
3116# and if not, it checks whether the MUMPS ThirdParty/Mumps directory has
3117# been configured.  It adds to ADDLIBS any flags required to link with
3118# an externally provided MUMPS.  It defines the makefile conditional
3119# and preprocessor macro COIN_HAS_MUMPS, if MUMPS is available, and it
3120# defines the makefile conditional COIN_BUILD_MUMPS, if MUMPS is
3121# compiled within COIN.
3122
3123AC_DEFUN([AC_COIN_HAS_MUMPS],
3124[
3125if test "$PACKAGE_NAME" = ThirdPartyMumps; then
3126  coin_mumpsobjdir=../Mumps
3127else
3128  coin_mumpsobjdir=../ThirdParty/Mumps
3129fi
3130coin_mumpssrcdir=$abs_source_dir/$coin_mumpsobjdir/MUMPS
3131
3132MAKEOKFILE=.MakeOk
3133
3134#check if user provides a MUMPS library (that works)
3135AC_LANG_PUSH(C)
3136SAVE_ADDLIBS="$ADDLIBS"
3137ADDLIBS="$ADDLIBS $FLIBS"
3138AC_COIN_HAS_USER_LIBRARY(mumps, MUMPS, dmumps_c.h, dmumps_c)
3139ADDLIBS="$SAVE_ADDLIBS"
3140AC_LANG_POP(C)
3141
3142if test "$coin_has_mumps" = "true"; then  # user provided mumps library
3143  use_mumps=yes
3144  coin_has_mumps=yes
3145
3146  MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $MUMPSINCDIR\`"
3147  ADDLIBS="$MUMPSLIB $ADDLIBS"
3148
3149else # no user provided library, so we try to build our own
3150  use_mumps=BUILD
3151
3152  # Check if the MUMPS' ThirdParty project has been configured
3153  if test "$PACKAGE_NAME" != ThirdPartyMumps; then
3154    if test -r $coin_mumpsobjdir/.MakeOk; then
3155      use_mumps=BUILD
3156      # Mumps needs pthreads
3157      AC_LANG_PUSH(C)
3158      save_LIBS="$LIBS"
3159      LIBS="$LIBS $FLIBS"
3160      AC_CHECK_LIB([pthread],[pthread_create],[LIBS="-lpthread $save_LIBS"; ADDLIBS="-lpthread $ADDLIBS"],[LIBS="save_LIBS"])
3161      AC_LANG_POP(C)
3162 
3163      MUMPS_INCFLAGS="-I\`\$(CYGPATH_W) $coin_mumpssrcdir/libseq\` -I\`\$(CYGPATH_W) $coin_mumpssrcdir/include\`"
3164    else
3165      use_mumps=
3166    fi
3167  fi
3168
3169  # if a user provided library is used, then COIN_HAS_USER_LIBRARY takes care of the COIN_HAS_MUMPS conditional and preprocessor symbol
3170  AM_CONDITIONAL([COIN_HAS_MUMPS],[test x"$use_mumps" != x])
3171  if test x"$use_mumps" != x; then
3172    AC_DEFINE([COIN_HAS_MUMPS],[1],[If defined, the MUMPS Library is available.])
3173    coin_has_mumps=yes
3174  else
3175    coin_has_mumps=no
3176  fi
3177  AC_MSG_CHECKING([whether MUMPS is available])
3178  AC_MSG_RESULT([$coin_has_mumps])
3179fi
3180
3181if test x"$use_mumps" != x; then
3182  # we need the Fortran runtime libraries if we want to link with C/C++
3183  coin_need_flibs=yes
3184
3185  AC_SUBST(MUMPS_INCFLAGS)
3186fi
3187
3188AM_CONDITIONAL([COIN_BUILD_MUMPS],[test "$use_mumps" = BUILD])
3189
3190]) # AC_COIN_HAS_MUMPS
3191
3192###########################################################################
3193#                            COIN_HAS_METIS                               #
3194###########################################################################
3195
3196# This macro checks for a library containing the METIS library.  It
3197# checks if the user has provided an argument for the METIS library,
3198# and if not, it checks whether the METIS ThirdParty/Metis directory has
3199# been configured.  It adds to ADDLIBS any flags required to link with
3200# an externally provided METIS.  It defines the makefile conditional
3201# and preprocessor macro COIN_HAS_METIS, if METIS is available, and it
3202# defines the makefile conditional COIN_BUILD_METIS, if METIS is
3203# compiled within COIN.
3204
3205AC_DEFUN([AC_COIN_HAS_METIS],
3206[
3207case "$PACKAGE_NAME" in
3208  ThirdParty*)
3209    coin_metisobjdir=../Metis
3210    ;;
3211  *)
3212    coin_metisobjdir=../ThirdParty/Metis
3213    ;;
3214esac
3215
3216MAKEOKFILE=.MakeOk
3217
3218#check if user provides a METIS library (that works)
3219AC_LANG_PUSH(C)
3220AC_ARG_WITH(metis,
3221   AS_HELP_STRING([--with-metis], [specify flags to link with METIS library]),
3222   [METISLIB="$withval"; coin_has_metis=true], [coin_has_metis=no])
3223
3224if test $coin_has_metis = true; then
3225  coin_save_LIBS="$LIBS"
3226  LIBS="$METISLIB $ADDLIBS"
3227  AC_MSG_CHECKING([whether symbol metis_nodend is available with ])
3228  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[metis_nodend()]])],
3229     [AC_MSG_RESULT(yes)],
3230     [AC_MSG_RESULT(no)
3231      AC_MSG_ERROR([User-supplied METIS library does not work])])
3232  LIBS="$coin_save_LIBS"
3233fi
3234AC_LANG_POP(C)
3235
3236if test "$coin_has_metis" = "true"; then  # user provided metis library
3237  use_metis=yes
3238  coin_has_metis=yes
3239
3240  ADDLIBS="$METISLIB $ADDLIBS"
3241
3242else # no user provided library, so we try to build our own
3243  use_metis=BUILD
3244
3245  # Check if the METIS' ThirdParty project has been configured
3246  if test "$PACKAGE_NAME" != ThirdPartyMetis; then
3247    if test -r $coin_metisobjdir/.MakeOk; then
3248      use_metis=BUILD
3249    else
3250      use_metis=
3251    fi
3252  fi
3253
3254  if test x"$use_metis" != x; then
3255    coin_has_metis=yes
3256  else
3257    coin_has_metis=no
3258  fi
3259  AC_MSG_CHECKING([whether METIS is available])
3260  AC_MSG_RESULT([$coin_has_metis])
3261fi
3262
3263AM_CONDITIONAL([COIN_HAS_METIS],[test $coin_has_metis = yes])
3264if test $coin_has_metis = yes; then
3265  AC_DEFINE([COIN_HAS_METIS],[1],[If defined, the METIS library is available.])
3266fi
3267
3268]) # AC_COIN_HAS_METIS
3269
3270
3271###########################################################################
3272#                             COIN_HAS_GLPK                               #
3273###########################################################################
3274#
3275# This macro checks for the GLPK package. GLPK provides two capabilities,
3276# an LP and MIP solver (GLPK) and the GNU Mathprog modelling language (GMPL).
3277# The macro checks for either Glpk or Gmpl, according to the value specified as
3278# the parameter. Use one of Glpk or Gmpl. Use *exactly* these strings, eh?
3279#
3280#
3281# The macro first uses COIN_HAS_USER_LIBRARY to see if the user has specified
3282# a preexisting library (this allows the use of any glpk version, if the user
3283# is fussy). The macro then checks for ThirdParty/Glpk.
3284#
3285# This macro will define the following variables for Glpk:
3286#   coin_has_glpk       true or false
3287#   GLPKLIB             link flags for GLPK (if user supplied)
3288#   GLPKINCDIR          location of glpk include files
3289#   COIN_HAS_GLPK       Preprocessor symbol, defined to 1
3290#   COIN_HAS_GLPK       Automake conditional
3291#   COIN_BUILD_GLPK     Automake conditional, defined only if Glpk is to be
3292#                       built in ThirdParty/Glpk
3293#
3294# With the exception of COIN_BUILD_GLPK, an identical set of variables is
3295# defined for Gmpl.
3296
3297AC_DEFUN([AC_COIN_HAS_GLPK],
3298[
3299if test "$PACKAGE_NAME" = ThirdPartyGlpk; then
3300  coin_glpkobjdir=../Glpk
3301else
3302  coin_glpkobjdir=../ThirdParty/Glpk
3303fi
3304coin_glpksrcdir=$abs_source_dir/$coin_glpkobjdir
3305
3306use_thirdpartyglpk=no
3307
3308# Check for the requested component. If the user specified an external glpk
3309# library don't force a ThirdParty build, let the error propagate.
3310
3311m4_if([$1],[Glpk],
3312[AC_COIN_HAS_USER_LIBRARY([Glpk],[GLPK],[glpk.h],
3313    [_glp_lpx_simplex glp_lpx_simplex])
3314 if test x"$coin_has_glpk" = xfalse && test x"$GLPKLIB" = x ; then
3315   use_thirdpartyglpk=try
3316 fi])
3317m4_if([$1],[Gmpl],
3318[AC_COIN_HAS_USER_LIBRARY([Gmpl],[GMPL],[glpmpl.h],
3319    [_glp_mpl_initialize glp_mpl_initialize])
3320 if test x"$coin_has_gmpl" = xfalse && test x"$GMPLLIB" = x ; then
3321   use_thirdpartyglpk=try
3322 fi])
3323
3324# If the user has supplied an external library, use it. Otherwise, consider
3325# a build in ThirdParty/Glpk. If we build, assume we get both glpk and gmpl.
3326
3327if test x"$use_thirdpartyglpk" = xtry ; then
3328  MAKEOKFILE=.MakeOk
3329  # Check if the Glpk's ThirdParty project has been configured
3330  if test "$PACKAGE_NAME" != ThirdPartyGlpk; then
3331    if test -r $coin_glpkobjdir/.MakeOk; then
3332      use_thirdpartyglpk=build
3333    else
3334      use_thirdpartyglpk=no
3335    fi
3336  else
3337    use_thirdpartyglpk=build
3338  fi
3339
3340# If we're building, set the library and include directory variables, create a
3341# preprocessor symbol, define a variable that says we're using glpk/gmpl, and
3342# another to indicate a link check is a bad idea (hard to do before the library
3343# exists).
3344
3345  if test x"$use_thirdpartyglpk" = xbuild ; then
3346    m4_toupper($1INCDIR)="$coin_glpksrcdir/glpk/include"
3347    AC_SUBST(m4_toupper($1INCDIR))
3348    AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],
3349              [Define to 1 if $1 package is available])
3350    m4_tolower(coin_has_$1)=true
3351    m4_tolower($1_libcheck)=no
3352    m4_toupper($1OBJDIR)=`cd $coin_glpkobjdir; pwd`
3353    AC_SUBST(m4_toupper($1OBJDIR))
3354    AC_MSG_NOTICE([Using $1 in ThirdParty/Glpk])
3355  fi
3356fi
3357
3358# Define the necessary automake conditionals.
3359
3360AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
3361               [test x"$m4_tolower(coin_has_$1)" = xtrue])
3362AM_CONDITIONAL([COIN_BUILD_GLPK],[test x"$use_thirdpartyglpk" = xbuild])
3363
3364]) # AC_COIN_HAS_GLPK
Note: See TracBrowser for help on using the repository browser.