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