1c43e99fdSEd Maste# Helper functions for option handling. -*- Autoconf -*- 2c43e99fdSEd Maste# 3*b50261e2SCy Schubert# Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software 4c43e99fdSEd Maste# Foundation, Inc. 5c43e99fdSEd Maste# Written by Gary V. Vaughan, 2004 6c43e99fdSEd Maste# 7c43e99fdSEd Maste# This file is free software; the Free Software Foundation gives 8c43e99fdSEd Maste# unlimited permission to copy and/or distribute it, with or without 9c43e99fdSEd Maste# modifications, as long as this notice is preserved. 10c43e99fdSEd Maste 11c43e99fdSEd Maste# serial 8 ltoptions.m4 12c43e99fdSEd Maste 13c43e99fdSEd Maste# This is to help aclocal find these macros, as it can't see m4_define. 14c43e99fdSEd MasteAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) 15c43e99fdSEd Maste 16c43e99fdSEd Maste 17c43e99fdSEd Maste# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) 18c43e99fdSEd Maste# ------------------------------------------ 19c43e99fdSEd Mastem4_define([_LT_MANGLE_OPTION], 20c43e99fdSEd Maste[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) 21c43e99fdSEd Maste 22c43e99fdSEd Maste 23c43e99fdSEd Maste# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) 24c43e99fdSEd Maste# --------------------------------------- 25c43e99fdSEd Maste# Set option OPTION-NAME for macro MACRO-NAME, and if there is a 26c43e99fdSEd Maste# matching handler defined, dispatch to it. Other OPTION-NAMEs are 27c43e99fdSEd Maste# saved as a flag. 28c43e99fdSEd Mastem4_define([_LT_SET_OPTION], 29c43e99fdSEd Maste[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl 30c43e99fdSEd Mastem4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), 31c43e99fdSEd Maste _LT_MANGLE_DEFUN([$1], [$2]), 32c43e99fdSEd Maste [m4_warning([Unknown $1 option '$2'])])[]dnl 33c43e99fdSEd Maste]) 34c43e99fdSEd Maste 35c43e99fdSEd Maste 36c43e99fdSEd Maste# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) 37c43e99fdSEd Maste# ------------------------------------------------------------ 38c43e99fdSEd Maste# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 39c43e99fdSEd Mastem4_define([_LT_IF_OPTION], 40c43e99fdSEd Maste[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) 41c43e99fdSEd Maste 42c43e99fdSEd Maste 43c43e99fdSEd Maste# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) 44c43e99fdSEd Maste# ------------------------------------------------------- 45c43e99fdSEd Maste# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME 46c43e99fdSEd Maste# are set. 47c43e99fdSEd Mastem4_define([_LT_UNLESS_OPTIONS], 48c43e99fdSEd Maste[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 49c43e99fdSEd Maste [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), 50c43e99fdSEd Maste [m4_define([$0_found])])])[]dnl 51c43e99fdSEd Mastem4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 52c43e99fdSEd Maste])[]dnl 53c43e99fdSEd Maste]) 54c43e99fdSEd Maste 55c43e99fdSEd Maste 56c43e99fdSEd Maste# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) 57c43e99fdSEd Maste# ---------------------------------------- 58c43e99fdSEd Maste# OPTION-LIST is a space-separated list of Libtool options associated 59c43e99fdSEd Maste# with MACRO-NAME. If any OPTION has a matching handler declared with 60c43e99fdSEd Maste# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about 61c43e99fdSEd Maste# the unknown option and exit. 62c43e99fdSEd Mastem4_defun([_LT_SET_OPTIONS], 63c43e99fdSEd Maste[# Set options 64c43e99fdSEd Mastem4_foreach([_LT_Option], m4_split(m4_normalize([$2])), 65c43e99fdSEd Maste [_LT_SET_OPTION([$1], _LT_Option)]) 66c43e99fdSEd Maste 67c43e99fdSEd Mastem4_if([$1],[LT_INIT],[ 68c43e99fdSEd Maste dnl 69c43e99fdSEd Maste dnl Simply set some default values (i.e off) if boolean options were not 70c43e99fdSEd Maste dnl specified: 71c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no 72c43e99fdSEd Maste ]) 73c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no 74c43e99fdSEd Maste ]) 75c43e99fdSEd Maste dnl 76c43e99fdSEd Maste dnl If no reference was made to various pairs of opposing options, then 77c43e99fdSEd Maste dnl we run the default mode handler for the pair. For example, if neither 78c43e99fdSEd Maste dnl 'shared' nor 'disable-shared' was passed, we enable building of shared 79c43e99fdSEd Maste dnl archives by default: 80c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) 81c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) 82c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) 83c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], 84c43e99fdSEd Maste [_LT_ENABLE_FAST_INSTALL]) 85c43e99fdSEd Maste _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], 86c43e99fdSEd Maste [_LT_WITH_AIX_SONAME([aix])]) 87c43e99fdSEd Maste ]) 88c43e99fdSEd Maste])# _LT_SET_OPTIONS 89c43e99fdSEd Maste 90c43e99fdSEd Maste 91c43e99fdSEd Maste## --------------------------------- ## 92c43e99fdSEd Maste## Macros to handle LT_INIT options. ## 93c43e99fdSEd Maste## --------------------------------- ## 94c43e99fdSEd Maste 95c43e99fdSEd Maste# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) 96c43e99fdSEd Maste# ----------------------------------------- 97c43e99fdSEd Mastem4_define([_LT_MANGLE_DEFUN], 98c43e99fdSEd Maste[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) 99c43e99fdSEd Maste 100c43e99fdSEd Maste 101c43e99fdSEd Maste# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) 102c43e99fdSEd Maste# ----------------------------------------------- 103c43e99fdSEd Mastem4_define([LT_OPTION_DEFINE], 104c43e99fdSEd Maste[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl 105c43e99fdSEd Maste])# LT_OPTION_DEFINE 106c43e99fdSEd Maste 107c43e99fdSEd Maste 108c43e99fdSEd Maste# dlopen 109c43e99fdSEd Maste# ------ 110c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes 111c43e99fdSEd Maste]) 112c43e99fdSEd Maste 113c43e99fdSEd MasteAU_DEFUN([AC_LIBTOOL_DLOPEN], 114c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], [dlopen]) 115c43e99fdSEd MasteAC_DIAGNOSE([obsolete], 116c43e99fdSEd Maste[$0: Remove this warning and the call to _LT_SET_OPTION when you 117c43e99fdSEd Masteput the 'dlopen' option into LT_INIT's first parameter.]) 118c43e99fdSEd Maste]) 119c43e99fdSEd Maste 120c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 121c43e99fdSEd Mastednl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) 122c43e99fdSEd Maste 123c43e99fdSEd Maste 124c43e99fdSEd Maste# win32-dll 125c43e99fdSEd Maste# --------- 126c43e99fdSEd Maste# Declare package support for building win32 dll's. 127c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [win32-dll], 128c43e99fdSEd Maste[enable_win32_dll=yes 129c43e99fdSEd Maste 130c43e99fdSEd Mastecase $host in 131c43e99fdSEd Maste*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) 132c43e99fdSEd Maste AC_CHECK_TOOL(AS, as, false) 133c43e99fdSEd Maste AC_CHECK_TOOL(DLLTOOL, dlltool, false) 134c43e99fdSEd Maste AC_CHECK_TOOL(OBJDUMP, objdump, false) 135c43e99fdSEd Maste ;; 136c43e99fdSEd Masteesac 137c43e99fdSEd Maste 138c43e99fdSEd Mastetest -z "$AS" && AS=as 139c43e99fdSEd Maste_LT_DECL([], [AS], [1], [Assembler program])dnl 140c43e99fdSEd Maste 141c43e99fdSEd Mastetest -z "$DLLTOOL" && DLLTOOL=dlltool 142c43e99fdSEd Maste_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl 143c43e99fdSEd Maste 144c43e99fdSEd Mastetest -z "$OBJDUMP" && OBJDUMP=objdump 145c43e99fdSEd Maste_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl 146c43e99fdSEd Maste])# win32-dll 147c43e99fdSEd Maste 148c43e99fdSEd MasteAU_DEFUN([AC_LIBTOOL_WIN32_DLL], 149c43e99fdSEd Maste[AC_REQUIRE([AC_CANONICAL_HOST])dnl 150c43e99fdSEd Maste_LT_SET_OPTION([LT_INIT], [win32-dll]) 151c43e99fdSEd MasteAC_DIAGNOSE([obsolete], 152c43e99fdSEd Maste[$0: Remove this warning and the call to _LT_SET_OPTION when you 153c43e99fdSEd Masteput the 'win32-dll' option into LT_INIT's first parameter.]) 154c43e99fdSEd Maste]) 155c43e99fdSEd Maste 156c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 157c43e99fdSEd Mastednl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) 158c43e99fdSEd Maste 159c43e99fdSEd Maste 160c43e99fdSEd Maste# _LT_ENABLE_SHARED([DEFAULT]) 161c43e99fdSEd Maste# ---------------------------- 162c43e99fdSEd Maste# implement the --enable-shared flag, and supports the 'shared' and 163c43e99fdSEd Maste# 'disable-shared' LT_INIT options. 164c43e99fdSEd Maste# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. 165c43e99fdSEd Mastem4_define([_LT_ENABLE_SHARED], 166c43e99fdSEd Maste[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl 167c43e99fdSEd MasteAC_ARG_ENABLE([shared], 168c43e99fdSEd Maste [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], 169c43e99fdSEd Maste [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], 170c43e99fdSEd Maste [p=${PACKAGE-default} 171c43e99fdSEd Maste case $enableval in 172c43e99fdSEd Maste yes) enable_shared=yes ;; 173c43e99fdSEd Maste no) enable_shared=no ;; 174c43e99fdSEd Maste *) 175c43e99fdSEd Maste enable_shared=no 176c43e99fdSEd Maste # Look at the argument we got. We use all the common list separators. 177c43e99fdSEd Maste lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, 178c43e99fdSEd Maste for pkg in $enableval; do 179c43e99fdSEd Maste IFS=$lt_save_ifs 180c43e99fdSEd Maste if test "X$pkg" = "X$p"; then 181c43e99fdSEd Maste enable_shared=yes 182c43e99fdSEd Maste fi 183c43e99fdSEd Maste done 184c43e99fdSEd Maste IFS=$lt_save_ifs 185c43e99fdSEd Maste ;; 186c43e99fdSEd Maste esac], 187c43e99fdSEd Maste [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) 188c43e99fdSEd Maste 189c43e99fdSEd Maste _LT_DECL([build_libtool_libs], [enable_shared], [0], 190c43e99fdSEd Maste [Whether or not to build shared libraries]) 191c43e99fdSEd Maste])# _LT_ENABLE_SHARED 192c43e99fdSEd Maste 193c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) 194c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) 195c43e99fdSEd Maste 196c43e99fdSEd Maste# Old names: 197c43e99fdSEd MasteAC_DEFUN([AC_ENABLE_SHARED], 198c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) 199c43e99fdSEd Maste]) 200c43e99fdSEd Maste 201c43e99fdSEd MasteAC_DEFUN([AC_DISABLE_SHARED], 202c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], [disable-shared]) 203c43e99fdSEd Maste]) 204c43e99fdSEd Maste 205c43e99fdSEd MasteAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) 206c43e99fdSEd MasteAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) 207c43e99fdSEd Maste 208c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 209c43e99fdSEd Mastednl AC_DEFUN([AM_ENABLE_SHARED], []) 210c43e99fdSEd Mastednl AC_DEFUN([AM_DISABLE_SHARED], []) 211c43e99fdSEd Maste 212c43e99fdSEd Maste 213c43e99fdSEd Maste 214c43e99fdSEd Maste# _LT_ENABLE_STATIC([DEFAULT]) 215c43e99fdSEd Maste# ---------------------------- 216c43e99fdSEd Maste# implement the --enable-static flag, and support the 'static' and 217c43e99fdSEd Maste# 'disable-static' LT_INIT options. 218c43e99fdSEd Maste# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. 219c43e99fdSEd Mastem4_define([_LT_ENABLE_STATIC], 220c43e99fdSEd Maste[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl 221c43e99fdSEd MasteAC_ARG_ENABLE([static], 222c43e99fdSEd Maste [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], 223c43e99fdSEd Maste [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], 224c43e99fdSEd Maste [p=${PACKAGE-default} 225c43e99fdSEd Maste case $enableval in 226c43e99fdSEd Maste yes) enable_static=yes ;; 227c43e99fdSEd Maste no) enable_static=no ;; 228c43e99fdSEd Maste *) 229c43e99fdSEd Maste enable_static=no 230c43e99fdSEd Maste # Look at the argument we got. We use all the common list separators. 231c43e99fdSEd Maste lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, 232c43e99fdSEd Maste for pkg in $enableval; do 233c43e99fdSEd Maste IFS=$lt_save_ifs 234c43e99fdSEd Maste if test "X$pkg" = "X$p"; then 235c43e99fdSEd Maste enable_static=yes 236c43e99fdSEd Maste fi 237c43e99fdSEd Maste done 238c43e99fdSEd Maste IFS=$lt_save_ifs 239c43e99fdSEd Maste ;; 240c43e99fdSEd Maste esac], 241c43e99fdSEd Maste [enable_static=]_LT_ENABLE_STATIC_DEFAULT) 242c43e99fdSEd Maste 243c43e99fdSEd Maste _LT_DECL([build_old_libs], [enable_static], [0], 244c43e99fdSEd Maste [Whether or not to build static libraries]) 245c43e99fdSEd Maste])# _LT_ENABLE_STATIC 246c43e99fdSEd Maste 247c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) 248c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) 249c43e99fdSEd Maste 250c43e99fdSEd Maste# Old names: 251c43e99fdSEd MasteAC_DEFUN([AC_ENABLE_STATIC], 252c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) 253c43e99fdSEd Maste]) 254c43e99fdSEd Maste 255c43e99fdSEd MasteAC_DEFUN([AC_DISABLE_STATIC], 256c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], [disable-static]) 257c43e99fdSEd Maste]) 258c43e99fdSEd Maste 259c43e99fdSEd MasteAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) 260c43e99fdSEd MasteAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) 261c43e99fdSEd Maste 262c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 263c43e99fdSEd Mastednl AC_DEFUN([AM_ENABLE_STATIC], []) 264c43e99fdSEd Mastednl AC_DEFUN([AM_DISABLE_STATIC], []) 265c43e99fdSEd Maste 266c43e99fdSEd Maste 267c43e99fdSEd Maste 268c43e99fdSEd Maste# _LT_ENABLE_FAST_INSTALL([DEFAULT]) 269c43e99fdSEd Maste# ---------------------------------- 270c43e99fdSEd Maste# implement the --enable-fast-install flag, and support the 'fast-install' 271c43e99fdSEd Maste# and 'disable-fast-install' LT_INIT options. 272c43e99fdSEd Maste# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. 273c43e99fdSEd Mastem4_define([_LT_ENABLE_FAST_INSTALL], 274c43e99fdSEd Maste[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl 275c43e99fdSEd MasteAC_ARG_ENABLE([fast-install], 276c43e99fdSEd Maste [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], 277c43e99fdSEd Maste [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], 278c43e99fdSEd Maste [p=${PACKAGE-default} 279c43e99fdSEd Maste case $enableval in 280c43e99fdSEd Maste yes) enable_fast_install=yes ;; 281c43e99fdSEd Maste no) enable_fast_install=no ;; 282c43e99fdSEd Maste *) 283c43e99fdSEd Maste enable_fast_install=no 284c43e99fdSEd Maste # Look at the argument we got. We use all the common list separators. 285c43e99fdSEd Maste lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, 286c43e99fdSEd Maste for pkg in $enableval; do 287c43e99fdSEd Maste IFS=$lt_save_ifs 288c43e99fdSEd Maste if test "X$pkg" = "X$p"; then 289c43e99fdSEd Maste enable_fast_install=yes 290c43e99fdSEd Maste fi 291c43e99fdSEd Maste done 292c43e99fdSEd Maste IFS=$lt_save_ifs 293c43e99fdSEd Maste ;; 294c43e99fdSEd Maste esac], 295c43e99fdSEd Maste [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) 296c43e99fdSEd Maste 297c43e99fdSEd Maste_LT_DECL([fast_install], [enable_fast_install], [0], 298c43e99fdSEd Maste [Whether or not to optimize for fast installation])dnl 299c43e99fdSEd Maste])# _LT_ENABLE_FAST_INSTALL 300c43e99fdSEd Maste 301c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) 302c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) 303c43e99fdSEd Maste 304c43e99fdSEd Maste# Old names: 305c43e99fdSEd MasteAU_DEFUN([AC_ENABLE_FAST_INSTALL], 306c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) 307c43e99fdSEd MasteAC_DIAGNOSE([obsolete], 308c43e99fdSEd Maste[$0: Remove this warning and the call to _LT_SET_OPTION when you put 309c43e99fdSEd Mastethe 'fast-install' option into LT_INIT's first parameter.]) 310c43e99fdSEd Maste]) 311c43e99fdSEd Maste 312c43e99fdSEd MasteAU_DEFUN([AC_DISABLE_FAST_INSTALL], 313c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) 314c43e99fdSEd MasteAC_DIAGNOSE([obsolete], 315c43e99fdSEd Maste[$0: Remove this warning and the call to _LT_SET_OPTION when you put 316c43e99fdSEd Mastethe 'disable-fast-install' option into LT_INIT's first parameter.]) 317c43e99fdSEd Maste]) 318c43e99fdSEd Maste 319c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 320c43e99fdSEd Mastednl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) 321c43e99fdSEd Mastednl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) 322c43e99fdSEd Maste 323c43e99fdSEd Maste 324c43e99fdSEd Maste# _LT_WITH_AIX_SONAME([DEFAULT]) 325c43e99fdSEd Maste# ---------------------------------- 326c43e99fdSEd Maste# implement the --with-aix-soname flag, and support the `aix-soname=aix' 327c43e99fdSEd Maste# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT 328c43e99fdSEd Maste# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. 329c43e99fdSEd Mastem4_define([_LT_WITH_AIX_SONAME], 330c43e99fdSEd Maste[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl 331c43e99fdSEd Masteshared_archive_member_spec= 332c43e99fdSEd Mastecase $host,$enable_shared in 333c43e99fdSEd Mastepower*-*-aix[[5-9]]*,yes) 334c43e99fdSEd Maste AC_MSG_CHECKING([which variant of shared library versioning to provide]) 335c43e99fdSEd Maste AC_ARG_WITH([aix-soname], 336c43e99fdSEd Maste [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], 337c43e99fdSEd Maste [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], 338c43e99fdSEd Maste [case $withval in 339c43e99fdSEd Maste aix|svr4|both) 340c43e99fdSEd Maste ;; 341c43e99fdSEd Maste *) 342c43e99fdSEd Maste AC_MSG_ERROR([Unknown argument to --with-aix-soname]) 343c43e99fdSEd Maste ;; 344c43e99fdSEd Maste esac 345c43e99fdSEd Maste lt_cv_with_aix_soname=$with_aix_soname], 346c43e99fdSEd Maste [AC_CACHE_VAL([lt_cv_with_aix_soname], 347c43e99fdSEd Maste [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) 348c43e99fdSEd Maste with_aix_soname=$lt_cv_with_aix_soname]) 349c43e99fdSEd Maste AC_MSG_RESULT([$with_aix_soname]) 350c43e99fdSEd Maste if test aix != "$with_aix_soname"; then 351c43e99fdSEd Maste # For the AIX way of multilib, we name the shared archive member 352c43e99fdSEd Maste # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', 353c43e99fdSEd Maste # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. 354c43e99fdSEd Maste # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, 355c43e99fdSEd Maste # the AIX toolchain works better with OBJECT_MODE set (default 32). 356c43e99fdSEd Maste if test 64 = "${OBJECT_MODE-32}"; then 357c43e99fdSEd Maste shared_archive_member_spec=shr_64 358c43e99fdSEd Maste else 359c43e99fdSEd Maste shared_archive_member_spec=shr 360c43e99fdSEd Maste fi 361c43e99fdSEd Maste fi 362c43e99fdSEd Maste ;; 363c43e99fdSEd Maste*) 364c43e99fdSEd Maste with_aix_soname=aix 365c43e99fdSEd Maste ;; 366c43e99fdSEd Masteesac 367c43e99fdSEd Maste 368c43e99fdSEd Maste_LT_DECL([], [shared_archive_member_spec], [0], 369c43e99fdSEd Maste [Shared archive member basename, for filename based shared library versioning on AIX])dnl 370c43e99fdSEd Maste])# _LT_WITH_AIX_SONAME 371c43e99fdSEd Maste 372c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) 373c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) 374c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) 375c43e99fdSEd Maste 376c43e99fdSEd Maste 377c43e99fdSEd Maste# _LT_WITH_PIC([MODE]) 378c43e99fdSEd Maste# -------------------- 379c43e99fdSEd Maste# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' 380c43e99fdSEd Maste# LT_INIT options. 381c43e99fdSEd Maste# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. 382c43e99fdSEd Mastem4_define([_LT_WITH_PIC], 383c43e99fdSEd Maste[AC_ARG_WITH([pic], 384c43e99fdSEd Maste [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], 385c43e99fdSEd Maste [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], 386c43e99fdSEd Maste [lt_p=${PACKAGE-default} 387c43e99fdSEd Maste case $withval in 388c43e99fdSEd Maste yes|no) pic_mode=$withval ;; 389c43e99fdSEd Maste *) 390c43e99fdSEd Maste pic_mode=default 391c43e99fdSEd Maste # Look at the argument we got. We use all the common list separators. 392c43e99fdSEd Maste lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, 393c43e99fdSEd Maste for lt_pkg in $withval; do 394c43e99fdSEd Maste IFS=$lt_save_ifs 395c43e99fdSEd Maste if test "X$lt_pkg" = "X$lt_p"; then 396c43e99fdSEd Maste pic_mode=yes 397c43e99fdSEd Maste fi 398c43e99fdSEd Maste done 399c43e99fdSEd Maste IFS=$lt_save_ifs 400c43e99fdSEd Maste ;; 401c43e99fdSEd Maste esac], 402c43e99fdSEd Maste [pic_mode=m4_default([$1], [default])]) 403c43e99fdSEd Maste 404c43e99fdSEd Maste_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl 405c43e99fdSEd Maste])# _LT_WITH_PIC 406c43e99fdSEd Maste 407c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) 408c43e99fdSEd MasteLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) 409c43e99fdSEd Maste 410c43e99fdSEd Maste# Old name: 411c43e99fdSEd MasteAU_DEFUN([AC_LIBTOOL_PICMODE], 412c43e99fdSEd Maste[_LT_SET_OPTION([LT_INIT], [pic-only]) 413c43e99fdSEd MasteAC_DIAGNOSE([obsolete], 414c43e99fdSEd Maste[$0: Remove this warning and the call to _LT_SET_OPTION when you 415c43e99fdSEd Masteput the 'pic-only' option into LT_INIT's first parameter.]) 416c43e99fdSEd Maste]) 417c43e99fdSEd Maste 418c43e99fdSEd Mastednl aclocal-1.4 backwards compatibility: 419c43e99fdSEd Mastednl AC_DEFUN([AC_LIBTOOL_PICMODE], []) 420c43e99fdSEd Maste 421c43e99fdSEd Maste## ----------------- ## 422c43e99fdSEd Maste## LTDL_INIT Options ## 423c43e99fdSEd Maste## ----------------- ## 424c43e99fdSEd Maste 425c43e99fdSEd Mastem4_define([_LTDL_MODE], []) 426c43e99fdSEd MasteLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], 427c43e99fdSEd Maste [m4_define([_LTDL_MODE], [nonrecursive])]) 428c43e99fdSEd MasteLT_OPTION_DEFINE([LTDL_INIT], [recursive], 429c43e99fdSEd Maste [m4_define([_LTDL_MODE], [recursive])]) 430c43e99fdSEd MasteLT_OPTION_DEFINE([LTDL_INIT], [subproject], 431c43e99fdSEd Maste [m4_define([_LTDL_MODE], [subproject])]) 432c43e99fdSEd Maste 433c43e99fdSEd Mastem4_define([_LTDL_TYPE], []) 434c43e99fdSEd MasteLT_OPTION_DEFINE([LTDL_INIT], [installable], 435c43e99fdSEd Maste [m4_define([_LTDL_TYPE], [installable])]) 436c43e99fdSEd MasteLT_OPTION_DEFINE([LTDL_INIT], [convenience], 437c43e99fdSEd Maste [m4_define([_LTDL_TYPE], [convenience])]) 438