annotate src/libsamplerate-0.1.8/M4/ltoptions.m4 @ 83:ae30d91d2ffe

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