18bf5c682Smrg# Helper functions for option handling.                    -*- Autoconf -*-
28bf5c682Smrg#
30a1d3ae0Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
40a1d3ae0Smrg#   Software Foundation, Inc.
58bf5c682Smrg#   Written by Gary V. Vaughan, 2004
68bf5c682Smrg#
78bf5c682Smrg# This file is free software; the Free Software Foundation gives
88bf5c682Smrg# unlimited permission to copy and/or distribute it, with or without
98bf5c682Smrg# modifications, as long as this notice is preserved.
108bf5c682Smrg
118bf5c682Smrg# serial 8 ltoptions.m4
128bf5c682Smrg
138bf5c682Smrg# This is to help aclocal find these macros, as it can't see m4_define.
148bf5c682SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
158bf5c682Smrg
168bf5c682Smrg
178bf5c682Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
188bf5c682Smrg# ------------------------------------------
198bf5c682Smrgm4_define([_LT_MANGLE_OPTION],
208bf5c682Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
218bf5c682Smrg
228bf5c682Smrg
238bf5c682Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
248bf5c682Smrg# ---------------------------------------
258bf5c682Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
268bf5c682Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
278bf5c682Smrg# saved as a flag.
288bf5c682Smrgm4_define([_LT_SET_OPTION],
298bf5c682Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
308bf5c682Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
318bf5c682Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
328bf5c682Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
338bf5c682Smrg])
348bf5c682Smrg
358bf5c682Smrg
368bf5c682Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
378bf5c682Smrg# ------------------------------------------------------------
388bf5c682Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
398bf5c682Smrgm4_define([_LT_IF_OPTION],
408bf5c682Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
418bf5c682Smrg
428bf5c682Smrg
438bf5c682Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
448bf5c682Smrg# -------------------------------------------------------
458bf5c682Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
468bf5c682Smrg# are set.
478bf5c682Smrgm4_define([_LT_UNLESS_OPTIONS],
488bf5c682Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
498bf5c682Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
508bf5c682Smrg		      [m4_define([$0_found])])])[]dnl
518bf5c682Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
528bf5c682Smrg])[]dnl
538bf5c682Smrg])
548bf5c682Smrg
558bf5c682Smrg
568bf5c682Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
578bf5c682Smrg# ----------------------------------------
588bf5c682Smrg# OPTION-LIST is a space-separated list of Libtool options associated
598bf5c682Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
608bf5c682Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
618bf5c682Smrg# the unknown option and exit.
628bf5c682Smrgm4_defun([_LT_SET_OPTIONS],
638bf5c682Smrg[# Set options
648bf5c682Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
658bf5c682Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
668bf5c682Smrg
678bf5c682Smrgm4_if([$1],[LT_INIT],[
688bf5c682Smrg  dnl
698bf5c682Smrg  dnl Simply set some default values (i.e off) if boolean options were not
708bf5c682Smrg  dnl specified:
718bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
728bf5c682Smrg  ])
738bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
748bf5c682Smrg  ])
758bf5c682Smrg  dnl
768bf5c682Smrg  dnl If no reference was made to various pairs of opposing options, then
778bf5c682Smrg  dnl we run the default mode handler for the pair.  For example, if neither
788bf5c682Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
798bf5c682Smrg  dnl archives by default:
808bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
818bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
828bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
838bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
848bf5c682Smrg		   [_LT_ENABLE_FAST_INSTALL])
858bf5c682Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
868bf5c682Smrg		   [_LT_WITH_AIX_SONAME([aix])])
878bf5c682Smrg  ])
888bf5c682Smrg])# _LT_SET_OPTIONS
898bf5c682Smrg
908bf5c682Smrg
918bf5c682Smrg## --------------------------------- ##
928bf5c682Smrg## Macros to handle LT_INIT options. ##
938bf5c682Smrg## --------------------------------- ##
948bf5c682Smrg
958bf5c682Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
968bf5c682Smrg# -----------------------------------------
978bf5c682Smrgm4_define([_LT_MANGLE_DEFUN],
988bf5c682Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
998bf5c682Smrg
1008bf5c682Smrg
1018bf5c682Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
1028bf5c682Smrg# -----------------------------------------------
1038bf5c682Smrgm4_define([LT_OPTION_DEFINE],
1048bf5c682Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
1058bf5c682Smrg])# LT_OPTION_DEFINE
1068bf5c682Smrg
1078bf5c682Smrg
1088bf5c682Smrg# dlopen
1098bf5c682Smrg# ------
1108bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
1118bf5c682Smrg])
1128bf5c682Smrg
1138bf5c682SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
1148bf5c682Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
1158bf5c682SmrgAC_DIAGNOSE([obsolete],
1168bf5c682Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1178bf5c682Smrgput the 'dlopen' option into LT_INIT's first parameter.])
1188bf5c682Smrg])
1198bf5c682Smrg
1208bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
1218bf5c682Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1228bf5c682Smrg
1238bf5c682Smrg
1248bf5c682Smrg# win32-dll
1258bf5c682Smrg# ---------
1268bf5c682Smrg# Declare package support for building win32 dll's.
1278bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
1288bf5c682Smrg[enable_win32_dll=yes
1298bf5c682Smrg
1308bf5c682Smrgcase $host in
1318bf5c682Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
1328bf5c682Smrg  AC_CHECK_TOOL(AS, as, false)
1338bf5c682Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1348bf5c682Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1358bf5c682Smrg  ;;
1368bf5c682Smrgesac
1378bf5c682Smrg
1388bf5c682Smrgtest -z "$AS" && AS=as
1398bf5c682Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
1408bf5c682Smrg
1418bf5c682Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1428bf5c682Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
1438bf5c682Smrg
1448bf5c682Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1458bf5c682Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
1468bf5c682Smrg])# win32-dll
1478bf5c682Smrg
1488bf5c682SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
1498bf5c682Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1508bf5c682Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
1518bf5c682SmrgAC_DIAGNOSE([obsolete],
1528bf5c682Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1538bf5c682Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
1548bf5c682Smrg])
1558bf5c682Smrg
1568bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
1578bf5c682Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
1588bf5c682Smrg
1598bf5c682Smrg
1608bf5c682Smrg# _LT_ENABLE_SHARED([DEFAULT])
1618bf5c682Smrg# ----------------------------
1628bf5c682Smrg# implement the --enable-shared flag, and supports the 'shared' and
1638bf5c682Smrg# 'disable-shared' LT_INIT options.
1648bf5c682Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
1658bf5c682Smrgm4_define([_LT_ENABLE_SHARED],
1668bf5c682Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
1678bf5c682SmrgAC_ARG_ENABLE([shared],
1688bf5c682Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1698bf5c682Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
1708bf5c682Smrg    [p=${PACKAGE-default}
1718bf5c682Smrg    case $enableval in
1728bf5c682Smrg    yes) enable_shared=yes ;;
1738bf5c682Smrg    no) enable_shared=no ;;
1748bf5c682Smrg    *)
1758bf5c682Smrg      enable_shared=no
1768bf5c682Smrg      # Look at the argument we got.  We use all the common list separators.
1778bf5c682Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
1788bf5c682Smrg      for pkg in $enableval; do
1798bf5c682Smrg	IFS=$lt_save_ifs
1808bf5c682Smrg	if test "X$pkg" = "X$p"; then
1818bf5c682Smrg	  enable_shared=yes
1828bf5c682Smrg	fi
1838bf5c682Smrg      done
1848bf5c682Smrg      IFS=$lt_save_ifs
1858bf5c682Smrg      ;;
1868bf5c682Smrg    esac],
1878bf5c682Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1888bf5c682Smrg
1898bf5c682Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
1908bf5c682Smrg	[Whether or not to build shared libraries])
1918bf5c682Smrg])# _LT_ENABLE_SHARED
1928bf5c682Smrg
1938bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
1948bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1958bf5c682Smrg
1968bf5c682Smrg# Old names:
1978bf5c682SmrgAC_DEFUN([AC_ENABLE_SHARED],
1988bf5c682Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
1998bf5c682Smrg])
2008bf5c682Smrg
2018bf5c682SmrgAC_DEFUN([AC_DISABLE_SHARED],
2028bf5c682Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
2038bf5c682Smrg])
2048bf5c682Smrg
2058bf5c682SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
2068bf5c682SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
2078bf5c682Smrg
2088bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
2098bf5c682Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
2108bf5c682Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
2118bf5c682Smrg
2128bf5c682Smrg
2138bf5c682Smrg
2148bf5c682Smrg# _LT_ENABLE_STATIC([DEFAULT])
2158bf5c682Smrg# ----------------------------
2168bf5c682Smrg# implement the --enable-static flag, and support the 'static' and
2178bf5c682Smrg# 'disable-static' LT_INIT options.
2188bf5c682Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2198bf5c682Smrgm4_define([_LT_ENABLE_STATIC],
2208bf5c682Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
2218bf5c682SmrgAC_ARG_ENABLE([static],
2228bf5c682Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2238bf5c682Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
2248bf5c682Smrg    [p=${PACKAGE-default}
2258bf5c682Smrg    case $enableval in
2268bf5c682Smrg    yes) enable_static=yes ;;
2278bf5c682Smrg    no) enable_static=no ;;
2288bf5c682Smrg    *)
2298bf5c682Smrg     enable_static=no
2308bf5c682Smrg      # Look at the argument we got.  We use all the common list separators.
2318bf5c682Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2328bf5c682Smrg      for pkg in $enableval; do
2338bf5c682Smrg	IFS=$lt_save_ifs
2348bf5c682Smrg	if test "X$pkg" = "X$p"; then
2358bf5c682Smrg	  enable_static=yes
2368bf5c682Smrg	fi
2378bf5c682Smrg      done
2388bf5c682Smrg      IFS=$lt_save_ifs
2398bf5c682Smrg      ;;
2408bf5c682Smrg    esac],
2418bf5c682Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
2428bf5c682Smrg
2438bf5c682Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
2448bf5c682Smrg	[Whether or not to build static libraries])
2458bf5c682Smrg])# _LT_ENABLE_STATIC
2468bf5c682Smrg
2478bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
2488bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
2498bf5c682Smrg
2508bf5c682Smrg# Old names:
2518bf5c682SmrgAC_DEFUN([AC_ENABLE_STATIC],
2528bf5c682Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
2538bf5c682Smrg])
2548bf5c682Smrg
2558bf5c682SmrgAC_DEFUN([AC_DISABLE_STATIC],
2568bf5c682Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
2578bf5c682Smrg])
2588bf5c682Smrg
2598bf5c682SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
2608bf5c682SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
2618bf5c682Smrg
2628bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
2638bf5c682Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
2648bf5c682Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
2658bf5c682Smrg
2668bf5c682Smrg
2678bf5c682Smrg
2688bf5c682Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
2698bf5c682Smrg# ----------------------------------
2708bf5c682Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
2718bf5c682Smrg# and 'disable-fast-install' LT_INIT options.
2728bf5c682Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2738bf5c682Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
2748bf5c682Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
2758bf5c682SmrgAC_ARG_ENABLE([fast-install],
2768bf5c682Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2778bf5c682Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2788bf5c682Smrg    [p=${PACKAGE-default}
2798bf5c682Smrg    case $enableval in
2808bf5c682Smrg    yes) enable_fast_install=yes ;;
2818bf5c682Smrg    no) enable_fast_install=no ;;
2828bf5c682Smrg    *)
2838bf5c682Smrg      enable_fast_install=no
2848bf5c682Smrg      # Look at the argument we got.  We use all the common list separators.
2858bf5c682Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2868bf5c682Smrg      for pkg in $enableval; do
2878bf5c682Smrg	IFS=$lt_save_ifs
2888bf5c682Smrg	if test "X$pkg" = "X$p"; then
2898bf5c682Smrg	  enable_fast_install=yes
2908bf5c682Smrg	fi
2918bf5c682Smrg      done
2928bf5c682Smrg      IFS=$lt_save_ifs
2938bf5c682Smrg      ;;
2948bf5c682Smrg    esac],
2958bf5c682Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
2968bf5c682Smrg
2978bf5c682Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
2988bf5c682Smrg	 [Whether or not to optimize for fast installation])dnl
2998bf5c682Smrg])# _LT_ENABLE_FAST_INSTALL
3008bf5c682Smrg
3018bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
3028bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
3038bf5c682Smrg
3048bf5c682Smrg# Old names:
3058bf5c682SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
3068bf5c682Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
3078bf5c682SmrgAC_DIAGNOSE([obsolete],
3088bf5c682Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3098bf5c682Smrgthe 'fast-install' option into LT_INIT's first parameter.])
3108bf5c682Smrg])
3118bf5c682Smrg
3128bf5c682SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
3138bf5c682Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
3148bf5c682SmrgAC_DIAGNOSE([obsolete],
3158bf5c682Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3168bf5c682Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
3178bf5c682Smrg])
3188bf5c682Smrg
3198bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
3208bf5c682Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
3218bf5c682Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
3228bf5c682Smrg
3238bf5c682Smrg
3248bf5c682Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
3258bf5c682Smrg# ----------------------------------
3268bf5c682Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
3278bf5c682Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
3288bf5c682Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
3298bf5c682Smrgm4_define([_LT_WITH_AIX_SONAME],
3308bf5c682Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
3318bf5c682Smrgshared_archive_member_spec=
3328bf5c682Smrgcase $host,$enable_shared in
3338bf5c682Smrgpower*-*-aix[[5-9]]*,yes)
3348bf5c682Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
3358bf5c682Smrg  AC_ARG_WITH([aix-soname],
3368bf5c682Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
3378bf5c682Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
3388bf5c682Smrg    [case $withval in
3398bf5c682Smrg    aix|svr4|both)
3408bf5c682Smrg      ;;
3418bf5c682Smrg    *)
3428bf5c682Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
3438bf5c682Smrg      ;;
3448bf5c682Smrg    esac
3458bf5c682Smrg    lt_cv_with_aix_soname=$with_aix_soname],
3468bf5c682Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
3478bf5c682Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
3488bf5c682Smrg    with_aix_soname=$lt_cv_with_aix_soname])
3498bf5c682Smrg  AC_MSG_RESULT([$with_aix_soname])
3508bf5c682Smrg  if test aix != "$with_aix_soname"; then
3518bf5c682Smrg    # For the AIX way of multilib, we name the shared archive member
3528bf5c682Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
3538bf5c682Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
3548bf5c682Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
3558bf5c682Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
3568bf5c682Smrg    if test 64 = "${OBJECT_MODE-32}"; then
3578bf5c682Smrg      shared_archive_member_spec=shr_64
3588bf5c682Smrg    else
3598bf5c682Smrg      shared_archive_member_spec=shr
3608bf5c682Smrg    fi
3618bf5c682Smrg  fi
3628bf5c682Smrg  ;;
3638bf5c682Smrg*)
3648bf5c682Smrg  with_aix_soname=aix
3658bf5c682Smrg  ;;
3668bf5c682Smrgesac
3678bf5c682Smrg
3688bf5c682Smrg_LT_DECL([], [shared_archive_member_spec], [0],
3698bf5c682Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
3708bf5c682Smrg])# _LT_WITH_AIX_SONAME
3718bf5c682Smrg
3728bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
3738bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
3748bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
3758bf5c682Smrg
3768bf5c682Smrg
3778bf5c682Smrg# _LT_WITH_PIC([MODE])
3788bf5c682Smrg# --------------------
3798bf5c682Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
3808bf5c682Smrg# LT_INIT options.
3818bf5c682Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
3828bf5c682Smrgm4_define([_LT_WITH_PIC],
3838bf5c682Smrg[AC_ARG_WITH([pic],
3848bf5c682Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
3858bf5c682Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
3868bf5c682Smrg    [lt_p=${PACKAGE-default}
3878bf5c682Smrg    case $withval in
3888bf5c682Smrg    yes|no) pic_mode=$withval ;;
3898bf5c682Smrg    *)
3908bf5c682Smrg      pic_mode=default
3918bf5c682Smrg      # Look at the argument we got.  We use all the common list separators.
3928bf5c682Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
3938bf5c682Smrg      for lt_pkg in $withval; do
3948bf5c682Smrg	IFS=$lt_save_ifs
3958bf5c682Smrg	if test "X$lt_pkg" = "X$lt_p"; then
3968bf5c682Smrg	  pic_mode=yes
3978bf5c682Smrg	fi
3988bf5c682Smrg      done
3998bf5c682Smrg      IFS=$lt_save_ifs
4008bf5c682Smrg      ;;
4018bf5c682Smrg    esac],
4028bf5c682Smrg    [pic_mode=m4_default([$1], [default])])
4038bf5c682Smrg
4048bf5c682Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
4058bf5c682Smrg])# _LT_WITH_PIC
4068bf5c682Smrg
4078bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
4088bf5c682SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
4098bf5c682Smrg
4108bf5c682Smrg# Old name:
4118bf5c682SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
4128bf5c682Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
4138bf5c682SmrgAC_DIAGNOSE([obsolete],
4148bf5c682Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
4158bf5c682Smrgput the 'pic-only' option into LT_INIT's first parameter.])
4168bf5c682Smrg])
4178bf5c682Smrg
4188bf5c682Smrgdnl aclocal-1.4 backwards compatibility:
4198bf5c682Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
4208bf5c682Smrg
4218bf5c682Smrg## ----------------- ##
4228bf5c682Smrg## LTDL_INIT Options ##
4238bf5c682Smrg## ----------------- ##
4248bf5c682Smrg
4258bf5c682Smrgm4_define([_LTDL_MODE], [])
4268bf5c682SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
4278bf5c682Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
4288bf5c682SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
4298bf5c682Smrg		 [m4_define([_LTDL_MODE], [recursive])])
4308bf5c682SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
4318bf5c682Smrg		 [m4_define([_LTDL_MODE], [subproject])])
4328bf5c682Smrg
4338bf5c682Smrgm4_define([_LTDL_TYPE], [])
4348bf5c682SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
4358bf5c682Smrg		 [m4_define([_LTDL_TYPE], [installable])])
4368bf5c682SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
4378bf5c682Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
438