14e8f48c7Smrg# Helper functions for option handling.                    -*- Autoconf -*-
24e8f48c7Smrg#
34e8f48c7Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
44e8f48c7Smrg#   Software Foundation, Inc.
54e8f48c7Smrg#   Written by Gary V. Vaughan, 2004
64e8f48c7Smrg#
74e8f48c7Smrg# This file is free software; the Free Software Foundation gives
84e8f48c7Smrg# unlimited permission to copy and/or distribute it, with or without
94e8f48c7Smrg# modifications, as long as this notice is preserved.
104e8f48c7Smrg
114e8f48c7Smrg# serial 8 ltoptions.m4
124e8f48c7Smrg
134e8f48c7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
144e8f48c7SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
154e8f48c7Smrg
164e8f48c7Smrg
174e8f48c7Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
184e8f48c7Smrg# ------------------------------------------
194e8f48c7Smrgm4_define([_LT_MANGLE_OPTION],
204e8f48c7Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
214e8f48c7Smrg
224e8f48c7Smrg
234e8f48c7Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
244e8f48c7Smrg# ---------------------------------------
254e8f48c7Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
264e8f48c7Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
274e8f48c7Smrg# saved as a flag.
284e8f48c7Smrgm4_define([_LT_SET_OPTION],
294e8f48c7Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
304e8f48c7Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
314e8f48c7Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
324e8f48c7Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
334e8f48c7Smrg])
344e8f48c7Smrg
354e8f48c7Smrg
364e8f48c7Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
374e8f48c7Smrg# ------------------------------------------------------------
384e8f48c7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
394e8f48c7Smrgm4_define([_LT_IF_OPTION],
404e8f48c7Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
414e8f48c7Smrg
424e8f48c7Smrg
434e8f48c7Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
444e8f48c7Smrg# -------------------------------------------------------
454e8f48c7Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
464e8f48c7Smrg# are set.
474e8f48c7Smrgm4_define([_LT_UNLESS_OPTIONS],
484e8f48c7Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
494e8f48c7Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
504e8f48c7Smrg		      [m4_define([$0_found])])])[]dnl
514e8f48c7Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
524e8f48c7Smrg])[]dnl
534e8f48c7Smrg])
544e8f48c7Smrg
554e8f48c7Smrg
564e8f48c7Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
574e8f48c7Smrg# ----------------------------------------
584e8f48c7Smrg# OPTION-LIST is a space-separated list of Libtool options associated
594e8f48c7Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
604e8f48c7Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
614e8f48c7Smrg# the unknown option and exit.
624e8f48c7Smrgm4_defun([_LT_SET_OPTIONS],
634e8f48c7Smrg[# Set options
644e8f48c7Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
654e8f48c7Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
664e8f48c7Smrg
674e8f48c7Smrgm4_if([$1],[LT_INIT],[
684e8f48c7Smrg  dnl
694e8f48c7Smrg  dnl Simply set some default values (i.e off) if boolean options were not
704e8f48c7Smrg  dnl specified:
714e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
724e8f48c7Smrg  ])
734e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
744e8f48c7Smrg  ])
754e8f48c7Smrg  dnl
764e8f48c7Smrg  dnl If no reference was made to various pairs of opposing options, then
774e8f48c7Smrg  dnl we run the default mode handler for the pair.  For example, if neither
784e8f48c7Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
794e8f48c7Smrg  dnl archives by default:
804e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
814e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
824e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
834e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
844e8f48c7Smrg		   [_LT_ENABLE_FAST_INSTALL])
854e8f48c7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
864e8f48c7Smrg		   [_LT_WITH_AIX_SONAME([aix])])
874e8f48c7Smrg  ])
884e8f48c7Smrg])# _LT_SET_OPTIONS
894e8f48c7Smrg
904e8f48c7Smrg
914e8f48c7Smrg## --------------------------------- ##
924e8f48c7Smrg## Macros to handle LT_INIT options. ##
934e8f48c7Smrg## --------------------------------- ##
944e8f48c7Smrg
954e8f48c7Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
964e8f48c7Smrg# -----------------------------------------
974e8f48c7Smrgm4_define([_LT_MANGLE_DEFUN],
984e8f48c7Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
994e8f48c7Smrg
1004e8f48c7Smrg
1014e8f48c7Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
1024e8f48c7Smrg# -----------------------------------------------
1034e8f48c7Smrgm4_define([LT_OPTION_DEFINE],
1044e8f48c7Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
1054e8f48c7Smrg])# LT_OPTION_DEFINE
1064e8f48c7Smrg
1074e8f48c7Smrg
1084e8f48c7Smrg# dlopen
1094e8f48c7Smrg# ------
1104e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
1114e8f48c7Smrg])
1124e8f48c7Smrg
1134e8f48c7SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
1144e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
1154e8f48c7SmrgAC_DIAGNOSE([obsolete],
1164e8f48c7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1174e8f48c7Smrgput the 'dlopen' option into LT_INIT's first parameter.])
1184e8f48c7Smrg])
1194e8f48c7Smrg
1204e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
1214e8f48c7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1224e8f48c7Smrg
1234e8f48c7Smrg
1244e8f48c7Smrg# win32-dll
1254e8f48c7Smrg# ---------
1264e8f48c7Smrg# Declare package support for building win32 dll's.
1274e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
1284e8f48c7Smrg[enable_win32_dll=yes
1294e8f48c7Smrg
1304e8f48c7Smrgcase $host in
1314e8f48c7Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
1324e8f48c7Smrg  AC_CHECK_TOOL(AS, as, false)
1334e8f48c7Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1344e8f48c7Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1354e8f48c7Smrg  ;;
1364e8f48c7Smrgesac
1374e8f48c7Smrg
1384e8f48c7Smrgtest -z "$AS" && AS=as
1394e8f48c7Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
1404e8f48c7Smrg
1414e8f48c7Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1424e8f48c7Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
1434e8f48c7Smrg
1444e8f48c7Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1454e8f48c7Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
1464e8f48c7Smrg])# win32-dll
1474e8f48c7Smrg
1484e8f48c7SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
1494e8f48c7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1504e8f48c7Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
1514e8f48c7SmrgAC_DIAGNOSE([obsolete],
1524e8f48c7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1534e8f48c7Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
1544e8f48c7Smrg])
1554e8f48c7Smrg
1564e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
1574e8f48c7Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
1584e8f48c7Smrg
1594e8f48c7Smrg
1604e8f48c7Smrg# _LT_ENABLE_SHARED([DEFAULT])
1614e8f48c7Smrg# ----------------------------
1624e8f48c7Smrg# implement the --enable-shared flag, and supports the 'shared' and
1634e8f48c7Smrg# 'disable-shared' LT_INIT options.
1644e8f48c7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
1654e8f48c7Smrgm4_define([_LT_ENABLE_SHARED],
1664e8f48c7Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
1674e8f48c7SmrgAC_ARG_ENABLE([shared],
1684e8f48c7Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1694e8f48c7Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
1704e8f48c7Smrg    [p=${PACKAGE-default}
1714e8f48c7Smrg    case $enableval in
1724e8f48c7Smrg    yes) enable_shared=yes ;;
1734e8f48c7Smrg    no) enable_shared=no ;;
1744e8f48c7Smrg    *)
1754e8f48c7Smrg      enable_shared=no
1764e8f48c7Smrg      # Look at the argument we got.  We use all the common list separators.
1774e8f48c7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
1784e8f48c7Smrg      for pkg in $enableval; do
1794e8f48c7Smrg	IFS=$lt_save_ifs
1804e8f48c7Smrg	if test "X$pkg" = "X$p"; then
1814e8f48c7Smrg	  enable_shared=yes
1824e8f48c7Smrg	fi
1834e8f48c7Smrg      done
1844e8f48c7Smrg      IFS=$lt_save_ifs
1854e8f48c7Smrg      ;;
1864e8f48c7Smrg    esac],
1874e8f48c7Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1884e8f48c7Smrg
1894e8f48c7Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
1904e8f48c7Smrg	[Whether or not to build shared libraries])
1914e8f48c7Smrg])# _LT_ENABLE_SHARED
1924e8f48c7Smrg
1934e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
1944e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1954e8f48c7Smrg
1964e8f48c7Smrg# Old names:
1974e8f48c7SmrgAC_DEFUN([AC_ENABLE_SHARED],
1984e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
1994e8f48c7Smrg])
2004e8f48c7Smrg
2014e8f48c7SmrgAC_DEFUN([AC_DISABLE_SHARED],
2024e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
2034e8f48c7Smrg])
2044e8f48c7Smrg
2054e8f48c7SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
2064e8f48c7SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
2074e8f48c7Smrg
2084e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
2094e8f48c7Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
2104e8f48c7Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
2114e8f48c7Smrg
2124e8f48c7Smrg
2134e8f48c7Smrg
2144e8f48c7Smrg# _LT_ENABLE_STATIC([DEFAULT])
2154e8f48c7Smrg# ----------------------------
2164e8f48c7Smrg# implement the --enable-static flag, and support the 'static' and
2174e8f48c7Smrg# 'disable-static' LT_INIT options.
2184e8f48c7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2194e8f48c7Smrgm4_define([_LT_ENABLE_STATIC],
2204e8f48c7Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
2214e8f48c7SmrgAC_ARG_ENABLE([static],
2224e8f48c7Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2234e8f48c7Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
2244e8f48c7Smrg    [p=${PACKAGE-default}
2254e8f48c7Smrg    case $enableval in
2264e8f48c7Smrg    yes) enable_static=yes ;;
2274e8f48c7Smrg    no) enable_static=no ;;
2284e8f48c7Smrg    *)
2294e8f48c7Smrg     enable_static=no
2304e8f48c7Smrg      # Look at the argument we got.  We use all the common list separators.
2314e8f48c7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2324e8f48c7Smrg      for pkg in $enableval; do
2334e8f48c7Smrg	IFS=$lt_save_ifs
2344e8f48c7Smrg	if test "X$pkg" = "X$p"; then
2354e8f48c7Smrg	  enable_static=yes
2364e8f48c7Smrg	fi
2374e8f48c7Smrg      done
2384e8f48c7Smrg      IFS=$lt_save_ifs
2394e8f48c7Smrg      ;;
2404e8f48c7Smrg    esac],
2414e8f48c7Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
2424e8f48c7Smrg
2434e8f48c7Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
2444e8f48c7Smrg	[Whether or not to build static libraries])
2454e8f48c7Smrg])# _LT_ENABLE_STATIC
2464e8f48c7Smrg
2474e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
2484e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
2494e8f48c7Smrg
2504e8f48c7Smrg# Old names:
2514e8f48c7SmrgAC_DEFUN([AC_ENABLE_STATIC],
2524e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
2534e8f48c7Smrg])
2544e8f48c7Smrg
2554e8f48c7SmrgAC_DEFUN([AC_DISABLE_STATIC],
2564e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
2574e8f48c7Smrg])
2584e8f48c7Smrg
2594e8f48c7SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
2604e8f48c7SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
2614e8f48c7Smrg
2624e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
2634e8f48c7Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
2644e8f48c7Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
2654e8f48c7Smrg
2664e8f48c7Smrg
2674e8f48c7Smrg
2684e8f48c7Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
2694e8f48c7Smrg# ----------------------------------
2704e8f48c7Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
2714e8f48c7Smrg# and 'disable-fast-install' LT_INIT options.
2724e8f48c7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2734e8f48c7Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
2744e8f48c7Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
2754e8f48c7SmrgAC_ARG_ENABLE([fast-install],
2764e8f48c7Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2774e8f48c7Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2784e8f48c7Smrg    [p=${PACKAGE-default}
2794e8f48c7Smrg    case $enableval in
2804e8f48c7Smrg    yes) enable_fast_install=yes ;;
2814e8f48c7Smrg    no) enable_fast_install=no ;;
2824e8f48c7Smrg    *)
2834e8f48c7Smrg      enable_fast_install=no
2844e8f48c7Smrg      # Look at the argument we got.  We use all the common list separators.
2854e8f48c7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2864e8f48c7Smrg      for pkg in $enableval; do
2874e8f48c7Smrg	IFS=$lt_save_ifs
2884e8f48c7Smrg	if test "X$pkg" = "X$p"; then
2894e8f48c7Smrg	  enable_fast_install=yes
2904e8f48c7Smrg	fi
2914e8f48c7Smrg      done
2924e8f48c7Smrg      IFS=$lt_save_ifs
2934e8f48c7Smrg      ;;
2944e8f48c7Smrg    esac],
2954e8f48c7Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
2964e8f48c7Smrg
2974e8f48c7Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
2984e8f48c7Smrg	 [Whether or not to optimize for fast installation])dnl
2994e8f48c7Smrg])# _LT_ENABLE_FAST_INSTALL
3004e8f48c7Smrg
3014e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
3024e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
3034e8f48c7Smrg
3044e8f48c7Smrg# Old names:
3054e8f48c7SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
3064e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
3074e8f48c7SmrgAC_DIAGNOSE([obsolete],
3084e8f48c7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3094e8f48c7Smrgthe 'fast-install' option into LT_INIT's first parameter.])
3104e8f48c7Smrg])
3114e8f48c7Smrg
3124e8f48c7SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
3134e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
3144e8f48c7SmrgAC_DIAGNOSE([obsolete],
3154e8f48c7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3164e8f48c7Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
3174e8f48c7Smrg])
3184e8f48c7Smrg
3194e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
3204e8f48c7Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
3214e8f48c7Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
3224e8f48c7Smrg
3234e8f48c7Smrg
3244e8f48c7Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
3254e8f48c7Smrg# ----------------------------------
3264e8f48c7Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
3274e8f48c7Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
3284e8f48c7Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
3294e8f48c7Smrgm4_define([_LT_WITH_AIX_SONAME],
3304e8f48c7Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
3314e8f48c7Smrgshared_archive_member_spec=
3324e8f48c7Smrgcase $host,$enable_shared in
3334e8f48c7Smrgpower*-*-aix[[5-9]]*,yes)
3344e8f48c7Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
3354e8f48c7Smrg  AC_ARG_WITH([aix-soname],
3364e8f48c7Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
3374e8f48c7Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
3384e8f48c7Smrg    [case $withval in
3394e8f48c7Smrg    aix|svr4|both)
3404e8f48c7Smrg      ;;
3414e8f48c7Smrg    *)
3424e8f48c7Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
3434e8f48c7Smrg      ;;
3444e8f48c7Smrg    esac
3454e8f48c7Smrg    lt_cv_with_aix_soname=$with_aix_soname],
3464e8f48c7Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
3474e8f48c7Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
3484e8f48c7Smrg    with_aix_soname=$lt_cv_with_aix_soname])
3494e8f48c7Smrg  AC_MSG_RESULT([$with_aix_soname])
3504e8f48c7Smrg  if test aix != "$with_aix_soname"; then
3514e8f48c7Smrg    # For the AIX way of multilib, we name the shared archive member
3524e8f48c7Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
3534e8f48c7Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
3544e8f48c7Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
3554e8f48c7Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
3564e8f48c7Smrg    if test 64 = "${OBJECT_MODE-32}"; then
3574e8f48c7Smrg      shared_archive_member_spec=shr_64
3584e8f48c7Smrg    else
3594e8f48c7Smrg      shared_archive_member_spec=shr
3604e8f48c7Smrg    fi
3614e8f48c7Smrg  fi
3624e8f48c7Smrg  ;;
3634e8f48c7Smrg*)
3644e8f48c7Smrg  with_aix_soname=aix
3654e8f48c7Smrg  ;;
3664e8f48c7Smrgesac
3674e8f48c7Smrg
3684e8f48c7Smrg_LT_DECL([], [shared_archive_member_spec], [0],
3694e8f48c7Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
3704e8f48c7Smrg])# _LT_WITH_AIX_SONAME
3714e8f48c7Smrg
3724e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
3734e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
3744e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
3754e8f48c7Smrg
3764e8f48c7Smrg
3774e8f48c7Smrg# _LT_WITH_PIC([MODE])
3784e8f48c7Smrg# --------------------
3794e8f48c7Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
3804e8f48c7Smrg# LT_INIT options.
3814e8f48c7Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
3824e8f48c7Smrgm4_define([_LT_WITH_PIC],
3834e8f48c7Smrg[AC_ARG_WITH([pic],
3844e8f48c7Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
3854e8f48c7Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
3864e8f48c7Smrg    [lt_p=${PACKAGE-default}
3874e8f48c7Smrg    case $withval in
3884e8f48c7Smrg    yes|no) pic_mode=$withval ;;
3894e8f48c7Smrg    *)
3904e8f48c7Smrg      pic_mode=default
3914e8f48c7Smrg      # Look at the argument we got.  We use all the common list separators.
3924e8f48c7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
3934e8f48c7Smrg      for lt_pkg in $withval; do
3944e8f48c7Smrg	IFS=$lt_save_ifs
3954e8f48c7Smrg	if test "X$lt_pkg" = "X$lt_p"; then
3964e8f48c7Smrg	  pic_mode=yes
3974e8f48c7Smrg	fi
3984e8f48c7Smrg      done
3994e8f48c7Smrg      IFS=$lt_save_ifs
4004e8f48c7Smrg      ;;
4014e8f48c7Smrg    esac],
4024e8f48c7Smrg    [pic_mode=m4_default([$1], [default])])
4034e8f48c7Smrg
4044e8f48c7Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
4054e8f48c7Smrg])# _LT_WITH_PIC
4064e8f48c7Smrg
4074e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
4084e8f48c7SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
4094e8f48c7Smrg
4104e8f48c7Smrg# Old name:
4114e8f48c7SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
4124e8f48c7Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
4134e8f48c7SmrgAC_DIAGNOSE([obsolete],
4144e8f48c7Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
4154e8f48c7Smrgput the 'pic-only' option into LT_INIT's first parameter.])
4164e8f48c7Smrg])
4174e8f48c7Smrg
4184e8f48c7Smrgdnl aclocal-1.4 backwards compatibility:
4194e8f48c7Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
4204e8f48c7Smrg
4214e8f48c7Smrg## ----------------- ##
4224e8f48c7Smrg## LTDL_INIT Options ##
4234e8f48c7Smrg## ----------------- ##
4244e8f48c7Smrg
4254e8f48c7Smrgm4_define([_LTDL_MODE], [])
4264e8f48c7SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
4274e8f48c7Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
4284e8f48c7SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
4294e8f48c7Smrg		 [m4_define([_LTDL_MODE], [recursive])])
4304e8f48c7SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
4314e8f48c7Smrg		 [m4_define([_LTDL_MODE], [subproject])])
4324e8f48c7Smrg
4334e8f48c7Smrgm4_define([_LTDL_TYPE], [])
4344e8f48c7SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
4354e8f48c7Smrg		 [m4_define([_LTDL_TYPE], [installable])])
4364e8f48c7SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
4374e8f48c7Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
438