toolkit/crashreporter/google-breakpad/m4/ltoptions.m4

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial