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