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