adamc@1141: # Helper functions for option handling. -*- Autoconf -*- adamc@1141: # adamc@1141: # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. adamc@1141: # Written by Gary V. Vaughan, 2004 adamc@1141: # adamc@1141: # This file is free software; the Free Software Foundation gives adamc@1141: # unlimited permission to copy and/or distribute it, with or without adamc@1141: # modifications, as long as this notice is preserved. adamc@1141: adamc@1141: # serial 6 ltoptions.m4 adamc@1141: adamc@1141: # This is to help aclocal find these macros, as it can't see m4_define. adamc@1141: AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) adamc@1141: adamc@1141: adamc@1141: # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) adamc@1141: # ------------------------------------------ adamc@1141: m4_define([_LT_MANGLE_OPTION], adamc@1141: [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) adamc@1141: adamc@1141: adamc@1141: # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) adamc@1141: # --------------------------------------- adamc@1141: # Set option OPTION-NAME for macro MACRO-NAME, and if there is a adamc@1141: # matching handler defined, dispatch to it. Other OPTION-NAMEs are adamc@1141: # saved as a flag. adamc@1141: m4_define([_LT_SET_OPTION], adamc@1141: [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl adamc@1141: m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), adamc@1141: _LT_MANGLE_DEFUN([$1], [$2]), adamc@1141: [m4_warning([Unknown $1 option `$2'])])[]dnl adamc@1141: ]) adamc@1141: adamc@1141: adamc@1141: # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) adamc@1141: # ------------------------------------------------------------ adamc@1141: # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. adamc@1141: m4_define([_LT_IF_OPTION], adamc@1141: [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) adamc@1141: adamc@1141: adamc@1141: # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) adamc@1141: # ------------------------------------------------------- adamc@1141: # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME adamc@1141: # are set. adamc@1141: m4_define([_LT_UNLESS_OPTIONS], adamc@1141: [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), adamc@1141: [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), adamc@1141: [m4_define([$0_found])])])[]dnl adamc@1141: m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 adamc@1141: ])[]dnl adamc@1141: ]) adamc@1141: adamc@1141: adamc@1141: # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) adamc@1141: # ---------------------------------------- adamc@1141: # OPTION-LIST is a space-separated list of Libtool options associated adamc@1141: # with MACRO-NAME. If any OPTION has a matching handler declared with adamc@1141: # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about adamc@1141: # the unknown option and exit. adamc@1141: m4_defun([_LT_SET_OPTIONS], adamc@1141: [# Set options adamc@1141: m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), adamc@1141: [_LT_SET_OPTION([$1], _LT_Option)]) adamc@1141: adamc@1141: m4_if([$1],[LT_INIT],[ adamc@1141: dnl adamc@1141: dnl Simply set some default values (i.e off) if boolean options were not adamc@1141: dnl specified: adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no adamc@1141: ]) adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no adamc@1141: ]) adamc@1141: dnl adamc@1141: dnl If no reference was made to various pairs of opposing options, then adamc@1141: dnl we run the default mode handler for the pair. For example, if neither adamc@1141: dnl `shared' nor `disable-shared' was passed, we enable building of shared adamc@1141: dnl archives by default: adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) adamc@1141: _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], adamc@1141: [_LT_ENABLE_FAST_INSTALL]) adamc@1141: ]) adamc@1141: ])# _LT_SET_OPTIONS adamc@1141: adamc@1141: adamc@1141: ## --------------------------------- ## adamc@1141: ## Macros to handle LT_INIT options. ## adamc@1141: ## --------------------------------- ## adamc@1141: adamc@1141: # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) adamc@1141: # ----------------------------------------- adamc@1141: m4_define([_LT_MANGLE_DEFUN], adamc@1141: [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) adamc@1141: adamc@1141: adamc@1141: # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) adamc@1141: # ----------------------------------------------- adamc@1141: m4_define([LT_OPTION_DEFINE], adamc@1141: [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl adamc@1141: ])# LT_OPTION_DEFINE adamc@1141: adamc@1141: adamc@1141: # dlopen adamc@1141: # ------ adamc@1141: LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes adamc@1141: ]) adamc@1141: adamc@1141: AU_DEFUN([AC_LIBTOOL_DLOPEN], adamc@1141: [_LT_SET_OPTION([LT_INIT], [dlopen]) adamc@1141: AC_DIAGNOSE([obsolete], adamc@1141: [$0: Remove this warning and the call to _LT_SET_OPTION when you adamc@1141: put the `dlopen' option into LT_INIT's first parameter.]) adamc@1141: ]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) adamc@1141: adamc@1141: adamc@1141: # win32-dll adamc@1141: # --------- adamc@1141: # Declare package support for building win32 dll's. adamc@1141: LT_OPTION_DEFINE([LT_INIT], [win32-dll], adamc@1141: [enable_win32_dll=yes adamc@1141: adamc@1141: case $host in adamc@1141: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) adamc@1141: AC_CHECK_TOOL(AS, as, false) adamc@1141: AC_CHECK_TOOL(DLLTOOL, dlltool, false) adamc@1141: AC_CHECK_TOOL(OBJDUMP, objdump, false) adamc@1141: ;; adamc@1141: esac adamc@1141: adamc@1141: test -z "$AS" && AS=as adamc@1141: _LT_DECL([], [AS], [0], [Assembler program])dnl adamc@1141: adamc@1141: test -z "$DLLTOOL" && DLLTOOL=dlltool adamc@1141: _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl adamc@1141: adamc@1141: test -z "$OBJDUMP" && OBJDUMP=objdump adamc@1141: _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl adamc@1141: ])# win32-dll adamc@1141: adamc@1141: AU_DEFUN([AC_LIBTOOL_WIN32_DLL], adamc@1141: [AC_REQUIRE([AC_CANONICAL_HOST])dnl adamc@1141: _LT_SET_OPTION([LT_INIT], [win32-dll]) adamc@1141: AC_DIAGNOSE([obsolete], adamc@1141: [$0: Remove this warning and the call to _LT_SET_OPTION when you adamc@1141: put the `win32-dll' option into LT_INIT's first parameter.]) adamc@1141: ]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) adamc@1141: adamc@1141: adamc@1141: # _LT_ENABLE_SHARED([DEFAULT]) adamc@1141: # ---------------------------- adamc@1141: # implement the --enable-shared flag, and supports the `shared' and adamc@1141: # `disable-shared' LT_INIT options. adamc@1141: # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. adamc@1141: m4_define([_LT_ENABLE_SHARED], adamc@1141: [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl adamc@1141: AC_ARG_ENABLE([shared], adamc@1141: [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], adamc@1141: [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], adamc@1141: [p=${PACKAGE-default} adamc@1141: case $enableval in adamc@1141: yes) enable_shared=yes ;; adamc@1141: no) enable_shared=no ;; adamc@1141: *) adamc@1141: enable_shared=no adamc@1141: # Look at the argument we got. We use all the common list separators. adamc@1141: lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," adamc@1141: for pkg in $enableval; do adamc@1141: IFS="$lt_save_ifs" adamc@1141: if test "X$pkg" = "X$p"; then adamc@1141: enable_shared=yes adamc@1141: fi adamc@1141: done adamc@1141: IFS="$lt_save_ifs" adamc@1141: ;; adamc@1141: esac], adamc@1141: [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) adamc@1141: adamc@1141: _LT_DECL([build_libtool_libs], [enable_shared], [0], adamc@1141: [Whether or not to build shared libraries]) adamc@1141: ])# _LT_ENABLE_SHARED adamc@1141: adamc@1141: LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) adamc@1141: LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) adamc@1141: adamc@1141: # Old names: adamc@1141: AC_DEFUN([AC_ENABLE_SHARED], adamc@1141: [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) adamc@1141: ]) adamc@1141: adamc@1141: AC_DEFUN([AC_DISABLE_SHARED], adamc@1141: [_LT_SET_OPTION([LT_INIT], [disable-shared]) adamc@1141: ]) adamc@1141: adamc@1141: AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) adamc@1141: AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AM_ENABLE_SHARED], []) adamc@1141: dnl AC_DEFUN([AM_DISABLE_SHARED], []) adamc@1141: adamc@1141: adamc@1141: adamc@1141: # _LT_ENABLE_STATIC([DEFAULT]) adamc@1141: # ---------------------------- adamc@1141: # implement the --enable-static flag, and support the `static' and adamc@1141: # `disable-static' LT_INIT options. adamc@1141: # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. adamc@1141: m4_define([_LT_ENABLE_STATIC], adamc@1141: [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl adamc@1141: AC_ARG_ENABLE([static], adamc@1141: [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], adamc@1141: [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], adamc@1141: [p=${PACKAGE-default} adamc@1141: case $enableval in adamc@1141: yes) enable_static=yes ;; adamc@1141: no) enable_static=no ;; adamc@1141: *) adamc@1141: enable_static=no adamc@1141: # Look at the argument we got. We use all the common list separators. adamc@1141: lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," adamc@1141: for pkg in $enableval; do adamc@1141: IFS="$lt_save_ifs" adamc@1141: if test "X$pkg" = "X$p"; then adamc@1141: enable_static=yes adamc@1141: fi adamc@1141: done adamc@1141: IFS="$lt_save_ifs" adamc@1141: ;; adamc@1141: esac], adamc@1141: [enable_static=]_LT_ENABLE_STATIC_DEFAULT) adamc@1141: adamc@1141: _LT_DECL([build_old_libs], [enable_static], [0], adamc@1141: [Whether or not to build static libraries]) adamc@1141: ])# _LT_ENABLE_STATIC adamc@1141: adamc@1141: LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) adamc@1141: LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) adamc@1141: adamc@1141: # Old names: adamc@1141: AC_DEFUN([AC_ENABLE_STATIC], adamc@1141: [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) adamc@1141: ]) adamc@1141: adamc@1141: AC_DEFUN([AC_DISABLE_STATIC], adamc@1141: [_LT_SET_OPTION([LT_INIT], [disable-static]) adamc@1141: ]) adamc@1141: adamc@1141: AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) adamc@1141: AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AM_ENABLE_STATIC], []) adamc@1141: dnl AC_DEFUN([AM_DISABLE_STATIC], []) adamc@1141: adamc@1141: adamc@1141: adamc@1141: # _LT_ENABLE_FAST_INSTALL([DEFAULT]) adamc@1141: # ---------------------------------- adamc@1141: # implement the --enable-fast-install flag, and support the `fast-install' adamc@1141: # and `disable-fast-install' LT_INIT options. adamc@1141: # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. adamc@1141: m4_define([_LT_ENABLE_FAST_INSTALL], adamc@1141: [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl adamc@1141: AC_ARG_ENABLE([fast-install], adamc@1141: [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], adamc@1141: [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], adamc@1141: [p=${PACKAGE-default} adamc@1141: case $enableval in adamc@1141: yes) enable_fast_install=yes ;; adamc@1141: no) enable_fast_install=no ;; adamc@1141: *) adamc@1141: enable_fast_install=no adamc@1141: # Look at the argument we got. We use all the common list separators. adamc@1141: lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," adamc@1141: for pkg in $enableval; do adamc@1141: IFS="$lt_save_ifs" adamc@1141: if test "X$pkg" = "X$p"; then adamc@1141: enable_fast_install=yes adamc@1141: fi adamc@1141: done adamc@1141: IFS="$lt_save_ifs" adamc@1141: ;; adamc@1141: esac], adamc@1141: [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) adamc@1141: adamc@1141: _LT_DECL([fast_install], [enable_fast_install], [0], adamc@1141: [Whether or not to optimize for fast installation])dnl adamc@1141: ])# _LT_ENABLE_FAST_INSTALL adamc@1141: adamc@1141: LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) adamc@1141: LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) adamc@1141: adamc@1141: # Old names: adamc@1141: AU_DEFUN([AC_ENABLE_FAST_INSTALL], adamc@1141: [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) adamc@1141: AC_DIAGNOSE([obsolete], adamc@1141: [$0: Remove this warning and the call to _LT_SET_OPTION when you put adamc@1141: the `fast-install' option into LT_INIT's first parameter.]) adamc@1141: ]) adamc@1141: adamc@1141: AU_DEFUN([AC_DISABLE_FAST_INSTALL], adamc@1141: [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) adamc@1141: AC_DIAGNOSE([obsolete], adamc@1141: [$0: Remove this warning and the call to _LT_SET_OPTION when you put adamc@1141: the `disable-fast-install' option into LT_INIT's first parameter.]) adamc@1141: ]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) adamc@1141: dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) adamc@1141: adamc@1141: adamc@1141: # _LT_WITH_PIC([MODE]) adamc@1141: # -------------------- adamc@1141: # implement the --with-pic flag, and support the `pic-only' and `no-pic' adamc@1141: # LT_INIT options. adamc@1141: # MODE is either `yes' or `no'. If omitted, it defaults to `both'. adamc@1141: m4_define([_LT_WITH_PIC], adamc@1141: [AC_ARG_WITH([pic], adamc@1141: [AS_HELP_STRING([--with-pic], adamc@1141: [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], adamc@1141: [pic_mode="$withval"], adamc@1141: [pic_mode=default]) adamc@1141: adamc@1141: test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) adamc@1141: adamc@1141: _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl adamc@1141: ])# _LT_WITH_PIC adamc@1141: adamc@1141: LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) adamc@1141: LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) adamc@1141: adamc@1141: # Old name: adamc@1141: AU_DEFUN([AC_LIBTOOL_PICMODE], adamc@1141: [_LT_SET_OPTION([LT_INIT], [pic-only]) adamc@1141: AC_DIAGNOSE([obsolete], adamc@1141: [$0: Remove this warning and the call to _LT_SET_OPTION when you adamc@1141: put the `pic-only' option into LT_INIT's first parameter.]) adamc@1141: ]) adamc@1141: adamc@1141: dnl aclocal-1.4 backwards compatibility: adamc@1141: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) adamc@1141: adamc@1141: ## ----------------- ## adamc@1141: ## LTDL_INIT Options ## adamc@1141: ## ----------------- ## adamc@1141: adamc@1141: m4_define([_LTDL_MODE], []) adamc@1141: LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], adamc@1141: [m4_define([_LTDL_MODE], [nonrecursive])]) adamc@1141: LT_OPTION_DEFINE([LTDL_INIT], [recursive], adamc@1141: [m4_define([_LTDL_MODE], [recursive])]) adamc@1141: LT_OPTION_DEFINE([LTDL_INIT], [subproject], adamc@1141: [m4_define([_LTDL_MODE], [subproject])]) adamc@1141: adamc@1141: m4_define([_LTDL_TYPE], []) adamc@1141: LT_OPTION_DEFINE([LTDL_INIT], [installable], adamc@1141: [m4_define([_LTDL_TYPE], [installable])]) adamc@1141: LT_OPTION_DEFINE([LTDL_INIT], [convenience], adamc@1141: [m4_define([_LTDL_TYPE], [convenience])])