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