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