ltoptions.m4 revision 0ef0e59a
10ef0e59aSmrg# Helper functions for option handling.                    -*- Autoconf -*-
20ef0e59aSmrg#
30ef0e59aSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
40ef0e59aSmrg#   Software Foundation, Inc.
50ef0e59aSmrg#   Written by Gary V. Vaughan, 2004
60ef0e59aSmrg#
70ef0e59aSmrg# This file is free software; the Free Software Foundation gives
80ef0e59aSmrg# unlimited permission to copy and/or distribute it, with or without
90ef0e59aSmrg# modifications, as long as this notice is preserved.
100ef0e59aSmrg
110ef0e59aSmrg# serial 8 ltoptions.m4
120ef0e59aSmrg
130ef0e59aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
140ef0e59aSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
150ef0e59aSmrg
160ef0e59aSmrg
170ef0e59aSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
180ef0e59aSmrg# ------------------------------------------
190ef0e59aSmrgm4_define([_LT_MANGLE_OPTION],
200ef0e59aSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
210ef0e59aSmrg
220ef0e59aSmrg
230ef0e59aSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
240ef0e59aSmrg# ---------------------------------------
250ef0e59aSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
260ef0e59aSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
270ef0e59aSmrg# saved as a flag.
280ef0e59aSmrgm4_define([_LT_SET_OPTION],
290ef0e59aSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
300ef0e59aSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
310ef0e59aSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
320ef0e59aSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
330ef0e59aSmrg])
340ef0e59aSmrg
350ef0e59aSmrg
360ef0e59aSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
370ef0e59aSmrg# ------------------------------------------------------------
380ef0e59aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
390ef0e59aSmrgm4_define([_LT_IF_OPTION],
400ef0e59aSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
410ef0e59aSmrg
420ef0e59aSmrg
430ef0e59aSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
440ef0e59aSmrg# -------------------------------------------------------
450ef0e59aSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
460ef0e59aSmrg# are set.
470ef0e59aSmrgm4_define([_LT_UNLESS_OPTIONS],
480ef0e59aSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
490ef0e59aSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
500ef0e59aSmrg		      [m4_define([$0_found])])])[]dnl
510ef0e59aSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
520ef0e59aSmrg])[]dnl
530ef0e59aSmrg])
540ef0e59aSmrg
550ef0e59aSmrg
560ef0e59aSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
570ef0e59aSmrg# ----------------------------------------
580ef0e59aSmrg# OPTION-LIST is a space-separated list of Libtool options associated
590ef0e59aSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
600ef0e59aSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
610ef0e59aSmrg# the unknown option and exit.
620ef0e59aSmrgm4_defun([_LT_SET_OPTIONS],
630ef0e59aSmrg[# Set options
640ef0e59aSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
650ef0e59aSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
660ef0e59aSmrg
670ef0e59aSmrgm4_if([$1],[LT_INIT],[
680ef0e59aSmrg  dnl
690ef0e59aSmrg  dnl Simply set some default values (i.e off) if boolean options were not
700ef0e59aSmrg  dnl specified:
710ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
720ef0e59aSmrg  ])
730ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
740ef0e59aSmrg  ])
750ef0e59aSmrg  dnl
760ef0e59aSmrg  dnl If no reference was made to various pairs of opposing options, then
770ef0e59aSmrg  dnl we run the default mode handler for the pair.  For example, if neither
780ef0e59aSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
790ef0e59aSmrg  dnl archives by default:
800ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
810ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
820ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
830ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
840ef0e59aSmrg		   [_LT_ENABLE_FAST_INSTALL])
850ef0e59aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
860ef0e59aSmrg		   [_LT_WITH_AIX_SONAME([aix])])
870ef0e59aSmrg  ])
880ef0e59aSmrg])# _LT_SET_OPTIONS
890ef0e59aSmrg
900ef0e59aSmrg
910ef0e59aSmrg## --------------------------------- ##
920ef0e59aSmrg## Macros to handle LT_INIT options. ##
930ef0e59aSmrg## --------------------------------- ##
940ef0e59aSmrg
950ef0e59aSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
960ef0e59aSmrg# -----------------------------------------
970ef0e59aSmrgm4_define([_LT_MANGLE_DEFUN],
980ef0e59aSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
990ef0e59aSmrg
1000ef0e59aSmrg
1010ef0e59aSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
1020ef0e59aSmrg# -----------------------------------------------
1030ef0e59aSmrgm4_define([LT_OPTION_DEFINE],
1040ef0e59aSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
1050ef0e59aSmrg])# LT_OPTION_DEFINE
1060ef0e59aSmrg
1070ef0e59aSmrg
1080ef0e59aSmrg# dlopen
1090ef0e59aSmrg# ------
1100ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
1110ef0e59aSmrg])
1120ef0e59aSmrg
1130ef0e59aSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
1140ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
1150ef0e59aSmrgAC_DIAGNOSE([obsolete],
1160ef0e59aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1170ef0e59aSmrgput the 'dlopen' option into LT_INIT's first parameter.])
1180ef0e59aSmrg])
1190ef0e59aSmrg
1200ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
1210ef0e59aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1220ef0e59aSmrg
1230ef0e59aSmrg
1240ef0e59aSmrg# win32-dll
1250ef0e59aSmrg# ---------
1260ef0e59aSmrg# Declare package support for building win32 dll's.
1270ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
1280ef0e59aSmrg[enable_win32_dll=yes
1290ef0e59aSmrg
1300ef0e59aSmrgcase $host in
1310ef0e59aSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
1320ef0e59aSmrg  AC_CHECK_TOOL(AS, as, false)
1330ef0e59aSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1340ef0e59aSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1350ef0e59aSmrg  ;;
1360ef0e59aSmrgesac
1370ef0e59aSmrg
1380ef0e59aSmrgtest -z "$AS" && AS=as
1390ef0e59aSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
1400ef0e59aSmrg
1410ef0e59aSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1420ef0e59aSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
1430ef0e59aSmrg
1440ef0e59aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1450ef0e59aSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
1460ef0e59aSmrg])# win32-dll
1470ef0e59aSmrg
1480ef0e59aSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
1490ef0e59aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1500ef0e59aSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
1510ef0e59aSmrgAC_DIAGNOSE([obsolete],
1520ef0e59aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
1530ef0e59aSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
1540ef0e59aSmrg])
1550ef0e59aSmrg
1560ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
1570ef0e59aSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
1580ef0e59aSmrg
1590ef0e59aSmrg
1600ef0e59aSmrg# _LT_ENABLE_SHARED([DEFAULT])
1610ef0e59aSmrg# ----------------------------
1620ef0e59aSmrg# implement the --enable-shared flag, and supports the 'shared' and
1630ef0e59aSmrg# 'disable-shared' LT_INIT options.
1640ef0e59aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
1650ef0e59aSmrgm4_define([_LT_ENABLE_SHARED],
1660ef0e59aSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
1670ef0e59aSmrgAC_ARG_ENABLE([shared],
1680ef0e59aSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1690ef0e59aSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
1700ef0e59aSmrg    [p=${PACKAGE-default}
1710ef0e59aSmrg    case $enableval in
1720ef0e59aSmrg    yes) enable_shared=yes ;;
1730ef0e59aSmrg    no) enable_shared=no ;;
1740ef0e59aSmrg    *)
1750ef0e59aSmrg      enable_shared=no
1760ef0e59aSmrg      # Look at the argument we got.  We use all the common list separators.
1770ef0e59aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
1780ef0e59aSmrg      for pkg in $enableval; do
1790ef0e59aSmrg	IFS=$lt_save_ifs
1800ef0e59aSmrg	if test "X$pkg" = "X$p"; then
1810ef0e59aSmrg	  enable_shared=yes
1820ef0e59aSmrg	fi
1830ef0e59aSmrg      done
1840ef0e59aSmrg      IFS=$lt_save_ifs
1850ef0e59aSmrg      ;;
1860ef0e59aSmrg    esac],
1870ef0e59aSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1880ef0e59aSmrg
1890ef0e59aSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
1900ef0e59aSmrg	[Whether or not to build shared libraries])
1910ef0e59aSmrg])# _LT_ENABLE_SHARED
1920ef0e59aSmrg
1930ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
1940ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1950ef0e59aSmrg
1960ef0e59aSmrg# Old names:
1970ef0e59aSmrgAC_DEFUN([AC_ENABLE_SHARED],
1980ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
1990ef0e59aSmrg])
2000ef0e59aSmrg
2010ef0e59aSmrgAC_DEFUN([AC_DISABLE_SHARED],
2020ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
2030ef0e59aSmrg])
2040ef0e59aSmrg
2050ef0e59aSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
2060ef0e59aSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
2070ef0e59aSmrg
2080ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
2090ef0e59aSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
2100ef0e59aSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
2110ef0e59aSmrg
2120ef0e59aSmrg
2130ef0e59aSmrg
2140ef0e59aSmrg# _LT_ENABLE_STATIC([DEFAULT])
2150ef0e59aSmrg# ----------------------------
2160ef0e59aSmrg# implement the --enable-static flag, and support the 'static' and
2170ef0e59aSmrg# 'disable-static' LT_INIT options.
2180ef0e59aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2190ef0e59aSmrgm4_define([_LT_ENABLE_STATIC],
2200ef0e59aSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
2210ef0e59aSmrgAC_ARG_ENABLE([static],
2220ef0e59aSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2230ef0e59aSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
2240ef0e59aSmrg    [p=${PACKAGE-default}
2250ef0e59aSmrg    case $enableval in
2260ef0e59aSmrg    yes) enable_static=yes ;;
2270ef0e59aSmrg    no) enable_static=no ;;
2280ef0e59aSmrg    *)
2290ef0e59aSmrg     enable_static=no
2300ef0e59aSmrg      # Look at the argument we got.  We use all the common list separators.
2310ef0e59aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2320ef0e59aSmrg      for pkg in $enableval; do
2330ef0e59aSmrg	IFS=$lt_save_ifs
2340ef0e59aSmrg	if test "X$pkg" = "X$p"; then
2350ef0e59aSmrg	  enable_static=yes
2360ef0e59aSmrg	fi
2370ef0e59aSmrg      done
2380ef0e59aSmrg      IFS=$lt_save_ifs
2390ef0e59aSmrg      ;;
2400ef0e59aSmrg    esac],
2410ef0e59aSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
2420ef0e59aSmrg
2430ef0e59aSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
2440ef0e59aSmrg	[Whether or not to build static libraries])
2450ef0e59aSmrg])# _LT_ENABLE_STATIC
2460ef0e59aSmrg
2470ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
2480ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
2490ef0e59aSmrg
2500ef0e59aSmrg# Old names:
2510ef0e59aSmrgAC_DEFUN([AC_ENABLE_STATIC],
2520ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
2530ef0e59aSmrg])
2540ef0e59aSmrg
2550ef0e59aSmrgAC_DEFUN([AC_DISABLE_STATIC],
2560ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
2570ef0e59aSmrg])
2580ef0e59aSmrg
2590ef0e59aSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
2600ef0e59aSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
2610ef0e59aSmrg
2620ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
2630ef0e59aSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
2640ef0e59aSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
2650ef0e59aSmrg
2660ef0e59aSmrg
2670ef0e59aSmrg
2680ef0e59aSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
2690ef0e59aSmrg# ----------------------------------
2700ef0e59aSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
2710ef0e59aSmrg# and 'disable-fast-install' LT_INIT options.
2720ef0e59aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2730ef0e59aSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
2740ef0e59aSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
2750ef0e59aSmrgAC_ARG_ENABLE([fast-install],
2760ef0e59aSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2770ef0e59aSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2780ef0e59aSmrg    [p=${PACKAGE-default}
2790ef0e59aSmrg    case $enableval in
2800ef0e59aSmrg    yes) enable_fast_install=yes ;;
2810ef0e59aSmrg    no) enable_fast_install=no ;;
2820ef0e59aSmrg    *)
2830ef0e59aSmrg      enable_fast_install=no
2840ef0e59aSmrg      # Look at the argument we got.  We use all the common list separators.
2850ef0e59aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2860ef0e59aSmrg      for pkg in $enableval; do
2870ef0e59aSmrg	IFS=$lt_save_ifs
2880ef0e59aSmrg	if test "X$pkg" = "X$p"; then
2890ef0e59aSmrg	  enable_fast_install=yes
2900ef0e59aSmrg	fi
2910ef0e59aSmrg      done
2920ef0e59aSmrg      IFS=$lt_save_ifs
2930ef0e59aSmrg      ;;
2940ef0e59aSmrg    esac],
2950ef0e59aSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
2960ef0e59aSmrg
2970ef0e59aSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
2980ef0e59aSmrg	 [Whether or not to optimize for fast installation])dnl
2990ef0e59aSmrg])# _LT_ENABLE_FAST_INSTALL
3000ef0e59aSmrg
3010ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
3020ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
3030ef0e59aSmrg
3040ef0e59aSmrg# Old names:
3050ef0e59aSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
3060ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
3070ef0e59aSmrgAC_DIAGNOSE([obsolete],
3080ef0e59aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3090ef0e59aSmrgthe 'fast-install' option into LT_INIT's first parameter.])
3100ef0e59aSmrg])
3110ef0e59aSmrg
3120ef0e59aSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
3130ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
3140ef0e59aSmrgAC_DIAGNOSE([obsolete],
3150ef0e59aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
3160ef0e59aSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
3170ef0e59aSmrg])
3180ef0e59aSmrg
3190ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
3200ef0e59aSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
3210ef0e59aSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
3220ef0e59aSmrg
3230ef0e59aSmrg
3240ef0e59aSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
3250ef0e59aSmrg# ----------------------------------
3260ef0e59aSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
3270ef0e59aSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
3280ef0e59aSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
3290ef0e59aSmrgm4_define([_LT_WITH_AIX_SONAME],
3300ef0e59aSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
3310ef0e59aSmrgshared_archive_member_spec=
3320ef0e59aSmrgcase $host,$enable_shared in
3330ef0e59aSmrgpower*-*-aix[[5-9]]*,yes)
3340ef0e59aSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
3350ef0e59aSmrg  AC_ARG_WITH([aix-soname],
3360ef0e59aSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
3370ef0e59aSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
3380ef0e59aSmrg    [case $withval in
3390ef0e59aSmrg    aix|svr4|both)
3400ef0e59aSmrg      ;;
3410ef0e59aSmrg    *)
3420ef0e59aSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
3430ef0e59aSmrg      ;;
3440ef0e59aSmrg    esac
3450ef0e59aSmrg    lt_cv_with_aix_soname=$with_aix_soname],
3460ef0e59aSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
3470ef0e59aSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
3480ef0e59aSmrg    with_aix_soname=$lt_cv_with_aix_soname])
3490ef0e59aSmrg  AC_MSG_RESULT([$with_aix_soname])
3500ef0e59aSmrg  if test aix != "$with_aix_soname"; then
3510ef0e59aSmrg    # For the AIX way of multilib, we name the shared archive member
3520ef0e59aSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
3530ef0e59aSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
3540ef0e59aSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
3550ef0e59aSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
3560ef0e59aSmrg    if test 64 = "${OBJECT_MODE-32}"; then
3570ef0e59aSmrg      shared_archive_member_spec=shr_64
3580ef0e59aSmrg    else
3590ef0e59aSmrg      shared_archive_member_spec=shr
3600ef0e59aSmrg    fi
3610ef0e59aSmrg  fi
3620ef0e59aSmrg  ;;
3630ef0e59aSmrg*)
3640ef0e59aSmrg  with_aix_soname=aix
3650ef0e59aSmrg  ;;
3660ef0e59aSmrgesac
3670ef0e59aSmrg
3680ef0e59aSmrg_LT_DECL([], [shared_archive_member_spec], [0],
3690ef0e59aSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
3700ef0e59aSmrg])# _LT_WITH_AIX_SONAME
3710ef0e59aSmrg
3720ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
3730ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
3740ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
3750ef0e59aSmrg
3760ef0e59aSmrg
3770ef0e59aSmrg# _LT_WITH_PIC([MODE])
3780ef0e59aSmrg# --------------------
3790ef0e59aSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
3800ef0e59aSmrg# LT_INIT options.
3810ef0e59aSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
3820ef0e59aSmrgm4_define([_LT_WITH_PIC],
3830ef0e59aSmrg[AC_ARG_WITH([pic],
3840ef0e59aSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
3850ef0e59aSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
3860ef0e59aSmrg    [lt_p=${PACKAGE-default}
3870ef0e59aSmrg    case $withval in
3880ef0e59aSmrg    yes|no) pic_mode=$withval ;;
3890ef0e59aSmrg    *)
3900ef0e59aSmrg      pic_mode=default
3910ef0e59aSmrg      # Look at the argument we got.  We use all the common list separators.
3920ef0e59aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
3930ef0e59aSmrg      for lt_pkg in $withval; do
3940ef0e59aSmrg	IFS=$lt_save_ifs
3950ef0e59aSmrg	if test "X$lt_pkg" = "X$lt_p"; then
3960ef0e59aSmrg	  pic_mode=yes
3970ef0e59aSmrg	fi
3980ef0e59aSmrg      done
3990ef0e59aSmrg      IFS=$lt_save_ifs
4000ef0e59aSmrg      ;;
4010ef0e59aSmrg    esac],
4020ef0e59aSmrg    [pic_mode=m4_default([$1], [default])])
4030ef0e59aSmrg
4040ef0e59aSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
4050ef0e59aSmrg])# _LT_WITH_PIC
4060ef0e59aSmrg
4070ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
4080ef0e59aSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
4090ef0e59aSmrg
4100ef0e59aSmrg# Old name:
4110ef0e59aSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
4120ef0e59aSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
4130ef0e59aSmrgAC_DIAGNOSE([obsolete],
4140ef0e59aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
4150ef0e59aSmrgput the 'pic-only' option into LT_INIT's first parameter.])
4160ef0e59aSmrg])
4170ef0e59aSmrg
4180ef0e59aSmrgdnl aclocal-1.4 backwards compatibility:
4190ef0e59aSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
4200ef0e59aSmrg
4210ef0e59aSmrg## ----------------- ##
4220ef0e59aSmrg## LTDL_INIT Options ##
4230ef0e59aSmrg## ----------------- ##
4240ef0e59aSmrg
4250ef0e59aSmrgm4_define([_LTDL_MODE], [])
4260ef0e59aSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
4270ef0e59aSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
4280ef0e59aSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
4290ef0e59aSmrg		 [m4_define([_LTDL_MODE], [recursive])])
4300ef0e59aSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
4310ef0e59aSmrg		 [m4_define([_LTDL_MODE], [subproject])])
4320ef0e59aSmrg
4330ef0e59aSmrgm4_define([_LTDL_TYPE], [])
4340ef0e59aSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
4350ef0e59aSmrg		 [m4_define([_LTDL_TYPE], [installable])])
4360ef0e59aSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
4370ef0e59aSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
438