lemon-project-template-glpk

annotate deps/glpk/m4/ltoptions.m4 @ 10:5545663ca997

Configure GLPK build
author Alpar Juttner <alpar@cs.elte.hu>
date Sun, 06 Nov 2011 21:42:23 +0100 (2011-11-06)
parents
children
rev   line source
alpar@9 1 # Helper functions for option handling. -*- Autoconf -*-
alpar@9 2 #
alpar@9 3 # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
alpar@9 4 # Inc.
alpar@9 5 # Written by Gary V. Vaughan, 2004
alpar@9 6 #
alpar@9 7 # This file is free software; the Free Software Foundation gives
alpar@9 8 # unlimited permission to copy and/or distribute it, with or without
alpar@9 9 # modifications, as long as this notice is preserved.
alpar@9 10
alpar@9 11 # serial 6 ltoptions.m4
alpar@9 12
alpar@9 13 # This is to help aclocal find these macros, as it can't see m4_define.
alpar@9 14 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
alpar@9 15
alpar@9 16
alpar@9 17 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
alpar@9 18 # ------------------------------------------
alpar@9 19 m4_define([_LT_MANGLE_OPTION],
alpar@9 20 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
alpar@9 21
alpar@9 22
alpar@9 23 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
alpar@9 24 # ---------------------------------------
alpar@9 25 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
alpar@9 26 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
alpar@9 27 # saved as a flag.
alpar@9 28 m4_define([_LT_SET_OPTION],
alpar@9 29 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
alpar@9 30 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
alpar@9 31 _LT_MANGLE_DEFUN([$1], [$2]),
alpar@9 32 [m4_warning([Unknown $1 option `$2'])])[]dnl
alpar@9 33 ])
alpar@9 34
alpar@9 35
alpar@9 36 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
alpar@9 37 # ------------------------------------------------------------
alpar@9 38 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
alpar@9 39 m4_define([_LT_IF_OPTION],
alpar@9 40 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
alpar@9 41
alpar@9 42
alpar@9 43 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
alpar@9 44 # -------------------------------------------------------
alpar@9 45 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
alpar@9 46 # are set.
alpar@9 47 m4_define([_LT_UNLESS_OPTIONS],
alpar@9 48 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
alpar@9 49 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
alpar@9 50 [m4_define([$0_found])])])[]dnl
alpar@9 51 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
alpar@9 52 ])[]dnl
alpar@9 53 ])
alpar@9 54
alpar@9 55
alpar@9 56 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
alpar@9 57 # ----------------------------------------
alpar@9 58 # OPTION-LIST is a space-separated list of Libtool options associated
alpar@9 59 # with MACRO-NAME. If any OPTION has a matching handler declared with
alpar@9 60 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
alpar@9 61 # the unknown option and exit.
alpar@9 62 m4_defun([_LT_SET_OPTIONS],
alpar@9 63 [# Set options
alpar@9 64 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
alpar@9 65 [_LT_SET_OPTION([$1], _LT_Option)])
alpar@9 66
alpar@9 67 m4_if([$1],[LT_INIT],[
alpar@9 68 dnl
alpar@9 69 dnl Simply set some default values (i.e off) if boolean options were not
alpar@9 70 dnl specified:
alpar@9 71 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
alpar@9 72 ])
alpar@9 73 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
alpar@9 74 ])
alpar@9 75 dnl
alpar@9 76 dnl If no reference was made to various pairs of opposing options, then
alpar@9 77 dnl we run the default mode handler for the pair. For example, if neither
alpar@9 78 dnl `shared' nor `disable-shared' was passed, we enable building of shared
alpar@9 79 dnl archives by default:
alpar@9 80 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
alpar@9 81 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
alpar@9 82 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
alpar@9 83 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
alpar@9 84 [_LT_ENABLE_FAST_INSTALL])
alpar@9 85 ])
alpar@9 86 ])# _LT_SET_OPTIONS
alpar@9 87
alpar@9 88
alpar@9 89 ## --------------------------------- ##
alpar@9 90 ## Macros to handle LT_INIT options. ##
alpar@9 91 ## --------------------------------- ##
alpar@9 92
alpar@9 93 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
alpar@9 94 # -----------------------------------------
alpar@9 95 m4_define([_LT_MANGLE_DEFUN],
alpar@9 96 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
alpar@9 97
alpar@9 98
alpar@9 99 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
alpar@9 100 # -----------------------------------------------
alpar@9 101 m4_define([LT_OPTION_DEFINE],
alpar@9 102 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
alpar@9 103 ])# LT_OPTION_DEFINE
alpar@9 104
alpar@9 105
alpar@9 106 # dlopen
alpar@9 107 # ------
alpar@9 108 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
alpar@9 109 ])
alpar@9 110
alpar@9 111 AU_DEFUN([AC_LIBTOOL_DLOPEN],
alpar@9 112 [_LT_SET_OPTION([LT_INIT], [dlopen])
alpar@9 113 AC_DIAGNOSE([obsolete],
alpar@9 114 [$0: Remove this warning and the call to _LT_SET_OPTION when you
alpar@9 115 put the `dlopen' option into LT_INIT's first parameter.])
alpar@9 116 ])
alpar@9 117
alpar@9 118 dnl aclocal-1.4 backwards compatibility:
alpar@9 119 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
alpar@9 120
alpar@9 121
alpar@9 122 # win32-dll
alpar@9 123 # ---------
alpar@9 124 # Declare package support for building win32 dll's.
alpar@9 125 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
alpar@9 126 [enable_win32_dll=yes
alpar@9 127
alpar@9 128 case $host in
alpar@9 129 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
alpar@9 130 AC_CHECK_TOOL(AS, as, false)
alpar@9 131 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
alpar@9 132 AC_CHECK_TOOL(OBJDUMP, objdump, false)
alpar@9 133 ;;
alpar@9 134 esac
alpar@9 135
alpar@9 136 test -z "$AS" && AS=as
alpar@9 137 _LT_DECL([], [AS], [1], [Assembler program])dnl
alpar@9 138
alpar@9 139 test -z "$DLLTOOL" && DLLTOOL=dlltool
alpar@9 140 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
alpar@9 141
alpar@9 142 test -z "$OBJDUMP" && OBJDUMP=objdump
alpar@9 143 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
alpar@9 144 ])# win32-dll
alpar@9 145
alpar@9 146 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
alpar@9 147 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
alpar@9 148 _LT_SET_OPTION([LT_INIT], [win32-dll])
alpar@9 149 AC_DIAGNOSE([obsolete],
alpar@9 150 [$0: Remove this warning and the call to _LT_SET_OPTION when you
alpar@9 151 put the `win32-dll' option into LT_INIT's first parameter.])
alpar@9 152 ])
alpar@9 153
alpar@9 154 dnl aclocal-1.4 backwards compatibility:
alpar@9 155 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
alpar@9 156
alpar@9 157
alpar@9 158 # _LT_ENABLE_SHARED([DEFAULT])
alpar@9 159 # ----------------------------
alpar@9 160 # implement the --enable-shared flag, and supports the `shared' and
alpar@9 161 # `disable-shared' LT_INIT options.
alpar@9 162 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
alpar@9 163 m4_define([_LT_ENABLE_SHARED],
alpar@9 164 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
alpar@9 165 AC_ARG_ENABLE([shared],
alpar@9 166 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
alpar@9 167 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
alpar@9 168 [p=${PACKAGE-default}
alpar@9 169 case $enableval in
alpar@9 170 yes) enable_shared=yes ;;
alpar@9 171 no) enable_shared=no ;;
alpar@9 172 *)
alpar@9 173 enable_shared=no
alpar@9 174 # Look at the argument we got. We use all the common list separators.
alpar@9 175 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
alpar@9 176 for pkg in $enableval; do
alpar@9 177 IFS="$lt_save_ifs"
alpar@9 178 if test "X$pkg" = "X$p"; then
alpar@9 179 enable_shared=yes
alpar@9 180 fi
alpar@9 181 done
alpar@9 182 IFS="$lt_save_ifs"
alpar@9 183 ;;
alpar@9 184 esac],
alpar@9 185 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
alpar@9 186
alpar@9 187 _LT_DECL([build_libtool_libs], [enable_shared], [0],
alpar@9 188 [Whether or not to build shared libraries])
alpar@9 189 ])# _LT_ENABLE_SHARED
alpar@9 190
alpar@9 191 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
alpar@9 192 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
alpar@9 193
alpar@9 194 # Old names:
alpar@9 195 AC_DEFUN([AC_ENABLE_SHARED],
alpar@9 196 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
alpar@9 197 ])
alpar@9 198
alpar@9 199 AC_DEFUN([AC_DISABLE_SHARED],
alpar@9 200 [_LT_SET_OPTION([LT_INIT], [disable-shared])
alpar@9 201 ])
alpar@9 202
alpar@9 203 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
alpar@9 204 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
alpar@9 205
alpar@9 206 dnl aclocal-1.4 backwards compatibility:
alpar@9 207 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
alpar@9 208 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
alpar@9 209
alpar@9 210
alpar@9 211
alpar@9 212 # _LT_ENABLE_STATIC([DEFAULT])
alpar@9 213 # ----------------------------
alpar@9 214 # implement the --enable-static flag, and support the `static' and
alpar@9 215 # `disable-static' LT_INIT options.
alpar@9 216 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
alpar@9 217 m4_define([_LT_ENABLE_STATIC],
alpar@9 218 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
alpar@9 219 AC_ARG_ENABLE([static],
alpar@9 220 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
alpar@9 221 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
alpar@9 222 [p=${PACKAGE-default}
alpar@9 223 case $enableval in
alpar@9 224 yes) enable_static=yes ;;
alpar@9 225 no) enable_static=no ;;
alpar@9 226 *)
alpar@9 227 enable_static=no
alpar@9 228 # Look at the argument we got. We use all the common list separators.
alpar@9 229 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
alpar@9 230 for pkg in $enableval; do
alpar@9 231 IFS="$lt_save_ifs"
alpar@9 232 if test "X$pkg" = "X$p"; then
alpar@9 233 enable_static=yes
alpar@9 234 fi
alpar@9 235 done
alpar@9 236 IFS="$lt_save_ifs"
alpar@9 237 ;;
alpar@9 238 esac],
alpar@9 239 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
alpar@9 240
alpar@9 241 _LT_DECL([build_old_libs], [enable_static], [0],
alpar@9 242 [Whether or not to build static libraries])
alpar@9 243 ])# _LT_ENABLE_STATIC
alpar@9 244
alpar@9 245 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
alpar@9 246 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
alpar@9 247
alpar@9 248 # Old names:
alpar@9 249 AC_DEFUN([AC_ENABLE_STATIC],
alpar@9 250 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
alpar@9 251 ])
alpar@9 252
alpar@9 253 AC_DEFUN([AC_DISABLE_STATIC],
alpar@9 254 [_LT_SET_OPTION([LT_INIT], [disable-static])
alpar@9 255 ])
alpar@9 256
alpar@9 257 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
alpar@9 258 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
alpar@9 259
alpar@9 260 dnl aclocal-1.4 backwards compatibility:
alpar@9 261 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
alpar@9 262 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
alpar@9 263
alpar@9 264
alpar@9 265
alpar@9 266 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
alpar@9 267 # ----------------------------------
alpar@9 268 # implement the --enable-fast-install flag, and support the `fast-install'
alpar@9 269 # and `disable-fast-install' LT_INIT options.
alpar@9 270 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
alpar@9 271 m4_define([_LT_ENABLE_FAST_INSTALL],
alpar@9 272 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
alpar@9 273 AC_ARG_ENABLE([fast-install],
alpar@9 274 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
alpar@9 275 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
alpar@9 276 [p=${PACKAGE-default}
alpar@9 277 case $enableval in
alpar@9 278 yes) enable_fast_install=yes ;;
alpar@9 279 no) enable_fast_install=no ;;
alpar@9 280 *)
alpar@9 281 enable_fast_install=no
alpar@9 282 # Look at the argument we got. We use all the common list separators.
alpar@9 283 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
alpar@9 284 for pkg in $enableval; do
alpar@9 285 IFS="$lt_save_ifs"
alpar@9 286 if test "X$pkg" = "X$p"; then
alpar@9 287 enable_fast_install=yes
alpar@9 288 fi
alpar@9 289 done
alpar@9 290 IFS="$lt_save_ifs"
alpar@9 291 ;;
alpar@9 292 esac],
alpar@9 293 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
alpar@9 294
alpar@9 295 _LT_DECL([fast_install], [enable_fast_install], [0],
alpar@9 296 [Whether or not to optimize for fast installation])dnl
alpar@9 297 ])# _LT_ENABLE_FAST_INSTALL
alpar@9 298
alpar@9 299 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
alpar@9 300 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
alpar@9 301
alpar@9 302 # Old names:
alpar@9 303 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
alpar@9 304 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
alpar@9 305 AC_DIAGNOSE([obsolete],
alpar@9 306 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
alpar@9 307 the `fast-install' option into LT_INIT's first parameter.])
alpar@9 308 ])
alpar@9 309
alpar@9 310 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
alpar@9 311 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
alpar@9 312 AC_DIAGNOSE([obsolete],
alpar@9 313 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
alpar@9 314 the `disable-fast-install' option into LT_INIT's first parameter.])
alpar@9 315 ])
alpar@9 316
alpar@9 317 dnl aclocal-1.4 backwards compatibility:
alpar@9 318 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
alpar@9 319 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
alpar@9 320
alpar@9 321
alpar@9 322 # _LT_WITH_PIC([MODE])
alpar@9 323 # --------------------
alpar@9 324 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
alpar@9 325 # LT_INIT options.
alpar@9 326 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
alpar@9 327 m4_define([_LT_WITH_PIC],
alpar@9 328 [AC_ARG_WITH([pic],
alpar@9 329 [AS_HELP_STRING([--with-pic],
alpar@9 330 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
alpar@9 331 [pic_mode="$withval"],
alpar@9 332 [pic_mode=default])
alpar@9 333
alpar@9 334 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
alpar@9 335
alpar@9 336 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
alpar@9 337 ])# _LT_WITH_PIC
alpar@9 338
alpar@9 339 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
alpar@9 340 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
alpar@9 341
alpar@9 342 # Old name:
alpar@9 343 AU_DEFUN([AC_LIBTOOL_PICMODE],
alpar@9 344 [_LT_SET_OPTION([LT_INIT], [pic-only])
alpar@9 345 AC_DIAGNOSE([obsolete],
alpar@9 346 [$0: Remove this warning and the call to _LT_SET_OPTION when you
alpar@9 347 put the `pic-only' option into LT_INIT's first parameter.])
alpar@9 348 ])
alpar@9 349
alpar@9 350 dnl aclocal-1.4 backwards compatibility:
alpar@9 351 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
alpar@9 352
alpar@9 353 ## ----------------- ##
alpar@9 354 ## LTDL_INIT Options ##
alpar@9 355 ## ----------------- ##
alpar@9 356
alpar@9 357 m4_define([_LTDL_MODE], [])
alpar@9 358 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
alpar@9 359 [m4_define([_LTDL_MODE], [nonrecursive])])
alpar@9 360 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
alpar@9 361 [m4_define([_LTDL_MODE], [recursive])])
alpar@9 362 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
alpar@9 363 [m4_define([_LTDL_MODE], [subproject])])
alpar@9 364
alpar@9 365 m4_define([_LTDL_TYPE], [])
alpar@9 366 LT_OPTION_DEFINE([LTDL_INIT], [installable],
alpar@9 367 [m4_define([_LTDL_TYPE], [installable])])
alpar@9 368 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
alpar@9 369 [m4_define([_LTDL_TYPE], [convenience])])