xref: /freebsd/contrib/ntp/sntp/libevent/m4/ltoptions.m4 (revision f0574f5cf69e168cc4ea71ebbe5fdec9ec9a3dfe)
12b15cb3dSCy Schubert# Helper functions for option handling.                    -*- Autoconf -*-
22b15cb3dSCy Schubert#
3*f0574f5cSXin LI#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
4*f0574f5cSXin LI#   Foundation, Inc.
52b15cb3dSCy Schubert#   Written by Gary V. Vaughan, 2004
62b15cb3dSCy Schubert#
72b15cb3dSCy Schubert# This file is free software; the Free Software Foundation gives
82b15cb3dSCy Schubert# unlimited permission to copy and/or distribute it, with or without
92b15cb3dSCy Schubert# modifications, as long as this notice is preserved.
102b15cb3dSCy Schubert
11*f0574f5cSXin LI# serial 8 ltoptions.m4
122b15cb3dSCy Schubert
132b15cb3dSCy Schubert# This is to help aclocal find these macros, as it can't see m4_define.
142b15cb3dSCy SchubertAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
152b15cb3dSCy Schubert
162b15cb3dSCy Schubert
172b15cb3dSCy Schubert# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
182b15cb3dSCy Schubert# ------------------------------------------
192b15cb3dSCy Schubertm4_define([_LT_MANGLE_OPTION],
202b15cb3dSCy Schubert[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
212b15cb3dSCy Schubert
222b15cb3dSCy Schubert
232b15cb3dSCy Schubert# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
242b15cb3dSCy Schubert# ---------------------------------------
252b15cb3dSCy Schubert# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
262b15cb3dSCy Schubert# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
272b15cb3dSCy Schubert# saved as a flag.
282b15cb3dSCy Schubertm4_define([_LT_SET_OPTION],
292b15cb3dSCy Schubert[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
302b15cb3dSCy Schubertm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
312b15cb3dSCy Schubert        _LT_MANGLE_DEFUN([$1], [$2]),
32*f0574f5cSXin LI    [m4_warning([Unknown $1 option '$2'])])[]dnl
332b15cb3dSCy Schubert])
342b15cb3dSCy Schubert
352b15cb3dSCy Schubert
362b15cb3dSCy Schubert# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
372b15cb3dSCy Schubert# ------------------------------------------------------------
382b15cb3dSCy Schubert# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
392b15cb3dSCy Schubertm4_define([_LT_IF_OPTION],
402b15cb3dSCy Schubert[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
412b15cb3dSCy Schubert
422b15cb3dSCy Schubert
432b15cb3dSCy Schubert# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
442b15cb3dSCy Schubert# -------------------------------------------------------
452b15cb3dSCy Schubert# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
462b15cb3dSCy Schubert# are set.
472b15cb3dSCy Schubertm4_define([_LT_UNLESS_OPTIONS],
482b15cb3dSCy Schubert[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
492b15cb3dSCy Schubert	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
502b15cb3dSCy Schubert		      [m4_define([$0_found])])])[]dnl
512b15cb3dSCy Schubertm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
522b15cb3dSCy Schubert])[]dnl
532b15cb3dSCy Schubert])
542b15cb3dSCy Schubert
552b15cb3dSCy Schubert
562b15cb3dSCy Schubert# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
572b15cb3dSCy Schubert# ----------------------------------------
582b15cb3dSCy Schubert# OPTION-LIST is a space-separated list of Libtool options associated
592b15cb3dSCy Schubert# with MACRO-NAME.  If any OPTION has a matching handler declared with
602b15cb3dSCy Schubert# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
612b15cb3dSCy Schubert# the unknown option and exit.
622b15cb3dSCy Schubertm4_defun([_LT_SET_OPTIONS],
632b15cb3dSCy Schubert[# Set options
642b15cb3dSCy Schubertm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
652b15cb3dSCy Schubert    [_LT_SET_OPTION([$1], _LT_Option)])
662b15cb3dSCy Schubert
672b15cb3dSCy Schubertm4_if([$1],[LT_INIT],[
682b15cb3dSCy Schubert  dnl
692b15cb3dSCy Schubert  dnl Simply set some default values (i.e off) if boolean options were not
702b15cb3dSCy Schubert  dnl specified:
712b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
722b15cb3dSCy Schubert  ])
732b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
742b15cb3dSCy Schubert  ])
752b15cb3dSCy Schubert  dnl
762b15cb3dSCy Schubert  dnl If no reference was made to various pairs of opposing options, then
772b15cb3dSCy Schubert  dnl we run the default mode handler for the pair.  For example, if neither
78*f0574f5cSXin LI  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
792b15cb3dSCy Schubert  dnl archives by default:
802b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
812b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
822b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
832b15cb3dSCy Schubert  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
842b15cb3dSCy Schubert		   [_LT_ENABLE_FAST_INSTALL])
85*f0574f5cSXin LI  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
86*f0574f5cSXin LI		   [_LT_WITH_AIX_SONAME([aix])])
872b15cb3dSCy Schubert  ])
882b15cb3dSCy Schubert])# _LT_SET_OPTIONS
892b15cb3dSCy Schubert
902b15cb3dSCy Schubert
912b15cb3dSCy Schubert## --------------------------------- ##
922b15cb3dSCy Schubert## Macros to handle LT_INIT options. ##
932b15cb3dSCy Schubert## --------------------------------- ##
942b15cb3dSCy Schubert
952b15cb3dSCy Schubert# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
962b15cb3dSCy Schubert# -----------------------------------------
972b15cb3dSCy Schubertm4_define([_LT_MANGLE_DEFUN],
982b15cb3dSCy Schubert[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
992b15cb3dSCy Schubert
1002b15cb3dSCy Schubert
1012b15cb3dSCy Schubert# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
1022b15cb3dSCy Schubert# -----------------------------------------------
1032b15cb3dSCy Schubertm4_define([LT_OPTION_DEFINE],
1042b15cb3dSCy Schubert[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
1052b15cb3dSCy Schubert])# LT_OPTION_DEFINE
1062b15cb3dSCy Schubert
1072b15cb3dSCy Schubert
1082b15cb3dSCy Schubert# dlopen
1092b15cb3dSCy Schubert# ------
1102b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
1112b15cb3dSCy Schubert])
1122b15cb3dSCy Schubert
1132b15cb3dSCy SchubertAU_DEFUN([AC_LIBTOOL_DLOPEN],
1142b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], [dlopen])
1152b15cb3dSCy SchubertAC_DIAGNOSE([obsolete],
1162b15cb3dSCy Schubert[$0: Remove this warning and the call to _LT_SET_OPTION when you
117*f0574f5cSXin LIput the 'dlopen' option into LT_INIT's first parameter.])
1182b15cb3dSCy Schubert])
1192b15cb3dSCy Schubert
1202b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
1212b15cb3dSCy Schubertdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
1222b15cb3dSCy Schubert
1232b15cb3dSCy Schubert
1242b15cb3dSCy Schubert# win32-dll
1252b15cb3dSCy Schubert# ---------
1262b15cb3dSCy Schubert# Declare package support for building win32 dll's.
1272b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [win32-dll],
1282b15cb3dSCy Schubert[enable_win32_dll=yes
1292b15cb3dSCy Schubert
1302b15cb3dSCy Schubertcase $host in
1312b15cb3dSCy Schubert*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
1322b15cb3dSCy Schubert  AC_CHECK_TOOL(AS, as, false)
1332b15cb3dSCy Schubert  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1342b15cb3dSCy Schubert  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1352b15cb3dSCy Schubert  ;;
1362b15cb3dSCy Schubertesac
1372b15cb3dSCy Schubert
1382b15cb3dSCy Schuberttest -z "$AS" && AS=as
1392b15cb3dSCy Schubert_LT_DECL([], [AS],      [1], [Assembler program])dnl
1402b15cb3dSCy Schubert
1412b15cb3dSCy Schuberttest -z "$DLLTOOL" && DLLTOOL=dlltool
1422b15cb3dSCy Schubert_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
1432b15cb3dSCy Schubert
1442b15cb3dSCy Schuberttest -z "$OBJDUMP" && OBJDUMP=objdump
1452b15cb3dSCy Schubert_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
1462b15cb3dSCy Schubert])# win32-dll
1472b15cb3dSCy Schubert
1482b15cb3dSCy SchubertAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
1492b15cb3dSCy Schubert[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1502b15cb3dSCy Schubert_LT_SET_OPTION([LT_INIT], [win32-dll])
1512b15cb3dSCy SchubertAC_DIAGNOSE([obsolete],
1522b15cb3dSCy Schubert[$0: Remove this warning and the call to _LT_SET_OPTION when you
153*f0574f5cSXin LIput the 'win32-dll' option into LT_INIT's first parameter.])
1542b15cb3dSCy Schubert])
1552b15cb3dSCy Schubert
1562b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
1572b15cb3dSCy Schubertdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
1582b15cb3dSCy Schubert
1592b15cb3dSCy Schubert
1602b15cb3dSCy Schubert# _LT_ENABLE_SHARED([DEFAULT])
1612b15cb3dSCy Schubert# ----------------------------
162*f0574f5cSXin LI# implement the --enable-shared flag, and supports the 'shared' and
163*f0574f5cSXin LI# 'disable-shared' LT_INIT options.
164*f0574f5cSXin LI# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
1652b15cb3dSCy Schubertm4_define([_LT_ENABLE_SHARED],
1662b15cb3dSCy Schubert[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
1672b15cb3dSCy SchubertAC_ARG_ENABLE([shared],
1682b15cb3dSCy Schubert    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1692b15cb3dSCy Schubert	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
1702b15cb3dSCy Schubert    [p=${PACKAGE-default}
1712b15cb3dSCy Schubert    case $enableval in
1722b15cb3dSCy Schubert    yes) enable_shared=yes ;;
1732b15cb3dSCy Schubert    no) enable_shared=no ;;
1742b15cb3dSCy Schubert    *)
1752b15cb3dSCy Schubert      enable_shared=no
1762b15cb3dSCy Schubert      # Look at the argument we got.  We use all the common list separators.
177*f0574f5cSXin LI      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
1782b15cb3dSCy Schubert      for pkg in $enableval; do
179*f0574f5cSXin LI	IFS=$lt_save_ifs
1802b15cb3dSCy Schubert	if test "X$pkg" = "X$p"; then
1812b15cb3dSCy Schubert	  enable_shared=yes
1822b15cb3dSCy Schubert	fi
1832b15cb3dSCy Schubert      done
184*f0574f5cSXin LI      IFS=$lt_save_ifs
1852b15cb3dSCy Schubert      ;;
1862b15cb3dSCy Schubert    esac],
1872b15cb3dSCy Schubert    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
1882b15cb3dSCy Schubert
1892b15cb3dSCy Schubert    _LT_DECL([build_libtool_libs], [enable_shared], [0],
1902b15cb3dSCy Schubert	[Whether or not to build shared libraries])
1912b15cb3dSCy Schubert])# _LT_ENABLE_SHARED
1922b15cb3dSCy Schubert
1932b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
1942b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
1952b15cb3dSCy Schubert
1962b15cb3dSCy Schubert# Old names:
1972b15cb3dSCy SchubertAC_DEFUN([AC_ENABLE_SHARED],
1982b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
1992b15cb3dSCy Schubert])
2002b15cb3dSCy Schubert
2012b15cb3dSCy SchubertAC_DEFUN([AC_DISABLE_SHARED],
2022b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], [disable-shared])
2032b15cb3dSCy Schubert])
2042b15cb3dSCy Schubert
2052b15cb3dSCy SchubertAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
2062b15cb3dSCy SchubertAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
2072b15cb3dSCy Schubert
2082b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
2092b15cb3dSCy Schubertdnl AC_DEFUN([AM_ENABLE_SHARED], [])
2102b15cb3dSCy Schubertdnl AC_DEFUN([AM_DISABLE_SHARED], [])
2112b15cb3dSCy Schubert
2122b15cb3dSCy Schubert
2132b15cb3dSCy Schubert
2142b15cb3dSCy Schubert# _LT_ENABLE_STATIC([DEFAULT])
2152b15cb3dSCy Schubert# ----------------------------
216*f0574f5cSXin LI# implement the --enable-static flag, and support the 'static' and
217*f0574f5cSXin LI# 'disable-static' LT_INIT options.
218*f0574f5cSXin LI# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2192b15cb3dSCy Schubertm4_define([_LT_ENABLE_STATIC],
2202b15cb3dSCy Schubert[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
2212b15cb3dSCy SchubertAC_ARG_ENABLE([static],
2222b15cb3dSCy Schubert    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2232b15cb3dSCy Schubert	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
2242b15cb3dSCy Schubert    [p=${PACKAGE-default}
2252b15cb3dSCy Schubert    case $enableval in
2262b15cb3dSCy Schubert    yes) enable_static=yes ;;
2272b15cb3dSCy Schubert    no) enable_static=no ;;
2282b15cb3dSCy Schubert    *)
2292b15cb3dSCy Schubert     enable_static=no
2302b15cb3dSCy Schubert      # Look at the argument we got.  We use all the common list separators.
231*f0574f5cSXin LI      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2322b15cb3dSCy Schubert      for pkg in $enableval; do
233*f0574f5cSXin LI	IFS=$lt_save_ifs
2342b15cb3dSCy Schubert	if test "X$pkg" = "X$p"; then
2352b15cb3dSCy Schubert	  enable_static=yes
2362b15cb3dSCy Schubert	fi
2372b15cb3dSCy Schubert      done
238*f0574f5cSXin LI      IFS=$lt_save_ifs
2392b15cb3dSCy Schubert      ;;
2402b15cb3dSCy Schubert    esac],
2412b15cb3dSCy Schubert    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
2422b15cb3dSCy Schubert
2432b15cb3dSCy Schubert    _LT_DECL([build_old_libs], [enable_static], [0],
2442b15cb3dSCy Schubert	[Whether or not to build static libraries])
2452b15cb3dSCy Schubert])# _LT_ENABLE_STATIC
2462b15cb3dSCy Schubert
2472b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
2482b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
2492b15cb3dSCy Schubert
2502b15cb3dSCy Schubert# Old names:
2512b15cb3dSCy SchubertAC_DEFUN([AC_ENABLE_STATIC],
2522b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
2532b15cb3dSCy Schubert])
2542b15cb3dSCy Schubert
2552b15cb3dSCy SchubertAC_DEFUN([AC_DISABLE_STATIC],
2562b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], [disable-static])
2572b15cb3dSCy Schubert])
2582b15cb3dSCy Schubert
2592b15cb3dSCy SchubertAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
2602b15cb3dSCy SchubertAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
2612b15cb3dSCy Schubert
2622b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
2632b15cb3dSCy Schubertdnl AC_DEFUN([AM_ENABLE_STATIC], [])
2642b15cb3dSCy Schubertdnl AC_DEFUN([AM_DISABLE_STATIC], [])
2652b15cb3dSCy Schubert
2662b15cb3dSCy Schubert
2672b15cb3dSCy Schubert
2682b15cb3dSCy Schubert# _LT_ENABLE_FAST_INSTALL([DEFAULT])
2692b15cb3dSCy Schubert# ----------------------------------
270*f0574f5cSXin LI# implement the --enable-fast-install flag, and support the 'fast-install'
271*f0574f5cSXin LI# and 'disable-fast-install' LT_INIT options.
272*f0574f5cSXin LI# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
2732b15cb3dSCy Schubertm4_define([_LT_ENABLE_FAST_INSTALL],
2742b15cb3dSCy Schubert[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
2752b15cb3dSCy SchubertAC_ARG_ENABLE([fast-install],
2762b15cb3dSCy Schubert    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2772b15cb3dSCy Schubert    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2782b15cb3dSCy Schubert    [p=${PACKAGE-default}
2792b15cb3dSCy Schubert    case $enableval in
2802b15cb3dSCy Schubert    yes) enable_fast_install=yes ;;
2812b15cb3dSCy Schubert    no) enable_fast_install=no ;;
2822b15cb3dSCy Schubert    *)
2832b15cb3dSCy Schubert      enable_fast_install=no
2842b15cb3dSCy Schubert      # Look at the argument we got.  We use all the common list separators.
285*f0574f5cSXin LI      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
2862b15cb3dSCy Schubert      for pkg in $enableval; do
287*f0574f5cSXin LI	IFS=$lt_save_ifs
2882b15cb3dSCy Schubert	if test "X$pkg" = "X$p"; then
2892b15cb3dSCy Schubert	  enable_fast_install=yes
2902b15cb3dSCy Schubert	fi
2912b15cb3dSCy Schubert      done
292*f0574f5cSXin LI      IFS=$lt_save_ifs
2932b15cb3dSCy Schubert      ;;
2942b15cb3dSCy Schubert    esac],
2952b15cb3dSCy Schubert    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
2962b15cb3dSCy Schubert
2972b15cb3dSCy Schubert_LT_DECL([fast_install], [enable_fast_install], [0],
2982b15cb3dSCy Schubert	 [Whether or not to optimize for fast installation])dnl
2992b15cb3dSCy Schubert])# _LT_ENABLE_FAST_INSTALL
3002b15cb3dSCy Schubert
3012b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
3022b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
3032b15cb3dSCy Schubert
3042b15cb3dSCy Schubert# Old names:
3052b15cb3dSCy SchubertAU_DEFUN([AC_ENABLE_FAST_INSTALL],
3062b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
3072b15cb3dSCy SchubertAC_DIAGNOSE([obsolete],
3082b15cb3dSCy Schubert[$0: Remove this warning and the call to _LT_SET_OPTION when you put
309*f0574f5cSXin LIthe 'fast-install' option into LT_INIT's first parameter.])
3102b15cb3dSCy Schubert])
3112b15cb3dSCy Schubert
3122b15cb3dSCy SchubertAU_DEFUN([AC_DISABLE_FAST_INSTALL],
3132b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
3142b15cb3dSCy SchubertAC_DIAGNOSE([obsolete],
3152b15cb3dSCy Schubert[$0: Remove this warning and the call to _LT_SET_OPTION when you put
316*f0574f5cSXin LIthe 'disable-fast-install' option into LT_INIT's first parameter.])
3172b15cb3dSCy Schubert])
3182b15cb3dSCy Schubert
3192b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
3202b15cb3dSCy Schubertdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
3212b15cb3dSCy Schubertdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
3222b15cb3dSCy Schubert
3232b15cb3dSCy Schubert
324*f0574f5cSXin LI# _LT_WITH_AIX_SONAME([DEFAULT])
325*f0574f5cSXin LI# ----------------------------------
326*f0574f5cSXin LI# implement the --with-aix-soname flag, and support the `aix-soname=aix'
327*f0574f5cSXin LI# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
328*f0574f5cSXin LI# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
329*f0574f5cSXin LIm4_define([_LT_WITH_AIX_SONAME],
330*f0574f5cSXin LI[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
331*f0574f5cSXin LIshared_archive_member_spec=
332*f0574f5cSXin LIcase $host,$enable_shared in
333*f0574f5cSXin LIpower*-*-aix[[5-9]]*,yes)
334*f0574f5cSXin LI  AC_MSG_CHECKING([which variant of shared library versioning to provide])
335*f0574f5cSXin LI  AC_ARG_WITH([aix-soname],
336*f0574f5cSXin LI    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
337*f0574f5cSXin LI      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
338*f0574f5cSXin LI    [case $withval in
339*f0574f5cSXin LI    aix|svr4|both)
340*f0574f5cSXin LI      ;;
341*f0574f5cSXin LI    *)
342*f0574f5cSXin LI      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
343*f0574f5cSXin LI      ;;
344*f0574f5cSXin LI    esac
345*f0574f5cSXin LI    lt_cv_with_aix_soname=$with_aix_soname],
346*f0574f5cSXin LI    [AC_CACHE_VAL([lt_cv_with_aix_soname],
347*f0574f5cSXin LI      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
348*f0574f5cSXin LI    with_aix_soname=$lt_cv_with_aix_soname])
349*f0574f5cSXin LI  AC_MSG_RESULT([$with_aix_soname])
350*f0574f5cSXin LI  if test aix != "$with_aix_soname"; then
351*f0574f5cSXin LI    # For the AIX way of multilib, we name the shared archive member
352*f0574f5cSXin LI    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
353*f0574f5cSXin LI    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
354*f0574f5cSXin LI    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
355*f0574f5cSXin LI    # the AIX toolchain works better with OBJECT_MODE set (default 32).
356*f0574f5cSXin LI    if test 64 = "${OBJECT_MODE-32}"; then
357*f0574f5cSXin LI      shared_archive_member_spec=shr_64
358*f0574f5cSXin LI    else
359*f0574f5cSXin LI      shared_archive_member_spec=shr
360*f0574f5cSXin LI    fi
361*f0574f5cSXin LI  fi
362*f0574f5cSXin LI  ;;
363*f0574f5cSXin LI*)
364*f0574f5cSXin LI  with_aix_soname=aix
365*f0574f5cSXin LI  ;;
366*f0574f5cSXin LIesac
367*f0574f5cSXin LI
368*f0574f5cSXin LI_LT_DECL([], [shared_archive_member_spec], [0],
369*f0574f5cSXin LI    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
370*f0574f5cSXin LI])# _LT_WITH_AIX_SONAME
371*f0574f5cSXin LI
372*f0574f5cSXin LILT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
373*f0574f5cSXin LILT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
374*f0574f5cSXin LILT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
375*f0574f5cSXin LI
376*f0574f5cSXin LI
3772b15cb3dSCy Schubert# _LT_WITH_PIC([MODE])
3782b15cb3dSCy Schubert# --------------------
379*f0574f5cSXin LI# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
3802b15cb3dSCy Schubert# LT_INIT options.
381*f0574f5cSXin LI# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
3822b15cb3dSCy Schubertm4_define([_LT_WITH_PIC],
3832b15cb3dSCy Schubert[AC_ARG_WITH([pic],
384*f0574f5cSXin LI    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
3852b15cb3dSCy Schubert	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
386*f0574f5cSXin LI    [lt_p=${PACKAGE-default}
387*f0574f5cSXin LI    case $withval in
388*f0574f5cSXin LI    yes|no) pic_mode=$withval ;;
389*f0574f5cSXin LI    *)
390*f0574f5cSXin LI      pic_mode=default
391*f0574f5cSXin LI      # Look at the argument we got.  We use all the common list separators.
392*f0574f5cSXin LI      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
393*f0574f5cSXin LI      for lt_pkg in $withval; do
394*f0574f5cSXin LI	IFS=$lt_save_ifs
395*f0574f5cSXin LI	if test "X$lt_pkg" = "X$lt_p"; then
396*f0574f5cSXin LI	  pic_mode=yes
397*f0574f5cSXin LI	fi
398*f0574f5cSXin LI      done
399*f0574f5cSXin LI      IFS=$lt_save_ifs
400*f0574f5cSXin LI      ;;
401*f0574f5cSXin LI    esac],
402*f0574f5cSXin LI    [pic_mode=m4_default([$1], [default])])
4032b15cb3dSCy Schubert
4042b15cb3dSCy Schubert_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
4052b15cb3dSCy Schubert])# _LT_WITH_PIC
4062b15cb3dSCy Schubert
4072b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
4082b15cb3dSCy SchubertLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
4092b15cb3dSCy Schubert
4102b15cb3dSCy Schubert# Old name:
4112b15cb3dSCy SchubertAU_DEFUN([AC_LIBTOOL_PICMODE],
4122b15cb3dSCy Schubert[_LT_SET_OPTION([LT_INIT], [pic-only])
4132b15cb3dSCy SchubertAC_DIAGNOSE([obsolete],
4142b15cb3dSCy Schubert[$0: Remove this warning and the call to _LT_SET_OPTION when you
415*f0574f5cSXin LIput the 'pic-only' option into LT_INIT's first parameter.])
4162b15cb3dSCy Schubert])
4172b15cb3dSCy Schubert
4182b15cb3dSCy Schubertdnl aclocal-1.4 backwards compatibility:
4192b15cb3dSCy Schubertdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
4202b15cb3dSCy Schubert
4212b15cb3dSCy Schubert## ----------------- ##
4222b15cb3dSCy Schubert## LTDL_INIT Options ##
4232b15cb3dSCy Schubert## ----------------- ##
4242b15cb3dSCy Schubert
4252b15cb3dSCy Schubertm4_define([_LTDL_MODE], [])
4262b15cb3dSCy SchubertLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
4272b15cb3dSCy Schubert		 [m4_define([_LTDL_MODE], [nonrecursive])])
4282b15cb3dSCy SchubertLT_OPTION_DEFINE([LTDL_INIT], [recursive],
4292b15cb3dSCy Schubert		 [m4_define([_LTDL_MODE], [recursive])])
4302b15cb3dSCy SchubertLT_OPTION_DEFINE([LTDL_INIT], [subproject],
4312b15cb3dSCy Schubert		 [m4_define([_LTDL_MODE], [subproject])])
4322b15cb3dSCy Schubert
4332b15cb3dSCy Schubertm4_define([_LTDL_TYPE], [])
4342b15cb3dSCy SchubertLT_OPTION_DEFINE([LTDL_INIT], [installable],
4352b15cb3dSCy Schubert		 [m4_define([_LTDL_TYPE], [installable])])
4362b15cb3dSCy SchubertLT_OPTION_DEFINE([LTDL_INIT], [convenience],
4372b15cb3dSCy Schubert		 [m4_define([_LTDL_TYPE], [convenience])])
438