13bf3b463Smrg# Helper functions for option handling.                    -*- Autoconf -*-
23bf3b463Smrg#
33bf3b463Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free
43bf3b463Smrg#   Software Foundation, Inc.
53bf3b463Smrg#   Written by Gary V. Vaughan, 2004
63bf3b463Smrg#
73bf3b463Smrg# This file is free software; the Free Software Foundation gives
83bf3b463Smrg# unlimited permission to copy and/or distribute it, with or without
93bf3b463Smrg# modifications, as long as this notice is preserved.
103bf3b463Smrg
113bf3b463Smrg# serial 10 ltoptions.m4
123bf3b463Smrg
133bf3b463Smrg# This is to help aclocal find these macros, as it can't see m4_define.
143bf3b463SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
153bf3b463Smrg
163bf3b463Smrg
173bf3b463Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
183bf3b463Smrg# ------------------------------------------
193bf3b463Smrgm4_define([_LT_MANGLE_OPTION],
203bf3b463Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
213bf3b463Smrg
223bf3b463Smrg
233bf3b463Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
243bf3b463Smrg# ---------------------------------------
253bf3b463Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
263bf3b463Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
273bf3b463Smrg# saved as a flag.
283bf3b463Smrgm4_define([_LT_SET_OPTION],
293bf3b463Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
303bf3b463Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
313bf3b463Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
323bf3b463Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
333bf3b463Smrg])
343bf3b463Smrg
353bf3b463Smrg
363bf3b463Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
373bf3b463Smrg# ------------------------------------------------------------
383bf3b463Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
393bf3b463Smrgm4_define([_LT_IF_OPTION],
403bf3b463Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
413bf3b463Smrg
423bf3b463Smrg
433bf3b463Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
443bf3b463Smrg# -------------------------------------------------------
453bf3b463Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
463bf3b463Smrg# are set.
473bf3b463Smrgm4_define([_LT_UNLESS_OPTIONS],
483bf3b463Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
493bf3b463Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
503bf3b463Smrg		      [m4_define([$0_found])])])[]dnl
513bf3b463Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
523bf3b463Smrg])[]dnl
533bf3b463Smrg])
543bf3b463Smrg
553bf3b463Smrg
563bf3b463Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
573bf3b463Smrg# ----------------------------------------
583bf3b463Smrg# OPTION-LIST is a space-separated list of Libtool options associated
593bf3b463Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
603bf3b463Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
613bf3b463Smrg# the unknown option and exit.
623bf3b463Smrgm4_defun([_LT_SET_OPTIONS],
633bf3b463Smrg[# Set options
643bf3b463Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
653bf3b463Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
663bf3b463Smrg
673bf3b463Smrgm4_if([$1],[LT_INIT],[
683bf3b463Smrg  dnl
693bf3b463Smrg  dnl Simply set some default values (i.e off) if boolean options were not
703bf3b463Smrg  dnl specified:
713bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
723bf3b463Smrg  ])
733bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
743bf3b463Smrg  ])
753bf3b463Smrg  dnl
763bf3b463Smrg  dnl If no reference was made to various pairs of opposing options, then
773bf3b463Smrg  dnl we run the default mode handler for the pair.  For example, if neither
783bf3b463Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
793bf3b463Smrg  dnl archives by default:
803bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
813bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
823bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
833bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
843bf3b463Smrg		   [_LT_ENABLE_FAST_INSTALL])
853bf3b463Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
863bf3b463Smrg		   [_LT_WITH_AIX_SONAME([aix])])
873bf3b463Smrg  ])
883bf3b463Smrg])# _LT_SET_OPTIONS
893bf3b463Smrg
903bf3b463Smrg
913bf3b463Smrg## --------------------------------- ##
923bf3b463Smrg## Macros to handle LT_INIT options. ##
933bf3b463Smrg## --------------------------------- ##
943bf3b463Smrg
953bf3b463Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
963bf3b463Smrg# -----------------------------------------
973bf3b463Smrgm4_define([_LT_MANGLE_DEFUN],
983bf3b463Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
993bf3b463Smrg
1003bf3b463Smrg
1013bf3b463Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
1023bf3b463Smrg# -----------------------------------------------
1033bf3b463Smrgm4_define([LT_OPTION_DEFINE],
1043bf3b463Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
1053bf3b463Smrg])# LT_OPTION_DEFINE
1063bf3b463Smrg
1073bf3b463Smrg
1083bf3b463Smrg# dlopen
1093bf3b463Smrg# ------
1103bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
1113bf3b463Smrg])
1123bf3b463Smrg
1133bf3b463SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
1143bf3b463Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
1153bf3b463SmrgAC_DIAGNOSE([obsolete],
1163bf3b463Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1173bf3b463Smrgput the 'dlopen' option into LT_INIT's first parameter.])
1183bf3b463Smrg])
1193bf3b463Smrg
1203bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
1213bf3b463Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1223bf3b463Smrg
1233bf3b463Smrg
1243bf3b463Smrg# win32-dll
1253bf3b463Smrg# ---------
1263bf3b463Smrg# Declare package support for building win32 dll's.
1273bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
1283bf3b463Smrg[enable_win32_dll=yes
1293bf3b463Smrg
1303bf3b463Smrgcase $host in
1313bf3b463Smrg*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*)
1323bf3b463Smrg  AC_CHECK_TOOL(AS, as, false)
1333bf3b463Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1343bf3b463Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1353bf3b463Smrg  ;;
1363bf3b463Smrgesac
1373bf3b463Smrg
1383bf3b463Smrgtest -z "$AS" && AS=as
1393bf3b463Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
1403bf3b463Smrg
1413bf3b463Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1423bf3b463Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
1433bf3b463Smrg
1443bf3b463Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1453bf3b463Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
1463bf3b463Smrg])# win32-dll
1473bf3b463Smrg
1483bf3b463SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
1493bf3b463Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1503bf3b463Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
1513bf3b463SmrgAC_DIAGNOSE([obsolete],
1523bf3b463Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1533bf3b463Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
1543bf3b463Smrg])
1553bf3b463Smrg
1563bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
1573bf3b463Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
1583bf3b463Smrg
1593bf3b463Smrg
1603bf3b463Smrg# _LT_ENABLE_SHARED([DEFAULT])
1613bf3b463Smrg# ----------------------------
1623bf3b463Smrg# implement the --enable-shared flag, and supports the 'shared' and
1633bf3b463Smrg# 'disable-shared' LT_INIT options.
1643bf3b463Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
1653bf3b463Smrgm4_define([_LT_ENABLE_SHARED],
1663bf3b463Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
1673bf3b463SmrgAC_ARG_ENABLE([shared],
1683bf3b463Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1693bf3b463Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
1703bf3b463Smrg    [p=${PACKAGE-default}
1713bf3b463Smrg    case $enableval in
1723bf3b463Smrg    yes) enable_shared=yes ;;
1733bf3b463Smrg    no) enable_shared=no ;;
1743bf3b463Smrg    *)
1753bf3b463Smrg      enable_shared=no
1763bf3b463Smrg      # Look at the argument we got.  We use all the common list separators.
1773bf3b463Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
1783bf3b463Smrg      for pkg in $enableval; do
1793bf3b463Smrg	IFS=$lt_save_ifs
1803bf3b463Smrg	if test "X$pkg" = "X$p"; then
1813bf3b463Smrg	  enable_shared=yes
1823bf3b463Smrg	fi
1833bf3b463Smrg      done
1843bf3b463Smrg      IFS=$lt_save_ifs
1853bf3b463Smrg      ;;
1863bf3b463Smrg    esac],
1873bf3b463Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1883bf3b463Smrg
1893bf3b463Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
1903bf3b463Smrg	[Whether or not to build shared libraries])
1913bf3b463Smrg])# _LT_ENABLE_SHARED
1923bf3b463Smrg
1933bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
1943bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1953bf3b463Smrg
1963bf3b463Smrg# Old names:
1973bf3b463SmrgAC_DEFUN([AC_ENABLE_SHARED],
1983bf3b463Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
1993bf3b463Smrg])
2003bf3b463Smrg
2013bf3b463SmrgAC_DEFUN([AC_DISABLE_SHARED],
2023bf3b463Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
2033bf3b463Smrg])
2043bf3b463Smrg
2053bf3b463SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
2063bf3b463SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
2073bf3b463Smrg
2083bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
2093bf3b463Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
2103bf3b463Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
2113bf3b463Smrg
2123bf3b463Smrg
2133bf3b463Smrg
2143bf3b463Smrg# _LT_ENABLE_STATIC([DEFAULT])
2153bf3b463Smrg# ----------------------------
2163bf3b463Smrg# implement the --enable-static flag, and support the 'static' and
2173bf3b463Smrg# 'disable-static' LT_INIT options.
2183bf3b463Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2193bf3b463Smrgm4_define([_LT_ENABLE_STATIC],
2203bf3b463Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
2213bf3b463SmrgAC_ARG_ENABLE([static],
2223bf3b463Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2233bf3b463Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
2243bf3b463Smrg    [p=${PACKAGE-default}
2253bf3b463Smrg    case $enableval in
2263bf3b463Smrg    yes) enable_static=yes ;;
2273bf3b463Smrg    no) enable_static=no ;;
2283bf3b463Smrg    *)
2293bf3b463Smrg     enable_static=no
2303bf3b463Smrg      # Look at the argument we got.  We use all the common list separators.
2313bf3b463Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2323bf3b463Smrg      for pkg in $enableval; do
2333bf3b463Smrg	IFS=$lt_save_ifs
2343bf3b463Smrg	if test "X$pkg" = "X$p"; then
2353bf3b463Smrg	  enable_static=yes
2363bf3b463Smrg	fi
2373bf3b463Smrg      done
2383bf3b463Smrg      IFS=$lt_save_ifs
2393bf3b463Smrg      ;;
2403bf3b463Smrg    esac],
2413bf3b463Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
2423bf3b463Smrg
2433bf3b463Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
2443bf3b463Smrg	[Whether or not to build static libraries])
2453bf3b463Smrg])# _LT_ENABLE_STATIC
2463bf3b463Smrg
2473bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
2483bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
2493bf3b463Smrg
2503bf3b463Smrg# Old names:
2513bf3b463SmrgAC_DEFUN([AC_ENABLE_STATIC],
2523bf3b463Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
2533bf3b463Smrg])
2543bf3b463Smrg
2553bf3b463SmrgAC_DEFUN([AC_DISABLE_STATIC],
2563bf3b463Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
2573bf3b463Smrg])
2583bf3b463Smrg
2593bf3b463SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
2603bf3b463SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
2613bf3b463Smrg
2623bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
2633bf3b463Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
2643bf3b463Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
2653bf3b463Smrg
2663bf3b463Smrg
2673bf3b463Smrg
2683bf3b463Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
2693bf3b463Smrg# ----------------------------------
2703bf3b463Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
2713bf3b463Smrg# and 'disable-fast-install' LT_INIT options.
2723bf3b463Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2733bf3b463Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
2743bf3b463Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
2753bf3b463SmrgAC_ARG_ENABLE([fast-install],
2763bf3b463Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2773bf3b463Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2783bf3b463Smrg    [p=${PACKAGE-default}
2793bf3b463Smrg    case $enableval in
2803bf3b463Smrg    yes) enable_fast_install=yes ;;
2813bf3b463Smrg    no) enable_fast_install=no ;;
2823bf3b463Smrg    *)
2833bf3b463Smrg      enable_fast_install=no
2843bf3b463Smrg      # Look at the argument we got.  We use all the common list separators.
2853bf3b463Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2863bf3b463Smrg      for pkg in $enableval; do
2873bf3b463Smrg	IFS=$lt_save_ifs
2883bf3b463Smrg	if test "X$pkg" = "X$p"; then
2893bf3b463Smrg	  enable_fast_install=yes
2903bf3b463Smrg	fi
2913bf3b463Smrg      done
2923bf3b463Smrg      IFS=$lt_save_ifs
2933bf3b463Smrg      ;;
2943bf3b463Smrg    esac],
2953bf3b463Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
2963bf3b463Smrg
2973bf3b463Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
2983bf3b463Smrg	 [Whether or not to optimize for fast installation])dnl
2993bf3b463Smrg])# _LT_ENABLE_FAST_INSTALL
3003bf3b463Smrg
3013bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
3023bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
3033bf3b463Smrg
3043bf3b463Smrg# Old names:
3053bf3b463SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
3063bf3b463Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
3073bf3b463SmrgAC_DIAGNOSE([obsolete],
3083bf3b463Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3093bf3b463Smrgthe 'fast-install' option into LT_INIT's first parameter.])
3103bf3b463Smrg])
3113bf3b463Smrg
3123bf3b463SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
3133bf3b463Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
3143bf3b463SmrgAC_DIAGNOSE([obsolete],
3153bf3b463Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3163bf3b463Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
3173bf3b463Smrg])
3183bf3b463Smrg
3193bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
3203bf3b463Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
3213bf3b463Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
3223bf3b463Smrg
3233bf3b463Smrg
3243bf3b463Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
3253bf3b463Smrg# ----------------------------------
3263bf3b463Smrg# implement the --enable-aix-soname configure option, and support the
3273bf3b463Smrg# `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options.
3283bf3b463Smrg# DEFAULT is either `aix', `both', or `svr4'.  If omitted, it defaults to `aix'.
3293bf3b463Smrgm4_define([_LT_WITH_AIX_SONAME],
3303bf3b463Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
3313bf3b463Smrgshared_archive_member_spec=
3323bf3b463Smrgcase $host,$enable_shared in
3333bf3b463Smrgpower*-*-aix[[5-9]]*,yes)
3343bf3b463Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
3353bf3b463Smrg  AC_ARG_ENABLE([aix-soname],
3363bf3b463Smrg    [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both],
3373bf3b463Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
3383bf3b463Smrg    [case $enableval in
3393bf3b463Smrg     aix|svr4|both)
3403bf3b463Smrg       ;;
3413bf3b463Smrg     *)
3423bf3b463Smrg       AC_MSG_ERROR([Unknown argument to --enable-aix-soname])
3433bf3b463Smrg       ;;
3443bf3b463Smrg     esac
3453bf3b463Smrg     lt_cv_with_aix_soname=$enable_aix_soname],
3463bf3b463Smrg    [_AC_ENABLE_IF([with], [aix-soname],
3473bf3b463Smrg        [case $withval in
3483bf3b463Smrg         aix|svr4|both)
3493bf3b463Smrg           ;;
3503bf3b463Smrg         *)
3513bf3b463Smrg           AC_MSG_ERROR([Unknown argument to --with-aix-soname])
3523bf3b463Smrg           ;;
3533bf3b463Smrg         esac
3543bf3b463Smrg         lt_cv_with_aix_soname=$with_aix_soname],
3553bf3b463Smrg        [AC_CACHE_VAL([lt_cv_with_aix_soname],
3563bf3b463Smrg           [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)])
3573bf3b463Smrg     enable_aix_soname=$lt_cv_with_aix_soname])
3583bf3b463Smrg  with_aix_soname=$enable_aix_soname
3593bf3b463Smrg  AC_MSG_RESULT([$with_aix_soname])
3603bf3b463Smrg  if test aix != "$with_aix_soname"; then
3613bf3b463Smrg    # For the AIX way of multilib, we name the shared archive member
3623bf3b463Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
3633bf3b463Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
3643bf3b463Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
3653bf3b463Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
3663bf3b463Smrg    if test 64 = "${OBJECT_MODE-32}"; then
3673bf3b463Smrg      shared_archive_member_spec=shr_64
3683bf3b463Smrg    else
3693bf3b463Smrg      shared_archive_member_spec=shr
3703bf3b463Smrg    fi
3713bf3b463Smrg  fi
3723bf3b463Smrg  ;;
3733bf3b463Smrg*)
3743bf3b463Smrg  with_aix_soname=aix
3753bf3b463Smrg  ;;
3763bf3b463Smrgesac
3773bf3b463Smrg
3783bf3b463Smrg_LT_DECL([], [shared_archive_member_spec], [0],
3793bf3b463Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
3803bf3b463Smrg])# _LT_WITH_AIX_SONAME
3813bf3b463Smrg
3823bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
3833bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
3843bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
3853bf3b463Smrg
3863bf3b463Smrg
3873bf3b463Smrg# _LT_WITH_PIC([MODE])
3883bf3b463Smrg# --------------------
3893bf3b463Smrg# implement the --enable-pic flag, and support the 'pic-only' and 'no-pic'
3903bf3b463Smrg# LT_INIT options.
3913bf3b463Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
3923bf3b463Smrgm4_define([_LT_WITH_PIC],
3933bf3b463Smrg[AC_ARG_ENABLE([pic],
3943bf3b463Smrg    [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@],
3953bf3b463Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
3963bf3b463Smrg    [lt_p=${PACKAGE-default}
3973bf3b463Smrg     case $enableval in
3983bf3b463Smrg     yes|no) pic_mode=$enableval ;;
3993bf3b463Smrg     *)
4003bf3b463Smrg       pic_mode=default
4013bf3b463Smrg       # Look at the argument we got.  We use all the common list separators.
4023bf3b463Smrg       lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
4033bf3b463Smrg       for lt_pkg in $enableval; do
4043bf3b463Smrg	 IFS=$lt_save_ifs
4053bf3b463Smrg	 if test "X$lt_pkg" = "X$lt_p"; then
4063bf3b463Smrg	   pic_mode=yes
4073bf3b463Smrg	 fi
4083bf3b463Smrg       done
4093bf3b463Smrg       IFS=$lt_save_ifs
4103bf3b463Smrg       ;;
4113bf3b463Smrg     esac],
4123bf3b463Smrg    [dnl Continue to support --with-pic and --without-pic, for backward
4133bf3b463Smrg     dnl compatibility.
4143bf3b463Smrg     _AC_ENABLE_IF([with], [pic],
4153bf3b463Smrg	[lt_p=${PACKAGE-default}
4163bf3b463Smrg	 case $withval in
4173bf3b463Smrg	 yes|no) pic_mode=$withval ;;
4183bf3b463Smrg	 *)
4193bf3b463Smrg	   pic_mode=default
4203bf3b463Smrg	   # Look at the argument we got.  We use all the common list separators.
4213bf3b463Smrg	   lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
4223bf3b463Smrg	   for lt_pkg in $withval; do
4233bf3b463Smrg	     IFS=$lt_save_ifs
4243bf3b463Smrg	     if test "X$lt_pkg" = "X$lt_p"; then
4253bf3b463Smrg	       pic_mode=yes
4263bf3b463Smrg	     fi
4273bf3b463Smrg	   done
4283bf3b463Smrg	   IFS=$lt_save_ifs
4293bf3b463Smrg	   ;;
4303bf3b463Smrg	 esac],
4313bf3b463Smrg	[pic_mode=m4_default([$1], [default])])]
4323bf3b463Smrg    )
4333bf3b463Smrg
4343bf3b463Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
4353bf3b463Smrg])# _LT_WITH_PIC
4363bf3b463Smrg
4373bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
4383bf3b463SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
4393bf3b463Smrg
4403bf3b463Smrg# Old name:
4413bf3b463SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
4423bf3b463Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
4433bf3b463SmrgAC_DIAGNOSE([obsolete],
4443bf3b463Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
4453bf3b463Smrgput the 'pic-only' option into LT_INIT's first parameter.])
4463bf3b463Smrg])
4473bf3b463Smrg
4483bf3b463Smrgdnl aclocal-1.4 backwards compatibility:
4493bf3b463Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
4503bf3b463Smrg
4513bf3b463Smrg## ----------------- ##
4523bf3b463Smrg## LTDL_INIT Options ##
4533bf3b463Smrg## ----------------- ##
4543bf3b463Smrg
4553bf3b463Smrgm4_define([_LTDL_MODE], [])
4563bf3b463SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
4573bf3b463Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
4583bf3b463SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
4593bf3b463Smrg		 [m4_define([_LTDL_MODE], [recursive])])
4603bf3b463SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
4613bf3b463Smrg		 [m4_define([_LTDL_MODE], [subproject])])
4623bf3b463Smrg
4633bf3b463Smrgm4_define([_LTDL_TYPE], [])
4643bf3b463SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
4653bf3b463Smrg		 [m4_define([_LTDL_TYPE], [installable])])
4663bf3b463SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
4673bf3b463Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
468