source: trunk/coin.m4 @ 3850

Last change on this file since 3850 was 3850, checked in by lou, 13 months ago

Rationalise the handling of data directories. Add/update comments.

  • Property svn:keywords set to Author Date Id Revision
File size: 61.8 KB
Line 
1# Copyright (C) 2013-2016
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4#
5# This file defines the common autoconf macros for COIN-OR
6#
7
8# Check requirements
9AC_PREREQ(2.69)
10
11###########################################################################
12#                           COIN_CHECK_VPATH                              #
13###########################################################################
14
15# This macro sets the variable coin_vpath_config to true if this is a VPATH
16# configuration, otherwise it sets it to false. `VPATH' just means we're
17# following best practices and not building in the source directory.
18
19AC_DEFUN([AC_COIN_CHECK_VPATH],
20[
21  AC_MSG_CHECKING(whether this is a VPATH configuration)
22  if test `cd $srcdir ; pwd` != `pwd`; then
23    coin_vpath_config=yes
24  else
25    coin_vpath_config=no
26  fi
27  AC_MSG_RESULT($coin_vpath_config)
28]) # AC_COIN_CHECK_VPATH
29
30
31###########################################################################
32#                          COIN_PROJECTVERSION                            #
33###########################################################################
34
35# This macro is used by COIN_INITIALIZE and sets up variables related to
36# versioning numbers of the project.
37#   COIN_PROJECTVERSION([project],[libtool_version_string])
38
39AC_DEFUN([AC_COIN_PROJECTVERSION],
40[
41  m4_ifvaln([$1],
42    [AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION),
43       ["$PACKAGE_VERSION"],[Version number of project])
44
45# Parse package version, assuming major.minor.release. PACKAGE_VERSION is set
46# by AC_INIT. Force components to 9999 if they're empty; this deals with
47# things like `trunk' and other nonstandard forms.
48 
49  [coin_majorver=`echo $PACKAGE_VERSION | sed -n -e 's/^\([0-9]*\).*/\1/gp'`]
50  [coin_minorver=`echo $PACKAGE_VERSION | sed -n -e 's/^[0-9]*\.\([0-9]*\).*/\1/gp'`]
51  [coin_releasever=`echo $PACKAGE_VERSION | sed -n -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/gp'`]
52  test -z "$coin_majorver"   && coin_majorver=9999
53  test -z "$coin_minorver"   && coin_minorver=9999
54  test -z "$coin_releasever" && coin_releasever=9999
55  AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION_MAJOR),
56    [$coin_majorver],[Major version number of project.])
57  AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION_MINOR),
58    [$coin_minorver],[Minor version number of project.])
59  AC_DEFINE_UNQUOTED(m4_toupper($1_VERSION_RELEASE),
60    [$coin_releasever],[Release version number of project.])
61
62# Create a variable set to the upper case version of the project name
63
64  COIN_PRJCT=m4_toupper($1)
65
66# Set the project's SVN revision number. The complicated sed expression
67# (made worse by quadrigraphs) ensures that things like 4123:4168MS end up
68# as a single number.
69
70  AC_CHECK_PROG([have_svnversion],[svnversion],[yes],[no])
71  if test "x$have_svnversion" = xyes; then
72    AC_SUBST(m4_toupper($1_SVN_REV))
73    svn_rev_tmp=`LANG=en_EN svnversion $srcdir 2>/dev/null`
74    if test "x$svn_rev_tmp" != xexported -a "x$svn_rev_tmp" != x -a "x$svn_rev_tmp" != "xUnversioned directory"; then
75      m4_toupper($1_SVN_REV)=`echo $svn_rev_tmp | sed -n -e 's/^@<:@0-9@:>@*://' -e 's/\(@<:@0-9@:>@\)@<:@^0-9@:>@*$/\1/p'`
76      AC_DEFINE_UNQUOTED(m4_toupper($1_SVN_REV),
77        $m4_toupper($1_SVN_REV),[SVN revision number of project])
78    fi
79  fi
80 ])
81 
82# Capture the libtool library version, if given.
83
84  m4_ifvaln([$2],[coin_libversion=$2],[])
85])
86
87
88###########################################################################
89#                          COIN_ENABLE_MSVC                               #
90###########################################################################
91
92# This macro is invoked by any PROG_compiler macro to establish the
93# --enable-msvc option.
94
95AC_DEFUN([AC_COIN_ENABLE_MSVC],
96[
97  AC_ARG_ENABLE([msvc],
98    [AC_HELP_STRING([--enable-msvc],
99       [Allow only Intel/Microsoft compilers on MinGW/MSys/Cygwin.])],
100    [enable_msvc=$enableval],
101    [enable_msvc=no])
102])
103
104
105###########################################################################
106#                      COIN_DEPENDENCY_LINKING                            #
107###########################################################################
108
109# Control whether all dependencies are linked into shared libraries. `Yes' is
110# the recommended best practice now-a-days. This can be overridden on the
111# configure command line.
112
113# In BuildTools/stable, dependency linking is disabled for cl and icl on
114# cygwin and mingw, enabled for everything else. That may need to be
115# reintroduced. --lh, 180228 --
116
117AC_DEFUN([AC_COIN_DEPENDENCY_LINKING],
118[
119  AC_ARG_ENABLE([dependency-linking],
120    [AC_HELP_STRING([--enable-dependency-linking],
121       [Link all library dependencies into shared libraries at
122        creation (default=yes)])],
123    [dependency_linking="$enableval"],
124    [dependency_linking=yes])
125
126# AC_SUBST([LT_LDFLAGS])
127# if test "$dependency_linking" = yes ; then
128#   LT_LDFLAGS="$LT_LDFLAGS -no-undefined"
129# fi
130
131  AM_CONDITIONAL(DEPENDENCY_LINKING, [test "$dependency_linking" = yes])
132])
133
134###########################################################################
135#                        COIN_COMPFLAGS_DEFAULTS                          #
136###########################################################################
137
138AC_DEFUN([AC_COIN_COMPFLAGS_DEFAULTS],
139[
140# We want --enable-msvc setup and checked
141
142  AC_REQUIRE([AC_COIN_ENABLE_MSVC])
143
144# This macro should run before the compiler checks (doesn't seem to be
145# sufficient for CFLAGS)
146
147  AC_BEFORE([$0],[AC_PROG_CXX])
148  AC_BEFORE([$0],[AC_PROG_CC])
149  AC_BEFORE([$0],[AC_PROG_F77])
150  AC_BEFORE([$0],[AC_PROG_FC])
151
152# change default compiler flags (TODO bring back --enable-debug)
153# - disable debugging (remove -g, set -DNDEBUG)
154# - enable exceptions for (i)cl
155
156  if test "$enable_msvc" = yes ; then
157    : ${FFLAGS:=""}
158    : ${FCFLAGS:=""}
159    : ${CFLAGS:="-DNDEBUG -nologo"}
160    : ${CXXFLAGS:="-DNDEBUG -EHsc -nologo"}
161    : ${AR:="lib"}
162    : ${AR_FLAGS:="-nologo -out:"}
163  else
164    : ${FFLAGS:=""}
165    : ${FCFLAGS:=""}
166    : ${CFLAGS:="-DNDEBUG"}
167    : ${CXXFLAGS:="-DNDEBUG"}
168  fi
169])
170
171###########################################################################
172#                            COIN_INITIALIZE                               #
173###########################################################################
174
175# AC_COIN_INITIALIZE(name,version)
176
177# This macro does everything that is required in the early part of the
178# configure script, such as defining a few variables.
179#   name: project name
180#   version (optional): the libtool library version (important for releases,
181#     less so for stable or trunk).
182
183AC_DEFUN([AC_COIN_INITIALIZE],
184[
185# Enforce the required autoconf version
186
187  AC_PREREQ(2.69)
188
189# Set the project's version numbers
190
191  AC_COIN_PROJECTVERSION($1, $2)
192
193# A useful makefile conditional that is always false
194
195  AM_CONDITIONAL(ALWAYS_FALSE, false)
196
197# Where should everything be installed by default?  The COIN default is to
198# install directly into subdirectories of the directory where configure is
199# run. The default would be to install under /usr/local.
200
201  AC_PREFIX_DEFAULT([`pwd`])
202
203# Change the default compiler flags. This needs to run before
204# AC_CANONICAL_BUILD.
205
206  AC_REQUIRE([AC_COIN_COMPFLAGS_DEFAULTS])
207
208# Get the build and host types
209
210  AC_CANONICAL_BUILD
211  AC_CANONICAL_HOST
212
213# libtool has some magic for host_os=mingw, but doesn't know about msys
214
215  if test $host_os = msys ; then
216    host_os=mingw
217    host=`echo $host | sed -e 's/msys/mingw/'`
218  fi
219
220# Make silent build rules the default (https://www.gnu.org/software/automake/
221# manual/html_node/Automake-Silent-Rules.html). Run before AM_INIT_AUTOMAKE,
222# which will AC_REQUIRE it anyway.
223
224  AM_SILENT_RULES([yes])
225
226# Initialize automake
227# - don't AC_DEFINE PACKAGE or VERSION (but there're still defined as shell
228#   variables in configure, and as make variables).
229# - disable dist target
230# - enable all automake warnings
231
232  AM_INIT_AUTOMAKE([no-define no-dist -Wall])
233
234# Disable automatic rebuild of configure/Makefile. Use run_autotools.
235
236  AM_MAINTAINER_MODE
237])
238
239###########################################################################
240#                           COIN_PROG_LIBTOOL                             #
241###########################################################################
242
243# Set up libtool parameters
244# (https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html)
245
246AC_DEFUN([AC_COIN_PROG_LIBTOOL],
247[
248# On Windows, shared C++ libraries do not work with the current libtool (it
249# handles only exports for C functions, not C++). On all other systems, build
250# only shared libraries.
251
252# (lh, 180302) Sadly, we can't use the obvious libtool macros
253# (AC_{ENABLE,DISABLE}_{SHARED,STATIC}, nor parameters to LT_INIT,
254# precisely because these macros record the default behaviour by defining
255# a macro, _LT_ENABLE_{SHARED,STATIC}_DEFAULT. No shell code involved, hence
256# any shell conditional has no effect. Either we trust libtool or we need
257# something more inventive. The relevant libtool macros are in ltoptions.m4,
258# _LT_ENABLE_SHARED and _LT_ENABLE_STATIC.
259
260# case $host_os in
261#   cygwin* | mingw* | msys* )
262#     AC_DISABLE_SHARED
263#     ;;
264#   *)
265#     AC_DISABLE_STATIC
266#     ;;
267# esac
268
269# Create libtool.
270
271  LT_INIT
272
273# Patch libtool to eliminate a trailing space after AR_FLAGS. This needs to be
274# run after config.status has created libtool. Apparently necessary on
275# Windows when lib.exe is the archive tool.
276
277  case "$AR" in
278    *lib* | *LIB* )
279      AC_CONFIG_COMMANDS([libtoolpatch],
280        [sed -e 's|AR_FLAGS |AR_FLAGS|g' libtool > libtool.tmp
281         mv libtool.tmp libtool
282         chmod 755 libtool])
283      ;;
284  esac
285
286# Set up LT_LDFLAGS. Add the library version string to LT_LDFLAGS, if one
287# is supplied.
288
289  AC_SUBST([LT_LDFLAGS])
290  AC_MSG_CHECKING([if the library version is set])
291  if test x"$coin_libversion" != x ; then
292    LT_LDFLAGS="$LT_LDFLAGS -version-info $coin_libversion"
293    AC_MSG_RESULT([$coin_libversion])
294  else
295    AC_MSG_RESULT([no])
296  fi
297
298# Check if dependency linking is enabled or disabled.
299
300  AC_COIN_DEPENDENCY_LINKING
301
302])
303
304###########################################################################
305#                    COIN_PROG_CC   COIN_PROG_CXX                         #
306###########################################################################
307
308# Macros to find C and C++ compilers according to specified lists of compiler
309# names. For Fortran compilers, see coin_fortran.m4.
310
311# Note that automake redefines AC_PROG_CC to invoke _AM_PROG_CC_C_O (an
312# equivalent to AC_PROG_CC_C_O, plus wrap CC in the compile script if needed)
313# and _AM_DEPENDENCIES (`dependency style'). Look in aclocal.m4 to see this.
314
315AC_DEFUN_ONCE([AC_COIN_PROG_CC],
316[
317  AC_REQUIRE([AC_COIN_ENABLE_MSVC])
318
319# Setting up libtool with LT_INIT will AC_REQUIRE AC_PROG_CC, but we want
320# to invoke it from this macro first so that we can supply a parameter.
321
322  AC_BEFORE([$0],[LT_INIT])
323
324# If enable-msvc, then test only for MS and Intel (on Windows) C compiler
325# otherwise, test a long list of C compilers that comes into our mind
326
327  if test $enable_msvc = yes ; then
328    comps="icl cl"
329  else
330    # TODO old buildtools was doing some $build specific logic here, do we
331    # still need this?
332    comps="gcc clang cc icc icl cl cc xlc xlc_r pgcc" 
333  fi
334  AC_PROG_CC([$comps])
335])
336
337# Note that automake redefines AC_PROG_CXX to invoke _AM_DEPENDENCIES
338# (`dependency style') but does not add an equivalent for AC_PROG_CXX_C_O,
339# hence we need an explicit call.
340
341AC_DEFUN_ONCE([AC_COIN_PROG_CXX],
342[
343  AC_REQUIRE([AC_COIN_ENABLE_MSVC])
344  AC_REQUIRE([AC_COIN_PROG_CC])
345
346# If enable-msvc, then test only for MS and Intel (on Windows) C++ compiler
347# otherwise, test a long list of C++ compilers that comes into our mind
348
349  if test $enable_msvc = yes ; then
350    comps="cl icl"
351  else
352    # TODO old buildtools was doing some $build specific logic here, do we
353    # still need this?
354    comps="g++ clang++ c++ pgCC icpc gpp cxx cc++ cl icl FCC KCC RCC xlC_r aCC CC"
355  fi
356  AC_PROG_CXX([$comps])
357
358# If the compiler does not support -c -o, then wrap the compile script around
359# it.
360
361  AC_PROG_CXX_C_O
362  if test $ac_cv_prog_cxx_c_o = no ; then
363    CXX="$am_aux_dir/compile $CXX"
364  fi
365])
366
367
368###########################################################################
369#                           COIN_HAS_PKGCONFIG                            #
370###########################################################################
371
372# Check whether a suitable pkg-config tool is available.  If so, then the
373# variable PKGCONFIG is set to its path, otherwise it is set to "".  Further,
374# the AM_CONDITIONAL COIN_HAS_PKGCONFIG is set and PKGCONFIG is AC_SUBST'ed.
375# Finally, the search path for .pc files is assembled from the value of
376# $prefix and $PKG_CONFIG_PATH in a variable COIN_PKG_CONFIG_PATH, which is
377# also AC_SUBST'ed.
378# The default minimal version number is 0.16.0 because COIN-OR .pc files
379# include a URL field which breaks pkg-config version <= 0.15. A more recent
380# minimum version can be specified as a parameter.
381# Portions of the macro body are derived from macros in pkg.m4.
382
383AC_DEFUN([AC_COIN_HAS_PKGCONFIG],
384[
385  AC_ARG_VAR([PKG_CONFIG],[path to pkg-config utility])
386
387# pkgconf is the up-and-coming thing, replacing pkg-config, so prefer it.
388# The next stanza is a modified version of PKG_PROG_PKG_CONFIG from pkg.m4.
389
390  if test -z "$PKG_CONFIG" ; then
391   AC_CHECK_TOOLS([PKG_CONFIG],[pkgconf pkg-config])
392  fi
393  if test -n "$PKG_CONFIG" ; then
394    pkg_min_version=m4_default([$1],[0.16.0])
395    AC_MSG_CHECKING([$PKG_CONFIG is at least version $pkg_min_version])
396    if $PKG_CONFIG --atleast-pkgconfig-version $pkg_min_version ; then
397      pkg_version=`$PKG_CONFIG --version`
398      AC_MSG_RESULT([yes: $pkg_version])
399    else
400     AC_MSG_RESULT([no])
401     PKG_CONFIG=""
402   fi
403  fi
404
405# Check if PKG_CONFIG supports the short-errors flag. The next stanza is a
406# modified version of _PKG_SHORT_ERRORS_SUPPORTED from pkg.m4.
407
408  if test -n "$PKG_CONFIG" &&
409     $PKG_CONFIG --atleast-pkgconfig-version 0.20 ; then
410    pkg_short_errors=" --short-errors "
411  else
412    pkg_short_errors=""
413  fi
414
415# Create a makefile variable and conditional.
416
417  AM_CONDITIONAL([COIN_HAS_PKGCONFIG], [test -n "$PKG_CONFIG"])
418  AC_SUBST(PKG_CONFIG)
419
420# Assemble a PKG_CONFIG search path that will include the installation
421# directory for .pc files for COIN packages.  Coin .pc files are installed in
422# ${libdir}/pkgconfig. But autoconf sets $libdir to '${exec_prefix}/lib', and
423# $exec_prefix to '${prefix}'.  COIN_INITIALIZE will set ac_default_prefix
424# correctly. Unless the user specifies --prefix, prefix is set to
425# NONE until the end of configuration, at which point it will be set to
426# $ac_default_prefix. Unless the user specifies --exec-prefix, exec-prefix
427# is set to NONE until the end of configuration, at which point it's set to
428# '${prefix}'. Sheesh.  So do the expansion, then back it out. Of course,
429# this whole house of cards balances on the shaky assumption that the user is
430# sane and has installed all packages in the same place and does not change
431# that place when make executes. If not, well, it's their responsibility to
432# augment PKG_CONFIG_PATH in the environment.
433
434  COIN_PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
435  AC_SUBST(COIN_PKG_CONFIG_PATH)
436
437  save_prefix=$prefix
438  save_exec_prefix=$exec_prefix
439  if test "x$prefix" = xNONE ; then
440    prefix=$ac_default_prefix
441  fi
442  if test "x$exec_prefix" = xNONE ; then
443    exec_prefix=$prefix
444  fi
445  expanded_libdir=$libdir
446  while expr "$expanded_libdir" : '.*$.*' >/dev/null 2>&1 ; do
447    eval expanded_libdir=$expanded_libdir
448  done
449  prefix=$save_prefix
450  exec_prefix=$save_exec_prefix
451  COIN_PKG_CONFIG_PATH="${expanded_libdir}/pkgconfig:${COIN_PKG_CONFIG_PATH}"
452  AC_MSG_NOTICE([$PKG_CONFIG path is "$COIN_PKG_CONFIG_PATH"])
453
454])  # COIN_HAS_PKGCONFIG
455
456
457###########################################################################
458#                      COIN_CHK_MOD_EXISTS                                #
459###########################################################################
460
461# COIN_CHK_MOD_EXISTS(MODULE, PACKAGES,
462#                     [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
463
464# Check to see whether a particular module (set of packages) exists. Derived
465# from PKG_CHECK_MODULES() from pkg.m4, but set only the variables $1_VERSIONS
466# and $1_PKG_ERRORS. PACKAGES ($2) is a space-separated list of .pc file names
467# (without the .pc suffix). Note that variable values will have one line per
468# package (embedded newlines) if more than one package is given in PACKAGES.
469
470AC_DEFUN([AC_COIN_CHK_MOD_EXISTS],
471[
472  AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])
473
474  if test -n "$PKG_CONFIG" ; then
475    if PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --exists "$2" ; then
476      m4_toupper($1)_VERSIONS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --modversion "$2" 2>/dev/null | tr '\n' ' '`
477      $3
478    else
479      m4_toupper($1)_PKG_ERRORS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "$2"`
480      $4
481    fi
482  else
483    AC_MSG_ERROR("Cannot check for existence of module $1 without pkgconf")
484  fi
485])
486
487###########################################################################
488#                          COIN_INIT_LIBVARS                              #
489###########################################################################
490
491# COIN_INIT_LIBVARS(lib,lflags,cflags,pcfiles,data)
492
493# This macro sets up the public variables for lib, PROJ_LFLAGS_PUB,
494# PROJ_CFLAGS_PUB, PROJ_PCFILES_PUB, and PROJ_DATA_PUB. These variables
495# correspond to Libs, Cflags, Requires, and datadir in the .pc.in file for
496# a project.  More generally, this macro is useful when a project builds
497# libraries that are used by other libraries during the project build. For
498# example, Osi builds OsiLib, which is used by OsiCommonTest and the various
499# OsiXxxLib interfaces to third-party solvers.
500
501# PROJ_PCFILES_PUB should be used rarely, if ever. We're exposing public
502# information from lower level libraries at the level of this library, which is
503# not usually necessary.
504
505# The datadir variable is a COIN extension in the .pc file. It defaults
506# to ${datarootdir}/PACKAGE_TARNAME in accordance with Gnu standards.
507
508AC_DEFUN([AC_COIN_INIT_LIBVARS],
509[
510  AC_SUBST(m4_toupper($1_LFLAGS_PUB),["$2"])
511  AC_SUBST(m4_toupper($1_CFLAGS_PUB),["$3"])
512  AC_SUBST(m4_toupper($1_PCFILES_PUB),["$4"])
513  AC_SUBST(m4_toupper($1_DATA_PUB),
514           [m4_default([$5],[\${datarootdir}/$PACKAGE_TARNAME])])
515])
516 
517
518###########################################################################
519#                          COIN_CHK_HERE                                  #
520###########################################################################
521
522# COIN_CHK_HERE([prim],[client packages],[pcfile])
523
524# Augment the _LFLAGS, _CFLAGS, and _PCFILES variables of the client
525# packages with the values from PRIM_LFLAGS_PUB, PRIM_CFLAGS_PUB, and
526# PRIM_PCFILES_PUB. This macro is intended for the case where a single project
527# builds several objects and one object includes another. For example,
528# the various OsiXxxLib solvers, which depend on OsiLib. We can't consult
529# osi.pc (it's not installed yet) but the relevant variables are ready at
530# hand. The name of prim is often different from the name of the .pc file
531# ($3), hence the separate parameter.
532
533# This macro should be called after FINALIZE_FLAGS is invoked for the
534# client packages, for two reasons: First, COIN packages tend to use
535# .pc files, so we're probably adding a package to _PCFILES that isn't yet
536# installed. Also, FINALIZE_FLAGS will have accessed the .pc files already
537# in _PCFILES and expanded them into _LIBS and _CFLAGS, saving the original
538# _LIBS and _CFLAGS in _LIBS_NOPC and _CFLAGS_NOPC.
539
540AC_DEFUN([AC_COIN_CHK_HERE],
541[
542
543# Make sure the necessary variables exist for each client package.
544
545  m4_foreach_w([myvar],[$2],
546    [AC_SUBST(m4_toupper(myvar)_LFLAGS)
547     AC_SUBST(m4_toupper(myvar)_CFLAGS)
548     AC_SUBST(m4_toupper(myvar)_PCFILES)])
549
550# Add the .pc file and augment LFLAGS and CFLAGS.
551
552    m4_foreach_w([myvar],[$2],
553      [m4_toupper(myvar)_PCFILES="$m4_toupper(myvar)_PCFILES $3"
554       m4_toupper(myvar)_LFLAGS="$m4_toupper(myvar)_LFLAGS $m4_toupper($1)_LFLAGS"
555       m4_toupper(myvar)_CFLAGS="$m4_toupper(myvar)_CFLAGS $m4_toupper($1)_CFLAGS"
556
557# Change the test to enable / disable debugging output
558
559       if test 1 = 1 ; then
560         AC_MSG_NOTICE([CHK_HERE adding $1 to myvar:])
561         AC_MSG_NOTICE([m4_toupper(myvar)_PCFILES: "${m4_toupper(myvar)_PCFILES}"])
562         AC_MSG_NOTICE([m4_toupper(myvar)_LFLAGS: "${m4_toupper(myvar)_LFLAGS}"])
563         AC_MSG_NOTICE([m4_toupper(myvar)_CFLAGS: "${m4_toupper(myvar)_CFLAGS}"])
564       fi ; ])
565
566])   # COIN_CHK_HERE
567
568###########################################################################
569#                      COIN_DEF_PRIM_ARGS                                 #
570###########################################################################
571
572# COIN_DEF_PRIM_ARGS([prim],[base],[lflags],[cflags],[dflags],[build])
573
574# This is a utility macro to handle the standard arguments that COIN
575# configuration files supply for a component (package or library):
576#   --with-prim: use primitive (yes / no / special)
577#   --with-prim-lflags: linker flags for the primitive
578#   --with-prim-cflags: preprocessor & compiler flags for the primitive
579#   --with-prim-data: data directory for the primitive
580# These arguments allow the user to override default macro behaviour from the
581# configure command line.
582# The string prim, lower-cased, is used in the flag name.
583# The parameters base, lflags, cflags, and dflags have the value yes or no and
584# determine whether a --with option will be defined for prim, lflags, cflags,
585# and data, respectively. They must be literals, as the macro uses them to cut
586# out unused options. To use the results, construct the name of the shell
587# variable as specified in the autoconf doc'n for ARG_WITH.
588
589# Setting the final parameter to 'build' will cause the phrase "'build' will
590# look for a COIN ThirdParty package" to be inserted in the documentation for
591# --with-prim.
592
593AC_DEFUN([AC_COIN_DEF_PRIM_ARGS],
594[
595  m4_define([extraHelp],[
596    m4_normalize(Use $1. [If an argument is given,]
597      ['yes' is equivalent to --with-m4_tolower($1),]
598      m4_case($6,build,
599      ['no' is equivalent to --without-m4_tolower($1)[,]
600       'build' will look for a COIN ThirdParty package.],
601      ['no' is equivalent to --without-m4_tolower($1).])
602      m4_case($3$4$5,nonono,,
603        nonoyes,
604        Any other argument is applied as for --with-m4_tolower($1)-data,
605        noyesno,
606        Any other argument is applied as for --with-m4_tolower($1)-cflags,
607        noyesyes,
608        Any other argument is applied as for --with-m4_tolower($1)-cflags,
609        Any other argument is applied as for --with-m4_tolower($1)-lflags))])
610
611  m4_if($2,yes,
612    [AC_ARG_WITH([m4_tolower($1)],
613       AS_HELP_STRING([--with-m4_tolower($1)],extraHelp))])
614
615  m4_if($3,yes,
616    [AC_ARG_WITH([m4_tolower($1)-lflags],
617       AS_HELP_STRING([--with-m4_tolower($1)-lflags],
618         [Linker flags for $1 appropriate for your environment.
619          (Most often, -l specs for libraries.)]))])
620
621  m4_if($4,yes,
622    [AC_ARG_WITH([m4_tolower($1)-cflags],
623       AS_HELP_STRING([--with-m4_tolower($1)-cflags],
624         [Compiler flags for $1 appropriate for your environment.
625          (Most often, -I specs for header file directories.)]))])
626
627  m4_if($5,yes,
628    [AC_ARG_WITH([m4_tolower($1)-data],
629       AS_HELP_STRING([--with-m4_tolower($1)-data],
630         [A data directory specification for $1 appropriate for your
631          environment.]))])
632])   # COIN_DEF_PRIM_ARGS
633
634
635###########################################################################
636#                     COIN_FIND_PRIM_PKG                                  #
637###########################################################################
638# COIN_FIND_PRIM_PKG([prim],[.pc file name],[default action],[cmdlineopts])
639
640# Determine whether we can use primary package prim ($1) and assemble
641# information on the required library flags (prim_lflags), compiler flags
642# (prim_cflags), and data directories (prim_data) as specified by cmdlineopts.
643
644# cmdlineopts ($4) specifies the set of configure command line options
645# defined and processed: 'nodata' produces --with-prim, --with-prim-libs, and
646# --with-prim-cflags; 'dataonly' produces --with-prim and --with-prim-data;
647# anything else ('all' works well) produces all four command line
648# options. Shell code produced by the macro is tailored based on
649# cmdlineopts. `nodata' is the default.
650
651# --with-prim is interpreted as follows: --with-prim=no is equivalent to
652# --without-prim. Any of --with-prim, --with-prim=yes, or --with-prim=build,
653# cause the macro to look for a .pc file. Any other value is taken as
654# equivalent to --with-prim-data=value (dataonly) or --with-prim-lflags=value
655# (anything else).
656
657# The algorithm first checks for a user-specified value of --with-prim;
658# if this is no, prim is skipped. Next, it looks for user specified values
659# given with command line parameters --with-prim-lflags, --with-prim-cflags,
660# and --with-prim-data. If none of these are specified, it will look for a
661# .pc file for prim using PKG_CONFIG.
662
663# Default action ($3) (no, yes, build) is the default action if the user
664# offers no guidance via command line parameters. The (hardwired) default is
665# yes.
666
667# If no .pc file names are specified, the macro will look for prim.pc if the
668# default is yes, coinprim.pc if the default is build.  If a .pc file name
669# ($2) is specified, it overrides the macro defaults. Note that for the
670# majority of COIN packages, you should not specify `build' as .pc files
671# for most COIN packages are simply the package name (e.g., clp.pc). For
672# ThirdParty packages, this works (e.g., coinglpk.pc).
673
674# The macro doesn't test that the specified values actually work. This is
675# deliberate.  There's no guarantee that user-specified libraries and/or
676# directories actually exist yet. The same possibility exists for values
677# returned when pkgconf checks the .pc file.
678
679AC_DEFUN([AC_COIN_FIND_PRIM_PKG],
680[
681  AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])
682
683  dflt_action=m4_default([$3],[yes])
684
685# Initialize variables for the primary package.
686
687  m4_tolower(coin_has_$1)=noInfo
688  m4_tolower($1_lflags)=
689  m4_tolower($1_cflags)=
690  m4_tolower($1_data)=
691  m4_tolower($1_pcfiles)=
692
693# --with-prim is always present. If the client specified dataonly, its value
694# is assigned to prim_data.
695
696  withval=$m4_tolower(with_$1)
697  if test -n "$withval" ; then
698    case "$withval" in
699      no )
700        m4_tolower(coin_has_$1)=skipping
701        ;;
702      yes )
703        m4_tolower(coin_has_$1)=requested
704        ;;
705      build )
706        m4_tolower(coin_has_$1)=build
707        ;;
708      * )
709        m4_tolower(coin_has_$1)=yes
710        m4_if(m4_default($4,nodata),dataonly,
711          [m4_tolower($1_data)=$withval],
712          [m4_tolower($1_lflags)=$withval])
713        ;;
714    esac
715  fi
716
717# --with-prim-libs and --with-prim-cflags are present unless the client
718# specified dataonly. Specifying --with-prim=no overrides the individual
719# options for libs and cflags.
720
721  m4_if(m4_default($4,nodata),dataonly,[],
722    [if test "$m4_tolower(coin_has_$1)" != skipping ; then
723       withval=$m4_tolower(with_$1_lflags)
724       if test -n "$withval" ; then
725         case "$withval" in
726           build | no | yes )
727             AC_MSG_ERROR(["$withval" is not valid here; please specify linker flags appropriate for your environment.])
728             ;;
729           * )
730             m4_tolower(coin_has_$1)=yes
731             m4_tolower($1_lflags)=$withval
732             ;;
733         esac
734       fi
735
736       withval=$m4_tolower(with_$1_cflags)
737       if test -n "$withval" ; then
738         case "$withval" in
739           build | no | yes )
740             AC_MSG_ERROR(["$withval" is not valid here; please specify compiler flags appropriate for your environment.])
741             ;;
742           * )
743             m4_tolower(coin_has_$1)=yes
744             m4_tolower($1_cflags)="$withval"
745             ;;
746         esac
747       fi
748     fi])
749
750# --with-prim-data will be present unless the client specified nodata.
751# Specifying --with-prim=no overrides the individual option for data.
752
753  m4_if(m4_default($4,nodata),nodata,[],
754    [if test "$m4_tolower(coin_has_$1)" != skipping ; then
755       withval=$m4_tolower(with_$1_data)
756       if test -n "$withval" ; then
757         case "$withval" in
758           build | no | yes )
759             AC_MSG_ERROR(["$withval" is not valid here; please give a data directory specification appropriate for your environment.])
760             ;;
761           * )
762             m4_tolower(coin_has_$1)=yes
763             m4_tolower($1_data)="$withval"
764             ;;
765         esac
766       fi
767     fi])
768
769# At this point, coin_has_prim can be one of noInfo (no user options
770# specified), skipping (user said no), requested or build (user said yes
771# or build and gave no further guidance), or yes (user specified one or
772# more --with-prim options). If we're already at yes or skipping, we're
773# done looking.
774
775# If there are no user options (noInfo) and the default is no, we're skipping.
776# Otherwise, the default must be yes or build; consider the package requested.
777# A default action we don't recognise defaults to yes.
778
779  if test "$m4_tolower(coin_has_$1)" = noInfo ; then
780    case $dflt_action in
781      no )
782        m4_tolower(coin_has_$1)=skipping
783        ;;
784      build )
785        m4_tolower(coin_has_$1)=build
786        ;;
787      * )
788        m4_tolower(coin_has_$1)=requested
789        ;;
790    esac
791  fi
792
793# Now coin_has_prim can be one of skipping, yes, requested, or build. For
794# requested or build, try pkgconf, if it's available. If it's not available,
795# well, hope that the user knows their system and prim can be used with no
796# additional flags.
797
798  case $m4_tolower(coin_has_$1) in
799    requested | build )
800      if test -n "$PKG_CONFIG" ; then
801        m4_ifnblank($2,
802          [pcfile=$2],
803          [if test $m4_tolower(coin_has_$1) = build ; then
804             pcfile=m4_tolower(coin$1)
805           else
806             pcfile=m4_tolower($1)
807           fi])
808        AC_COIN_CHK_MOD_EXISTS([$1],[$pcfile],
809          [m4_tolower(coin_has_$1)=yes
810           m4_tolower($1_data)=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --variable=datadir $pcfile 2>/dev/null`
811           m4_tolower($1_pcfiles)="$pcfile"],
812          [m4_tolower(coin_has_$1)=no])
813      else
814        m4_tolower(coin_has_$1)=yes
815        # AC_MSG_WARN([skipped check via pkgconf as no pkgconf available])
816      fi
817      ;;
818    skipping | yes )
819      ;;
820    * )
821      AC_MSG_WARN([Unexpected status "$m4_tolower(coin_has_$1)" in COIN_FIND_PRIM_PKG])
822      ;;
823  esac
824
825# The final value of coin_has_prim will be yes, no, or skipping. No means
826# we looked (with pkgconfig) and didn't find anything. Skipping means the
827# user said `don't use.' Yes means we have something, from the user or
828# from pkgconfig. Note that we haven't run a useability test!
829
830# Change the test to enable / disable debugging output
831
832    if test 1 = 1 ; then
833      AC_MSG_NOTICE([FIND_PRIM_PKG result for $1: "$m4_tolower(coin_has_$1)"])
834      AC_MSG_NOTICE([Collected values for package '$1'])
835      AC_MSG_NOTICE([m4_tolower($1_lflags) is "$m4_tolower($1_lflags)"])
836      AC_MSG_NOTICE([m4_tolower($1_cflags) is "$m4_tolower($1_cflags)"])
837      AC_MSG_NOTICE([m4_tolower($1_data) is "$m4_tolower($1_data)"])
838      AC_MSG_NOTICE([m4_tolower($1_pcfiles) is "$m4_tolower($1_pcfiles)"])
839    fi
840
841])  # COIN_FIND_PRIM_PKG
842
843###########################################################################
844#                          COIN_CHK_PKG                                   #
845###########################################################################
846
847# COIN_CHK_PKG([prim],[client packages],[.pc file name],
848#              [default action],[cmdopts])
849
850# Determine whether we can use primary package prim ($1) and assemble
851# information on the required linker flags (prim_lflags), compiler flags
852# (prim_cflags), and data directories (prim_data).
853
854# The configure command line options offered to the user are controlled
855# by cmdopts ($5). 'nodata' offers --with-prim, --with-prim-lflags, and
856# --with-prim-cflags. 'dataonly' offers --with-prim and --with-prim-data.
857# 'all' offers all four. DEF_PRIM_ARGS and FIND_PRIM_PKG are tailored
858# accordingly. The (hardwired) default is 'nodata'.
859
860# Default action ($4) (no, yes, build) is the default action if the user
861# offers no guidance via command line parameters. Really, 'build' has no hope
862# of working except for COIN ThirdParty packages. Don't use it for other COIN
863# packages.
864
865# If no .pc file names are specified, the macro will look for prim.pc if the
866# default is yes, coinprim.pc if the default is build.  If a .pc file name
867# ($3) is specified, it overrides the macro defaults.
868
869# Define an automake conditional COIN_HAS_PRIM to record the result. If we
870# decide to use prim, also define a preprocessor symbol COIN_HAS_PRIM.
871
872# Linker and compiler flag information will be propagated to the space-
873# separated list of client packages ($2) using the _PCFILES variable if
874# a .pc file is used, otherwise by the _LFLAGS and _CFLAGS variables of
875# client packages. These variables match Requires.private, Libs.private,
876# and Cflags.private, respectively, in a .pc file.
877
878# Data directory information is used differently. Typically what's wanted is
879# individual variables specifying the data directory for each primitive. Hence
880# the macro defines PRIM_DATA for the primitive.
881
882# The macro doesn't test that the specified values actually work. This is
883# deliberate.  There's no guarantee that user-specified libraries and/or
884# directories actually exist yet. The same possibility exists for values
885# returned when pkgconf checks the .pc file.
886
887AC_DEFUN([AC_COIN_CHK_PKG],
888[
889  AC_REQUIRE([AC_COIN_HAS_PKGCONFIG])
890
891  AC_MSG_CHECKING([for package $1])
892
893# Make sure the necessary variables exist for each client package.
894
895  m4_foreach_w([myvar],[$2],
896    [AC_SUBST(m4_toupper(myvar)_LFLAGS)
897     AC_SUBST(m4_toupper(myvar)_CFLAGS)
898     AC_SUBST(m4_toupper(myvar)_PCFILES)])
899
900# Check to see if the user has set an override to skip this primary.
901
902  m4_tolower(coin_has_$1)=noInfo
903  if test x"$COIN_SKIP_PROJECTS" != x ; then
904    for pkg in $COIN_SKIP_PROJECTS ; do
905      if test "$m4_tolower(pkg)" = "$m4_tolower($1)" ; then
906        m4_tolower(coin_has_$1)=skipping
907      fi
908    done
909  fi
910
911# If we're not skipping this primary, define and process the command line
912# options according to the cmdopts parameter. Then invoke FIND_PRIM_PKG to do
913# the heavy lifting.
914
915  if test "$m4_tolower(coin_has_$1)" != skipping ; then
916    m4_case(m4_default($5,nodata),
917      nodata,[AC_COIN_DEF_PRIM_ARGS([$1],yes,yes,yes,no,$4)],
918      dataonly,[AC_COIN_DEF_PRIM_ARGS([$1],yes,no,no,yes,$4)],
919      [AC_COIN_DEF_PRIM_ARGS([$1],yes,yes,yes,yes,$4)])
920    AC_COIN_FIND_PRIM_PKG(m4_tolower($1),[$3],[$4],[$5])
921    AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
922  else
923    AC_MSG_RESULT([$m4_tolower(coin_has_$1) due to COIN_SKIP_PROJECTS])
924  fi
925
926# Possibilities are `yes', 'no', or `skipping'. Normalise to `yes' or `no'.
927
928  if test "$m4_tolower(coin_has_$1)" != yes ; then
929    m4_tolower(coin_has_$1)=no
930  fi
931
932# Create an automake conditional COIN_HAS_PRIM.
933
934  AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
935                 [test $m4_tolower(coin_has_$1) = yes])
936
937# If we've located the package, define preprocessor symbol COIN_HAS_PRIM and
938# augment the necessary variables for the client packages.
939
940  if test $m4_tolower(coin_has_$1) = yes ; then
941    AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],
942      [Define to 1 if $1 is available.])
943    m4_foreach_w([myvar],[$2],
944      [m4_toupper(myvar)_PCFILES="$m4_tolower($1_pcfiles) $m4_toupper(myvar)_PCFILES"
945       m4_toupper(myvar)_LFLAGS="$m4_tolower($1_lflags) $m4_toupper(myvar)_LFLAGS"
946       m4_toupper(myvar)_CFLAGS="$m4_tolower($1_cflags) $m4_toupper(myvar)_CFLAGS"])
947
948# Finally, set up PRIM_DATA, unless the user specified nodata.
949
950    m4_if(m4_default([$5],nodata),nodata,[],
951      [AC_SUBST(m4_toupper($1)_DATA)
952       m4_toupper($1)_DATA=$m4_tolower($1_data)])
953  fi
954])   # COIN_CHK_PKG
955
956
957###########################################################################
958#                          FIND_PRIM_LIB                                  #
959###########################################################################
960
961# COIN_FIND_PRIM_LIB([prim],[lflgs],[cflgs],[dflgs],
962#                    [dfltaction],[cmdlineopts])
963
964# Determine whether we can use primary library prim ($1) and assemble
965# information on the required linker flags (prim_lflags), compiler flags
966# (prim_cflags), and data directories (prim_data) as specified by cmdlineopts.
967
968# cmdlineopts ($6) specifies the set of configure command line options
969# defined and processed: 'nodata' produces --with-prim, --with-prim-lflags,
970# and --with-prim-cflags; 'dataonly' produces only --with-prim and
971# --with-prim-data; anything else ('all' works well) produces all four
972# command line options. Shell code produced by the macro is tailored based
973# on cmdlineopts. `nodata' is the default.
974
975# --with-prim is interpreted as follows:
976#   * --with-prim=no is equivalent to --without-prim.
977#   * --with-prim or --with-prim=yes is equivalent to
978#       --with-prim-lflags=-lprim
979#       --with-prim-data=/usr/local/share
980#   * --with-prim=build attempts to invent something that will find a COIN
981#     ThirdParty library or data
982#       --with-prim-lflags="-L\$(libdir) -lcoinprim"
983#       --with-prim-cflgs="-I\$(pkgincludedir)/ThirdParty"
984#       --with-prim-data="\$(pkgdatadir)"
985#   * Any other value is taken as equivalent to
986#       --with-prim-data=value (dataonly) or
987#       --with-prim-lflags=value (anything else)
988
989# The algorithm first checks for a user-specified value of --with-prim;
990# if this is no, prim is skipped. Next, it looks for user specified values
991# given with command line parameters --with-prim-lflags, --with-prim-cflags,
992# and --with-prim-data. If none of these are specified, it will use the values
993# passed as parameters. It's all or none: any command line options disable all
994# parameters.
995
996# Default action ($5) (no, yes, build) is the default value of --with-prim
997# if the user offers no guidance via command line parameters. The (hardwired)
998# default is yes. `build' doesn't have a hope of working except for COIN
999# ThirdParty packages, and even then it's pretty shaky. You should be
1000# using CHK_PKG, because COIN packaging for ThirdParty software creates a .pc
1001# file.
1002
1003# The macro doesn't test that the specified values actually work. This is
1004# deliberate --- there's no guarantee that the specified values actually
1005# exist just yet. Really all we're doing here is filling in variables using a
1006# complicated algorithm.
1007
1008AC_DEFUN([AC_COIN_FIND_PRIM_LIB],
1009[
1010  dflt_action=m4_default([$5],[yes])
1011
1012# Initialize variables for the primary library.
1013
1014  m4_tolower(coin_has_$1)=noInfo
1015  m4_tolower($1_lflags)=
1016  m4_tolower($1_cflags)=
1017  m4_tolower($1_data)=
1018
1019# --with-prim is always present. If the client specified dataonly, its value
1020# is assigned to prim_data.
1021
1022  withval=$m4_tolower(with_$1)
1023  if test -n "$withval" ; then
1024    case "$withval" in
1025      no )
1026        m4_tolower(coin_has_$1)=skipping
1027        ;;
1028      yes )
1029        m4_tolower(coin_has_$1)=requested
1030        ;;
1031      build )
1032        m4_tolower(coin_has_$1)=build
1033        ;;
1034      * )
1035        m4_tolower(coin_has_$1)=yes
1036        m4_if(m4_default($6,nodata),dataonly,
1037          [m4_tolower($1_data)=$withval],
1038          [m4_tolower($1_libs)=$withval])
1039        ;;
1040    esac
1041  fi
1042
1043# --with-prim-lflags and --with-prim-cflags are present unless the client
1044# specified dataonly. Specifying --with-prim=no overrides the individual
1045# options for lflags and cflags.
1046
1047  m4_if(m4_default($6,nodata),dataonly,[],
1048    [if test "$m4_tolower(coin_has_$1)" != skipping ; then
1049       withval=$m4_tolower(with_$1_lflags)
1050       if test -n "$withval" ; then
1051         case "$withval" in
1052           build | no | yes )
1053             AC_MSG_ERROR(["$withval" is not valid here; please specify linker flags appropriate for your environment.])
1054             ;;
1055           * )
1056             m4_tolower(coin_has_$1)=yes
1057             m4_tolower($1_libs)=$withval
1058             ;;
1059         esac
1060       fi
1061
1062       withval=$m4_tolower(with_$1_cflags)
1063       if test -n "$withval" ; then
1064         case "$withval" in
1065           build | no | yes )
1066             AC_MSG_ERROR(["$withval" is not valid here; please specify compiler flags appropriate for your environment.])
1067             ;;
1068           * )
1069             m4_tolower(coin_has_$1)=yes
1070             m4_tolower($1_cflags)="$withval"
1071             ;;
1072         esac
1073       fi
1074     fi])
1075
1076# --with-prim-data will be present unless the client specified nodata.
1077# Specifying --with-prim=no overrides the individual option for data.
1078
1079  m4_if(m4_default($6,nodata),nodata,[],
1080    [if test "$m4_tolower(coin_has_$1)" != skipping ; then
1081       withval=$m4_tolower(with_$1_data)
1082       if test -n "$withval" ; then
1083         case "$withval" in
1084           build | no | yes )
1085             AC_MSG_ERROR(["$withval" is not valid here; please give a data directory specification appropriate for your environment.])
1086             ;;
1087           * )
1088             m4_tolower(coin_has_$1)=yes
1089             m4_tolower($1_data)="$withval"
1090             ;;
1091         esac
1092       fi
1093     fi])
1094
1095# At this point, coin_has_prim can be one of noInfo (no user options
1096# specified), skipping (user said no), requested or build (user said yes
1097# or build and gave no further guidance), or yes (user specified one or
1098# more --with-prim options). If we're already at yes or skipping, we're
1099# done looking.
1100
1101# If there are no user options (noInfo) and the default is no, we're skipping.
1102# Otherwise, the default must be yes or build; consider the package requested.
1103# A default action we don't recognise defaults to yes.
1104
1105  if test "$m4_tolower(coin_has_$1)" = noInfo ; then
1106    case $dflt_action in
1107      no )
1108        m4_tolower(coin_has_$1)=skipping
1109        ;;
1110      build )
1111        m4_tolower(coin_has_$1)=build
1112        ;;
1113      * )
1114        m4_tolower(coin_has_$1)=requested
1115        ;;
1116    esac
1117  fi
1118
1119# Now coin_has_prim can be one of skipping, yes, build, or requested. For
1120# build or requested, use the parameter values or invent some.
1121
1122  case $m4_tolower(coin_has_$1) in
1123    build | requested)
1124      m4_if(m4_default($6,nodata),dataonly,[],
1125        [m4_ifnblank([$2],
1126           [m4_tolower($1_lflags)=$2],
1127           [if test "$m4_tolower(coin_has_$1)" = build ; then
1128              m4_tolower($1_lflags)="-L\$(libdir) -l[]m4_tolower(coin$1)"
1129            else
1130              m4_tolower($1_lflags)="-l[]m4_tolower($1)"
1131            fi])
1132         m4_ifnblank([$3],
1133           [m4_tolower($1_cflags)=$3],
1134           [if test "$m4_tolower(coin_has_$1)" = build ; then
1135              m4_tolower($1_cflags)="-I\$(pkgincludedir)/ThirdParty"
1136            fi])])
1137      m4_if(m4_default($6,nodata),nodata,[],
1138        [m4_tolower($1_data)=m4_default([$3],
1139           [if test "$m4_tolower(coin_has_$1)" = build ; then
1140              m4_tolower($1_data)="\$(pkgdatadir)"
1141            else
1142              m4_tolower($1_data)="/usr/local/share"
1143            fi])])
1144      m4_tolower(coin_has_$1)=yes
1145      ;;
1146    skipping | yes )
1147      ;;
1148    * )
1149      AC_MSG_WARN([Unexpected status "$m4_tolower(coin_has_$1)" in COIN_FIND_PRIM_LIB])
1150      ;;
1151  esac
1152
1153# The final value of coin_has_prim will be yes or skipping.  Skipping means
1154# the user said `don't use.' Yes means we have something, from the user or
1155# macro parameters or invented. Note that we haven't run a useability test!
1156
1157# Change the test to enable / disable debugging output
1158
1159    if test 1 = 1 ; then
1160      AC_MSG_NOTICE([FIND_PRIM_LIB result for $1: "$m4_tolower(coin_has_$1)"])
1161      AC_MSG_NOTICE([Collected values for package '$1'])
1162      AC_MSG_NOTICE([m4_tolower($1_lflags) is "$m4_tolower($1_lflags)"])
1163      AC_MSG_NOTICE([m4_tolower($1_cflags) is "$m4_tolower($1_cflags)"])
1164      AC_MSG_NOTICE([m4_tolower($1_data) is "$m4_tolower($1_data)"])
1165      AC_MSG_NOTICE([m4_tolower($1_pcfiles) is "$m4_tolower($1_pcfiles)"])
1166    fi
1167
1168])  # COIN_FIND_PRIM_LIB
1169
1170###########################################################################
1171#                          COIN_CHK_LIB                                   #
1172###########################################################################
1173
1174# COIN_CHK_LIB([prim],[client packages],[lflgs],[cflgs],[dflgs],
1175#              [dfltaction],[cmdopts])
1176
1177# Determine whether we can use primary library prim ($1) and assemble
1178# information on the required linker flags (prim_lflags), compiler flags
1179# (prim_cflags), and data directories (prim_data).
1180
1181# The configure command line options offered to the user are controlled
1182# by cmdopts ($7). 'nodata' offers --with-prim, --with-prim-lflags, and
1183# --with-prim-cflags; 'dataonly' offers --with-prim and --with-prim-data;
1184# 'all' offers all four. DEF_PRIM_ARGS and FIND_PRIM_LIB are tailored
1185# accordingly. The (hardwired) default is 'nodata'.
1186
1187# Macro parameters lflgs ($3), cflgs ($4), and dflgs ($5) are used for
1188# --with-prim-lflags, --with-prim-cflags, and --with-prim-data if and only if
1189# there are no user-supplied values on the command line. It's all or nothing;
1190# any user-supplied value causes all macro parameters to be ignored.
1191
1192# Default action ($6) (no, yes, build) is the default action if the user
1193# offers no guidance via command line parameters. Really, 'build' has no
1194# hope of working except for COIN ThirdParty packages. Don't use it for
1195# other COIN packages. You should be using CHK_PKG because COIN packaging
1196# for ThirdParty software creates a .pc file.
1197
1198# Define an automake conditional COIN_HAS_PRIM to record the result. If we
1199# decide to use prim, also define a preprocessor symbol COIN_HAS_PRIM.
1200
1201# Linker and compiler flag information will be propagated to the space-
1202# separated list of client packages ($2) using the _LFLAGS and _CFLAGS
1203# variables of client packages. These variables match Libs.private and
1204# Cflags.private, respectively, in a .pc file.
1205
1206# Data directory information is used differently. Typically what's wanted is
1207# individual variables specifying the data directory for each primitive. Hence
1208# the macro defines PRIM_DATA for the primitive.
1209
1210# The macro doesn't test that the specified values actually work. This is
1211# deliberate.  There's no guarantee that user-specified libraries and/or
1212# directories actually exist yet. The same possibility exists for values
1213# returned when pkgconf checks the .pc file.
1214
1215AC_DEFUN([AC_COIN_CHK_LIB],
1216[
1217  AC_MSG_CHECKING([for package $1])
1218
1219# Make sure the necessary variables exist for each client package.
1220
1221  m4_foreach_w([myvar],[$2],
1222    [AC_SUBST(m4_toupper(myvar)_LFLAGS)
1223     AC_SUBST(m4_toupper(myvar)_CFLAGS)])
1224
1225# Check to see if the user has overridden configure parameters from the
1226# environment.
1227
1228  m4_tolower(coin_has_$1)=noInfo
1229  if test x"$COIN_SKIP_PROJECTS" != x ; then
1230    for pkg in $COIN_SKIP_PROJECTS ; do
1231      if test "$m4_tolower(pkg)" = "$m4_tolower($1)" ; then
1232        m4_tolower(coin_has_$1)=skipping
1233      fi
1234    done
1235  fi
1236
1237# If we're not skipping this project, define and process the command line
1238# options according to the cmdopts parameter. Then invoke FIND_PRIM_PKG to do
1239# the heavy lifting.
1240
1241  if test "$m4_tolower(coin_has_$1)" != skipping ; then
1242    m4_case(m4_default($7,nodata),
1243      nodata,[AC_COIN_DEF_PRIM_ARGS([$1],yes,yes,yes,no,$4)],
1244      dataonly,[AC_COIN_DEF_PRIM_ARGS([$1],yes,no,no,yes,$4)],
1245      [AC_COIN_DEF_PRIM_ARGS([$1],yes,yes,yes,yes,$4)])
1246    AC_COIN_FIND_PRIM_LIB(m4_tolower($1),[$3],[$4],[$5],[$6],[$7])
1247    AC_MSG_RESULT([$m4_tolower(coin_has_$1)])
1248  else
1249    AC_MSG_RESULT([$m4_tolower(coin_has_$1) due to COIN_SKIP_PROJECTS])
1250  fi
1251
1252# Possibilities are `yes' or `skipping'. Normalise to `yes' or `no'.
1253
1254  if test "$m4_tolower(coin_has_$1)" != yes ; then
1255    m4_tolower(coin_has_$1)=no
1256  fi
1257
1258# Create an automake conditional COIN_HAS_PRIM.
1259
1260  AM_CONDITIONAL(m4_toupper(COIN_HAS_$1),
1261                 [test $m4_tolower(coin_has_$1) = yes])
1262
1263# If we've located the package, define preprocessor symbol COIN_HAS_PRIM
1264# and augment the necessary variables for the client packages.
1265
1266  if test $m4_tolower(coin_has_$1) = yes ; then
1267    AC_DEFINE(m4_toupper(COIN_HAS_$1),[1],
1268      [Define to 1 if the $1 package is available])
1269    m4_foreach_w([myvar],[$2],
1270      [m4_toupper(myvar)_LFLAGS="$m4_tolower($1_lflags) $m4_toupper(myvar)_LFLAGS"
1271       m4_toupper(myvar)_CFLAGS="$m4_tolower($1_cflags) $m4_toupper(myvar)_CFLAGS"])
1272
1273# Finally, set up PRIM_DATA, unless the user specified nodata.
1274
1275    m4_if(m4_default([$7],nodata),nodata,[],
1276      [AC_SUBST(m4_toupper($1)_DATA)
1277       m4_toupper($1)_DATA=$m4_tolower($1_data)])
1278  fi
1279])   # COIN_CHK_LIB
1280
1281
1282#######################################################################
1283#                           COIN_CHK_LIBM                           #
1284#######################################################################
1285
1286# COIN_CHK_LIBM([client1 client2 ...])
1287# Check if a library spec is needed for the math library. If something is
1288# needed, the macro adds the flags to CLIENT_LFLAGS for each client.
1289
1290AC_DEFUN([AC_COIN_CHK_LIBM],
1291[
1292  AC_REQUIRE([AC_PROG_CC])
1293
1294  coin_save_LIBS="$LIBS"
1295  LIBS=
1296  AC_SEARCH_LIBS([cos],[m],
1297    [if test "$ac_cv_search_cos" != 'none required' ; then
1298       m4_foreach_w([myvar],[$1],
1299         [m4_toupper(myvar)_LFLAGS="$ac_cv_search_cos $m4_toupper(myvar)_LFLAGS"])
1300     fi])
1301  LIBS="$coin_save_LIBS"
1302]) # AC_COIN_CHK_LIBM
1303
1304###########################################################################
1305#                           COIN_CHK_ZLIB                               #
1306###########################################################################
1307
1308# COIN_CHK_ZLIB([client1 client2 ...])
1309
1310# This macro checks for the libz library.  If found, it sets the automake
1311# conditional COIN_HAS_ZLIB and defines the C preprocessor variable
1312# COIN_HAS_ZLIB. The default is to use zlib, if it's present.  For each client,
1313# it adds the linker flags to the variable CLIENT_LFLAGS for each client.
1314
1315AC_DEFUN([AC_COIN_CHK_ZLIB],
1316[
1317  AC_REQUIRE([AC_COIN_PROG_CC])
1318
1319  coin_has_zlib=no
1320
1321  AC_ARG_ENABLE([zlib],
1322    [AC_HELP_STRING([--disable-zlib],
1323       [do not compile with compression library zlib])],
1324    [coin_enable_zlib=$enableval],
1325    [coin_enable_zlib=yes])
1326
1327  if test x$coin_enable_zlib = xyes ; then
1328    AC_CHECK_HEADER([zlib.h],[coin_has_zlib=yes])
1329    if test x$coin_has_zlib = xyes ; then
1330      AC_CHECK_LIB([z],[gzopen],[],[coin_has_zlib=no])
1331    fi
1332    if test x$coin_has_zlib = xyes ; then
1333      m4_foreach_w([myvar],[$1],
1334        [m4_toupper(myvar)_LFLAGS="-lz $m4_toupper(myvar)_LFLAGS"])
1335      AC_DEFINE([COIN_HAS_ZLIB],[1],[Define to 1 if zlib is available])
1336    fi
1337  fi
1338
1339  AM_CONDITIONAL([COIN_HAS_ZLIB],[test x$coin_has_zlib = xyes])
1340]) # AC_COIN_CHK_ZLIB
1341
1342
1343###########################################################################
1344#                            COIN_CHK_BZLIB                             #
1345###########################################################################
1346
1347# COIN_CHK_BZLIB([client1 client2 ...])
1348
1349# This macro checks for the libbz2 library.  If found, it defines the
1350# C preprocessor variable COIN_HAS_BZLIB and the automake conditional
1351# COIN_HAS_BZLIB.  Further, for a (space separated) list of clients, it adds
1352# the linker flag to the variable CLIENT_LFLAGS for each client.
1353
1354AC_DEFUN([AC_COIN_CHK_BZLIB],
1355[
1356  AC_REQUIRE([AC_PROG_CC])
1357
1358  coin_has_bzlib=no
1359
1360  AC_ARG_ENABLE([bzlib],
1361    [AC_HELP_STRING([--disable-bzlib],
1362       [do not compile with compression library bzlib])],
1363    [coin_enable_bzlib=$enableval],
1364    [coin_enable_bzlib=yes])
1365
1366  if test $coin_enable_bzlib = yes ; then
1367    AC_CHECK_HEADER([bzlib.h],[coin_has_bzlib=yes])
1368    if test $coin_has_bzlib = yes ; then
1369      AC_CHECK_LIB([bz2],[BZ2_bzReadOpen],[],[coin_has_bzlib=no])
1370    fi
1371    if test $coin_has_bzlib = yes ; then
1372      m4_foreach_w([myvar],[$1],
1373        [m4_toupper(myvar)_LFLAGS="-lbz2 $m4_toupper(myvar)_LFLAGS"])
1374      AC_DEFINE([COIN_HAS_BZLIB],[1],[Define to 1 if bzlib is available])
1375    fi
1376  fi
1377
1378  AM_CONDITIONAL([COIN_HAS_BZLIB],[test x$coin_has_bzlib = xyes])
1379]) # AC_COIN_CHK_BZLIB
1380
1381
1382###########################################################################
1383#                              COIN_CHK_GMP                             #
1384###########################################################################
1385
1386# COIN_CHK_GMP([client1 client2 ...])
1387
1388# This macro checks for the gmp library.  If found, it defines the C
1389# preprocessor variable COIN_HAS_GMP and the automake conditional COIN_HAS_GMP.
1390# Further, for a (space separated) list of clients, it adds the linker
1391# flag to the variable CLIENT_LFLAGS for each client.
1392
1393AC_DEFUN([AC_COIN_CHK_GMP],
1394[
1395  AC_REQUIRE([AC_PROG_CC])
1396
1397  coin_has_gmp=no
1398
1399  AC_ARG_ENABLE([gmp],
1400    [AC_HELP_STRING([--disable-gmp],
1401       [do not compile with GNU multiple precision library])],
1402    [coin_enable_gmp=$enableval],
1403    [coin_enable_gmp=yes])
1404
1405  if test $coin_enable_gmp = yes ; then
1406    AC_CHECK_HEADER([gmp.h],
1407      [AC_CHECK_LIB([gmp],[__gmpz_init],[coin_has_gmp=yes])])
1408    if test $coin_has_gmp = yes ; then
1409      m4_foreach_w([myvar],[$1],
1410        [m4_toupper(myvar)_LFLAGS="-lgmp $m4_toupper(myvar)_LFLAGS"])
1411      AC_DEFINE([COIN_HAS_GMP],[1],[Define to 1 if GMP is available])
1412    fi
1413  fi
1414
1415  AM_CONDITIONAL([COIN_HAS_GMP],[test x$coin_has_gmp = xyes])
1416]) # AC_COIN_CHK_GMP
1417
1418
1419###########################################################################
1420#                         COIN_CHK_GNU_READLINE                         #
1421###########################################################################
1422
1423# COIN_CHK_GNU_READLINE([client1 client2 ...])
1424
1425# This macro checks for GNU's readline.  It verifies that the header
1426# readline/readline.h is available, and that the -lreadline library contains
1427# "readline".  It is assumed that #include <stdio.h> is included in the source
1428# file before the #include<readline/readline.h> If found, it defines the C
1429# preprocessor variable COIN_HAS_READLINE.  Further, for a (space separated)
1430# list of clients, it adds the linker flag to the variable CLIENT_LFLAGS for
1431# each client.
1432
1433AC_DEFUN([AC_COIN_CHK_GNU_READLINE],
1434[
1435  AC_REQUIRE([AC_PROG_CC])
1436
1437  coin_has_readline=no
1438
1439  AC_ARG_ENABLE([readline],
1440    [AC_HELP_STRING([--disable-readline],
1441       [do not compile with readline library])],
1442    [coin_enable_readline=$enableval],
1443    [coin_enable_readline=yes])
1444
1445  if test $coin_enable_readline = yes ; then
1446    AC_CHECK_HEADER([readline/readline.h],
1447      [coin_has_readline=yes],[],[#include <stdio.h>])
1448    coin_save_LIBS="$LIBS"
1449    LIBS=
1450    if test $coin_has_readline = yes ; then
1451      AC_SEARCH_LIBS([tputs],
1452        [ncurses termcap curses],[],[coin_has_readline=no])
1453    fi
1454    if test $coin_has_readline = yes ; then
1455      AC_CHECK_LIB([readline],[readline],[],[coin_has_readline=no])
1456    fi
1457    if test $coin_has_readline = yes ; then
1458      m4_foreach_w([myvar],[$1],
1459        [m4_toupper(myvar)_LFLAGS="-lreadline $m4_toupper(myvar)_LFLAGS"])
1460      AC_DEFINE([COIN_HAS_READLINE],[1],[Define to 1 if readline is available])
1461    fi
1462    LIBS="$coin_save_LIBS"
1463  fi
1464
1465  AM_CONDITIONAL([COIN_HAS_READLINE],[test x$coin_has_readline = xyes])
1466]) # AC_COIN_CHK_GNU_READLINE
1467
1468###########################################################################
1469#                           COIN_DOXYGEN                                  #
1470###########################################################################
1471
1472# This macro determines the configuration information for doxygen, the tool
1473# used to generate online documentation of COIN code. It takes one parameter,
1474# a list of projects (mixed-case, to match the install directory names) that
1475# should be processed as external tag files. E.g., COIN_DOXYGEN([Clp Osi]).
1476
1477# This macro will define the following variables:
1478#  coin_have_doxygen    Yes if doxygen is found, no otherwise
1479#  coin_doxy_usedot     Defaults to `yes'; --with-dot will still check to see
1480#                       if dot is available
1481#  coin_doxy_tagname    Name of doxygen tag file (placed in doxydoc directory)
1482#  coin_doxy_logname    Name of doxygen log file (placed in doxydoc directory)
1483#  coin_doxy_tagfiles   List of doxygen tag files used to reference other
1484#                       doxygen documentation
1485
1486# It's not immediately obvious, but the code in this macro, configure-time
1487# substitions in doxygen.conf.in, and build-time edits of doxygen.conf in
1488# Makemain.inc combine to hardwire the assumptions that a tag file is named
1489# proj_doxy.tag, that PKG_TARNAME is coin-or-proj, and that the doxygen
1490# documentation is in the GNU default location $(docdir)/$PKG_TARNAME. Have
1491# a look over the complete machinery before you start changing things. The
1492# point of the build-time edits is to allow the user to redefine docdir at
1493# build time, as per GNU standards. Failure to use coin-or-proj as PKG_TARNAME
1494# will surely break linking of documentation with tag files.
1495
1496AC_DEFUN([AC_COIN_DOXYGEN],
1497[
1498
1499AC_MSG_NOTICE([configuring doxygen documentation options])
1500
1501# Check to see if doxygen is available.
1502
1503AC_CHECK_PROG([coin_have_doxygen],[doxygen],[yes],[no])
1504AC_CHECK_PROG([coin_have_latex],[latex],[yes],[no])
1505
1506# Look for the dot tool from the graphviz package, unless the user has
1507# disabled it.
1508
1509AC_ARG_WITH([dot],
1510  AS_HELP_STRING([--with-dot],
1511                 [use dot (from graphviz) when creating documentation with
1512                  doxygen if available; --without-dot to disable]),
1513  [],[withval=yes])
1514if test x"$withval" = xno ; then
1515  coin_doxy_usedot=NO
1516  AC_MSG_CHECKING([for dot ])
1517  AC_MSG_RESULT([disabled])
1518else
1519  AC_CHECK_PROG([coin_doxy_usedot],[dot],[YES],[NO])
1520fi
1521
1522# Generate a tag file name and a log file name.
1523
1524lc_pkg=`echo ${PACKAGE_NAME} | [tr [A-Z] [a-z]]`
1525AC_SUBST([coin_doxy_tagname],[${lc_pkg}_doxy.tag])
1526AC_SUBST([coin_doxy_logname],[${lc_pkg}_doxy.log])
1527AM_CONDITIONAL(COIN_HAS_DOXYGEN, [test $coin_have_doxygen = yes])
1528AM_CONDITIONAL(COIN_HAS_LATEX, [test $coin_have_latex = yes])
1529
1530# Process the list of project names and massage each one into the name of
1531# a tag file. The value of coin_doxy_tagfiles is substituted for TAGFILES
1532# in doxygen.conf.in. Further substitution for @baredocdir_nosub@ will happen
1533# as an edit during make install. See comments in Makemain.inc.
1534
1535coin_doxy_tagfiles=
1536tmp="$1"
1537for proj in $tmp ; do
1538  lc_proj=`echo $proj | [tr [A-Z] [a-z]]`
1539  doxytag=${lc_proj}_doxy.tag
1540  doxydir="@baredocdir_nosub@/coin-or-${lc_proj}/doxydoc"
1541  coin_doxy_tagfiles="$coin_doxy_tagfiles $doxydir/$doxytag=$doxydir/html"
1542done
1543AC_SUBST([coin_doxy_tagfiles])
1544
1545]) # AC_COIN_DOXYGEN
1546
1547
1548###########################################################################
1549#                          COIN_EXAMPLE_FILES                             #
1550###########################################################################
1551
1552# This macro deals with `example' files. Its original use is for data files
1553# associated with the Data projects. It allows for uniform handling of files
1554# that are not processed but should be present in the build directory. Most of
1555# the work is done by make. This macro just sets up the necessary variables.
1556# The justification for this approach is to allow the use of file name wild
1557# cards in the argument. The underlying machinery of autoconf and automake
1558# kind of breaks down when the file names are not literal text.
1559
1560# One tradeoff for allowing the use of wildcards is that it's not possible to
1561# give the created link a name that's different from the source file.
1562
1563# The variables (file names accumulate over calls):
1564# EXAMPLE_DIST_FILES: The originals that should be distributed
1565# EXAMPLE_UNCOMP_FILES: like EXAMPLE_DIST_FILES, but names of compressed files
1566# are stripped of their .gz suffix.
1567# EXAMPLE_CLEAN_FILES: contains only the names of files that were stripped of
1568# .gz. Essential for distclean in a non-VPATH build.
1569# One of EXAMPLE_DIST_FILES or EXAMPLE_UNCOMP_FILES will be the list of file
1570# names for install / uninstall. See Makefile.am in a Data project for usage.
1571
1572AC_DEFUN([AC_COIN_EXAMPLE_FILES],
1573[
1574AC_REQUIRE([AC_COIN_CHECK_VPATH])[]dnl
1575AC_REQUIRE([AC_PROG_LN_S])[]dnl
1576AM_CONDITIONAL([COIN_VPATH_BUILD],[test x$coin_vpath_config = xyes])
1577
1578# Get the names of the files and sort them to the various variables. As
1579# a convenient side-effect, the loop will remove newlines from the list
1580# of files. Avoid adding duplicate file names. (Allowing wild cards makes
1581# duplicates far too likely.) The redirect of stderr on the ls is arguable. It
1582# avoids error messages in the configure output if the package maintainer
1583# specifies files that don't exist (for example, generic wild card specs
1584# that anticipate future growth) but it will hide honest errors.
1585
1586files=`cd $srcdir; ls $1 2>/dev/null`
1587for file in $files; do
1588  if expr " $EXAMPLE_DIST_FILES " : '.* '"$file"' .*' >/dev/null 2>&1 ; then
1589    continue ;
1590  fi
1591  EXAMPLE_DIST_FILES="$EXAMPLE_DIST_FILES $file"
1592  if expr "$file" : '.*\.gz$' >/dev/null 2>&1 ; then
1593    EXAMPLE_UNCOMP_FILES="$EXAMPLE_UNCOMP_FILES `expr "$file" : '\(.*\)\.gz$'`"
1594    EXAMPLE_CLEAN_FILES="$EXAMPLE_CLEAN_FILES `expr "$file" : '\(.*\)\.gz$'`"
1595  else
1596    EXAMPLE_UNCOMP_FILES="$EXAMPLE_UNCOMP_FILES $file"
1597  fi
1598done
1599
1600AC_SUBST(EXAMPLE_DIST_FILES)
1601AC_SUBST(EXAMPLE_UNCOMP_FILES)
1602AC_SUBST(EXAMPLE_CLEAN_FILES)
1603
1604]) # AC_COIN_EXAMPLE_FILES
1605
1606###########################################################################
1607#                           COIN_FINALIZE_FLAGS                           #
1608###########################################################################
1609
1610# COIN_FINALIZE_FLAGS([prim1 prim2 ...])
1611
1612# For each PRIM, produce final versions of variables specifying linker and
1613# compiler flags.  PRIM_LFLAGS_NOPC and PRIM_CFLAGS_NOPC are appropriate for
1614# use in .pc files together with PRIM_PCFILES. PRIM_LFLAGS and PRIM_CFLAGS
1615# are augmented to contain flags obtained by invoking PKG_CONFIG on packages
1616# listed in PRIM_PCFILES and are appropriate for use in Makefile.am files.
1617
1618# TODO this could be moved into COIN_FINALIZE, if we were able to remember
1619#   for which variables we need to run pkg-config
1620
1621AC_DEFUN([AC_COIN_FINALIZE_FLAGS],
1622[
1623  m4_foreach_w([myvar],[$1],
1624    [ if test 1 = 1 ; then
1625        AC_MSG_NOTICE([FINALIZE_FLAGS for myvar:])
1626      fi
1627      AC_SUBST(m4_toupper(myvar)_LFLAGS_NOPC,[$m4_toupper(myvar)_LFLAGS])
1628      AC_SUBST(m4_toupper(myvar)_CFLAGS_NOPC,[$m4_toupper(myvar)_CFLAGS])
1629      if test -n "${m4_toupper(myvar)_PCFILES}" ; then
1630        temp_CFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --cflags ${m4_toupper(myvar)_PCFILES}`
1631        temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs ${m4_toupper(myvar)_PCFILES}`
1632        m4_toupper(myvar)_CFLAGS="$temp_CFLAGS ${m4_toupper(myvar)_CFLAGS}"
1633        m4_toupper(myvar)_LFLAGS="$temp_LFLAGS ${m4_toupper(myvar)_LFLAGS}"
1634      fi
1635
1636# Change the test to enable / disable debugging output
1637
1638      if test 1 = 1 ; then
1639        AC_MSG_NOTICE(
1640          [m4_toupper(myvar)_LFLAGS_NOPC: "${m4_toupper(myvar)_LFLAGS_NOPC}"])
1641        AC_MSG_NOTICE(
1642          [m4_toupper(myvar)_CFLAGS_NOPC: "${m4_toupper(myvar)_CFLAGS_NOPC}"])
1643        AC_MSG_NOTICE([adding "${m4_toupper(myvar)_PCFILES}"])
1644        AC_MSG_NOTICE([m4_toupper(myvar)_LFLAGS: "${m4_toupper(myvar)_LFLAGS}"])
1645        AC_MSG_NOTICE([m4_toupper(myvar)_CFLAGS: "${m4_toupper(myvar)_CFLAGS}"])
1646      fi ; ])
1647])
1648
1649###########################################################################
1650#                              COIN_FINALIZE                              #
1651###########################################################################
1652
1653# This macro should be called at the very end of the configure.ac file.
1654# It creates the output files (by using AC_OUTPUT), and might do some other
1655# things (such as generating links to data files in a VPATH configuration).
1656# It also prints the "success" message.
1657# Note: If the variable coin_skip_ac_output is set to yes, then no output
1658# files are written.
1659
1660AC_DEFUN([AC_COIN_FINALIZE],
1661[
1662  AC_OUTPUT
1663
1664  AC_MSG_NOTICE([In case of trouble, first consult the troubleshooting page at https://projects.coin-or.org/BuildTools/wiki/user-troubleshooting])
1665  AC_MSG_NOTICE([Configuration of $PACKAGE_NAME successful])
1666
1667]) #AC_COIN_FINALIZE
1668
Note: See TracBrowser for help on using the repository browser.