clustal-omega-1.2.1/0000777000175100017510000000000012304154462011260 500000000000000clustal-omega-1.2.1/m4/0000777000175100017510000000000012304154462011600 500000000000000clustal-omega-1.2.1/m4/ltversion.m40000644000175100017510000000127511134064213014002 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. # serial 3012 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6]) m4_define([LT_PACKAGE_REVISION], [1.3012]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6' macro_revision='1.3012' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) clustal-omega-1.2.1/m4/libtool.m40000644000175100017510000077426611134064213013442 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) clustal-omega-1.2.1/m4/lt~obsolete.m40000644000175100017510000001311311134064213014321 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) clustal-omega-1.2.1/m4/ax_openmp.m40000644000175100017510000001027411472524343013754 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_openmp.html # =========================================================================== # # SYNOPSIS # # AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro tries to find out how to compile programs that use OpenMP a # standard API and set of compiler directives for parallel programming # (see http://www-unix.mcs/) # # On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS # output variable to the flag (e.g. -omp) used both to compile *and* link # OpenMP programs in the current language. # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. # # If you want to compile everything with OpenMP, you should set: # # CFLAGS="$CFLAGS $OPENMP_CFLAGS" # #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" # #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" # # (depending on the selected language). # # The user can override the default choice by setting the corresponding # environment variable (e.g. OPENMP_CFLAGS). # # ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is # not found. If ACTION-IF-FOUND is not specified, the default action will # define HAVE_OPENMP. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AC_DEFUN([AX_OPENMP], [ AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" fi for ax_openmp_flag in $ax_openmp_flags; do case $ax_openmp_flag in none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; esac AC_TRY_LINK_FUNC(omp_set_num_threads, [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) done []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS ]) if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then m4_default([$2],:) else if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp fi m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) fi ])dnl AX_OPENMP clustal-omega-1.2.1/m4/ltoptions.m40000644000175100017510000002724211134064213014012 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) clustal-omega-1.2.1/m4/ax_prefix_config_h.m40000644000175100017510000002062011513327424015600 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html # =========================================================================== # # SYNOPSIS # # AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] # # DESCRIPTION # # This is a new variant from ac_prefix_config_ this one will use a # lowercase-prefix if the config-define was starting with a # lowercase-char, e.g. "#define const", "#define restrict", or "#define # off_t", (and this one can live in another directory, e.g. # testpkg/config.h therefore I decided to move the output-header to be the # first arg) # # takes the usual config.h generated header file; looks for each of the # generated "#define SOMEDEF" lines, and prefixes the defined name (ie. # makes it "#define PREFIX_SOMEDEF". The result is written to the output # config.header file. The PREFIX is converted to uppercase for the # conversions. # # Defaults: # # OUTPUT-HEADER = $PACKAGE-config.h # PREFIX = $PACKAGE # ORIG-HEADER, from AM_CONFIG_HEADER(config.h) # # Your configure.ac script should contain both macros in this order, and # unlike the earlier variations of this prefix-macro it is okay to place # the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation. # # Example: # # AC_INIT(config.h.in) # config.h.in as created by "autoheader" # AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE # AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in # AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. # AC_MEMORY_H # makes "#undef NEED_MEMORY_H" # AC_C_CONST_H # makes "#undef const" # AC_OUTPUT(Makefile) # creates the "config.h" now # # and also mylib/_config.h # # if the argument to AX_PREFIX_CONFIG_H would have been omitted then the # default outputfile would have been called simply "testpkg-config.h", but # even under the name "mylib/_config.h" it contains prefix-defines like # # #ifndef TESTPKG_VERSION # #define TESTPKG_VERSION "0.1.1" # #endif # #ifndef TESTPKG_NEED_MEMORY_H # #define TESTPKG_NEED_MEMORY_H 1 # #endif # #ifndef _testpkg_const # #define _testpkg_const _const # #endif # # and this "mylib/_config.h" can be installed along with other # header-files, which is most convenient when creating a shared library # (that has some headers) where some functionality is dependent on the # OS-features detected at compile-time. No need to invent some # "mylib-confdefs.h.in" manually. :-) # # Note that some AC_DEFINEs that end up in the config.h file are actually # self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T # say that they "will define inline|const|off_t if the system does not do # it by itself". You might want to clean up about these - consider an # extra mylib/conf.h that reads something like: # # #include # #ifndef _testpkg_const # #define _testpkg_const const # #endif # # and then start using _testpkg_const in the header files. That is also a # good thing to differentiate whether some library-user has starting to # take up with a different compiler, so perhaps it could read something # like this: # # #ifdef _MSC_VER # #include # #else # #include # #endif # #ifndef _testpkg_const # #define _testpkg_const const # #endif # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Marten Svantesson # Copyright (c) 2008 Gerald Point # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl AC_PREREQ([2.62]) AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl m4_pushdef([_script],[conftest.prefix])dnl m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl _OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)` _DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` _PKG=`echo ifelse($2, , $PACKAGE, $2)` _LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` _UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` _INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'` if test ".$_INP" = "."; then for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue case "$ac_file" in *.h) _INP=$ac_file ;; *) esac test ".$_INP" != "." && break done fi if test ".$_INP" = "."; then case "$_OUT" in */*) _INP=`basename "$_OUT"` ;; *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` ;; *) _INP=config.h ;; esac fi if test -z "$_PKG" ; then AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) else if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then _INP="$srcdir/$_INP" fi fi AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) if test -f $_INP ; then AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script AS_ECHO(["@%:@endif/"]) >> _script AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script AS_ECHO(["@%:@endif/"]) >> _script # now executing _script on _DEF input to create _OUT output file echo "@%:@ifndef $_DEF" >$tmp/pconfig.h echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h sed -f _script $_INP >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h echo "@%:@endif" >>$tmp/pconfig.h if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then AC_MSG_NOTICE([$_OUT is unchanged]) else ac_dir=`AS_DIRNAME(["$_OUT"])` AS_MKDIR_P(["$ac_dir"]) rm -f "$_OUT" mv $tmp/pconfig.h "$_OUT" fi cp _script _configs.sed else AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) fi rm -f conftest.* fi m4_popdef([_symbol])dnl m4_popdef([_script])dnl AS_VAR_POPDEF([_INP])dnl AS_VAR_POPDEF([_UPP])dnl AS_VAR_POPDEF([_LOW])dnl AS_VAR_POPDEF([_PKG])dnl AS_VAR_POPDEF([_DEF])dnl AS_VAR_POPDEF([_OUT])dnl ],[PACKAGE="$PACKAGE"])]) clustal-omega-1.2.1/m4/ltsugar.m40000644000175100017510000001042411134064213013432 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) clustal-omega-1.2.1/configure0000755000175100017510000255700412304116377013123 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for Clustal Omega 1.2.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Clustal Omega' PACKAGE_TARNAME='clustal-omega' PACKAGE_VERSION='1.2.1' PACKAGE_STRING='Clustal Omega 1.2.1' PACKAGE_BUGREPORT='clustalw@ucd.ie' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS AM_LDFLAGS AM_CFLAGS AM_CXXFLAGS OPENMP_CXXFLAGS OPENMP_CFLAGS CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL host_os host_vendor host_cpu host build_os build_vendor build_cpu build EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM PACKAGE_CODENAME target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock with_openmp with_dmalloc enable_debug ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Clustal Omega 1.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/clustal-omega] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Clustal Omega 1.2.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Enable debugging (default=no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --without-openmp Do not use OpenMP --with-dmalloc use dmalloc, as in http://www.dmalloc.com/dmalloc.tar.gz Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Clustal Omega configure 1.2.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Clustal Omega $as_me 1.2.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu PACKAGE_CODENAME="AndreaGiacomo" # The AC_INIT macro can take any source file as an argument. It just # checks that the file is there, which should, in turn, mean that the # source directory is there. AC_INIT generates the following m4 # macros, output variables and preprocessor symbols: { $as_echo "$as_me:$LINENO: Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME) +NMMMMMMMMMS= MMMMM? :MMMMM8 IMMMMS MMMMM, ~MMMMN ,MMMMM =MMMMM MMMMM ?MMMMM +MMMMM MMMMMS MMMMM MMMMM MMMMM: MMMMM MMMMM+ MMMMM MMMMM~ MMMMM MMMMM MMMMMZ MMMMM MMMMM ,MMMMZ MMMM8 MMMM+ MMMMS MMMM, MMMMO MMMM ,N SMMM MMM8 +8 ,M7 M+ M+ :M8 ,MMMMMMMMMMMMI MMMMMMMMMMMM8 ,MMMMMMMMMMMM8 MMMMMMMMMMMM8 ,MMMMMMMMMMMMN MMMMMMMMMMMM8 " >&5 $as_echo "$as_me: Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME) +NMMMMMMMMMS= MMMMM? :MMMMM8 IMMMMS MMMMM, ~MMMMN ,MMMMM =MMMMM MMMMM ?MMMMM +MMMMM MMMMMS MMMMM MMMMM MMMMM: MMMMM MMMMM+ MMMMM MMMMM~ MMMMM MMMMM MMMMMZ MMMMM MMMMM ,MMMMZ MMMM8 MMMM+ MMMMS MMMM, MMMMO MMMM ,N SMMM MMM8 +8 ,M7 M+ M+ :M8 ,MMMMMMMMMMMMI MMMMMMMMMMMM8 ,MMMMMMMMMMMM8 MMMMMMMMMMMM8 ,MMMMMMMMMMMMN MMMMMMMMMMMM8 " >&6;} # # Created with http://www.glassgiant.com/ascii/ and Wikipedia's Omega # Replaced all dollars with S's. # # # ,MMMMMMMMMD: MMMMM # NMMMMMMMMMMMMMM+ SMMMM # DMMMMMMMMMMMMMMMMMM, +MMMM # MMMMMMMMM8ZSO8MMMMMMMM +MMMM # MMMMM7 SMMMM +MMMM # MMMO MM? +MMMM # ?MMI NMIIMMMM # MMM MMMMMMM # MM # MN # MD # MM # MM? ,~+ISON # =MMI MMSOMMMM # MMMZ MMS +MMMM # MMMM8: :NMMM +MMMM # MMMMMMMMMDOODMMMMMMMMM +MMMM # MMMMMMMMMMMMMMMMMMMM +MMMM # OMMMMMMMMMMMMMMZ SMMMM # MMMMMMMMMM+ MMMMM # # AC_MSG_NOTICE([Configuring for your system...]) # 2.60 needed for AC_USE_SYSTEM_EXTENSIONS # consider 2.64 which allows to define a URL as well # The AM_INIT_AUTOMAKE line adds several standard checks. # This macro is always needed for automake # Obsolete: It takes the program name and version number as arguments. am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='clustal-omega' VERSION='1.2.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # config header: provides a way for people to customise the # configuration for their platform, via #defines. config.h.in can be # generated automatically with the autoheader tool. However, you need # a stamp-h file in your project to ensure that automake regenerates # config.h from config.h.in. Type 'touch stamp-h' to add this file to # your project. # ac_config_headers="$ac_config_headers src/config.h" # the following allows to install a copy config.h for libclustalo in a # namespace like way, i.e. no name clash with your own config.h ac_config_commands="$ac_config_commands src/clustal-omega-config.h" # This macro was introduced in Autoconf 2.60. If possible, enable # extensions to C or Posix on hosts that normally disable the # extensions. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 $as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 $as_echo_n "checking minix/config.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to clustalw@ucd.ie ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 $as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 $as_echo "$ac_cv_header_minix_config_h" >&6; } fi if test "x$ac_cv_header_minix_config_h" = x""yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _TANDEM_SOURCE 1 _ACEOF # for cross compilation # # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ## AC_CANONICAL_BUILD ## AC_CANONICAL_TARGET # Set the @SET_MAKE@ variable=make if $(MAKE) not set { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # AC_PROG_RANLIB will allow you to build code in sub-directories into # temporary libraries, which make will then link in with the rest of # the code. # Rendered obsolte by LT_INIT: AC_PROG_RANLIB #AC_PROG_LIBTOOL case `pwd` in *\ * | *\ *) { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6' macro_revision='1.3012' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed $as_unset ac_script || ac_script= if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:5230: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5233: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5236: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 6441 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_ld_exported_symbols_list=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7810: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7814: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8149: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8153: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8254: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8258: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8309: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8313: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 11122 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 11218 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # AC_PROG_INSTALL will generate an install target so that users may # just type 'make install' to install the software. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # check for C++ preprocessor and compiler and the library compiler # (might change the compiler flags) # # Determine a C compiler to use. If using the GNU C compiler, set # shell variable GCC to `yes'. If output variable CFLAGS was not # already set, set it to `-g -O2' for the GNU C compiler (`-O2' on # systems where GCC does not accept `-g'), or `-g' for other # compilers. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Set output variable CPP to a command that runs the C preprocessor. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # Determine a C++ compiler to use. If output variable CXXFLAGS was not # already set, set it to `-g -O2' for the GNU C++ compiler (`-O2' on # systems where G++ does not accept `-g'), or `-g' for other # compilers. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} _lt_caught_CXX_error=yes; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15594: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15598: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15693: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15697: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15745: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15749: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Set CXXCPP to a command that runs the C++ preprocessor ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # reset compiler flags to initial flags #CXXFLAGS=$OLD_CXXFLAGS # safety check: AC_CONFIG_SRCDIR([src/clustal.h]) # Let source files know in which context they are being used cat >>confdefs.h <<\_ACEOF #define CLUSTALO 1 _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_CODENAME "$PACKAGE_CODENAME" _ACEOF # Get svn revision #AC_PATH_PROG(svnversioncommand, svnversion) #if test "X$svnversioncommand" = "X" || test `$svnversioncommand -n '.'` = "exported"; then #AC_DEFINE_UNQUOTED(SVN_VERSION, ["`cat saved_svn_version.txt`"], [repository svn version]) #else #AC_DEFINE_UNQUOTED(SVN_VERSION, ["`svnversion -n`"], [repository svn version]) #`svnversion -n > saved_svn_version.txt` #fi # AW: we might need this in the future # case "$host_os" in linux*) # AC_DEFINE(LINUX,1,[This is a Linux system]) cat >>confdefs.h <<_ACEOF #define LINUX 1 _ACEOF # AM_CONDITIONAL(HAVE_GNU_LD, true) # AM_CONDITIONAL(SOMEBSD, false) # XTRA_CPPLIBS=-lstdc++ # LIBEXT=.so ;; freebsd*) cat >>confdefs.h <<_ACEOF #define SOMEBSD 1 _ACEOF # AC_CHECK_LIB(c_r, pthread_create) # AM_CONDITIONAL(HAVE_GNU_LD, true) # AM_CONDITIONAL(SOMEBSD, true) # XTRA_CPPLIBS=-lstdc++ # LIBEXT=.so ;; openbsd*) cat >>confdefs.h <<_ACEOF #define SOMEBSD 1 _ACEOF # AC_CHECK_LIB(c_r, pthread_create) # AM_CONDITIONAL(HAVE_GNU_LD, true) # AM_CONDITIONAL(SOMEBSD, true) # XTRA_CPPLIBS=-lstdc++ # LIBEXT=.so ;; netbsd*) cat >>confdefs.h <<_ACEOF #define SOMEBSD 1 _ACEOF # AC_CHECK_LIB(c_r, pthread_create) # AM_CONDITIONAL(HAVE_GNU_LD, true) # AM_CONDITIONAL(SOMEBSD, true) # XTRA_CPPLIBS=-lstdc++ # LIBEXT=.so ;; *solaris*) cat >>confdefs.h <<_ACEOF #define SOLARIS 1 _ACEOF # AC_CHECK_LIB(resolv, res_init) # XTRA_CPPLIBS=-lstdc++ # AM_CONDITIONAL(HAVE_GNU_LD, false) # AM_CONDITIONAL(SOMEBSD, false) # CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $CFLAGS" # LIBEXT=.so ;; darwin*) cat >>confdefs.h <<_ACEOF #define DARWIN 1 _ACEOF # AM_CONDITIONAL(HAVE_GNU_LD, false) # AM_CONDITIONAL(SOMEBSD, false) # CFLAGS="-fno-common $CFLAGS" # LIBEXT=.so ;; cygwin*) cat >>confdefs.h <<_ACEOF #define CYGWIN 1 _ACEOF # LDFLAGS="$LDFLAGS -no-undefined" # AM_CONDITIONAL(SOMEBSD, false) # AM_CONDITIONAL(HAVE_GNU_LD, false) # LIBEXT=.dll ;; mingw*) cat >>confdefs.h <<_ACEOF #define MINGW 1 _ACEOF # AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) # AC_CHECK_LIB(intl, gettext) # AC_CHECK_LIB(ws2_32, _head_libws2_32_a,,[AC_MSG_ERROR([libextractor requires Winsock2])]) # AC_CHECK_LIB(plibc, plibc_init,,[AC_MSG_ERROR([libextractor requires PlibC])]) # LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols" # LIBSOLD=$LIBS # AM_CONDITIONAL(HAVE_GNU_LD, true) # AM_CONDITIONAL(SOMEBSD, false) # LIBEXT=.dll ;; *) # AC_MSG_RESULT(Unrecognised OS $host_os) cat >>confdefs.h <<_ACEOF #define OTHEROS 1 _ACEOF # AC_MSG_RESULT(otheros) # AM_CONDITIONAL(HAVE_GNU_LD, false) # AM_CONDITIONAL(SOMEBSD, false) # LIBEXT=.so ;; esac # Checks for standard header files. # obsolescent according to http://www.gnu.org/software/hello/manual/autoconf/Particular-Headers.html { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # Guess the next one is obsolete as well then? for ac_header in assert.h ctype.h float.h limits.h math.h memory.h stdarg.h stdio.h stdlib.h string.h time.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to clustalw@ucd.ie ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # awk '/^#include *' # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac # Checks for library functions. # AC_CHECK_FUNCS(strdup strstr strchr erand48) # AW is there an automatic way to extract library functions used in the program? # explicit libm check { $as_echo "$as_me:$LINENO: checking for log in -lm" >&5 $as_echo_n "checking for log in -lm... " >&6; } if test "${ac_cv_lib_m_log+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char log (); int main () { return log (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_m_log=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_log=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_log" >&5 $as_echo "$ac_cv_lib_m_log" >&6; } if test "x$ac_cv_lib_m_log" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else { { $as_echo "$as_me:$LINENO: error: Could not find libm" >&5 $as_echo "$as_me: error: Could not find libm" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: checking for log2 in -lm" >&5 $as_echo_n "checking for log2 in -lm... " >&6; } if test "${ac_cv_lib_m_log2+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char log2 (); int main () { return log2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_m_log2=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_log2=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_log2" >&5 $as_echo "$ac_cv_lib_m_log2" >&6; } if test "x$ac_cv_lib_m_log2" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LOG2 1 _ACEOF fi # --- argtable header and library check # # for ac_header in argtable2.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to clustalw@ucd.ie ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: Could not find argtable2.h. Try $ ./configure CFLAGS='-Iyour-argtable2-include-path" >&5 $as_echo "$as_me: error: Could not find argtable2.h. Try $ ./configure CFLAGS='-Iyour-argtable2-include-path" >&2;} { (exit 1); exit 1; }; } fi done { $as_echo "$as_me:$LINENO: checking for arg_parse in -largtable2" >&5 $as_echo_n "checking for arg_parse in -largtable2... " >&6; } if test "${ac_cv_lib_argtable2_arg_parse+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-largtable2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char arg_parse (); int main () { return arg_parse (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_argtable2_arg_parse=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_argtable2_arg_parse=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_argtable2_arg_parse" >&5 $as_echo "$ac_cv_lib_argtable2_arg_parse" >&6; } if test "x$ac_cv_lib_argtable2_arg_parse" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBARGTABLE2 1 _ACEOF LIBS="-largtable2 $LIBS" else { { $as_echo "$as_me:$LINENO: error: Could not find libargtable2. Try $ ./configure LDFLAGS=\"-Lyour-argtable2-lib-path'" >&5 $as_echo "$as_me: error: Could not find libargtable2. Try $ ./configure LDFLAGS=\"-Lyour-argtable2-lib-path'" >&2;} { (exit 1); exit 1; }; } fi # enable python if requested (--with-python) # #AC_ARG_WITH([python], # [AS_HELP_STRING([--with-python], # [Enable Python Interface])], # [with_python=$withval], # [with_python=no]) #if test "$with_python" = "yes"; then # AC_MSG_CHECKING([for python-config to get compiler flags]) # AC_CHECK_PROG(python_config, 'python-config', yes) # if test "${python_config}" != "yes"; then # AC_MSG_ERROR("Could not run python-config.") # fi # PYTHON_CFLAGS=`python-config --cflags` # PYTHON_LDFLAGS=`python-config --ldflags` # AC_DEFINE([PYTHON_ENABLED], [1], [define for python usage]) #fi #AC_SUBST(PYTHON_CFLAGS) #AC_SUBST(PYTHON_LDFLAGS) # --- SSE support # "One instruction to do the same operation on 4 packed elements simultaneously." # # http://www.codeproject.com/KB/recipes/sseintro.aspx?msg=568491 # http://www.drdobbs.com/go-parallel/blog/archives/2010/03/getting_amazing.html # http://software.intel.com/file/1000 # # AC_MSG_CHECKING(for SSE in current arch/CFLAGS) # AC_LINK_IFELSE([ # AC_LANG_PROGRAM([[ # #include # __m128 testfunc(float *a, float *b) { # return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b)); # } # ]])], # [has_sse=yes], [has_sse=no] # ) # AC_MSG_RESULT($has_sse) # # AC_ARG_ENABLE([sse], # [AS_HELP_STRING([--enable-sse], # [Enable SSE support])], # [has_sse="$enableval"], # [has_sse=no]) # # if test x"$has_sse" = x"yes"; then # AC_DEFINE([USE_SSE], , [Enable SSE support]) # CFLAGS="${CFLAGS} -msse" # fi # --- openmp # # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_openmp.html # =========================================================================== # # SYNOPSIS # # AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro tries to find out how to compile programs that use OpenMP a # standard API and set of compiler directives for parallel programming # (see http://www-unix.mcs/) # # On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS # output variable to the flag (e.g. -omp) used both to compile *and* link # OpenMP programs in the current language. # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. # # If you want to compile everything with OpenMP, you should set: # # CFLAGS="$CFLAGS $OPENMP_CFLAGS" # #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" # #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" # # (depending on the selected language). # # The user can override the default choice by setting the corresponding # environment variable (e.g. OPENMP_CFLAGS). # # ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is # not found. If ACTION-IF-FOUND is not specified, the default action will # define HAVE_OPENMP. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 # Check whether --with-openmp was given. if test "${with_openmp+set}" = set; then withval=$with_openmp; fi if test "x$with_openmp" = "xno"; then : else { $as_echo "$as_me:$LINENO: checking for OpenMP flag of C compiler" >&5 $as_echo_n "checking for OpenMP flag of C compiler... " >&6; } if test "${ax_cv_c_openmp+set}" = set; then $as_echo_n "(cached) " >&6 else saveCFLAGS=$CFLAGS ax_cv_c_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_CFLAGS" != x; then ax_openmp_flags="$OPENMP_CFLAGS $ax_openmp_flags" fi for ax_openmp_flag in $ax_openmp_flags; do case $ax_openmp_flag in none) CFLAGS=$saveC ;; *) CFLAGS="$saveCFLAGS $ax_openmp_flag" ;; esac cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char omp_set_num_threads (); int main () { return omp_set_num_threads (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ax_cv_c_openmp=$ax_openmp_flag; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done CFLAGS=$saveCFLAGS fi { $as_echo "$as_me:$LINENO: result: $ax_cv_c_openmp" >&5 $as_echo "$ax_cv_c_openmp" >&6; } if test "x$ax_cv_c_openmp" = "xunknown"; then : else if test "x$ax_cv_c_openmp" != "xnone"; then OPENMP_CFLAGS=$ax_cv_c_openmp fi cat >>confdefs.h <<\_ACEOF #define HAVE_OPENMP 1 _ACEOF fi fi # according to http://beagle-lib.googlecode.com/svn-history/r824/trunk/configure.ac: # "OpenMP checker only defines for C when compiling both C and C++" OPENMP_CXXFLAGS=$OPENMP_CFLAGS # version 2: enable openmp only if explicitely asked for it #AC_ARG_ENABLE(openmp, AS_HELP_STRING([--enable-openmp], [Multi-threaded parallel version using OpenMP])) #if test -n "${enable_openmp}" -a x"${enable_openmp}" != x"no"; then # m4_include([m4/ax_openmp.m4]) # AX_OPENMP(AC_DEFINE(HAVE_OPENMP, 1, [enable OpenMP support]), # AC_MSG_ERROR([Compiler does not seem to support OpenMP])) # AC_SUBST(OPENMP_CFLAGS) # AC_SUBST(OPENMP_CXXFLAGS) #fi # --- squid # # # Extra checks for squid; see their configure, config.log, squidconf.h # etc. For example, I'm not sure about USE_HOST_BYTESWAP_FUNCTIONS, # SIZEOF_UNSIGNED_LONG, HAVE_STRTOUL and HAVE_STRTOULL # # Might not just have to set compiler flags but create use squidconf.h.in # # The following hopefully takes about byte ordering (big-endian...). # My hope is that it will set WORDS_BIGENDIAN and # USE_HOST_BYTESWAP_FUNCTIONS (as used by squid) if necessary: # { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # Check for potential -arch flags. It is not universal unless # there are some -arch flags. Note that *ppc* also matches # ppc64. This check is also rather less than ideal. case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to _BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then # Try to guess by grepping values from an object file. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) { $as_echo "$as_me:$LINENO: WARNING: $PACKAGE_NAME hasn't been tested on Big-Endian machines...expecting trouble!" >&5 $as_echo "$as_me: WARNING: $PACKAGE_NAME hasn't been tested on Big-Endian machines...expecting trouble!" >&2;};; #( no) ;; #( universal) cat >>confdefs.h <<\_ACEOF #define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF ;; #( *) { { $as_echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 $as_echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac for ac_func in ntohs ntohl ntons ntonl do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned short" >&5 $as_echo_n "checking size of unsigned short... " >&6; } if test "${ac_cv_sizeof_unsigned_short+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned short))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned short))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned short))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_short=$ac_lo;; '') if test "$ac_cv_type_unsigned_short" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (unsigned short)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned short))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned short)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned short)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_short=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_short" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_short=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5 $as_echo "$ac_cv_sizeof_unsigned_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned int" >&5 $as_echo_n "checking size of unsigned int... " >&6; } if test "${ac_cv_sizeof_unsigned_int+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; '') if test "$ac_cv_type_unsigned_int" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (unsigned int)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned int))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned int)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned int)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_int=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_int" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned long" >&5 $as_echo_n "checking size of unsigned long... " >&6; } if test "${ac_cv_sizeof_unsigned_long+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long=$ac_lo;; '') if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (unsigned long)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned long))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned long)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned long)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of unsigned long long" >&5 $as_echo_n "checking size of unsigned long long... " >&6; } if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (unsigned long long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long_long=$ac_lo;; '') if test "$ac_cv_type_unsigned_long_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (unsigned long long)); } static unsigned long int ulongval () { return (long int) (sizeof (unsigned long long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (unsigned long long))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (unsigned long long)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (unsigned long long)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long_long=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_long_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_long_long=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5 $as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long _ACEOF # for ac_func in stroul strtoull do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in ftello fseeko do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in ftello64 fseeko64 do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in ftell64 fseek64 do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # { $as_echo "$as_me:$LINENO: checking for off_t" >&5 $as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_off_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((off_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 $as_echo "$ac_cv_type_off_t" >&6; } if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 $as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default static long int longval () { return (long int) (sizeof (fpos_t)); } static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (fpos_t)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (fpos_t)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 $as_echo "$ac_cv_sizeof_fpos_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t _ACEOF # # struct stat64 and stat64 test: # version 1: #AC_CHECK_TYPE(struct stat64, # [AC_CHECK_FUNC([stat64], # AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))]) # version 2: #AC_MSG_CHECKING(for struct stat64) #AC_CACHE_VAL(sc_cv_type_stat64, #[AC_TRY_COMPILE([#include ],[struct stat64 s;], #[sc_cv_type_stat64=yes], #[sc_cv_type_stat64=no])]) #if test $sc_cv_type_stat64 = yes; then # AC_MSG_RESULT($sc_cv_type_stat64) # AC_CHECK_FUNC([stat64], AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function])) # #AC_DEFINE(HAVE_STAT64, [1], [Define if you have the stat64 function]) #fi # # # Above fails on myosin because storage size of struct 64 is unknown: # ssi.c:480: error: storage size of ‘s1’ isn’t known # # On my MacBook OS X 10.6 I get: # ssi.c:481: warning: ‘stat64’ is deprecated (declared at /usr/include/sys/stat.h:465) # # So forget about it: we won't use stat64 or define HAVE_STAT64 and # consequently do no tests here # # Add support for the Dmalloc package. If the user runs configure with # --with-dmalloc, then define WITH_DMALLOC and add -ldmalloc to LIBS. { $as_echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5 $as_echo_n "checking if malloc debugging is wanted... " >&6; } # Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval=$with_dmalloc; if test "$withval" = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_DMALLOC 1 _ACEOF LIBS="$LIBS -ldmalloc" LDFLAGS="$LDFLAGS -g" else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi # Check if svnversion is installed #AC_PATH_PROG([SVNVERSION_BIN], [svnversionFIXME], [no]) ## checking if we build in a subversion WC #wc_found="no"; #if test "$SVNVERSION_BIN" != "no"; then # SVNVERSION=`$SVNVERSION_BIN -n $srcdir` # if test $SVNVERSION != "exported"; # then # AC_MSG_NOTICE($SVNVERSION); # fi #fi # --- debugging # # # { $as_echo "$as_me:$LINENO: checking whether to build with debug information" >&5 $as_echo_n "checking whether to build with debug information... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; debugit="$enableval" else debugit=no fi { $as_echo "$as_me:$LINENO: result: $debugit" >&5 $as_echo "$debugit" >&6; } if test x"$debugit" = x"yes"; then # User variables CFLAGS/CXXFLAGS are used last during compilation and # can therefore overwrite system settings. # # if debugging was requested, add debugging info at the end of # C[XX]FLAGS, which makes sure previous optimisation flags are # overwritten (normally C[XX]FLAGS should not be modified as they # are user variables): # switch off assert etc # AC_DEFINE([DEBUG],[],[Debug Mode]) CFLAGS="${CFLAGS} -g -ansi -Wall -O0" CXXFLAGS="${CXXFLAGS} -g -ansi -Wall -O0" else # switch off assert etc cat >>confdefs.h <<\_ACEOF #define NDEBUG /**/ _ACEOF # if no debugging is requested, we make optimisation explicit AM_CXXFLAGS="${AM_CXXFLAGS} -O3" AM_CFLAGS="${AM_CFLAGS} -O3" fi ac_config_files="$ac_config_files Makefile src/Makefile clustalo.pc Doxyfile src/clustal/Makefile src/hhalign/Makefile src/kmpp/Makefile src/squid/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Clustal Omega $as_me 1.2.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ Clustal Omega config.status 1.2.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # PACKAGE="$PACKAGE" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "src/clustal-omega-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/clustal-omega-config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "clustalo.pc") CONFIG_FILES="$CONFIG_FILES clustalo.pc" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "src/clustal/Makefile") CONFIG_FILES="$CONFIG_FILES src/clustal/Makefile" ;; "src/hhalign/Makefile") CONFIG_FILES="$CONFIG_FILES src/hhalign/Makefile" ;; "src/kmpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/kmpp/Makefile" ;; "src/squid/Makefile") CONFIG_FILES="$CONFIG_FILES src/squid/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "src/clustal-omega-config.h":C) ac_prefix_conf_OUT=`echo src/clustal-omega-config.h` ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"` ac_prefix_conf_PKG=`echo $PACKAGE` ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"` ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"` ac_prefix_conf_INP=`echo "" | sed -e 's/ *//'` if test ".$ac_prefix_conf_INP" = "."; then for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue case "$ac_file" in *.h) ac_prefix_conf_INP=$ac_file ;; *) esac test ".$ac_prefix_conf_INP" != "." && break done fi if test ".$ac_prefix_conf_INP" = "."; then case "$ac_prefix_conf_OUT" in */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"` ;; *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"` ;; *) ac_prefix_conf_INP=config.h ;; esac fi if test -z "$ac_prefix_conf_PKG" ; then { { $as_echo "$as_me:$LINENO: error: no prefix for _PREFIX_PKG_CONFIG_H" >&5 $as_echo "$as_me: error: no prefix for _PREFIX_PKG_CONFIG_H" >&2;} { (exit 1); exit 1; }; } else if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP" fi fi { $as_echo "$as_me:$LINENO: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5 $as_echo "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;} if test -f $ac_prefix_conf_INP ; then $as_echo "s/^#undef *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix $as_echo "s/^#undef *\\([abcdefghijklmnopqrstuvwxyz]\\)/#undef $ac_prefix_conf_LOW""_\\1/" >> conftest.prefix $as_echo "s/^#define *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1\\" >> conftest.prefix $as_echo "#define $ac_prefix_conf_UPP""_\\1\\2\\" >> conftest.prefix $as_echo "#endif/" >> conftest.prefix $as_echo "s/^#define *\\([abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_LOW""_\\1\\" >> conftest.prefix $as_echo "#define $ac_prefix_conf_LOW""_\\1\\2\\" >> conftest.prefix $as_echo "#endif/" >> conftest.prefix # now executing _script on _DEF input to create _OUT output file echo "#ifndef $ac_prefix_conf_DEF" >$tmp/pconfig.h echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h echo "#endif" >>$tmp/pconfig.h if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then { $as_echo "$as_me:$LINENO: $ac_prefix_conf_OUT is unchanged" >&5 $as_echo "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;} else ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" || $as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \ X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \ X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_prefix_conf_OUT" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } rm -f "$ac_prefix_conf_OUT" mv $tmp/pconfig.h "$ac_prefix_conf_OUT" fi cp conftest.prefix _configs.sed else { { $as_echo "$as_me:$LINENO: error: input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" >&5 $as_echo "$as_me: error: input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.* fi ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi clustal-omega-1.2.1/missing0000755000175100017510000002623311377212452012604 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: clustal-omega-1.2.1/TODO0000644000175100017510000000242211551336436011672 00000000000000IMPORTANT --------- - consensus output (sto,aln) and compatibilety with bioperl/biopython - Split Homfam refs in two. Use one part as background HMM, the other parts for benchmarking - Implement meta flags: accurate: --iterations 3 default: --mbed --iterations 1 fast: --mbed and for more than 10k sequences: --mbed --mbed-iter - SSE instructions for hhalign (little use in ClustalO frontend; DD) / Patch new code which already contains SSE instructions also fix automake/configure then - Multi-HMMs; also for Pfam+iteration (FS) - Show degradation of alignment quality when using x reference sequences added to y random/false sequences (Lio Pachter) - Seed pre-alignment with M-Coffee, MSAProbs, ... - GUI/API: Will have to catch/override exits from source. find . -name \*.c -or -name \*.cpp -or -name \*.h | xargs grep 'exit(' Also best to allow for user override of void Fatal(char *msg, ...); void Error(char *msg, ...); void Warn(char *msg, ...); void Info(int level, char *msg, ...); - Soeding: DNA/RNA alignment incl. reading of nucleotide HMMs - Automatic HMM-selection/search/download for input - Structure input: Psipred predictions are apparently part of their hhms and should therefore be ready to use (part automatic HMM-selection) clustal-omega-1.2.1/src/0000777000175100017510000000000012304154462012047 500000000000000clustal-omega-1.2.1/src/clustal-omega.c0000644000175100017510000015045112270506657014703 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: clustal-omega.c 290 2013-09-20 15:18:12Z fabian $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "clustal-omega.h" #include "hhalign/general.h" #include "clustal/hhalign_wrapper.h" /* The following comment block contains the frontpage/mainpage of the doxygen * documentation. Please add some more info. FIXME add more */ /** * * @mainpage Clustal-Omega Documentation * * @section intro_sec Introduction * * For more information see http://www.clustal.org/ * * @section api_section API * * @subsection example_prog_subsection An Example Program * * To use libclustalo you will have to include the clustal-omega.h header and * link against libclustalo. For linking against libclustalo you will have to * use a C++ compiler, no matter if your program was written in C or C++. See * below (\ref pkgconfig_subsubsec)) on how to figure out compiler flags with * pkg-config. * * Assuming Clustal Omega was installed in system-wide default directory (e.g. * /usr), first compile (don't link yet) your source (for example code see * section \ref example_src_subsubsec) and then link against libclustalo: * * @code * $ gcc -c -ansi -Wall clustalo-api-test.c * $ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o -lclustalo * @endcode * * Voila! Now you have your own alignment program based on Clustal Omega which * can be run with * * @code * $ ./clustalo-api-test * @endcode * * It's best to use the same compiler that you used for compiling libclustal. * If libclustal was compiled with OpenMP support, you will have to use OpenMP * flags for you program as well. * * * @subsubsection pkgconfig_subsubsec Using pkg-config / Figuring out compiler flags * * Clustal Omega comes with support for pkg-config, which means you * can run * * @code * $ pkg-config --cflags --libs clustalo * @endcode * * to figure out cflags and library flags needed to compile and link against * libclustalo. This is especially handy if Clustal Omega was installed to a * non-standard directory. * * You might have to change PKG_CONFIG_PATH. For example, if you used the prefix $HOME/local/ for * installation then you will first need to set PKG_CONFIG_PATH: * * @code * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig * $ pkg-config --cflags --libs clustalo * @endcode * * * To compile your source use as above but this time using proper flags: * * @code * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig * $ gcc -c -ansi -Wall $(pkg-config --cflags clustalo) clustalo-api-test.c * $ g++ -ansi -Wall -o clustalo-api-test $(pkg-config --libs clustalo) clustalo-api-test.o * @endcode * * * @subsubsection example_src_subsubsec Example Source Code * * @include "clustalo-api-test.c" * * */ /* the following are temporary flags while the code is still under construction; had problems internalising hhmake, so as temporary crutch write alignment to file and get external hmmer/hhmake via system call to read alignment and convert into HMM All this will go, once hhmake is properly internalised */ #define INDIRECT_HMM 0 /* temp flag: (1) write aln to file, use system(hmmer/hhmake), (0) internal hhmake */ #define USEHMMER 1 /* temp flag: use system(hmmer) to build HMM */ #define USEHHMAKE (!USEHMMER) /* temp flag: use system(hhmake) to build HMM */ /* shuffle order of input sequences */ #define SHUFFLE_INPUT_SEQ_ORDER 0 /* sort input sequences by length */ #define SORT_INPUT_SEQS 0 int iNumberOfThreads; /* broken, unused and lonely */ static const int ITERATION_SCORE_IMPROVEMENT_THRESHOLD = 0.01; /** * @brief Print Long version information to pre-allocated char. * * @note short version * information is equivalent to PACKAGE_VERSION * * @param[out] pcStr * char pointer to write to preallocated to hold iSize chars. * @param[in] iSize * size of pcStr */ void PrintLongVersion(char *pcStr, int iSize) { snprintf(pcStr, iSize, "version %s; code-name '%s'; build date %s", PACKAGE_VERSION, PACKAGE_CODENAME, __DATE__); } /* end of PrintLongVersion() */ /** * @brief free aln opts members * */ void FreeAlnOpts(opts_t *prAlnOpts) { if (NULL != prAlnOpts->pcGuidetreeInfile) { CKFREE(prAlnOpts->pcGuidetreeInfile); } if (NULL != prAlnOpts->pcGuidetreeOutfile) { CKFREE(prAlnOpts->pcGuidetreeOutfile); } if (NULL != prAlnOpts->pcDistmatOutfile) { CKFREE(prAlnOpts->pcDistmatOutfile); } if (NULL != prAlnOpts->pcDistmatInfile) { CKFREE(prAlnOpts->pcDistmatInfile); } } /* end of FreeAlnOpts() */ /** * @brief Sets members of given user opts struct to default values * * @param[out] prOpts * User opt struct to initialise * */ void SetDefaultAlnOpts(opts_t *prOpts) { prOpts->bAutoOptions = FALSE; prOpts->pcDistmatInfile = NULL; prOpts->pcDistmatOutfile = NULL; prOpts->iClustersizes = 100; /* FS, r274 -> */ prOpts->iTransitivity = 0; /* FS, r290 -> */ prOpts->pcClustfile = NULL; /* FS, r274 -> */ prOpts->pcPosteriorfile = NULL; /* FS, r288 -> */ prOpts->iClusteringType = CLUSTERING_UPGMA; prOpts->iPairDistType = PAIRDIST_KTUPLE; prOpts->bUseMbed = TRUE; /* FS, r250 -> */ prOpts->bUseMbedForIteration = TRUE; /* FS, r250 -> */ prOpts->bPileup = FALSE; /* FS, r288 -> */ prOpts->pcGuidetreeOutfile = NULL; prOpts->pcGuidetreeInfile = NULL; prOpts->bPercID = FALSE; prOpts->ppcHMMInput = NULL; prOpts->iHMMInputFiles = 0; prOpts->iNumIterations = 0; prOpts->bIterationsAuto = FALSE; prOpts->iMaxGuidetreeIterations = INT_MAX; prOpts->iMaxHMMIterations = INT_MAX; SetDefaultHhalignPara(& prOpts->rHhalignPara); } /* end of SetDefaultAlnOpts() */ /** * @brief Check logic of parsed user options. Will exit (call Log(&rLog, LOG_FATAL, )) * on Fatal logic error * * @param[in] prOpts * Already parsed user options * */ void AlnOptsLogicCheck(opts_t *prOpts) { /* guide-tree & distmat * */ if (prOpts->pcDistmatInfile && prOpts->pcGuidetreeInfile) { Log(&rLog, LOG_FATAL, "Read distances *and* guide-tree from file doesn't make sense."); } if (prOpts->pcDistmatOutfile && prOpts->pcGuidetreeInfile) { Log(&rLog, LOG_FATAL, "Won't be able to save distances to file, because I got a guide-tree as input."); } /* combination of options that don't make sense when not iterating */ if (prOpts->iNumIterations==0 && prOpts->bIterationsAuto != TRUE) { if (prOpts->pcGuidetreeInfile && prOpts->pcGuidetreeOutfile) { Log(&rLog, LOG_FATAL, "Got a guide-tree as input and output which doesn't make sense when not iterating."); } /* if (prOpts->pcGuidetreeInfile && prOpts->bUseMbed > 0) { Log(&rLog, LOG_FATAL, "Got a guide-tree as input and was requested to cluster with mBed, which doesn't make sense when not iterating."); } */ /* AW: bUseMbedForIteration default since at least R252 if (prOpts->bUseMbedForIteration > 0) { Log(&rLog, LOG_FATAL, "No iteration requested, but mbed for iteration was set. Paranoia exit."); } */ } if (prOpts->rHhalignPara.iMacRamMB < 512) { Log(&rLog, LOG_WARN, "Memory for MAC Algorithm quite low, Viterbi Algorithm may be triggered."); if (prOpts->rHhalignPara.iMacRamMB < 1) { Log(&rLog, LOG_WARN, "Viterbi Algorithm always turned on, increase MAC-RAM to turn on MAC."); } } return; } /* end of AlnOptsLogicCheck() */ /** * @brief FIXME doc */ void PrintAlnOpts(FILE *prFile, opts_t *prOpts) { int iAux; /* keep in same order as struct */ fprintf(prFile, "option: auto-options = %d\n", prOpts->bAutoOptions); fprintf(prFile, "option: distmat-infile = %s\n", NULL != prOpts->pcDistmatInfile? prOpts->pcDistmatInfile: "(null)"); fprintf(prFile, "option: distmat-outfile = %s\n", NULL != prOpts->pcDistmatOutfile? prOpts->pcDistmatOutfile: "(null)"); fprintf(prFile, "option: clustering-type = %d\n", prOpts->iClusteringType); fprintf(prFile, "option: pair-dist-type = %d\n", prOpts->iPairDistType); fprintf(prFile, "option: use-mbed = %d\n", prOpts->bUseMbed); fprintf(prFile, "option: use-mbed-for-iteration = %d\n", prOpts->bUseMbedForIteration); fprintf(prFile, "option: pile-up = %d\n", prOpts->bPileup); fprintf(prFile, "option: guidetree-outfile = %s\n", NULL != prOpts->pcGuidetreeOutfile? prOpts->pcGuidetreeOutfile: "(null)"); fprintf(prFile, "option: guidetree-infile = %s\n", NULL != prOpts->pcGuidetreeInfile? prOpts->pcGuidetreeInfile: "(null)"); for (iAux=0; iAuxiHMMInputFiles; iAux++) { fprintf(prFile, "option: hmm-input no %d = %s\n", iAux, prOpts->ppcHMMInput[iAux]); } fprintf(prFile, "option: hmm-input-files = %d\n", prOpts->iHMMInputFiles); fprintf(prFile, "option: num-iterations = %d\n", prOpts->iNumIterations); fprintf(prFile, "option: iterations-auto = %d\n", prOpts->bIterationsAuto); fprintf(prFile, "option: max-hmm-iterations = %d\n", prOpts->iMaxHMMIterations); fprintf(prFile, "option: max-guidetree-iterations = %d\n", prOpts->iMaxGuidetreeIterations); fprintf(prFile, "option: iMacRamMB = %d\n", prOpts->rHhalignPara.iMacRamMB); fprintf(prFile, "option: percent-id = %d\n", prOpts->bPercID); fprintf(prFile, "option: use-kimura = %d\n", prOpts->bUseKimura); fprintf(prFile, "option: clustering-out = %s\n", prOpts->pcClustfile); fprintf(prFile, "option: posterior-out = %s\n", prOpts->pcPosteriorfile); } /* end of PrintAlnOpts() */ /** * @brief Returns major version of HMMER. Whichever hmmbuild version * is found first in your PATH will be used * * @return -1 on error, major hmmer version otherwise * */ int HmmerVersion() { char zcHmmerTestCall[] = "hmmbuild -h"; FILE *fp = NULL; int iMajorVersion = 0; char zcLine[16384]; if (NULL == (fp = popen(zcHmmerTestCall, "r"))) { Log(&rLog, LOG_ERROR, "Couldn't exec %s", zcHmmerTestCall); return -1; } while (fgets(zcLine, sizeof(zcLine), fp)) { char *pcLocate; if ((pcLocate = strstr(zcLine, "HMMER "))) { iMajorVersion = atoi(&pcLocate[6]); break; } } pclose(fp); return iMajorVersion; } /* end of HmmerVersion() */ /** * @brief Create a HHM file from aligned sequences * * @warning Should be eliminated in the future * as building routine should not create intermediate files * * @param[in] prMSeq * Aligned mseq_t * @param[in] pcHMMOut * HMM output file name * * @return Non-zero on error * */ int AlnToHHMFile(mseq_t *prMSeq, char *pcHMMOut) { char *tmp_aln = NULL; int retcode = OK; assert(NULL!=prMSeq); assert(NULL!=pcHMMOut); if (FALSE == prMSeq->aligned) { Log(&rLog, LOG_ERROR, "Sequences need to be aligned to create an HMM"); return FAILURE; } /* Convert alignment to a2m, and call hhmake * * can't be static templates, or mktemp fails (at least on os x * (with a bus error)) * * gcc says we should use mkstemp to avoid race conditions, * but that returns a file descriptor, which is of no use to * us */ /* NOTE: the following won't work on windows: missing /tmp/ */ tmp_aln = CkStrdup("/tmp/clustalo_tmpaln_XXXXXX"); if (NULL == mktemp(tmp_aln)) { Log(&rLog, LOG_ERROR, "Could not create temporary alignment filename"); retcode = FAILURE; goto cleanup_and_return; } #define LINE_WRAP 60 if (WriteAlignment(prMSeq, tmp_aln, MSAFILE_A2M, LINE_WRAP, FALSE)) { Log(&rLog, LOG_ERROR, "Could not save alignment to %s", tmp_aln); retcode = FAILURE; goto cleanup_and_return; } if (HHMake_Wrapper(tmp_aln, pcHMMOut)){ Log(&rLog, LOG_ERROR, "Could not convert alignment %s into HHM", tmp_aln); retcode = FAILURE; goto cleanup_and_return; } cleanup_and_return: if (NULL != tmp_aln) { if (FileExists(tmp_aln)) { if (remove(tmp_aln)) { Log(&rLog, LOG_WARN, "Removing %s failed. Continuing anyway", tmp_aln); } } CKFREE(tmp_aln); } return retcode; } /* end of AlnToHHMFile() */ /** * @brief Create a HMM file from aligned sequences * * @warning Should be replaced in the future by some internal HMM * building routine that does not call external programs * * @param[in] prMSeq * Aligned mseq_t * @param[in] pcHMMOut * HMM output file name * * @return Non-zero on error * */ int AlnToHMMFile(mseq_t *prMSeq, const char *pcHMMOut) { char *tmp_aln = NULL; char *tmp_hmm = NULL; /* only needed for hmmer3 to hmmer2 conversion */ char cmdbuf[16384]; int iHmmerVersion = 0; int retcode = OK; assert(NULL!=prMSeq); assert(NULL!=pcHMMOut); if (FALSE == prMSeq->aligned) { Log(&rLog, LOG_ERROR, "Sequences need to be aligned to create an HMM"); return FAILURE; } iHmmerVersion = HmmerVersion(); if (2 != iHmmerVersion && 3 != iHmmerVersion) { Log(&rLog, LOG_ERROR, "Could not find suitable HMMER binaries"); return FAILURE; } /* Convert alignment to stockholm, call hmmbuild and then * either hmmconvert (hmmer3) or hmmcalibrate (hmmer2) * * can't be static templates, or mktemp fails (at least on os x * (with a bus error)) * * gcc says we should use mkstemp to avoid race conditions, * but that returns a file descriptor, which is of no use to * us */ /* NOTE: the following won't work on windows: missing /tmp/ */ tmp_aln = CkStrdup("/tmp/clustalo_tmpaln_XXXXXX"); if (NULL == mktemp(tmp_aln)) { Log(&rLog, LOG_ERROR, "Could not create temporary alignment filename"); retcode = FAILURE; goto cleanup_and_return; } #define LINE_WRAP 60 if (WriteAlignment(prMSeq, tmp_aln, MSAFILE_STOCKHOLM, LINE_WRAP, FALSE)) { Log(&rLog, LOG_ERROR, "Could not save alignment to %s", tmp_aln); retcode = FAILURE; goto cleanup_and_return; } if (2 == iHmmerVersion) { sprintf(cmdbuf, "hmmbuild %s %s >/dev/null && hmmcalibrate %s >/dev/null", pcHMMOut, tmp_aln, pcHMMOut); if (system(cmdbuf)) { Log(&rLog, LOG_ERROR, "Command '%s' failed", cmdbuf); retcode = FAILURE; goto cleanup_and_return; } } else if (3 == iHmmerVersion) { /* NOTE: the following won't work on windows: missing /tmp/ */ tmp_hmm = CkStrdup("/tmp/clustalo_tmphmm2_XXXXXX"); if (NULL == mktemp(tmp_hmm)) { Log(&rLog, LOG_ERROR, "Could not create temporary hmm filename"); retcode = FAILURE; goto cleanup_and_return; } sprintf(cmdbuf, "hmmbuild %s %s >/dev/null && hmmconvert -2 %s > %s", tmp_hmm, tmp_aln, tmp_hmm, pcHMMOut); if (system(cmdbuf)) { Log(&rLog, LOG_ERROR, "Command '%s' failed", cmdbuf); retcode = FAILURE; goto cleanup_and_return; } } else { CKFREE(tmp_aln); Log(&rLog, LOG_FATAL, "Internal error: Unknown Hmmer version %d", iHmmerVersion); } cleanup_and_return: if (NULL != tmp_aln) { if (FileExists(tmp_aln)) { if (remove(tmp_aln)) { Log(&rLog, LOG_WARN, "Removing %s failed. Continuing anyway", tmp_aln); } } CKFREE(tmp_aln); } if (NULL != tmp_hmm) { if (FileExists(tmp_hmm)) { if (remove(tmp_hmm)) { Log(&rLog, LOG_WARN, "Removing %s failed. Continuing anyway", tmp_hmm); } } CKFREE(tmp_hmm); } return retcode; } /* end of AlnToHMMFile() */ /** * @brief Convert a multiple sequence structure into a HMM * * @param[out] prHMM * Pointer to preallocted HMM which will be set here * @param[in] prMSeq * Pointer to an alignment * * @return 0 on error, non-0 otherwise * * @see AlnToHMMFile() * */ int AlnToHMM(hmm_light *prHMM, mseq_t *prMSeq) { char *pcHMM; /* temp hmm file */ Log(&rLog, LOG_INFO, "Using HMMER version %d to calculate a new HMM.", HmmerVersion()); /* FIXME replace all this with internal HMM computation (HHmake) */ /** * @warning the following probably won't work on windows: missing * /tmp/. Should be ok on Cygwin though */ pcHMM = CkStrdup("/tmp/clustalo-hmm-iter_XXXXXX"); if (NULL == mktemp(pcHMM)) { Log(&rLog, LOG_ERROR, "Could not create temporary hmm filename"); CKFREE(pcHMM); return FAILURE; } /* Create a HMM representing the current alignment */ #if USEHMMER if (AlnToHMMFile(prMSeq, pcHMM)) { Log(&rLog, LOG_ERROR, "AlnToHMMFile() on %s failed.", pcHMM); CKFREE(pcHMM); return FAILURE; } #elif USEHHMAKE if (AlnToHHMFile(prMSeq, pcHMM)) { Log(&rLog, LOG_ERROR, "AlnToHHMFile() on %s failed.", pcHMM); CKFREE(pcHMM); return FAILURE; } /* Log(&rLog, LOG_FATAL, "Method to create HHM (HMM using hhmake) not installed yet"); */ #else Log(&rLog, LOG_FATAL, "Unknown method to create temporary HMM"); #endif /* Read HMM information */ if (OK != readHMMWrapper(prHMM, pcHMM)){ Log(&rLog, LOG_ERROR, "Processing of HMM file %s failed", pcHMM); CKFREE(pcHMM); return FAILURE; } if (remove(pcHMM)) { Log(&rLog, LOG_WARN, "Removing %s failed. Continuing anyway", pcHMM); } CKFREE(pcHMM); return OK; } /* end of AlnToHMM() */ /** * @brief FIXME * */ void InitClustalOmega(int iNumThreadsRequested) { #ifdef HAVE_OPENMP iNumberOfThreads = iNumThreadsRequested; omp_set_num_threads(iNumberOfThreads); #else if (iNumThreadsRequested>1) { Log(&rLog, LOG_FATAL, "Cannot change number of threads to %d. %s was build without OpenMP support.", iNumThreadsRequested, PACKAGE_NAME); } iNumberOfThreads = 1; /* need to set this, even if build without support */ #endif Log(&rLog, LOG_INFO, "Using %d threads", iNumberOfThreads); } /* end of InitClustalOmega() */ /** * @brief Defines an alignment order, which adds sequences * sequentially, i.e. one at a time starting with seq 1 & 2 * * @param[out] piOrderLR_p * order in which nodes/profiles are to be merged/aligned * @param[in] iNumSeq * Number of sequences * * @see TraverseTree() * */ void SequentialAlignmentOrder(int **piOrderLR_p, int iNumSeq) { unsigned int uNodes = iNumSeq*2-1; unsigned int uNodeCounter = 0; unsigned int uSeqCounter = 0; Log(&rLog, LOG_FATAL, "FIXME: Untested..."); (*piOrderLR_p) = (int *)CKCALLOC(DIFF_NODE * uNodes, sizeof(int)); /* loop over merge nodes, which have per definition even indices * and set up children which have odd indices */ uSeqCounter = 0; for (uNodeCounter=iNumSeq; uNodeCounternseqs) { Log(&rLog, LOG_VERBOSE, "Have only two sequences: No need to compute pairwise score and compute a tree."); if (NULL != pcDistmatOutfile){ Log(&rLog, LOG_WARN, "Have only two sequences: Will not calculate/print distance matrix."); } (*piOrderLR_p) = (int*) CKMALLOC(DIFF_NODE * 3 * sizeof(int)); (*piOrderLR_p)[DIFF_NODE*0+LEFT_NODE] = 0; (*piOrderLR_p)[DIFF_NODE*0+RGHT_NODE] = 0; (*piOrderLR_p)[DIFF_NODE*0+PRNT_NODE] = 0; (*piOrderLR_p)[DIFF_NODE*1+LEFT_NODE] = 1; (*piOrderLR_p)[DIFF_NODE*1+RGHT_NODE] = 1; (*piOrderLR_p)[DIFF_NODE*1+PRNT_NODE] = 1; /* root */ (*piOrderLR_p)[DIFF_NODE*2+LEFT_NODE] = 0; (*piOrderLR_p)[DIFF_NODE*2+RGHT_NODE] = 1; (*piOrderLR_p)[DIFF_NODE*2+PRNT_NODE] = 2; /* Same logic as CalcClustalWeights(). Changes there will have to be reflected here as well. */ #if USE_WEIGHTS (*pdWeights_p) = (double *) CKMALLOC(uNodeCount * sizeof(double)); (*pdWeights_p)[0] = 0.5; (*pdWeights_p)[1] = 0.5; #endif return OK; } /* compute distance & guide tree, alternatively read distances or * guide tree from file * */ if (NULL != pcGuidetreeInfile) { Log(&rLog, LOG_INFO, "Reading guide-tree from %s", pcGuidetreeInfile); if (GuideTreeFromFile(&prTree, prMSeq, pcGuidetreeInfile)) { Log(&rLog, LOG_ERROR, "Reading of guide tree %s failed.", pcGuidetreeInfile); return FAILURE; } } else { if (bUseMbed) { if (NULL != pcDistmatInfile) { Log(&rLog, LOG_ERROR, "Can't input distance matrix when in mbed mode."); return FAILURE; } if (Mbed(&prTree, prMSeq, iPairDistType, pcGuidetreeOutfile, iClustersizes, pcClusterFile)) { Log(&rLog, LOG_ERROR, "mbed execution failed."); return FAILURE; } Log(&rLog, LOG_INFO, "Guide-tree computation (mBed) done."); if (NULL != pcDistmatOutfile) { Log(&rLog, LOG_INFO, "Ignoring request to write distance matrix (am in mBed mode)"); } } else { if (PairDistances(&distmat, prMSeq, iPairDistType, bPercID, 0, prMSeq->nseqs, 0, prMSeq->nseqs, pcDistmatInfile, pcDistmatOutfile)) { Log(&rLog, LOG_ERROR, "Couldn't compute pair distances"); return FAILURE; } /* clustering of distances to get guide tree */ if (CLUSTERING_UPGMA == iClusteringType) { char **labels; labels = (char**) CKMALLOC(prMSeq->nseqs * sizeof(char*)); for (i=0; inseqs; i++) { labels[i] = prMSeq->sqinfo[i].name; } GuideTreeUpgma(&prTree, labels, distmat, pcGuidetreeOutfile); Log(&rLog, LOG_INFO, "Guide-tree computation done."); CKFREE(labels); } else { Log(&rLog, LOG_FATAL, "INTERNAL ERROR %s", "clustering method should have been checked before"); } } /* did not use mBed */ } /* had to calculate tree (did not read from file) */ #if USE_WEIGHTS /* derive sequence weights from tree * */ Log(&rLog, LOG_INFO, "Calculating sequence weights"); CalcClustalWeights(pdSeqWeights_p, prTree); for (i = 0; i < GetLeafCount(prTree); i++) { Log(&rLog, LOG_VERBOSE, "Weight for seq no %d: %s = %f", i, prMSeq->sqinfo[i].name, (*pdSeqWeights_p)[i]); } #else Log(&rLog, LOG_DEBUG, "Not using weights"); #endif /* define traversing order of tree * */ TraverseTree(piOrderLR_p, prTree, prMSeq); if (rLog.iLogLevelEnabled <= LOG_DEBUG) { /* FIXME: debug only, FS */ uint uNodeIndex; FILE *fp = LogGetFP(&rLog, LOG_INFO); Log(&rLog, LOG_DEBUG, "left/right order after tree traversal"); for (uNodeIndex = 0; uNodeIndex < GetNodeCount(prTree); uNodeIndex++) { fprintf(fp, "%3d:\t%2d/%2d -> %d\n", i, (*piOrderLR_p)[DIFF_NODE*uNodeIndex+LEFT_NODE], (*piOrderLR_p)[DIFF_NODE*uNodeIndex+RGHT_NODE], (*piOrderLR_p)[DIFF_NODE*uNodeIndex+PRNT_NODE]); } } FreeMuscleTree(prTree); FreeSymMatrix(&distmat); #if 0 Log(&rLog, LOG_FATAL, "DEBUG EXIT before leaving %s", __FUNCTION__); #endif return OK; } /* end of AlignmentOrder() */ /** * @brief Set some options automatically based on number of sequences. Might * overwrite some user-set options. * * @param[out] prOpts * Pointer to alignment options structure * @param[in] iNumSeq * Number of sequences to align */ void SetAutoOptions(opts_t *prOpts, int iNumSeq) { Log(&rLog, LOG_INFO, "Setting options automatically based on input sequence characteristics (might overwrite some of your options)."); /* AW: new version of mbed is always good (uses subclusters) */ if (FALSE == prOpts->bUseMbed) { Log(&rLog, LOG_INFO, "Auto settings: Enabling mBed."); prOpts->bUseMbed = TRUE; } if (iNumSeq >= 1000) { if (0 != prOpts->iNumIterations) { Log(&rLog, LOG_INFO, "Auto settings: Disabling iterations."); prOpts->iNumIterations = 0; } } else if (iNumSeq < 1000) { if (1 != prOpts->iNumIterations) { Log(&rLog, LOG_INFO, "Auto settings: Setting iteration to 1."); prOpts->iNumIterations = 1; } } } /* end of */ /** * @brief The main alignment function which wraps everything else. * * @param[out] prMSeq * *the* multiple sequences structure * @param[in] prMSeqProfile * optional profile to align against * @param[in] prOpts * alignment options to use * * @return 0 on success, -1 on failure * */ int Align(mseq_t *prMSeq, mseq_t *prMSeqProfile, opts_t *prOpts) { /* HMM */ /* structs with pseudocounts etc; one for each HMM infile, i.e. * index range: 0..iHMMInputFiles */ hmm_light *prHMMs = NULL; /* MSA order in which nodes/profiles are to be merged/aligned (order of nodes in guide tree (left/right)*/ int *piOrderLR = NULL; /* weights per sequence */ double *pdSeqWeights = NULL; /* Iteration */ int iIterationCounter = 0; double dAlnScore; /* last dAlnScore for iteration */ double dLastAlnScore = -666.666; int i, j; /* aux */ assert(NULL != prMSeq); if (NULL != prMSeqProfile) { assert(TRUE == prMSeqProfile->aligned); } /* automatic setting of options * */ if (prOpts->bAutoOptions) { SetAutoOptions(prOpts, prMSeq->nseqs); } #if SHUFFLE_INPUT_SEQ_ORDER /* * shuffle input: only useful for testing/debugging */ Log(&rLog, LOG_WARN, "Shuffling input sequences! (Will also change output order)"); ShuffleMSeq(prMSeq); #endif #if SORT_INPUT_SEQS /* * sort input: * * would ensure we *always* (unless we get into the mbed k-means stage) * get the same answer. usually you don't, because most pairwise alignment * scores are in theory not symmetric, therefore sequence ordering might * have an effect on the guide-tree. Sorting by length should get rid of * this (and takes no time even for 100k seqs). Benchmark results on * Balibase show almost no difference after sorting. */ Log(&rLog, LOG_WARN, "Sorting input seq by length! This will also change the output order"); SortMSeqByLength(prMSeq, 'd'); #endif if (TRUE == prOpts->bPileup){ PileUp(prMSeq, prOpts->rHhalignPara, prOpts->iClustersizes); return 0; } /* Read backgrounds HMMs and store in prHMMs * */ if (0 < prOpts->iHMMInputFiles) { int iHMMInfileIndex; /** * @warning old structure used to be initialised like this: * hmm_light rHMM = {0}; */ prHMMs = (hmm_light *) CKMALLOC(prOpts->iHMMInputFiles * sizeof(hmm_light)); for (iHMMInfileIndex=0; iHMMInfileIndexiHMMInputFiles; iHMMInfileIndex++) { char *pcHMMInput = prOpts->ppcHMMInput[iHMMInfileIndex]; if (OK != readHMMWrapper(&prHMMs[iHMMInfileIndex], pcHMMInput)){ Log(&rLog, LOG_ERROR, "Processing of HMM file %s failed", pcHMMInput); return -1; } #if 0 Log(&rLog, LOG_FORCED_DEBUG, "HMM length is %d", prHMMs[iHMMInfileIndex].L); Log(&rLog, LOG_FORCED_DEBUG, "n-display is %d", prHMMs[iHMMInfileIndex].n_display); for (i = 0; NULL != prHMMs[prOpts->iHMMInputFiles].seq[i]; i++){ printf("seq[%d]: %s\n", i, prHMMs[iHMMInfileIndex].seq[i]); } Log(&rLog, LOG_FORCED_DEBUG, "Neff_HMM is %f", prHMMs[iHMMInfileIndex].Neff_HMM); #endif if (rLog.iLogLevelEnabled <= LOG_DEBUG){ Log(&rLog, LOG_DEBUG, "print frequencies"); for (i = 0; i < prHMMs[iHMMInfileIndex].L; i++){ #define PRINT_TAIL 5 if ( (PRINT_TAIL+1 == i) && (prHMMs[iHMMInfileIndex].L-PRINT_TAIL != i) ){ printf("....\n"); } if ( (i > PRINT_TAIL) && (i < prHMMs[iHMMInfileIndex].L-PRINT_TAIL) ){ continue; } printf("%3d:", i); for (j = 0; j < 20; j++){ printf("\t%1.3f", prHMMs[iHMMInfileIndex].f[i][j]); } printf("\n"); } } /* debug print block */ CKFREE(prOpts->ppcHMMInput[iHMMInfileIndex]); } /* for each background HMM file */ CKFREE(prOpts->ppcHMMInput); } /* there were background HMM files */ /* If the input ("non-profile") sequences are aligned, then turn * the alignment into a HMM and add to the list of background HMMs * */ if (TRUE == prMSeq->aligned) { /* FIXME: gcc warns about missing initialiser here (-Wall -Wextra -pedantic) */ hmm_light rHMMLocal = {0}; Log(&rLog, LOG_INFO, "Input sequences are aligned. Will turn alignment into HMM and add it to the user provided background HMMs."); /* certain gap parameters ('~' MSF) cause problems, sanitise them; FS, r258 -> r259 */ SanitiseUnknown(prMSeq); if (OK != #if INDIRECT_HMM AlnToHMM(&rHMMLocal, prMSeq) #else AlnToHMM2(&rHMMLocal, prOpts->rHhalignPara, prMSeq->seq, prMSeq->nseqs) #endif ) { Log(&rLog, LOG_ERROR, "Couldn't convert aligned input sequences to HMM. Will try to continue"); } else { prHMMs = (hmm_light *) CKREALLOC(prHMMs, ((prOpts->iHMMInputFiles+1) * sizeof(hmm_light))); memcpy(&(prHMMs[prOpts->iHMMInputFiles]), &rHMMLocal, sizeof(hmm_light)); prOpts->iHMMInputFiles++; } } /* If we have a profile turn it into a HMM and add to * the list of background HMMs. * */ if (NULL != prMSeqProfile) { /* FIXME: gcc warns about missing initialiser here (-Wall -Wextra -pedantic) */ hmm_light rHMMLocal = {0}; Log(&rLog, LOG_INFO, "Turning profile1 into HMM and will use it during progressive alignment."); if (OK != #if INDIRECT_HMM AlnToHMM(&rHMMLocal, prMSeqProfile) #else AlnToHMM2(&rHMMLocal, prOpts->rHhalignPara, prMSeqProfile->seq, prMSeqProfile->nseqs) #endif ) { Log(&rLog, LOG_ERROR, "Couldn't convert profile1 to HMM. Will try to continue"); } else { prHMMs = (hmm_light *) CKREALLOC(prHMMs, ((prOpts->iHMMInputFiles+1) * sizeof(hmm_light))); memcpy(&(prHMMs[prOpts->iHMMInputFiles]), &rHMMLocal, sizeof(hmm_light)); prOpts->iHMMInputFiles++; } } /* Now do a first alignment of the input sequences (prMSeq) adding * all collected background HMMs * */ /* Determine progressive alignment order */ if (TRUE == prMSeq->aligned) { if ( (SEQTYPE_PROTEIN == prMSeq->seqtype) && (TRUE == prOpts->bUseKimura) ){ Log(&rLog, LOG_INFO, "%s %s", "Input sequences are aligned.", "Will use Kimura distances of aligned sequences."); prOpts->iPairDistType = PAIRDIST_SQUIDID_KIMURA; } else { prOpts->iPairDistType = PAIRDIST_SQUIDID; } } #if 0 Log(&rLog, LOG_WARN, "Using a sequential alignment order."); SequentialAlignmentOrder(&piOrderLR, prMSeq->nseqs); #else if (OK != AlignmentOrder(&piOrderLR, &pdSeqWeights, prMSeq, prOpts->iPairDistType, prOpts->pcDistmatInfile, prOpts->pcDistmatOutfile, prOpts->iClusteringType, prOpts->iClustersizes, prOpts->pcGuidetreeInfile, prOpts->pcGuidetreeOutfile, prOpts->pcClustfile, prOpts->bUseMbed, prOpts->bPercID)) { Log(&rLog, LOG_ERROR, "AlignmentOrder() failed. Cannot continue"); return -1; } #endif /* if max-hmm-iter is set < 0 then do not perform alignment * there is a problem/feature(?) that the un-aligned sequences are output */ if (prOpts->iMaxHMMIterations < 0){ Log(&rLog, LOG_VERBOSE, "iMaxHMMIterations < 0 (%d), will not perform alignment", prOpts->iMaxHMMIterations); return 0; } /* Progressive alignment of input sequences. Order defined by * branching of guide tree (piOrderLR). Use optional * background HMM information (prHMMs[0..prOpts->iHMMInputFiles-1]) * */ dAlnScore = HHalignWrapper(prMSeq, piOrderLR, pdSeqWeights, 2*prMSeq->nseqs -1/* nodes */, prHMMs, prOpts->iHMMInputFiles, -1, prOpts->rHhalignPara); dLastAlnScore = dAlnScore; Log(&rLog, LOG_VERBOSE, "Alignment score for first alignment = %f", dAlnScore); /* ------------------------------------------------------------ * * prMSeq is aligned now. Now start iterations if requested and save the * alignment at the very end. * * @note We discard the background HMM information at this point, * because it was already used. Could consider to make this choice * optional. FIXME * * ------------------------------------------------------------ */ /* iteration after first alignment was computed (if not profile-profile * alignment) * */ for (iIterationCounter=0; (iIterationCounter < prOpts->iNumIterations || prOpts->bIterationsAuto); iIterationCounter++) { hmm_light rHMMLocal = {0}; /* FIXME Keep copy of old alignment in case new one sucks? */ if (iIterationCounter >= prOpts->iMaxHMMIterations && iIterationCounter >= prOpts->iMaxGuidetreeIterations) { Log(&rLog, LOG_VERBOSE, "Reached maximum number of HMM and guide-tree iterations"); break; } if (! prOpts->bIterationsAuto) { Log(&rLog, LOG_INFO, "Iteration step %d out of %d", iIterationCounter+1, prOpts->iNumIterations); } else { Log(&rLog, LOG_INFO, "Iteration step %d out of ", iIterationCounter+1); } #if 0 if (rLog.iLogLevelEnabled <= LOG_VERBOSE) { char zcIntermediate[1000] = {0}; char *pcFormat = "fasta"; sprintf(zcIntermediate, "clustalo-aln-iter~%d~", iIterationCounter); #define LINE_WRAP 60 if (WriteAlignment(prMSeq, zcIntermediate, MSAFILE_A2M, LINE_WRAP)) { Log(&rLog, LOG_ERROR, "Could not save alignment to %s", zcIntermediate); return -1; } } #endif /* new guide-tree * */ if (iIterationCounter < prOpts->iMaxGuidetreeIterations) { /* determine progressive alignment order * * few things are different now when calling AlignmentOrder: * - we have to ignore prOpts->pcDistmatInfile and pcGuidetreeInfile * as they were used before * - the corresponding outfiles are still valid though */ /* Free stuff that has already been allocated by or further * downstream of AlignmentOrder() */ if (NULL != piOrderLR) CKFREE(piOrderLR); if (NULL != pdSeqWeights) CKFREE(pdSeqWeights); Log(&rLog, LOG_INFO, "Computing new guide tree (iteration step %d)"); if (AlignmentOrder(&piOrderLR, &pdSeqWeights, prMSeq, ((SEQTYPE_PROTEIN == prMSeq->seqtype) && (TRUE == prOpts->bUseKimura)) ? PAIRDIST_SQUIDID_KIMURA : PAIRDIST_SQUIDID, NULL, prOpts->pcDistmatOutfile, prOpts->iClusteringType, prOpts->iClustersizes, NULL, prOpts->pcGuidetreeOutfile, prOpts->pcClustfile, prOpts->bUseMbedForIteration, prOpts->bPercID)) { Log(&rLog, LOG_ERROR, "AlignmentOrder() failed. Cannot continue"); return -1; } } else { Log(&rLog, LOG_INFO, "Skipping guide-tree iteration at iteration step %d (reached maximum)", iIterationCounter); } /* new local hmm iteration * */ /* non-residue/gap characters will crash AlnToHMM2(), therefore sanitise unknown characters, FS, r259 -> r260 */ SanitiseUnknown(prMSeq); if (iIterationCounter < prOpts->iMaxHMMIterations) { Log(&rLog, LOG_INFO, "Computing HMM from alignment"); if (OK != #if INDIRECT_HMM AlnToHMM(&rHMMLocal, prMSeq) #else AlnToHMM2(&rHMMLocal, prOpts->rHhalignPara, prMSeq->seq, prMSeq->nseqs) #endif ) { Log(&rLog, LOG_ERROR, "Couldn't convert alignment to HMM. Will stop iterating now..."); break; } } else { Log(&rLog, LOG_INFO, "Skipping HMM iteration at iteration step %d (reached maximum)", iIterationCounter); } /* align the sequences (again) */ dAlnScore = HHalignWrapper(prMSeq, piOrderLR, pdSeqWeights, 2*prMSeq->nseqs -1/* nodes */, &rHMMLocal, 1, -1, prOpts->rHhalignPara); Log(&rLog, LOG_VERBOSE, "Alignment score for alignmnent in hmm-iteration no %d = %f (last score = %f)", iIterationCounter+1, dAlnScore, dLastAlnScore); FreeHMMstruct(&rHMMLocal); #if 0 /* FIXME: need a better score for automatic iteration */ if (prOpts->bIterationsAuto) { /* automatic iteration: break if score improvement was not * big enough */ double dScoreImprovement = (dAlnScore-dLastAlnScore)/dLastAlnScore; if (dScoreImprovement < ITERATION_SCORE_IMPROVEMENT_THRESHOLD) { Log(&rLog, LOG_INFO, "Stopping after %d guide-tree iterations. No further alignment score improvement achieved.", iIterationCounter+1); /* use previous alignment */ FreeMSeq(&prMSeq); Log(&rLog, LOG_FORCED_DEBUG, "FIXME: %s", "CopyMSeq breaks things in this context"); CopyMSeq(&prMSeq, prMSeqCopy); /* FIXME: prOpts->pcDistmatOutfile and pcGuidetreeOutfile * might have been updated, but then discarded here? */ break; } else { Log(&rLog, LOG_INFO, "Got a %d%% better score in iteration step %d", (int)dScoreImprovement*100, iIterationCounter+1); FreeMSeq(&prMSeqCopy); } } dLastAlnScore = dAlnScore; #endif } /* end of iterations */ /* Last step: if a profile was also provided then align now-aligned mseq * with this profile * * Don't use the backgrounds HMMs anymore and don't iterate. * (which was done before). * */ if (NULL != prMSeqProfile) { if (AlignProfiles(prMSeq, prMSeqProfile, prOpts->rHhalignPara)) { Log(&rLog, LOG_ERROR, "An error occured during the profile/profile alignment"); return -1; } } if (NULL != prOpts->pcPosteriorfile){ hmm_light rHMMLocal = {0}; if (OK != #if INDIRECT_HMM AlnToHMM(&rHMMLocal, prMSeq) #else AlnToHMM2(&rHMMLocal, prOpts->rHhalignPara, prMSeq->seq, prMSeq->nseqs) #endif ) { Log(&rLog, LOG_ERROR, "Couldn't convert alignment to HMM. Will not do posterior probabilities..."); } PosteriorProbabilities(prMSeq, rHMMLocal, prOpts->rHhalignPara, prOpts->pcPosteriorfile); FreeHMMstruct(&rHMMLocal); } if (NULL != piOrderLR) { CKFREE(piOrderLR); } if (NULL != pdSeqWeights) { CKFREE(pdSeqWeights); } if (0 < prOpts->iHMMInputFiles) { for (i=0; iiHMMInputFiles; i++) { FreeHMMstruct(&prHMMs[i]); } CKFREE(prHMMs); } return 0; } /* end of Align() */ /** * @brief Align two profiles, ie two sets of prealigned sequences. Already * aligned columns won't be changed. * * @param[out] prMSeqProfile1 * First profile/aligned set of sequences. Merged alignment will be found in * here. * @param[in] prMSeqProfile2 * First profile/aligned set of sequences * @param[in] rHhalignPara * FIXME * * @return 0 on success, -1 on failure * */ int AlignProfiles(mseq_t *prMSeqProfile1, mseq_t *prMSeqProfile2, hhalign_para rHhalignPara) { double dAlnScore; /* number of seqs in first half of joined profile */ int iProfProfSeparator = prMSeqProfile1->nseqs; assert(TRUE == prMSeqProfile1->aligned); assert(TRUE == prMSeqProfile2->aligned); Log(&rLog, LOG_INFO, "Performing profile/profile alignment"); /* Combine the available mseqs into prMSeq * which will be aligned afterwards. */ JoinMSeqs(&prMSeqProfile1, prMSeqProfile2); /* set alignment flag explicitly to FALSE */ prMSeqProfile1->aligned = FALSE; dAlnScore = HHalignWrapper(prMSeqProfile1, NULL, /* no order */ NULL, /* no weights */ 3, /* nodes: root+2profiles */ NULL, 0 /* no bg-hmms */, iProfProfSeparator, rHhalignPara); Log(&rLog, LOG_VERBOSE, "Alignment score is = %f", dAlnScore); return 0; } /* end of AlignProfiles() */ /** * @brief read pseudo-count 'fudge' parameters from file * * @param[out] rHhalignPara_p * structure that holds several hhalign parameters * @param[in] pcPseudoFile * name of file with pseudo-count information. * format must be collection of pairs of lines where one line specifies name of parameter * (gapb,gapd,gape,gapf,gapg,gaph,gapi,pca,pcb,pcc,gapbV,gapdV,gapeV,gapfV,gapgV,gaphV,gapiV,pcaV,pcbV,pccV) * followed by second line with the (double) value of this parameter. * * order of parameters is not fixed, not all parameters have to be set */ int ReadPseudoCountParams(hhalign_para *rHhalignPara_p, char *pcPseudoFile){ FILE *pfIn = NULL; char zcLine[1000] = {0}; char zcFudge[1000] = {0}; double dVal = 0.00; char *pcToken = NULL; char *pcEnd = NULL; if (NULL == (pfIn = fopen(pcPseudoFile, "r"))){ Log(&rLog, LOG_FATAL, "File %s with pseudo-count parameters does not exist", pcPseudoFile); } else { while (NULL != fgets(zcLine, 1000, pfIn)){ if (NULL == (pcToken = strtok(zcLine, " \040\t\n"))){ Log(&rLog, LOG_FATAL, "no token specifying pseudo-count parameter in file %s\n" , pcPseudoFile ); } strcpy(zcFudge, pcToken); if (NULL == fgets(zcLine, 1000, pfIn)){ Log(&rLog, LOG_FATAL, "no line with parameter in file %s associated with %s\n" , pcPseudoFile, zcFudge ); } else { if (NULL == (pcToken = strtok(zcLine, " \040\t\n"))){ Log(&rLog, LOG_FATAL, "no token in 2nd line in file %s associated with %s\n" , pcPseudoFile, zcFudge ); } else { dVal = (double)strtod(pcToken, &pcEnd); if ('\0' != *pcEnd){ Log(&rLog, LOG_FATAL, "token in file %s associated with %s not valid double (%s)\n" , pcPseudoFile, zcFudge, pcToken ); } } } #if 0 printf("%s:%s:%d: read file %s: fudge = %s, val = %f\n" , __FUNCTION__, __FILE__, __LINE__ , pcPseudoFile, zcFudge, dVal ); #endif if (0 == strcmp(zcFudge, "gapb")){ rHhalignPara_p->gapb = dVal; } else if (0 == strcmp(zcFudge, "gapd")){ rHhalignPara_p->gapd = dVal; } else if (0 == strcmp(zcFudge, "gape")){ rHhalignPara_p->gape = dVal; } else if (0 == strcmp(zcFudge, "gapf")){ rHhalignPara_p->gapf = dVal; } else if (0 == strcmp(zcFudge, "gapg")){ rHhalignPara_p->gapg = dVal; } else if (0 == strcmp(zcFudge, "gaph")){ rHhalignPara_p->gaph = dVal; } else if (0 == strcmp(zcFudge, "gapi")){ rHhalignPara_p->gapi = dVal; } else if (0 == strcmp(zcFudge, "pca")){ rHhalignPara_p->pca = dVal; } else if (0 == strcmp(zcFudge, "pcb")){ rHhalignPara_p->pcb = dVal; } else if (0 == strcmp(zcFudge, "pcc")){ rHhalignPara_p->pcc = dVal; } else if (0 == strcmp(zcFudge, "gapbV")){ rHhalignPara_p->gapbV = dVal; } else if (0 == strcmp(zcFudge, "gapdV")){ rHhalignPara_p->gapdV = dVal; } else if (0 == strcmp(zcFudge, "gapeV")){ rHhalignPara_p->gapeV = dVal; } else if (0 == strcmp(zcFudge, "gapfV")){ rHhalignPara_p->gapfV = dVal; } else if (0 == strcmp(zcFudge, "gapgV")){ rHhalignPara_p->gapgV = dVal; } else if (0 == strcmp(zcFudge, "gaphV")){ rHhalignPara_p->gaphV = dVal; } else if (0 == strcmp(zcFudge, "gapiV")){ rHhalignPara_p->gapiV = dVal; } else if (0 == strcmp(zcFudge, "pcaV")){ rHhalignPara_p->pcaV = dVal; } else if (0 == strcmp(zcFudge, "pcbV")){ rHhalignPara_p->pcbV = dVal; } else if (0 == strcmp(zcFudge, "pccV")){ rHhalignPara_p->pccV = dVal; } else { Log(&rLog, LOG_FATAL, "%s not a valid pseudo-count parameter\n" "must be one of [gapb,gapd,gape,gapf,gapg,gaph,gapi,pca,pcb,pcc,gapbV,gapdV,gapeV,gapfV,gapgV,gaphV,gapiV,pcaV,pcbV,pccV]\n" , zcFudge); } /* switched between parameters */ } /* while !EOF */ fclose(pfIn); pfIn = NULL; } /* there was a parameter file */ #if 0 printf("%s:%s:%d: gapb=%g,gapd=%g,gape=%g,gapf=%g,gapg=%g,gaph=%g,gapi=%g,pca=%g,pcb=%g,pcc=%g\n" , __FUNCTION__, __FILE__, __LINE__ , rHhalignPara_p->gapb, rHhalignPara_p->gapd, rHhalignPara_p->gape, rHhalignPara_p->gapf, rHhalignPara_p->gapg, rHhalignPara_p->gaph, rHhalignPara_p->gapi, rHhalignPara_p->pca, rHhalignPara_p->pcb, rHhalignPara_p->pcc ); #endif #if 0 printf("%s:%s:%d: gapbV=%g,gapdV=%g,gapeV=%g,gapfV=%g,gapgV=%g,gaphV=%g,gapiV=%g,pcaV=%g,pcbV=%g,pccV=%g\n" , __FUNCTION__, __FILE__, __LINE__ , rHhalignPara_p->gapbV, rHhalignPara_p->gapdV, rHhalignPara_p->gapeV, rHhalignPara_p->gapfV, rHhalignPara_p->gapgV, rHhalignPara_p->gaphV, rHhalignPara_p->gapiV, rHhalignPara_p->pcaV, rHhalignPara_p->pcbV, rHhalignPara_p->pccV ); #endif return 0; } /* this is the end of ReadPseudoCountParams() */ /* * EOF clustal-omega.c */ clustal-omega-1.2.1/src/clustal-omega-config.h0000644000175100017510000002221012304124357016131 00000000000000#ifndef _SRC_CLUSTAL_OMEGA_CONFIG_H #define _SRC_CLUSTAL_OMEGA_CONFIG_H 1 /* src/clustal-omega-config.h. Generated automatically at end of configure. */ /* src/config.h. Generated from config.h.in by configure. */ /* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ /* Let all files know they are being used inside Clustal Omega */ #ifndef CLUSTAL_OMEGA_CLUSTALO #define CLUSTAL_OMEGA_CLUSTALO 1 #endif /* This is a CYGWIN system */ /* #undef CYGWIN */ /* This is a Darwin system */ /* #undef DARWIN */ /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_ARGTABLE2_H #define CLUSTAL_OMEGA_HAVE_ARGTABLE2_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_ASSERT_H #define CLUSTAL_OMEGA_HAVE_ASSERT_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_CTYPE_H #define CLUSTAL_OMEGA_HAVE_CTYPE_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_DLFCN_H #define CLUSTAL_OMEGA_HAVE_DLFCN_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_FLOAT_H #define CLUSTAL_OMEGA_HAVE_FLOAT_H 1 #endif /* Define to 1 if you have the `fseek64' function. */ /* #undef HAVE_FSEEK64 */ /* Define to 1 if you have the `fseeko' function. */ #ifndef CLUSTAL_OMEGA_HAVE_FSEEKO #define CLUSTAL_OMEGA_HAVE_FSEEKO 1 #endif /* Define to 1 if you have the `fseeko64' function. */ #ifndef CLUSTAL_OMEGA_HAVE_FSEEKO64 #define CLUSTAL_OMEGA_HAVE_FSEEKO64 1 #endif /* Define to 1 if you have the `ftell64' function. */ /* #undef HAVE_FTELL64 */ /* Define to 1 if you have the `ftello' function. */ #ifndef CLUSTAL_OMEGA_HAVE_FTELLO #define CLUSTAL_OMEGA_HAVE_FTELLO 1 #endif /* Define to 1 if you have the `ftello64' function. */ #ifndef CLUSTAL_OMEGA_HAVE_FTELLO64 #define CLUSTAL_OMEGA_HAVE_FTELLO64 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_INTTYPES_H #define CLUSTAL_OMEGA_HAVE_INTTYPES_H 1 #endif /* Define to 1 if you have the `argtable2' library (-largtable2). */ #ifndef CLUSTAL_OMEGA_HAVE_LIBARGTABLE2 #define CLUSTAL_OMEGA_HAVE_LIBARGTABLE2 1 #endif /* Define to 1 if you have the `m' library (-lm). */ #ifndef CLUSTAL_OMEGA_HAVE_LIBM #define CLUSTAL_OMEGA_HAVE_LIBM 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_LIMITS_H #define CLUSTAL_OMEGA_HAVE_LIMITS_H 1 #endif /* Has log2() */ #ifndef CLUSTAL_OMEGA_HAVE_LOG2 #define CLUSTAL_OMEGA_HAVE_LOG2 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_MATH_H #define CLUSTAL_OMEGA_HAVE_MATH_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_MEMORY_H #define CLUSTAL_OMEGA_HAVE_MEMORY_H 1 #endif /* Define to 1 if you have the `ntohl' function. */ #ifndef CLUSTAL_OMEGA_HAVE_NTOHL #define CLUSTAL_OMEGA_HAVE_NTOHL 1 #endif /* Define to 1 if you have the `ntohs' function. */ #ifndef CLUSTAL_OMEGA_HAVE_NTOHS #define CLUSTAL_OMEGA_HAVE_NTOHS 1 #endif /* Define to 1 if you have the `ntonl' function. */ /* #undef HAVE_NTONL */ /* Define to 1 if you have the `ntons' function. */ /* #undef HAVE_NTONS */ /* Defined if OpenMP should and can be used */ #ifndef CLUSTAL_OMEGA_HAVE_OPENMP #define CLUSTAL_OMEGA_HAVE_OPENMP 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STDARG_H #define CLUSTAL_OMEGA_HAVE_STDARG_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STDINT_H #define CLUSTAL_OMEGA_HAVE_STDINT_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STDIO_H #define CLUSTAL_OMEGA_HAVE_STDIO_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STDLIB_H #define CLUSTAL_OMEGA_HAVE_STDLIB_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STRINGS_H #define CLUSTAL_OMEGA_HAVE_STRINGS_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_STRING_H #define CLUSTAL_OMEGA_HAVE_STRING_H 1 #endif /* Define to 1 if you have the `stroul' function. */ /* #undef HAVE_STROUL */ /* Define to 1 if you have the `strtoull' function. */ #ifndef CLUSTAL_OMEGA_HAVE_STRTOULL #define CLUSTAL_OMEGA_HAVE_STRTOULL 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_SYS_STAT_H #define CLUSTAL_OMEGA_HAVE_SYS_STAT_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_SYS_TYPES_H #define CLUSTAL_OMEGA_HAVE_SYS_TYPES_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_TIME_H #define CLUSTAL_OMEGA_HAVE_TIME_H 1 #endif /* Define to 1 if you have the header file. */ #ifndef CLUSTAL_OMEGA_HAVE_UNISTD_H #define CLUSTAL_OMEGA_HAVE_UNISTD_H 1 #endif /* This is a LINUX system */ #ifndef CLUSTAL_OMEGA_LINUX #define CLUSTAL_OMEGA_LINUX 1 #endif /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #ifndef CLUSTAL_OMEGA_LT_OBJDIR #define CLUSTAL_OMEGA_LT_OBJDIR ".libs/" #endif /* This is a MinGW system */ /* #undef MINGW */ /* No-debug Mode */ /* #undef NDEBUG */ /* Some strange OS */ /* #undef OTHEROS */ /* Name of package */ #ifndef CLUSTAL_OMEGA_PACKAGE #define CLUSTAL_OMEGA_PACKAGE "clustal-omega" #endif /* Define to the address where bug reports for this package should be sent. */ #ifndef CLUSTAL_OMEGA_PACKAGE_BUGREPORT #define CLUSTAL_OMEGA_PACKAGE_BUGREPORT "clustalw@ucd.ie" #endif /* The package code name */ #ifndef CLUSTAL_OMEGA_PACKAGE_CODENAME #define CLUSTAL_OMEGA_PACKAGE_CODENAME "AndreaGiacomo" #endif /* Define to the full name of this package. */ #ifndef CLUSTAL_OMEGA_PACKAGE_NAME #define CLUSTAL_OMEGA_PACKAGE_NAME "Clustal Omega" #endif /* Define to the full name and version of this package. */ #ifndef CLUSTAL_OMEGA_PACKAGE_STRING #define CLUSTAL_OMEGA_PACKAGE_STRING "Clustal Omega 1.2.1" #endif /* Define to the one symbol short name of this package. */ #ifndef CLUSTAL_OMEGA_PACKAGE_TARNAME #define CLUSTAL_OMEGA_PACKAGE_TARNAME "clustal-omega" #endif /* Define to the version of this package. */ #ifndef CLUSTAL_OMEGA_PACKAGE_VERSION #define CLUSTAL_OMEGA_PACKAGE_VERSION "1.2.1" #endif /* The size of `fpos_t', as computed by sizeof. */ #ifndef CLUSTAL_OMEGA_SIZEOF_FPOS_T #define CLUSTAL_OMEGA_SIZEOF_FPOS_T 16 #endif /* The size of `unsigned int', as computed by sizeof. */ #ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT #define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT 4 #endif /* The size of `unsigned long', as computed by sizeof. */ #ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG #define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG 8 #endif /* The size of `unsigned long long', as computed by sizeof. */ #ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG #define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG 8 #endif /* The size of `unsigned short', as computed by sizeof. */ #ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT #define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT 2 #endif /* This is a Solaris system */ /* #undef SOLARIS */ /* This is a BSD system */ /* #undef SOMEBSD */ /* Define to 1 if you have the ANSI C header files. */ #ifndef CLUSTAL_OMEGA_STDC_HEADERS #define CLUSTAL_OMEGA_STDC_HEADERS 1 #endif /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # define _TANDEM_SOURCE 1 #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 #endif /* Version number of package */ #ifndef CLUSTAL_OMEGA_VERSION #define CLUSTAL_OMEGA_VERSION "1.2.1" #endif /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN /* # undef WORDS_BIGENDIAN */ # endif #endif /* Define to 1 if on MINIX. */ /* #undef _MINIX */ /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to `long int' if does not define. */ /* #undef off_t */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ /* once: _SRC_CLUSTAL_OMEGA_CONFIG_H */ #endif clustal-omega-1.2.1/src/clustal-omega.h0000644000175100017510000001104012270505074014666 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: clustal-omega.h 212 2011-03-10 15:09:46Z andreas $ */ #ifndef CLUSTALO_H #define CLUSTALO_H #ifdef HAVE_OPENMP #include #endif #include #include "clustal-omega-config.h" /* the following needs to be kept in sync with library_include_HEADERS of all * subdir Makefile.am's */ /* hhalign */ #include "hhalign/general.h" #include "hhalign/hhfunc.h" /* clustal */ #include "clustal/log.h" #include "clustal/util.h" #include "clustal/symmatrix.h" #include "clustal/tree.h" #include "clustal/seq.h" #include "clustal/mbed.h" #include "clustal/weights.h" #include "clustal/pair_dist.h" #include "clustal/hhalign_wrapper.h" #define CLUSTERING_UNKNOWN 0 #define CLUSTERING_UPGMA 1 /* weights will be computed if 1. but are not really used for now and they * might slow things down. also, mbed's screws up branch lengths which will * have a negative effect on weights */ #define USE_WEIGHTS 0 extern int iNumberOfThreads; /* output order */ enum {INPUT_ORDER = 0, TREE_ORDER}; /** user/commandline options * * changes here will have to be reflected in ParseCommandLine() * and during setup of the default opts * */ typedef struct { /* auto: Clustal (know what) is good for you */ bool bAutoOptions; /* Distance matrix */ /** distance matrix input file */ char *pcDistmatInfile; /** distance matrix output file */ char *pcDistmatOutfile; /* Clustering / guide-tree */ /** clustering type (from cmdline arg) */ int iClusteringType; /** number of sequences in cluster */ int iClustersizes; /** file with clustering information */ char *pcClustfile; /** use transitivity */ int iTransitivity; /** file with posterior probability information */ char *pcPosteriorfile; /** pairwise distance method */ int iPairDistType; /** use mbed-like clustering */ bool bUseMbed; /** use mbed-like clustering also during iteration */ bool bUseMbedForIteration; /** pile-up flag */ bool bPileup; /** guidetree output file */ char *pcGuidetreeOutfile; /** guidetree input file */ char *pcGuidetreeInfile; /** use Kimura corrected distance */ bool bUseKimura; /** print percentage identity */ bool bPercID; /* HMMs */ /** HMM input files. index range: 0..iHMMInputFiles */ char **ppcHMMInput; /** number of provided HMM input files. not really a user option but need for ppcHMMInput */ int iHMMInputFiles; /* Iteration */ /** number of iterations */ int iNumIterations; /** determine number of iterations automatically */ bool bIterationsAuto; /** maximum number of hmm iterations */ int iMaxHMMIterations; /** max number of guidetree iterations */ int iMaxGuidetreeIterations; hhalign_para rHhalignPara; /* changes here will have to be reflected in FreeAlnOpts(), * SetDefaultAlnOpts(), AlnOptsLogicCheck() etc */ } opts_t; extern void PrintLongVersion(char *pcStr, int iSize); extern void SetDefaultAlnOpts(opts_t *opts); extern void FreeAlnOpts(opts_t *aln_opts); extern void AlnOptsLogicCheck(opts_t *opts); extern void PrintAlnOpts(FILE *prFile, opts_t *opts); extern void InitClustalOmega(int iNumThreadsToUse); extern void SequentialAlignmentOrder(int **piOrderLR_p, int iNumSeq); extern int AlignmentOrder(int **piOrderLR_p, double **pdSeqWeights_p, mseq_t *prMSeq, int iPairDistType, char *pcDistmatInfile, char *pcDistmatOutfile, int iClusteringType, int iClustersizes, char *pcGuidetreeInfile, char *pcGuidetreeOutfile, char *pcClusterFile, bool bUseMBed, bool bPercID); extern int Align(mseq_t *prMSeq, mseq_t *prMSeqProfile, opts_t *prOpts); extern int AlignProfiles(mseq_t *prMSeqProfile1, mseq_t *prMSeqProfile2, hhalign_para rHhalignPara); #endif extern int ReadPseudoCountParams(hhalign_para *rHhalignPara_p, char *pcPseudoFile); clustal-omega-1.2.1/src/clustal/0000777000175100017510000000000012304154462013516 500000000000000clustal-omega-1.2.1/src/clustal/mbed.h0000644000175100017510000000154212145200411014501 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: mbed.h 278 2013-05-16 15:53:45Z fabian $ */ #ifndef CLUSTALO_MBED_H #define CLUSTALO_MBED_H #include "muscle_tree.h" #include "seq.h" extern int Mbed(tree_t **tree, mseq_t *prMSeq, const int iPairDistType, const char *pcGuidetreeOutfile, int iClustersizes, const char *pcClusterFile); #endif clustal-omega-1.2.1/src/clustal/ktuple_pair.h0000644000175100017510000000234311527010404016115 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: ktuple_pair.h 193 2011-02-07 15:45:21Z andreas $ */ /* K-Tuple code for pairwise alignment (Wilbur and Lipman (1983) * Most code taken from showpair (Clustal 1.83) */ #ifndef CLUSTALO_KTUPLE_PAIR_H #define CLUSTALO_KTUPLE_PAIR_H #include "seq.h" #include "symmatrix.h" #include "progress.h" typedef struct { int ktup; int window; int wind_gap; int signif; } ktuple_param_t; extern void KTuplePairDist(symmatrix_t *tmat, mseq_t *mseq, int istart, int iend, int jstart, int jend, ktuple_param_t *aln_param, progress_t *prProgress, unsigned long int *ulStepNo, unsigned long int ulTotalStepNo); #endif clustal-omega-1.2.1/src/clustal/progress.c0000644000175100017510000001060612206661646015455 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: progress.c 230 2011-04-09 15:37:50Z andreas $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "util.h" #include "log.h" #include "progress.h" #define LOGLEVEL_THRESHOLD LOG_INFO /** * @brief Allocates a new progress structure and initialises its members. * Free with FreeProgress() * * @note Starts the internal stopwatch immediatly! * * @see FreeProgress() * * @param[out] pprProgress * Pointer pointer to progress structure. Progress structure will be * allocated here. * @param[in] prFile * Where to log messages to * @param[in] pcPrefix * What prefix to use for messages * @param[in] bPrintCR * If TRUE carriage return instead of newline will be printed between log messages */ void NewProgress(progress_t **pprProgress, FILE *prFile, char *pcPrefix, bool bPrintCR) { assert(NULL!=pprProgress); assert(NULL!=prFile); assert(NULL!=pcPrefix); (*pprProgress) = (progress_t *) CKMALLOC(1*sizeof(progress_t)); (*pprProgress)->prFile = prFile; (*pprProgress)->bPrintCR = bPrintCR; (*pprProgress)->pcPrefix = CkStrdup(pcPrefix); strcpy((*pprProgress)->pcLastLogMsg, "\0"); (*pprProgress)->prStopwatch = StopwatchCreate(); StopwatchZero((*pprProgress)->prStopwatch); StopwatchStart((*pprProgress)->prStopwatch); return; } /*** end: NewProgress() ***/ /** * @brief Frees progress structure and its members * * @param[out] pprProgress * Pointer pointer to progress structure * * @see NewProgress() * */ void FreeProgress(progress_t **pprProgress) { (*pprProgress)->prFile = NULL; CKFREE((*pprProgress)->pcPrefix); StopwatchFree((*pprProgress)->prStopwatch); CKFREE(*pprProgress); return; } /*** end: FreeProgress() ***/ /** * @brief Prints a progress update (and a carriage return) * * @param[in] prProgress * Pointer to the progress structure * @param[in] iStep * Current step number * @param[in] iTotalSteps * Total step number * @param[in] bForceOutput * If percentage hasn't changed output is normally supressed * normally. Output can be forced with this flag. * */ void ProgressLog(progress_t *prProgress, unsigned long int iStep, unsigned long int iTotalSteps, bool bForceOutput) { char pcLogMsg[1024]; assert(0!=iTotalSteps); if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { return; } (void) snprintf(pcLogMsg, sizeof(pcLogMsg), "%s: %lu %%", prProgress->pcPrefix, (unsigned long int)(iStep/(float)iTotalSteps*100.0)); if (! bForceOutput) { /* Skip logging, if we've just logged the same message */ if (STR_EQ(pcLogMsg, prProgress->pcLastLogMsg)) { return; } } strncpy(prProgress->pcLastLogMsg, pcLogMsg, sizeof(prProgress->pcLastLogMsg)); fprintf(prProgress->prFile, "%s (%lu out of %lu)", pcLogMsg, iStep, iTotalSteps); if (prProgress->bPrintCR) { fprintf(prProgress->prFile, "\r"); } else { fprintf(prProgress->prFile, "\n"); } (void) fflush(prProgress->prFile); return; } /*** end: ProgressLog() ***/ /** * @brief Finishes progress output by printing the elapsed time * * @param[in] prProgress * Pointer to the progress structure * */ void ProgressDone(progress_t *prProgress) { char pcBuf[1024]; if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { return; } (void) snprintf(pcBuf, sizeof(pcBuf), "%s done. CPU time: ", prProgress->pcPrefix); StopwatchStop(prProgress->prStopwatch); StopwatchDisplay(prProgress->prFile, pcBuf, prProgress->prStopwatch); (void) fflush(prProgress->prFile); return; } /*** end: ProgressDone() ***/ clustal-omega-1.2.1/src/clustal/pair_dist.c0000644000175100017510000003505412206661646015573 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: pair_dist.c 288 2013-07-29 13:15:50Z andreas $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include /* only neededfor iNumberOfThreads */ #include "clustal-omega.h" #include "ktuple_pair.h" #include "pair_dist.h" #include "progress.h" #include "util.h" /* Up to rev 173 we had a USE_SYM_KTUPLE switch implemented here. When active * ktuple distances were computed twice for each pair and averaged. Idea was * to avoid assymmetries in the pairwise scores (score(a, b) is often not the * same as score(b, a)). Results on BAliBASE indicate that this is overkill: * * r92_default core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218) * r93-mod--norm-ktuple/ core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218) * r93-mod--sym-ktuple/ core columns: avg-sp=0.801083 avg-tc=0.476544 (of total 217) * r93-mod--rand-ktuple-1 core columns: avg-sp=0.799289 avg-tc=0.468028 (of total 218) * r93-mod--rand-ktuple-2 core columns: avg-sp=0.801654 avg-tc=0.47659 (of total 217) * r93-mod--rand-ktuple-3 core columns: avg-sp=0.800234 avg-tc=0.474908 (of total 218) * r93-mod--rand-ktuple-4 core columns: avg-sp=0.800573 avg-tc=0.476514 (of total 218) * r93-mod--rand-ktuple-5 core columns: avg-sp=0.799679 avg-tc=0.468716 (of total 218) * */ static double KimuraCorrection(double frac_id); static int SquidIdPairDist(symmatrix_t *tmat, mseq_t *mseq, int istart, int iend, int jstart, int jend, bool use_KimuraCorrection, progress_t *prProgress, unsigned long int *ulStepNo, unsigned long int ulTotalStepNo); /* Taken from Muscle's msadistkimura.cpp */ static int DAYHOFF_PAMS[]={ 195, /* 75.0% observed d; 195 PAMs estimated = 195% estimated d */ 196, /* 75.1% observed d; 196 PAMs estimated */ 197, 198, 199, 200, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 226, 227, 228, 229, 230, 231, 232, 233, 234, 236, 237, 238, 239, 240, 241, 243, 244, 245, 246, 248, 249, 250, /* 250 PAMs = 80.3% observed d */ 252, 253, 254, 255, 257, 258, 260, 261, 262, 264, 265, 267, 268, 270, 271, 273, 274, 276, 277, 279, 281, 282, 284, 285, 287, 289, 291, 292, 294, 296, 298, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323, 325, 328, 330, 332, 335, 337, 339, 342, 344, 347, 349, 352, 354, 357, 360, 362, 365, 368, 371, 374, 377, 380, 383, 386, 389, 393, 396, 399, 403, 407, 410, 414, 418, 422, 426, 430, 434, 438, 442, 447, 451, 456, 461, 466, 471, 476, 482, 487, 493, 498, 504, 511, 517, 524, 531, 538, 545, 553, 560, 569, 577, 586, 595, 605, 615, 626, 637, 649, 661, 675, 688, 703, 719, 736, 754, 775, 796, 819, 845, 874, 907, 945, /* 92.9% observed; 945 PAMs */ 988 /* 93.0% observed; 988 PAMs */ }; static int DAYHOFF_TABLE_ENTRIES = sizeof(DAYHOFF_PAMS)/sizeof(DAYHOFF_PAMS[0]); /** * * @brief Compute Kimura corrected distance. * * Original Muscle documentation following: * """ * This is defined to be: * log_e(1 - p - p*p/5) * where p is the fraction of residues that differ, i.e.: * p = (1 - fractional_conservation) * This measure is infinite for p = 0.8541 and is considered * unreliable for p >= 0.75 (according to the ClustalW docs). * ClustalW uses a table lookup for values > 0.75. The following table * was copied from the ClustalW file dayhoff.h. * """ * * @note copied from Muscle's msadistkimura.cpp:KimuraDist() * * @warning For protein only (uses Dayhoff substitution parameters) * * @param[in] p * distance, e.g. 1.0 - fractional/relative identity * * @return The Kimura corrected distance * */ double KimuraCorrection(double p) { int table_index; /* Typical case: use Kimura's empirical formula */ if (p < 0.75) return -log(1 - p - (p*p)/5); /* Per ClustalW, return 10.0 for anything over 93% */ if (p > 0.93) return 10.0; /* If 0.75 >= p <= 0.93, use table lookup */ table_index = (int) ((p - 0.75)*1000 + 0.5); if (table_index < 0 || table_index >= DAYHOFF_TABLE_ENTRIES) Log(&rLog, LOG_FATAL, "Internal error in %s:%s", __FILE__, __FUNCTION__); return DAYHOFF_PAMS[table_index] / 100.0; } /*** end: KimuraCorrection() ***/ /** * @brief Compute distances between all aligned sequence pairs using * squid's PairwiseIdentity, which is: idents / MIN(len1, len2) * * @param[out] tmat * Where to store the computed distances * @param[in] mseq * The aligned sequences * @param[in] istart * For distances [i][j] i>=istart, i=jstart, ialigned) { Log(&rLog, LOG_ERROR, "Sequences need to be aligned (%s)", __FUNCTION__); return -1; } if (SEQTYPE_PROTEIN != mseq->seqtype && TRUE == use_kimura) { Log(&rLog, LOG_WARN, "Using Kimura distance corretion which includes Dayhoff substitution table lookup for non-protein sequences"); } NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO), "Pairwise distance calculation progress", bPrintCR); /* estimation of total number of steps (if istart and jstart are * both 0) */ /* ulTotalStepNo = iend*jend - iend*iend/2 + iend/2; ulStepNo = 0; */ /*LOG_DEBUG("istart=%d iend=%d jstart=%d jend=%d", istart, iend, jstart, jend);*/ for (i=istart; iseq[i], mseq->seq[j]); #ifdef HAVE_OPENMP #pragma omp atomic #endif (*ulStepNo)++; /*LOG_DEBUG("%d:%d raw dist = %f", i, j, dist);*/ if (use_kimura) { dist = KimuraCorrection(dist); /*LOG_DEBUG("cor dist = %f", dist);*/ } SymMatrixSetValue(tmat, i, j, dist); #ifdef HAVE_OPENMP #pragma omp critical(squidid) #endif { Log(&rLog, LOG_DEBUG, "Aligned distance for sequence pair %d:%d= %lg", i+1, j+1, dist); } } } return 0; } /*** end: SquidIdPairDist() ***/ /** * @brief compute or read precomputed distances for given sequences * * @param[out] distmat * Distances will be written to this matrix. will be allocated here as * well. Caller must free with FreeSymMatrix() * @param[in] mseq * Distances will be computed for these sequences * @param[in] pairdist_type * Type of pairwise distance comparison * @param[in] fdist_in * If not NULL, sequences will be written from this file instead of * computing them * @param[in] istart * Compute distances for sequences i:j, i>=istart, inseqs. * @param[in] jstart * Compute distances for sequences i:j, j>=jstart, inseqs. * @param[in] fdist_out * If not NULL, distances will be written to this files * * */ int PairDistances(symmatrix_t **distmat, mseq_t *mseq, int pairdist_type, bool bPercID, int istart, int iend, int jstart, int jend, char *fdist_in, char *fdist_out) { int uSeqIndex; unsigned long int ulStepNo = 0, ulTotalStepNo; /* DD: moved from SquidIdPairDist so progress bar works multithreaded */ int iChunk, iChunkStart, iChunkEnd; int iChunkStarts[iNumberOfThreads]; int iChunkEnds[iNumberOfThreads]; progress_t *prProgress = NULL; int iSquidSuccess = 0; bool bPrintCR = (rLog.iLogLevelEnabled<=LOG_VERBOSE) ? FALSE : TRUE; assert(NULL!=distmat); assert(NULL!=mseq); assert(istartnseqs * sizeof(char*)); for (uSeqIndex=0; uSeqIndexnseqs; uSeqIndex++) { names[uSeqIndex] = mseq->sqinfo[uSeqIndex].name; } SymMatrixPrint((*distmat), names, fdist_out, bPercID); Log(&rLog, LOG_INFO, "Pairwise distance matrix written to %s", fdist_out); CKFREE(names); } #if 0 #include "distance-distrib.h" #endif if (NULL != prProgress) { ProgressDone(prProgress); FreeProgress(&prProgress); } return 0; } /*** end: PairDistances() ***/ clustal-omega-1.2.1/src/clustal/symmatrix.h0000644000175100017510000000440612175477637015666 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: symmatrix.h 288 2013-07-29 13:15:50Z andreas $ */ /** * Functions for symmetric (square) matrices including diagonal. * * Supports the notion of non-square sub-matrices of a symmetric * matrix, i.e. where |rows|<|cols| and the corresponding full matrix * would be |cols|x|cols| * * Instead of making this one big chunk of memory we keep pointers to * pointers, so that we can easily realloc (the project where this file * originated from needed this for growing a "seed" matrix). * * FIXME Allocating one big chunk of memory is probably * much faster and also easier to maintain. * * */ #ifndef CLUSTALO_SYMMATRIX_H #define CLUSTALO_SYMMATRIX_H /* ugly, but necessary for cross-checking of names in distmat and * mseq */ #include "seq.h" /** * @brief symmetric matrix structure */ typedef struct { int nrows; /**< number of rows */ int ncols; /**< number of columns */ /** * stored data * * @note indices range: [i][j-i] i<=j. use getvalue() and * setvalue() instead of accessing directly * * @see SymMatrixGetValue(), SymMatrixSetValue() */ double **data; } symmatrix_t; extern int NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols); extern void SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value); extern double SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j); extern void SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j); extern void FreeSymMatrix(symmatrix_t **symmat); extern void SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path, bool bPercID); extern int SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq); #endif clustal-omega-1.2.1/src/clustal/seq.h0000644000175100017510000000754012216025141014372 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: seq.h 289 2013-09-17 10:09:37Z fabian $ */ #ifndef CLUSTALO_SEQ_H #define CLUSTALO_SEQ_H #include "squid/squid.h" #include "util.h" /** * int-encoded sequence types. * these are in sync with squid's seqtypes and only used for * convenience here */ #define SEQTYPE_UNKNOWN kOtherSeq #define SEQTYPE_DNA kDNA #define SEQTYPE_RNA kRNA #define SEQTYPE_PROTEIN kAmino /* Alphabets are defined in squid.h: AMINO_ALPHABET, DNA_ALPHABET, * RNA_ALPHABET (all uppercase) */ #define AMINOACID_ANY 'X' #define NUCLEOTIDE_ANY 'N' /** * @brief structure for storing multiple sequences * */ typedef struct { int nseqs; /**< number of sequences */ int seqtype; /**< sequence type */ char *filename; /**< input file / source of sequences */ bool aligned; /**< true if all seqs are same length **/ /** (working) sequence residues as char pointer. * range for first index: 0--nseq-1. * changes during alignment. */ char **seq; /** original sequence residues as char pointer. * range for first index: 0--nseq-1. * only set during input */ char **orig_seq; /** order in which sequences appear in guide-tree */ int *tree_order; /** * @brief Squid's sequence info structure. * Index range: 0--nseq-1. * * extra data are available: * int flags; * * name: * char name[SQINFO_NAMELEN]; * * database identifier: * char id[SQINFO_NAMELEN]; * * database accession no: * char acc[SQINFO_NAMELEN]; * * description: * char desc[SQINFO_DESCLEN]; * * length of this seq, incl gaps in our case!: * int len; * * start position on source seq (valid range: 1..len): * int start; * * end position on source seq (valid range: 1..len): * int stop; * * original length of source seq: * int olen; * * kRNA, kDNA, kAmino, or kOther: * int type; * * secondary structure string (index range: 0..len-1): * char *ss; * * percent side chain surface access (index range: 0..len-1): * char *sa; * * @see squid.h * @see LogSqInfo() * */ SQINFO *sqinfo; } mseq_t; extern void AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll); extern void AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes); extern void SeqSwap(mseq_t *mseq, int i, int j); extern void DealignMSeq(mseq_t *mseq); extern const char * SeqTypeToStr(int seqtype); extern int ReadSequences(mseq_t *prMSeq_p, char *pcSeqFile, int iSeqType, int iSeqFmt, bool bIsProfile, bool bDealignInputSeqs, int iMaxNumSeq, int iMaxSeqLen); extern void NewMSeq(mseq_t **mseq); extern void FreeMSeq(mseq_t **mseq); extern void CopyMSeq(mseq_t **prMSeqDest_p, mseq_t *prMSeqSrc); extern void LogSqInfo(SQINFO *sqinfo); extern int FindSeqName(char *seqname, mseq_t *mseq); extern int WriteAlignment(mseq_t *mseq, const char *aln_outfile, int msafile_format, int iWrap, bool bResno); extern void DealignSeq(char *seq); extern void ShuffleMSeq(mseq_t *prMSeq); extern void SortMSeqByLength(mseq_t *prMSeq, const char cOrder); void JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd); bool SeqsAreAligned(mseq_t *prMSeq, bool bIsProfile, bool bDealignInputSeqs); #endif clustal-omega-1.2.1/src/clustal/log.c0000644000175100017510000001451212206661646014372 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "log.h" /* a default standard logger */ log_t rLog; void LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList); void LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList); void LogError(FILE *prFP, char *pcFmt, va_list rVArgList); void LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList); void LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList); void LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList); /** * @brief Plain, default print function * * Newline character is automatically appended to message. * */ void LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList) { /* print prefix */ vfprintf(prFP, pcFmt, rVArgList); fprintf(prFP,"\n"); #ifndef NDEBUG fflush(prFP); #endif } /* end of LogVfprintf() */ /** * @brief * */ void LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList) { fprintf(prFP, "WARNING: "); LogVfprintf(prFP, pcFmt, rVArgList); } /* end of LogWarn() */ /** * @brief * */ void LogError(FILE *prFP, char *pcFmt, va_list rVArgList) { fprintf(prFP, "ERROR: "); LogVfprintf(prFP, pcFmt, rVArgList); } /* end of LogError() */ /** * @brief * */ void LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList) { fprintf(prFP, "CRITICAL ERROR: "); LogVfprintf(prFP, pcFmt, rVArgList); } /* end of LogCritical() */ /** * @brief Will also exit! */ void LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList) { fprintf(prFP, "FATAL: "); LogVfprintf(prFP, pcFmt, rVArgList); exit(EXIT_FAILURE); } /* end of LogFatal() */ /** * @brief * */ void LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList) { fprintf(prFP, "FORCED DEBUG: "); LogVfprintf(prFP, pcFmt, rVArgList); } /* end of LogForcedDebug() */ /** * * @brief Sets up default function pointers * */ void LogDefaultSetup(log_t *log) { log->iLogLevelEnabled = LOG_WARN; log->prFP[LOG_DEBUG] = stdout; log->prFP[LOG_INFO] = stdout; log->prFP[LOG_WARN] = stderr; log->prFP[LOG_ERROR] = stderr; log->prFP[LOG_CRITICAL] = stderr; log->prFP[LOG_FATAL] = stderr; log->prFP[LOG_FORCED_DEBUG] = stderr; log->prFunc[LOG_DEBUG] = &LogVfprintf; log->prFunc[LOG_INFO] = &LogVfprintf; log->prFunc[LOG_WARN] = &LogWarn; log->prFunc[LOG_ERROR] = &LogError; log->prFunc[LOG_CRITICAL] = &LogCritical; log->prFunc[LOG_FATAL] = &LogFatal; log->prFunc[LOG_FORCED_DEBUG] = &LogForcedDebug; } /* end of LogDefaultSetup() */ /** * @brief Log to certain level * * See also comp.lang.c FAQ list · Question 15.12 * http://c-faq.com/varargs/handoff.html How can I write a function which * takes a variable number of arguments and passes them to some other function * (which takes a variable number of arguments)? * */ void Log(log_t *prLog, int iLevel, char *pcFmt, ...) { va_list rVArgList; void (*prFunc) (FILE *prFP, char *pcFormat, va_list rVArgList); FILE *prFP; assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); /* fprintf(stderr, "DEBUG: iLevel=%d and iLogLevelEnabled=%d\n", iLevel, prLog->iLogLevelEnabled); */ /* return if below current loglevel */ if (iLevel < prLog->iLogLevelEnabled) { return; } prFunc = prLog->prFunc[iLevel]; prFP = prLog->prFP[iLevel]; /* return if muted */ if (NULL == prFunc) { return; } va_start(rVArgList, pcFmt); prFunc(prFP, pcFmt, rVArgList); va_end(rVArgList); } /* end of Log() */ /** * * @brief Change file pointer for certain level * */ void LogSetFP(log_t *prLog, int iLevel, FILE *prFP) { assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); prLog->prFP[iLevel] = prFP; } /* end of LogSetFP() */ /** * * @brief Return file pointer for certain level * */ FILE * LogGetFP(log_t *prLog, int iLevel) { assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); return prLog->prFP[iLevel]; } /* end of LogGetFP() */ /** * * @brief Change file pointer for all levels * */ void LogSetFPForAll(log_t *prLog, FILE *prFP) { int iAux; for (iAux=0; iAuxprFP[iAux] = prFP; } } /* end of LogSetFP() */ /** * * @brief Mute certain level (i.e set the corresponding function to NULL) * */ void LogMute(log_t *prLog, int iLevel) { assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); prLog->prFunc[iLevel] = NULL; } /* end of LogMute() */ /** * * @brief Mute all channels * */ void LogMuteAll(log_t *prLog) { int iAux; for (iAux=0; iAux=0 && iLevel<=LOG_NUM_LEVELS); prLog->prFunc[iLevel] = Func; } /* end of LogFuncOverwrite() */ #ifdef LOG_TEST #define TEXT "Lorem ipsum dolor sit amet" void PrintSomeTextToAll(log_t *prLog) { int iAux; for (iAux=0; iAux #include "util.h" #ifndef uint /* limit use of uint (see coding_style_guideline.txt) */ typedef unsigned int uint; #endif static const uint NULL_NEIGHBOR = UINT_MAX; /** * @brief guide-tree structure * * @note We kept the original variable names here, to make it easy to * search through Muscle's source code. * From phy.cpp: * Node has 0 to 3 neighbors: * 0 neighbors: singleton root * 1 neighbor: leaf, neighbor is parent * 2 neigbors: non-singleton root * 3 neighbors: internal node (other than root) * * Minimal rooted tree is single node. * Minimal unrooted tree is single edge. * Leaf node always has nulls in neighbors 2 and 3, neighbor 1 is parent. * When tree is rooted, neighbor 1=parent, 2=left, 3=right. * */ typedef struct { uint m_uNodeCount;/**< number of nodes */ uint m_uCacheCount;/**< reserved memory */ uint *m_uNeighbor1;/**< parent node */ uint *m_uNeighbor2;/**< left node */ uint *m_uNeighbor3;/**< right node */ /* do we have edge lengths info stored (m_dEdgeLength[123]) */ bool *m_bHasEdgeLength1; bool *m_bHasEdgeLength2; bool *m_bHasEdgeLength3; double *m_dEdgeLength1; double *m_dEdgeLength2; double *m_dEdgeLength3; #if USE_HEIGHT /* unused in our version of the code. we might need it at some * stage so keep it in here, but disable via USE_HEIGHT throughout * the code */ double *m_dHeight; bool *m_bHasHeight; #endif /** * leaf labels. * index range: 0 -- (m_uNodeCount+1)/2 */ char **m_ptrName; /** * node id. * index range: 0 -- m_uNodeCount */ uint *m_Ids; bool m_bRooted; /**< tree is rooted */ uint m_uRootNodeIndex; } tree_t; extern void MuscleTreeCreate(tree_t *tree, uint uLeafCount, uint uRoot, const uint *Left, const uint *Right, const float *LeftLength, const float* RightLength, const uint *LeafIds, char **LeafNames); extern void MuscleTreeToFile(FILE *fp, tree_t *tree); extern int MuscleTreeFromFile(tree_t *tree, char *ftree); extern void FreeMuscleTree(tree_t *tree); extern void LogTree(tree_t *tree, FILE *fp); extern bool IsRooted(tree_t *tree); extern uint GetNodeCount(tree_t *tree); extern uint GetLeafCount(tree_t *tree); extern uint FirstDepthFirstNode(tree_t *tree); extern uint NextDepthFirstNode(uint nodeindex, tree_t *tree); extern bool IsLeaf(uint nodeindex, tree_t *tree); extern void SetLeafId(tree_t *tree, uint uNodeIndex, uint uId); extern uint GetLeafId(uint nodeindex, tree_t *tree); extern char * GetLeafName(unsigned uNodeIndex, tree_t *tree); extern uint GetLeft(uint nodeindex, tree_t *tree); extern uint GetRight(uint nodeindex, tree_t *tree); extern uint GetRootNodeIndex(tree_t *tree); extern bool IsRoot(uint uNodeIndex, tree_t *tree); extern uint GetParent(unsigned uNodeIndex, tree_t *tree); extern double GetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree); extern uint LeafIndexToNodeIndex(uint uLeafIndex, tree_t *prTree); extern void AppendTree(tree_t *prDstTree, uint uDstTreeNodeIndex, tree_t *prSrcTree); extern void TreeValidate(tree_t *tree); #endif clustal-omega-1.2.1/src/clustal/seq.c0000644000175100017510000010704312303701006014362 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: seq.c 291 2014-02-27 18:20:54Z fabian $ * * * Module for sequence/alignment IO and misc. * * This depends heavily on Sean Eddy's squid library, which is obsoleted by * HMMER3's Easel. However, easel doesn't support that many non-aligned input * formats. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "squid/squid.h" #include #include "util.h" #include "log.h" #include "seq.h" #define ALLOW_ONLY_PROTEIN 0 // DD /** * @brief Stripped down version of squid's alistat * * * @param[in] prMSeq * The alignment to analyse * @param[in] bSampling * For many sequences: samples from pool * @param[in] bReportAll * Report identities for all sequence pairs * * Don't have to worry about sequence case because our version of PairwiseIdentity is case insensitive */ void AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll) { /* * bSampling = squid's do_fast * bReportAll = squid's allreport */ float **ppdIdentMx; /* identity matrix (squid: imx) */ const int iNumSample = 1000; /* sample size (squid: nsample) */ MSA *msa; /* squid's alignment structure */ int small, large; int bestj, worstj; float sum; float worst_worst, worst_best, best_best; float avgid; int i, j; int nres; /* number of residues */ if (bSampling && bReportAll) { Log(&rLog, LOG_WARN, "Cannot report all and sample at the same time. Skipping %s()", __FUNCTION__); return; } if (FALSE == prMSeq->aligned) { Log(&rLog, LOG_WARN, "Sequences are not aligned. Skipping %s()", __FUNCTION__); return; } /* silence gcc warnings about uninitialized variables */ worst_worst = worst_best = best_best = 0.0; bestj = worstj = -1; /** mseq to squid msa * * FIXME code overlap with WriteAlignment. Make it a function and take * code there (contains more comments) as template * */ msa = MSAAlloc(prMSeq->nseqs, /* derive alignment length from first seq */ strlen(prMSeq->seq[0])); for (i=0; inseqs; i++) { int key; /* MSA struct internal index for sequence */ char *this_name = prMSeq->sqinfo[i].name; /* prMSeq sequence name */ char *this_seq = prMSeq->seq[i]; /* prMSeq sequence */ SQINFO *this_sqinfo = &prMSeq->sqinfo[i]; /* prMSeq sequence name */ key = GKIStoreKey(msa->index, this_name); msa->sqname[key] = sre_strdup(this_name, strlen(this_name)); /* setting msa->sqlen[idx] and msa->aseq[idx] */ msa->sqlen[key] = sre_strcat(&(msa->aseq[key]), msa->sqlen[key], this_seq, strlen(this_seq)); if (this_sqinfo->flags & SQINFO_DESC) { MSASetSeqDescription(msa, key, this_sqinfo->desc); } msa->nseq++; } nres = 0; small = large = -1; for (i = 0; i < msa->nseq; i++) { int rlen; /* raw sequence length */ rlen = DealignedLength(msa->aseq[i]); nres += rlen; if (small == -1 || rlen < small) small = rlen; if (large == -1 || rlen > large) large = rlen; } if (bSampling) { avgid = AlignmentIdentityBySampling(msa->aseq, msa->alen, msa->nseq, iNumSample); } else { float best, worst; /* this might be slow...could use openmp inside squid */ MakeIdentityMx(msa->aseq, msa->nseq, &ppdIdentMx); if (bReportAll) { printf(" %-15s %5s %7s %-15s %7s %-15s\n", "NAME", "LEN", "HIGH ID", "(TO)", "LOW ID", "(TO)"); printf(" --------------- ----- ------- --------------- ------- ---------------\n"); } sum = 0.0; worst_best = 1.0; best_best = 0.0; worst_worst = 1.0; for (i = 0; i < msa->nseq; i++) { worst = 1.0; best = 0.0; for (j = 0; j < msa->nseq; j++) { /* closest seq to this one = best */ if (i != j && ppdIdentMx[i][j] > best) { best = ppdIdentMx[i][j]; bestj = j; } if (ppdIdentMx[i][j] < worst) { worst = ppdIdentMx[i][j]; worstj = j; } } if (bReportAll) { printf("* %-15s %5d %7.1f %-15s %7.1f %-15s\n", msa->sqname[i], DealignedLength(msa->aseq[i]), best * 100., msa->sqname[bestj], worst * 100., msa->sqname[worstj]); } if (best > best_best) best_best = best; if (best < worst_best) worst_best = best; if (worst < worst_worst) worst_worst = worst; for (j = 0; j < i; j++) sum += ppdIdentMx[i][j]; } avgid = sum / (float) (msa->nseq * (msa->nseq-1)/2.0); if (bReportAll) puts(""); FMX2Free(ppdIdentMx); } /* else bSampling */ /* Print output */ if (msa->name != NULL) printf("Alignment name: %s\n", msa->name); /*printf("Format: %s\n", SeqfileFormat2String(afp->format));*/ printf("Number of sequences: %d\n", msa->nseq); printf("Total # residues: %d\n", nres); printf("Smallest: %d\n", small); printf("Largest: %d\n", large); printf("Average length: %.1f\n", (float) nres / (float) msa->nseq); printf("Alignment length: %d\n", msa->alen); printf("Average identity: %.2f%%\n", 100.*avgid); if (! bSampling) { printf("Most related pair: %.2f%%\n", 100.*best_best); printf("Most unrelated pair: %.2f%%\n", 100.*worst_worst); printf("Most distant seq: %.2f%%\n", 100.*worst_best); } /* char *cs; cs = MajorityRuleConsensus(msa->aseq, msa->nseq, msa->alen); printf cs; */ MSAFree(msa); } /* end of AliStat() */ /** * @brief Shuffle mseq order * * @param[out] mseq * mseq structure to shuffle * */ void ShuffleMSeq(mseq_t *mseq) { int iSeqIndex; int *piPermArray; /* quick and dirty: create an array with permuted indices and * swap accordingly (which amounts to shuffling twice) */ PermutationArray(&piPermArray, mseq->nseqs); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { SeqSwap(mseq, piPermArray[iSeqIndex], iSeqIndex); } CKFREE(piPermArray); } /*** end: ShuffleMSeq() ***/ /** * @brief Swap two sequences in an mseq_t structure. * * @param[out] prMSeq * Multiple sequence struct * @param[in] i * Index of first sequence * @param[in] j * Index of seconds sequence * * */ void SeqSwap(mseq_t *prMSeq, int i, int j) { char *pcTmp; SQINFO rSqinfoTmp; assert(NULL!=prMSeq); assert(inseqs && jnseqs); if (i==j) { return; } pcTmp = prMSeq->seq[i]; prMSeq->seq[i] = prMSeq->seq[j]; prMSeq->seq[j] = pcTmp; pcTmp = prMSeq->orig_seq[i]; prMSeq->orig_seq[i] = prMSeq->orig_seq[j]; prMSeq->orig_seq[j] = pcTmp; rSqinfoTmp = prMSeq->sqinfo[i]; prMSeq->sqinfo[i] = prMSeq->sqinfo[j]; prMSeq->sqinfo[j] = rSqinfoTmp; return; } /*** end: SeqSwap() ***/ /** * @brief Dealigns all sequences in mseq structure, updates the * sequence length info and sets aligned to FALSE * * @param[out] mseq * The mseq structure to dealign * */ void DealignMSeq(mseq_t *mseq) { int i; /* aux */ for (i=0; inseqs; i++) { DealignSeq(mseq->seq[i]); mseq->sqinfo[i].len = strlen(mseq->seq[i]); } mseq->aligned = FALSE; return; } /*** end: DealinMSeq() ***/ /** * @brief debug output of sqinfo struct * * @param[in] sqinfo * Squid's SQINFO struct for a certain seqeuence * * @note useful for debugging only * */ void LogSqInfo(SQINFO *sqinfo) { /*LOG_DEBUG("sqinfo->flags = %d", sqinfo->flags);*/ if (sqinfo->flags & SQINFO_NAME) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->name = %s", sqinfo->name); if (sqinfo->flags & SQINFO_ID) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->id = %s", sqinfo->id); if (sqinfo->flags & SQINFO_ACC) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->acc = %s", sqinfo->acc); if (sqinfo->flags & SQINFO_DESC) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->desc = %s", sqinfo->desc); if (sqinfo->flags & SQINFO_LEN) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->len = %d", sqinfo->len); if (sqinfo->flags & SQINFO_START) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->start = %d", sqinfo->start); if (sqinfo->flags & SQINFO_STOP) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->stop = %d", sqinfo->stop); if (sqinfo->flags & SQINFO_OLEN) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->olen = %d", sqinfo->olen); if (sqinfo->flags & SQINFO_TYPE) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->type = %d", sqinfo->type); if (sqinfo->flags & SQINFO_SS) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->ss = %s", sqinfo->ss); if (sqinfo->flags & SQINFO_SA) Log(&rLog, LOG_FORCED_DEBUG, "sqinfo->sa = %s", sqinfo->sa); } /*** end: log_sqinfo ***/ /** * @brief convert int-encoded iSeqType to string * * @param[in] iSeqType int-encoded sequence type * * @return character pointer describing the sequence type * */ const char* SeqTypeToStr(int iSeqType) { switch (iSeqType) { case SEQTYPE_DNA: return "DNA"; case SEQTYPE_RNA: return "RNA"; case SEQTYPE_PROTEIN: return "Protein"; case SEQTYPE_UNKNOWN: return "UNKNOWN"; default: Log(&rLog, LOG_FATAL, "Internal error in %s", __FUNCTION__); } return "Will never get here"; } /*** end: SeqTypeToStr ***/ /** * @brief reads sequences from file * * @param[out] prMSeq * Multiple sequence struct. Must be preallocated. * FIXME: would make more sense to allocate it here. * @param[in] seqfile * Sequence file name. If '-' sequence will be read from stdin. * @param[in] iSeqType * int-encoded sequence type. Set to * SEQTYPE_UNKNOWN for autodetect (guessed from first sequence) * @param[in] iMaxNumSeq * Return an error, if more than iMaxNumSeq have been read * @param[in] iMaxSeqLen * Return an error, if a seq longer than iMaxSeqLen has been read * * @return 0 on success, -1 on error * * @note * - Depends heavily on squid * - Sequence file format will be guessed * - If supported by squid, gzipped files can be read as well. */ int ReadSequences(mseq_t *prMSeq, char *seqfile, int iSeqType, int iSeqFmt, bool bIsProfile, bool bDealignInputSeqs, int iMaxNumSeq, int iMaxSeqLen) { SQFILE *dbfp; /* sequence file descriptor */ char *cur_seq; SQINFO cur_sqinfo; int iSeqIdx; /* sequence counter */ int iSeqPos; /* sequence string position counter */ assert(NULL!=seqfile); /* Try to work around inability to autodetect from a pipe or .gz: * assume FASTA format */ if (SQFILE_UNKNOWN == iSeqFmt && (Strparse("^.*\\.gz$", seqfile, 0) || strcmp(seqfile, "-") == 0)) { iSeqFmt = SQFILE_FASTA; } /* Using squid routines to read input. taken from seqstat_main.c. we don't * know if input is aligned, so we use SeqfileOpen instead of MSAFileOpen * etc. NOTE this also means we discard some information, e.g. when * reading from and writing to a stockholm file, all extra MSA * info/annotation will be lost. * */ if (NULL == (dbfp = SeqfileOpen(seqfile, iSeqFmt, NULL))) { Log(&rLog, LOG_ERROR, "Failed to open sequence file %s for reading", seqfile); return -1; } /* FIXME squid's ReadSeq() will exit with fatal error if format is * unknown. This will be a problem for a GUI. Same is true for many squid * other functions. * * The original squid:ReadSeq() dealigns sequences on input. We * use a patched version. * */ while (ReadSeq(dbfp, dbfp->format, &cur_seq, &cur_sqinfo)) { if (prMSeq->nseqs+1>iMaxNumSeq) { Log(&rLog, LOG_ERROR, "Maximum number of sequences (=%d) exceeded after reading sequence '%s' from '%s'", iMaxNumSeq, cur_sqinfo.name, seqfile); return -1; } if ((int)strlen(cur_seq)>iMaxSeqLen) { Log(&rLog, LOG_ERROR, "Sequence '%s' has %d residues and is therefore longer than allowed (max. sequence length is %d)", cur_sqinfo.name, strlen(cur_seq), iMaxSeqLen); return -1; } if ((int)strlen(cur_seq)==0) { Log(&rLog, LOG_ERROR, "Sequence '%s' has 0 residues", cur_sqinfo.name); return -1; } /* FIXME: use modified version of AddSeq() that allows handing down SqInfo */ prMSeq->seq = (char **) CKREALLOC(prMSeq->seq, (prMSeq->nseqs+1) * sizeof(char *)); prMSeq->seq[prMSeq->nseqs] = CkStrdup(cur_seq); prMSeq->sqinfo = (SQINFO *) CKREALLOC(prMSeq->sqinfo, (prMSeq->nseqs+1) * sizeof(SQINFO)); SeqinfoCopy(&prMSeq->sqinfo[prMSeq->nseqs], &cur_sqinfo); #ifdef TRACE Log(&rLog, LOG_FORCED_DEBUG, "seq no %d: seq = %s", prMSeq->nseqs, prMSeq->seq[prMSeq->nseqs]); LogSqInfo(&prMSeq->sqinfo[prMSeq->nseqs]); #endif /* always guess type from first seq. use squid function and * convert value */ if (0 == prMSeq->nseqs) { int type = Seqtype(prMSeq->seq[prMSeq->nseqs]); switch (type) { case kDNA: prMSeq->seqtype = SEQTYPE_DNA; break; case kRNA: prMSeq->seqtype = SEQTYPE_RNA; break; case kAmino: prMSeq->seqtype = SEQTYPE_PROTEIN; break; case kOtherSeq: prMSeq->seqtype = SEQTYPE_UNKNOWN; break; default: Log(&rLog, LOG_FATAL, "Internal error in %s", __FUNCTION__); } /* override with given sequence type but check with * automatically detected type and warn if necessary */ if (SEQTYPE_UNKNOWN != iSeqType) { if (prMSeq->seqtype != iSeqType) { Log(&rLog, LOG_WARN, "Overriding automatically determined seq-type %s to %s as requested", SeqTypeToStr(prMSeq->seqtype), SeqTypeToStr(iSeqType)); prMSeq->seqtype = iSeqType; } } /* if type could not be determined and was not set return error */ if (SEQTYPE_UNKNOWN == iSeqType && SEQTYPE_UNKNOWN == prMSeq->seqtype) { Log(&rLog, LOG_ERROR, "Couldn't guess sequence type from first sequence"); FreeSequence(cur_seq, &cur_sqinfo); SeqfileClose(dbfp); return -1; } } Log(&rLog, LOG_DEBUG, "seq-no %d: type=%s name=%s len=%d seq=%s", prMSeq->nseqs, SeqTypeToStr(prMSeq->seqtype), prMSeq->sqinfo[prMSeq->nseqs].name, prMSeq->sqinfo[prMSeq->nseqs].len, prMSeq->seq[prMSeq->nseqs]); /* FIXME IPUAC and/or case conversion? If yes see * corresponding squid functions. Special treatment of * Stockholm tilde-gaps for ktuple code? */ prMSeq->nseqs++; FreeSequence(cur_seq, &cur_sqinfo); } SeqfileClose(dbfp); /*#if ALLOW_ONLY_PROTEIN if (SEQTYPE_PROTEIN != prMSeq->seqtype) { Log(&rLog, LOG_FATAL, "Sequence type is %s. %s only works on protein.", SeqTypeToStr(prMSeq->seqtype), PACKAGE_NAME); } #endif*/ /* Check if sequences are aligned */ prMSeq->aligned = SeqsAreAligned(prMSeq, bIsProfile, bDealignInputSeqs); /* keep original sequence as copy and convert "working" sequence * */ prMSeq->orig_seq = (char**) CKMALLOC(prMSeq->nseqs * sizeof(char *)); for (iSeqIdx=0; iSeqIdxnseqs; iSeqIdx++) { prMSeq->orig_seq[iSeqIdx] = CkStrdup(prMSeq->seq[iSeqIdx]); /* convert unknown characters according to set seqtype * be conservative, i.e. don't allow any fancy ambiguity * characters to make sure that ktuple code etc. works. */ /* first on the fly conversion between DNA and RNA */ if (prMSeq->seqtype==SEQTYPE_DNA) ToDNA(prMSeq->seq[iSeqIdx]); if (prMSeq->seqtype==SEQTYPE_RNA) ToRNA(prMSeq->seq[iSeqIdx]); /* then check of each character */ for (iSeqPos=0; iSeqPos<(int)strlen(prMSeq->seq[iSeqIdx]); iSeqPos++) { char *res = &(prMSeq->seq[iSeqIdx][iSeqPos]); if (isgap(*res)) continue; if (prMSeq->seqtype==SEQTYPE_PROTEIN) { if (NULL == strchr(AMINO_ALPHABET, toupper(*res))) { *res = AMINOACID_ANY; } } else if (prMSeq->seqtype==SEQTYPE_DNA) { if (NULL == strchr(DNA_ALPHABET, toupper(*res))) { *res = NUCLEOTIDE_ANY; } } else if (prMSeq->seqtype==SEQTYPE_RNA) { if (NULL == strchr(RNA_ALPHABET, toupper(*res))) { *res = NUCLEOTIDE_ANY; } } } } /* order in which sequences appear in guide-tree * only allocate if different output-order desired */ prMSeq->tree_order = NULL; prMSeq->filename = CkStrdup(seqfile); Log(&rLog, LOG_INFO, "Read %d sequences (type: %s) from %s", prMSeq->nseqs, SeqTypeToStr(prMSeq->seqtype), prMSeq->filename); return 0; } /*** end: ReadSequences ***/ /** * @brief allocate and initialise new mseq_t * * @param[out] prMSeq * newly allocated and initialised mseq_t * * @note caller has to free by calling FreeMSeq() * * @see FreeMSeq * */ void NewMSeq(mseq_t **prMSeq) { *prMSeq = (mseq_t *) CKMALLOC(1 * sizeof(mseq_t)); (*prMSeq)->nseqs = 0; (*prMSeq)->seq = NULL; (*prMSeq)->orig_seq = NULL; (*prMSeq)->seqtype = SEQTYPE_UNKNOWN; (*prMSeq)->sqinfo = NULL; (*prMSeq)->filename = NULL; (*prMSeq)->tree_order = NULL; } /*** end: NewMSeq ***/ /** * @brief copies an mseq structure * * @param[out] prMSeqDest_p * Copy of mseq structure * @param[in] prMSeqSrc * Source mseq structure to copy * * @note caller has to free copy by calling FreeMSeq() * */ void CopyMSeq(mseq_t **prMSeqDest_p, mseq_t *prMSeqSrc) { int i; assert(prMSeqSrc != NULL && prMSeqDest_p != NULL); NewMSeq(prMSeqDest_p); (*prMSeqDest_p)->nseqs = prMSeqSrc->nseqs; (*prMSeqDest_p)->seqtype = prMSeqSrc->seqtype; if (prMSeqSrc->filename!=NULL) { (*prMSeqDest_p)->filename = CkStrdup(prMSeqSrc->filename); } (*prMSeqDest_p)->seq = (char **) CKMALLOC((*prMSeqDest_p)->nseqs * sizeof(char *)); (*prMSeqDest_p)->orig_seq = (char **) CKMALLOC((*prMSeqDest_p)->nseqs * sizeof(char *)); (*prMSeqDest_p)->sqinfo = (SQINFO *) CKMALLOC((*prMSeqDest_p)->nseqs * sizeof(SQINFO)); for (i=0; i<(*prMSeqDest_p)->nseqs; i++) { (*prMSeqDest_p)->seq[i] = CkStrdup(prMSeqSrc->seq[i]); (*prMSeqDest_p)->orig_seq[i] = CkStrdup(prMSeqSrc->orig_seq[i]); SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[i], &prMSeqSrc->sqinfo[i]); } } /*** end: CopyMSeq ***/ /** * @brief * * @param[in] seqname * The sequence name to search for * @param[in] mseq * The multiple sequence structure to search in * * @return -1 on failure, sequence index of matching name otherwise * * @warning If sequence name happens to be used twice, only the first * one will be reported back * */ int FindSeqName(char *seqname, mseq_t *mseq) { int i; /* aux */ assert(NULL!=mseq); for (i=0; inseqs; i++) { if (STR_EQ(mseq->sqinfo[i].name, seqname)) { return i; } } return -1; } /*** end: FindSeqName() ***/ /** * @brief Frees an mseq_t and it's members and zeros all members * * @param[in] mseq mseq_to to free * * @note use in conjunction with NewMSeq() * @see new_mseq */ void FreeMSeq(mseq_t **mseq) { int i; if (NULL==(*mseq)) { return; } if ((*mseq)->filename) { (*mseq)->filename = CKFREE((*mseq)->filename); } for (i=0; i<(*mseq)->nseqs; i++) { FreeSequence((*mseq)->seq[i], &(*mseq)->sqinfo[i]); CKFREE((*mseq)->orig_seq[i]); } if ((*mseq)->seq) { CKFREE((*mseq)->seq); } if ((*mseq)->orig_seq) { /* FIXME (FS): only ptr to ptr freed, actual sequences NOT freed*/ CKFREE((*mseq)->orig_seq); } if ((*mseq)->sqinfo) { CKFREE((*mseq)->sqinfo); } /* FIXME (FS): problem with freeing tree_order */ if ((*mseq)->tree_order){ CKFREE((*mseq)->tree_order); } (*mseq)->seqtype = SEQTYPE_UNKNOWN; (*mseq)->nseqs = 0; CKFREE((*mseq)); } /*** end: FreeMSeq ***/ /** * @brief Write alignment to file. * * @param[in] mseq * The mseq_t struct containing the aligned sequences * @param[in] pcAlnOutfile * The name of the output file * @param[in] outfmt * The alignment output format (defined in squid.h) * @param[in] iWrap * length of line for Clustal/Fasta format * * @return Non-zero on error * * @note We create a temporary squid MSA struct in here because we never * use it within clustal. We might be better of using the old clustal * output routines instead. * */ int WriteAlignment(mseq_t *mseq, const char *pcAlnOutfile, int outfmt, int iWrap, bool bResno) { int i; /* aux */ MSA *msa; /* squid's alignment structure */ FILE *pfOut = NULL; int key; /* MSA struct internal index for sequence */ int alen; /* alignment length */ bool use_stdout; assert(mseq!=NULL); if (MSAFILE_UNKNOWN == outfmt) { Log(&rLog, LOG_ERROR, "Unknown output format chosen"); return -1; } if (NULL == pcAlnOutfile) { pfOut = stdout; use_stdout = TRUE; } else { use_stdout = FALSE; if (NULL == (pfOut = fopen(pcAlnOutfile, "w"))) { Log(&rLog, LOG_ERROR, "Could not open file %s for writing", pcAlnOutfile); return -1; } } /* derive alignment length from first seq */ alen = strlen(mseq->seq[0]); msa = MSAAlloc(mseq->nseqs, alen); /* basic structure borrowed code from squid-1.9g/a2m.c:ReadA2M() * we actually create a copy of mseq. keeping the pointers becomes * messy when calling MSAFree() */ for (i=0; inseqs; i++) { char *this_name = NULL; /* mseq sequence name */ char *this_seq = NULL; /* mseq sequence */ SQINFO *this_sqinfo = NULL; /* mseq sequence name */ int iI; /* mseq->tree_order encodes to order in which sequences are listed in the guide-tree, if the user wants the sequence output in the input-order then mseq->tree_order==NULL, otherwise mseq->tree_order!=NULL, containing the indices of the sequences, FS, r274 -> */ iI = (NULL == mseq->tree_order) ? i : mseq->tree_order[i]; this_name = mseq->sqinfo[iI].name; /* mseq sequence name */ this_seq = mseq->seq[iI]; /* mseq sequence */ this_sqinfo = &mseq->sqinfo[iI]; /* mseq sequence name */ key = GKIStoreKey(msa->index, this_name); msa->sqname[key] = sre_strdup(this_name, strlen(this_name)); /* setting msa->sqlen[idx] and msa->aseq[idx] */ msa->sqlen[key] = sre_strcat(&(msa->aseq[key]), msa->sqlen[key], this_seq, strlen(this_seq)); if (this_sqinfo->flags & SQINFO_DESC) { /* FIXME never get here ... */ MSASetSeqDescription(msa, key, this_sqinfo->desc); } /* FIXME extend this by copying more stuff according to flags. * See MSAFileRead() in msa.c and used functions there * * Problem is that we never parse MSA information as we use squid'sSeqFile */ msa->nseq++; } /* 0 <= i < mseq->nseqs */ /* FIXME Would like to, but can't use MSAVerifyParse(msa) here, as it * will die on error. Need to implement our own version */ #if 0 MSAVerifyParse(msa); #endif /* The below is copy of MSAFileWrite() which originally only writes to stdout. */ /* Be sloppy and make a2m and fasta the same. same for vienna (which is the same). same same. can can. boleh boleh */ if (outfmt==SQFILE_FASTA) outfmt = MSAFILE_A2M; if (outfmt==SQFILE_VIENNA) outfmt = MSAFILE_VIENNA; switch (outfmt) { case MSAFILE_A2M: /*WriteA2M(pfOut, msa, 0);*/ WriteA2M(pfOut, msa, iWrap); break; case MSAFILE_VIENNA: /*WriteA2M(pfOut, msa, 1);*/ WriteA2M(pfOut, msa, INT_MAX); break; case MSAFILE_CLUSTAL: WriteClustal(pfOut, msa, iWrap, TRUE==bResno ? 1 : 0, mseq->seqtype); break; case MSAFILE_MSF: WriteMSF(pfOut, msa); break; case MSAFILE_PHYLIP: WritePhylip(pfOut, msa); break; case MSAFILE_SELEX: WriteSELEX(pfOut, msa); break; case MSAFILE_STOCKHOLM: WriteStockholm(pfOut, msa); break; default: Log(&rLog, LOG_FATAL, "internal error: %s", "invalid output format should have been detected before"); } if (use_stdout == FALSE) { (void) fclose(pfOut); Log(&rLog, LOG_INFO, "Alignment written to %s", pcAlnOutfile); } MSAFree(msa); return 0; } /*** end of WriteAlignment() ***/ /** * @brief Removes all gap-characters from a sequence. * * @param[out] seq * Sequence to dealign * * @note seq will not be reallocated */ void DealignSeq(char *seq) { int aln_pos; int dealn_pos; assert(seq!=NULL); dealn_pos=0; for (aln_pos=0; aln_pos<(int)strlen(seq); aln_pos++) { if (! isgap(seq[aln_pos])) { seq[dealn_pos++] = seq[aln_pos]; } } seq[dealn_pos] = '\0'; return; } /*** end: DealignSeq() ***/ /** * @brief Sort sequences by length * * @param[out] prMSeq * mseq to sort by length * @param[out] cOrder * Sorting order. 'd' for descending, 'a' for ascending. * * */ void SortMSeqByLength(mseq_t *prMSeq, const char cOrder) { int *piSeqLen; int *piOrder; int iSeqIndex; mseq_t *prMSeqCopy = NULL; assert('a'==cOrder || 'd'==cOrder); Log(&rLog, LOG_WARN, "FIXME: This modifies sequence ordering. Might not be what user wants. Will change output order as well"); piSeqLen = (int *) CKMALLOC(prMSeq->nseqs * sizeof(int)); piOrder = (int *) CKMALLOC(prMSeq->nseqs * sizeof(int)); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { piSeqLen[iSeqIndex] = prMSeq->sqinfo[iSeqIndex].len; } QSortAndTrackIndex(piOrder, piSeqLen, prMSeq->nseqs, cOrder, FALSE); CopyMSeq(&prMSeqCopy, prMSeq); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { /* copy mseq entry */ CKFREE(prMSeq->seq[iSeqIndex]); prMSeq->seq[iSeqIndex] = CkStrdup(prMSeqCopy->seq[piOrder[iSeqIndex]]); CKFREE(prMSeq->orig_seq[iSeqIndex]); prMSeq->orig_seq[iSeqIndex] = CkStrdup(prMSeqCopy->orig_seq[piOrder[iSeqIndex]]); SeqinfoCopy(&prMSeq->sqinfo[iSeqIndex], &prMSeqCopy->sqinfo[piOrder[iSeqIndex]]); } CKFREE(piSeqLen); CKFREE(piOrder); FreeMSeq(&prMSeqCopy); return; } /*** end: SortMSeqByLength() ***/ /** * @brief Checks if sequences in given mseq structure are aligned. By * definition this is only true, if sequences are of the same length * and at least one gap was found * * @param[in] prMSeq * Sequences to check * * @return TRUE if sequences are aligned, FALSE if not * * */ bool SeqsAreAligned(mseq_t *prMSeq, bool bIsProfile, bool bDealignInputSeqs) { bool bGapFound, bSameLength; int iSeqIdx; /* sequence counter */ int iSeqPos; /* sequence string position counter */ /* Special case of just one sequence: * it is arguable that a single sequence qualifies as a profile, * however, this is what we do at the first stage of MSA anyway. * So, if there is only 1 sequence it is a 1-profile * and it is (defined to be) aligned (with itself). FS, r240 -> 241 */ if (1 == prMSeq->nseqs) { return TRUE; } /* Check if sequences are aligned. For being aligned, the * sequences have to be of same length (bSameLength) and at least * one of them has to contain at least one gap (bGapFound) */ bGapFound = FALSE; bSameLength = TRUE; for (iSeqIdx=0; (iSeqIdx < prMSeq->nseqs); iSeqIdx++) { if ( (FALSE == bGapFound) ){ for (iSeqPos=0; iSeqPossqinfo[iSeqIdx].len && false==bGapFound; iSeqPos++) { if (isgap(prMSeq->seq[iSeqIdx][iSeqPos])) { bGapFound = TRUE; /* skip rest of sequence */ break; } } } /* gap not (yet) found */ if (iSeqIdx>0) { if (prMSeq->sqinfo[iSeqIdx].len != prMSeq->sqinfo[iSeqIdx-1].len) { bSameLength = FALSE; /* no need to continue search, bSameLength==FALSE is * sufficient condition */ break; } } } /* 0 <= iSeqIdx < prMSeq->nseqs */ #if 0 Log(&rLog, LOG_FORCED_DEBUG, "bSameLength=%d bGapFound=%d", bSameLength, bGapFound); #endif #if 0 if ( (TRUE == bSameLength) && ((TRUE == bGapFound) || (TRUE == bIsProfile)) ) { return TRUE; } else { if ((FALSE == bSameLength) && (TRUE == bGapFound) && (FALSE == bDealignInputSeqs)){ Log(&rLog, LOG_FORCED_DEBUG, "Potential Problem: Gaps encountered but not all sequences have same length, consider using --dealign"); } return FALSE; } #else if (FALSE == bSameLength){ /* if sequences don't have same lengths they can never be profile */ if (TRUE == bGapFound){ Log(&rLog, LOG_FORCED_DEBUG, "Potential Problem: sequences (N=%d) don't have same lengths but contain gaps, consider using --dealign", prMSeq->nseqs); } return FALSE; } else { /* here all sequences have same lengths */ if (TRUE == bGapFound){ /* if at least one sequence contains gaps (and all have the same lengths) then we can be sure it is a profile */ return TRUE; } /* here all sequences have same lengths but no sequences contain any gaps */ else if (TRUE == bIsProfile){ /* if the user says it is a profile then it is */ return TRUE; } else { return FALSE; } } #endif } /*** end: SeqsAreAligned() ***/ /** * @brief Creates a new sequence entry and appends it to an existing mseq * structure. * * @param[out] prMSeqDest_p * Already existing and initialised mseq structure * @param[in] pcSeqName * sequence name of the sequence to add * @param[in] pcSeqRes * the actual sequence (residues) to add * * @note Don't forget to update the align and type flag if necessary! * * FIXME allow adding of more features * */ void AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes) { int iSeqIdx = 0; SQINFO sqinfo; assert(NULL != prMSeqDest_p); assert(NULL != pcSeqName); assert(NULL != pcSeqRes); iSeqIdx = (*prMSeqDest_p)->nseqs; (*prMSeqDest_p)->seq = (char **) CKREALLOC((*prMSeqDest_p)->seq, (iSeqIdx+1) * sizeof(char *)); (*prMSeqDest_p)->orig_seq = (char **) CKREALLOC((*prMSeqDest_p)->orig_seq, (iSeqIdx+1) * sizeof(char *)); (*prMSeqDest_p)->sqinfo = (SQINFO *) CKREALLOC((*prMSeqDest_p)->sqinfo, (iSeqIdx+1) * sizeof(SQINFO)); (*prMSeqDest_p)->seq[iSeqIdx] = CkStrdup(pcSeqRes); (*prMSeqDest_p)->orig_seq[iSeqIdx] = CkStrdup(pcSeqRes); /* should probably get ri of SqInfo altogether in the long run and just transfer the intersting members into our own struct */ sqinfo.flags = 0; /* init */ sqinfo.len = strlen(pcSeqRes); sqinfo.flags |= SQINFO_LEN; /* name is an array of SQINFO_NAMELEN length */ strncpy(sqinfo.name, pcSeqName, SQINFO_NAMELEN-1); sqinfo.name[SQINFO_NAMELEN-1] = '\0'; sqinfo.flags |= SQINFO_NAME; SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iSeqIdx], & sqinfo); (*prMSeqDest_p)->nseqs++; return; } /* end of AddSeq() */ /** * @brief Appends an mseq structure to an already existing one. * filename will be left untouched. * * @param[in] prMSeqDest_p * MSeq structure to which to append to * @param[out] prMSeqToAdd * MSeq structure which is to append * */ void JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd) { int iSrcSeqIndex; int iNewNSeq; assert(NULL != prMSeqDest_p && NULL != (*prMSeqDest_p)); assert(NULL != prMSeqToAdd); if (0 == prMSeqToAdd->nseqs) { Log(&rLog, LOG_WARN, "Was asked to add 0 sequences"); return; } /* warn on seqtype mismatch and keep original seqtype */ if ((*prMSeqDest_p)->seqtype != prMSeqToAdd->seqtype) { Log(&rLog, LOG_WARN, "Joining sequences of different type"); } /* leave filename as it is */ /* * copy new seq/s, orig_seq/s, sqinfo/s */ iNewNSeq = (*prMSeqDest_p)->nseqs + prMSeqToAdd->nseqs; (*prMSeqDest_p)->seq = (char **) CKREALLOC((*prMSeqDest_p)->seq, iNewNSeq * sizeof(char *)); (*prMSeqDest_p)->orig_seq = (char **) CKREALLOC((*prMSeqDest_p)->orig_seq, iNewNSeq * sizeof(char *)); (*prMSeqDest_p)->sqinfo = (SQINFO *) CKREALLOC((*prMSeqDest_p)->sqinfo, iNewNSeq * sizeof(SQINFO)); for (iSrcSeqIndex=0; iSrcSeqIndex < prMSeqToAdd->nseqs; iSrcSeqIndex++) { int iDstSeqIndex = (*prMSeqDest_p)->nseqs++; (*prMSeqDest_p)->seq[iDstSeqIndex] = CkStrdup(prMSeqToAdd->seq[iSrcSeqIndex]); (*prMSeqDest_p)->orig_seq[iDstSeqIndex] = CkStrdup(prMSeqToAdd->orig_seq[iSrcSeqIndex]); SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iDstSeqIndex], & prMSeqToAdd->sqinfo[iSrcSeqIndex]); } (*prMSeqDest_p)->nseqs = iNewNSeq; #if 0 /* 2nd arg is bIsProfile, which when set TRUE skips * the check for gaps. here always check for gaps, * so set FALSE (main reason is that it is easier), FS, r282 -> */ /* had a problem at this stage, therefore dispense with gap check, FS, r290 -> */ /* 3rd argument is dealignment flag, do not dealign profiles */ (*prMSeqDest_p)->aligned = SeqsAreAligned(*prMSeqDest_p, TRUE/*FALSE*/, FALSE); #else (*prMSeqDest_p)->aligned = TRUE; #endif return; } /*** end: JoinMSeqs() ***/ clustal-omega-1.2.1/src/clustal/muscle_tree.c0000644000175100017510000015635512206661646016134 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* This a mix of tree functions and data-structures from * Bob Edgar's Muscle (version 3.7) ported to pure C, topped up with * some of our own stuff. * * Used files: phy.cpp, tree.h, phytofile.cpp and phyfromclust.cpp * * Muscle's code is public domain and so is this code here. * From http://www.drive5.com/muscle/license.htm: * """ * MUSCLE is public domain software * * The MUSCLE software, including object and source code and * documentation, is hereby donated to the public domain. * * Disclaimer of warranty * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * """ * */ /* * RCS $Id: muscle_tree.c 230 2011-04-09 15:37:50Z andreas $ */ #include #include #include #include #include #include #include "util.h" #include "log.h" #include "muscle_tree.h" static const double VERY_NEGATIVE_DOUBLE = -9e29; /*const double dInsane = VERY_NEGATIVE_DOUBLE;*/ static const double dInsane = -9e29; static const unsigned uInsane = 8888888; typedef enum { NTT_Unknown, /* Returned from Tree::GetToken: */ NTT_Lparen, NTT_Rparen, NTT_Colon, NTT_Comma, NTT_Semicolon, NTT_String, /* Following are never returned from Tree::GetToken: */ NTT_SingleQuotedString, NTT_DoubleQuotedString, NTT_Comment } NEWICK_TOKEN_TYPE; static void InitCache(uint uCacheCount, tree_t *tree); static void TreeZero(tree_t *tree); static uint GetNeighborCount(unsigned uNodeIndex, tree_t *tree); static bool IsEdge(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree); static bool HasEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree); static void TreeToFileNodeRooted(tree_t *tree, uint m_uRootNodeIndex, FILE *fp); static void ValidateNode(uint uNodeIndex, tree_t *tree); static void AssertAreNeighbors(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree); static void ExpandCache(tree_t *tree); static void TreeCreateRooted(tree_t *tree); static bool GetGroupFromFile(FILE *fp, uint uNodeIndex, double *ptrdEdgeLength, tree_t *tree); static NEWICK_TOKEN_TYPE GetToken(FILE *fp, char szToken[], uint uBytes); /* stuff from textfile.cpp */ static void FileSkipWhite(FILE *fp); static bool FileSkipWhiteX(FILE *fp); static void SetLeafName(uint uNodeIndex, const char *ptrName, tree_t *tree); uint AppendBranch(tree_t *tree, uint uExistingLeafIndex); static void SetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, double dLength, tree_t *tree); static uint UnrootFromFile(tree_t *tree); uint GetNeighbor(uint uNodeIndex, uint uNeighborSubscript, tree_t *tree); static void InitNode(tree_t *prTree, uint uNodeIndex); /** * @param[in] uNodeIndex * node to examine * @param[in] tree * tree to examine * @return id of left node * @note called GetRight in Muscle3.7 */ uint GetLeft(uint uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount); return tree->m_uNeighbor2[uNodeIndex]; } /*** end: GetLeft ***/ /** * @param[in] uNodeIndex * node to examine * @param[in] tree * tree to examine * @return id of right node * @note called GetRight in Muscle3.7 */ uint GetRight(uint uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount); return tree->m_uNeighbor3[uNodeIndex]; } /*** end: GetRight ***/ /** * @param[in] uNodeIndex * node to examine * @param[in] tree * tree to examine * @return leaf id of current node */ uint GetLeafId(uint uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(uNodeIndex < tree->m_uNodeCount); assert(IsLeaf(uNodeIndex, tree)); return tree->m_Ids[uNodeIndex]; } /*** end: GetLeafId ***/ /** * @note originally called GetLeafName * */ char * GetLeafName(unsigned uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(uNodeIndex < tree->m_uNodeCount); assert(IsLeaf(uNodeIndex, tree)); return tree->m_ptrName[uNodeIndex]; } /*** end: GetLeafName ***/ /** * @brief returns first leaf node for a depth-first traversal of tree * * @param[in] tree * tree to traverse * * @return node index of first leaf node for depth-first traversal * * @note called FirstDepthFirstNode in Muscle3.7 * */ uint FirstDepthFirstNode(tree_t *tree) { uint uNodeIndex; assert(NULL != tree); assert(IsRooted(tree)); /* Descend via left branches until we hit a leaf */ uNodeIndex = tree->m_uRootNodeIndex; while (!IsLeaf(uNodeIndex, tree)) uNodeIndex = GetLeft(uNodeIndex, tree); return uNodeIndex; } /*** end: FirstDepthFirstNode ***/ /** * @brief returns next leaf node index for depth-first traversal of * tree * * @param[in] tree * tree to traverse * @param[in] uNodeIndex * Current node index * * @return node index of next leaf node during depth-first traversal * * @note called NextDepthFirstNode in Muscle3.7 */ uint NextDepthFirstNode(uint uNodeIndex, tree_t *tree) { uint uParent; assert(NULL != tree); assert(IsRooted(tree)); assert(uNodeIndex < tree->m_uNodeCount); if (IsRoot(uNodeIndex, tree)) { /* Node uNodeIndex is root, end of traversal */ return NULL_NEIGHBOR; } uParent = GetParent(uNodeIndex, tree); if (GetRight(uParent, tree) == uNodeIndex) { /* Is right branch, return parent=uParent */ return uParent; } uNodeIndex = GetRight(uParent, tree); /* Descend left from right sibling uNodeIndex */ while (!IsLeaf(uNodeIndex, tree)) { uNodeIndex = GetLeft(uNodeIndex, tree); } /* bottom out at leaf uNodeIndex */ return uNodeIndex; } /*** end: NextDepthFirstNode ***/ /** * @brief check if tree is a rooted tree * @param[in] tree * tree to check * @return TRUE if given tree is rooted, FALSE otherwise * */ bool IsRooted(tree_t *tree) { assert(NULL != tree); return tree->m_bRooted; } /*** end: IsRooted ***/ /** * */ void FreeMuscleTree(tree_t *tree) { uint i; assert(tree!=NULL); /* FIXME use GetLeafNodeIndex? or for (unsigned uNodeIndex = 0; uNodeIndex < m_uNodeCount; ++uNodeIndex) { if (tree.IsLeaf(uNodeIndex)) { const char *ptrName = tree.GetLeafName(uNodeIndex); */ /* IsLeaf needs m_uNodeCount and all m_uNeighbor's * so free first */ for (i=0; im_uNodeCount; i++) { /* IsLeaf needs neighbour count, so free those guys later */ if (IsLeaf(i, tree)) { CKFREE(tree->m_ptrName[i]); } } CKFREE(tree->m_ptrName); CKFREE(tree->m_uNeighbor1); CKFREE(tree->m_uNeighbor2); CKFREE(tree->m_uNeighbor3); CKFREE(tree->m_Ids); CKFREE(tree->m_dEdgeLength1); CKFREE(tree->m_dEdgeLength2); CKFREE(tree->m_dEdgeLength3); #if USE_HEIGHT CKFREE(tree->m_dHeight); CKFREE(tree->m_bHasHeight); #endif CKFREE(tree->m_bHasEdgeLength1); CKFREE(tree->m_bHasEdgeLength2); CKFREE(tree->m_bHasEdgeLength3); TreeZero(tree); free(tree); } /*** end: FreeMuscleTree ***/ /** * @brief create a muscle tree * * @note Original comment in Muscle code: "Create rooted tree from a * vector description. Node indexes are 0..N-1 for leaves, N..2N-2 for * internal nodes. Vector subscripts are i-N and have values for * internal nodes only, but those values are node indexes 0..2N-2. So * e.g. if N=6 and Left[2]=1, this means that the third internal node * (node index 8) has the second leaf (node index 1) as its left * child. uRoot gives the vector subscript of the root, so add N to * get the node index." * * @param[out] tree * newly created tree * @param[in] uLeafCount * number of leaf nodes * @param[in] uRoot * Internal node index of root node * @param[in] Left * Node index of left sibling of an internal node. * Index range: 0--uLeafCount-1 * @param[in] Right * Node index of right sibling of an internal node. * Index range: 0--uLeafCount-1 * @param[in] LeftLength * Branch length of left branch of an internal node. * Index range: 0--uLeafCount-1 * @param[in] RightLength * Branch length of right branch of an internal node. * Index range: 0--uLeafCount-1 * @param[in] LeafIds * Leaf id. Index range: 0--uLeafCount * @param[in] LeafNames * Leaf label. Index range: 0--uLeafCount * */ void MuscleTreeCreate(tree_t *tree, uint uLeafCount, uint uRoot, const uint *Left, const uint *Right, const float *LeftLength, const float* RightLength, const uint *LeafIds, char **LeafNames) { uint uNodeIndex; TreeZero(tree); tree->m_uNodeCount = 2*uLeafCount - 1; InitCache(tree->m_uNodeCount, tree); for (uNodeIndex = 0; uNodeIndex < uLeafCount; ++uNodeIndex) { tree->m_Ids[uNodeIndex] = LeafIds[uNodeIndex]; tree->m_ptrName[uNodeIndex] = CkStrdup(LeafNames[uNodeIndex]); } for (uNodeIndex = uLeafCount; uNodeIndex < tree->m_uNodeCount; ++uNodeIndex) { uint v = uNodeIndex - uLeafCount; uint uLeft = Left[v]; uint uRight = Right[v]; float fLeft = LeftLength[v]; float fRight = RightLength[v]; tree->m_uNeighbor2[uNodeIndex] = uLeft; tree->m_uNeighbor3[uNodeIndex] = uRight; tree->m_bHasEdgeLength2[uNodeIndex] = TRUE; tree->m_bHasEdgeLength3[uNodeIndex] = TRUE; tree->m_dEdgeLength2[uNodeIndex] = fLeft; tree->m_dEdgeLength3[uNodeIndex] = fRight; tree->m_uNeighbor1[uLeft] = uNodeIndex; tree->m_uNeighbor1[uRight] = uNodeIndex; tree->m_dEdgeLength1[uLeft] = fLeft; tree->m_dEdgeLength1[uRight] = fRight; tree->m_bHasEdgeLength1[uLeft] = TRUE; tree->m_bHasEdgeLength1[uRight] = TRUE; } tree->m_bRooted = TRUE; tree->m_uRootNodeIndex = uRoot + uLeafCount; #ifndef NDEBUG TreeValidate(tree); #endif } /*** end: MuscleTreeCreate ***/ /** * @param[in] tree * tree to write * @param[out] fp * filepointer to write to2 * * @brief write a muscle tree to a file in newick format (distances * and all names) * * */ void MuscleTreeToFile(FILE *fp, tree_t *tree) { assert(NULL != tree); if (IsRooted(tree)) { TreeToFileNodeRooted(tree, tree->m_uRootNodeIndex, fp); fprintf(fp, ";\n"); return; } else { Log(&rLog, LOG_FATAL, "FIXME: output of unrooted muscle trees not implemented"); } } /*** end: MuscleTreeToFile ***/ /** * @brief check if given node is a leaf node * * @param[in] uNodeIndex * the node index * @param tree * the tree * * @return TRUE if given node is a leaf, FALSE otherwise * * @note called IsLeaf in Muscle3.7. See tree.h in original code */ bool IsLeaf(uint uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(uNodeIndex < tree->m_uNodeCount); if (1 == tree->m_uNodeCount) return TRUE; return 1 == GetNeighborCount(uNodeIndex, tree); } /*** end: IsLeaf ***/ /** */ bool IsRoot(uint uNodeIndex, tree_t *tree) { assert(NULL != tree); return IsRooted(tree) && tree->m_uRootNodeIndex == uNodeIndex; } /*** end: IsRoot ***/ /** */ uint GetNeighborCount(uint uNodeIndex, tree_t *tree) { uint n1, n2, n3; assert(uNodeIndex < tree->m_uNodeCount); assert(NULL != tree); assert(NULL != tree->m_uNeighbor1); assert(NULL != tree->m_uNeighbor2); assert(NULL != tree->m_uNeighbor3); n1 = tree->m_uNeighbor1[uNodeIndex]; n2 = tree->m_uNeighbor2[uNodeIndex]; n3 = tree->m_uNeighbor3[uNodeIndex]; return (NULL_NEIGHBOR != n1) + (NULL_NEIGHBOR != n2) + (NULL_NEIGHBOR != n3); } /*** end: GetNeighborCount ***/ /** */ uint GetParent(unsigned uNodeIndex, tree_t *tree) { assert(NULL != tree); assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount); return tree->m_uNeighbor1[uNodeIndex]; } /*** end: GetParent ***/ /** */ bool IsEdge(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree) { assert(uNodeIndex1 < tree->m_uNodeCount && uNodeIndex2 < tree->m_uNodeCount); assert(NULL != tree); return tree->m_uNeighbor1[uNodeIndex1] == uNodeIndex2 || tree->m_uNeighbor2[uNodeIndex1] == uNodeIndex2 || tree->m_uNeighbor3[uNodeIndex1] == uNodeIndex2; } /*** end: IsEdge ***/ /** */ bool HasEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree) { assert(NULL != tree); assert(uNodeIndex1 < tree->m_uNodeCount); assert(uNodeIndex2 < tree->m_uNodeCount); assert(IsEdge(uNodeIndex1, uNodeIndex2, tree)); if (tree->m_uNeighbor1[uNodeIndex1] == uNodeIndex2) return tree->m_bHasEdgeLength1[uNodeIndex1]; else if (tree->m_uNeighbor2[uNodeIndex1] == uNodeIndex2) return tree->m_bHasEdgeLength2[uNodeIndex1]; assert(tree->m_uNeighbor3[uNodeIndex1] == uNodeIndex2); return tree->m_bHasEdgeLength3[uNodeIndex1]; } /*** end: ***/ /** */ double GetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree) { assert(NULL != tree); assert(uNodeIndex1 < tree->m_uNodeCount && uNodeIndex2 < tree->m_uNodeCount); if (!HasEdgeLength(uNodeIndex1, uNodeIndex2, tree)) { Log(&rLog, LOG_FATAL, "Missing edge length in tree %u-%u", uNodeIndex1, uNodeIndex2); } if (tree->m_uNeighbor1[uNodeIndex1] == uNodeIndex2) return tree->m_dEdgeLength1[uNodeIndex1]; else if (tree->m_uNeighbor2[uNodeIndex1] == uNodeIndex2) return tree->m_dEdgeLength2[uNodeIndex1]; assert(tree->m_uNeighbor3[uNodeIndex1] == uNodeIndex2); return tree->m_dEdgeLength3[uNodeIndex1]; } /*** end: GetEdgeLength ***/ /** * */ void InitNode(tree_t *prTree, uint uNodeIndex) { prTree->m_uNeighbor1[uNodeIndex] = NULL_NEIGHBOR; prTree->m_uNeighbor2[uNodeIndex] = NULL_NEIGHBOR; prTree->m_uNeighbor3[uNodeIndex] = NULL_NEIGHBOR; prTree->m_bHasEdgeLength1[uNodeIndex] = FALSE; prTree->m_bHasEdgeLength2[uNodeIndex] = FALSE; prTree->m_bHasEdgeLength3[uNodeIndex] = FALSE; #if USE_HEIGHT prTree->m_bHasHeight[uNodeIndex] = FALSE; prTree->m_dHeight[uNodeIndex] = dInsane; #endif prTree->m_dEdgeLength1[uNodeIndex] = dInsane; prTree->m_dEdgeLength2[uNodeIndex] = dInsane; prTree->m_dEdgeLength3[uNodeIndex] = dInsane; prTree->m_ptrName[uNodeIndex] = NULL; prTree->m_Ids[uNodeIndex] = uInsane; } /*** end: InitNode ***/ /** * */ void InitCache(uint uCacheCount, tree_t *tree) { uint uNodeIndex; tree->m_uCacheCount = uCacheCount; tree->m_uNeighbor1 = (uint *) CKMALLOC(sizeof(uint) * tree->m_uCacheCount); tree->m_uNeighbor2 = (uint *) CKMALLOC(sizeof(uint) * tree->m_uCacheCount); tree->m_uNeighbor3 = (uint *) CKMALLOC(sizeof(uint) * tree->m_uCacheCount); tree->m_Ids = (uint *) CKMALLOC(sizeof(uint) * tree->m_uCacheCount); tree->m_dEdgeLength1 = (double *) CKMALLOC(sizeof(double) * tree->m_uCacheCount); tree->m_dEdgeLength2 = (double *) CKMALLOC(sizeof(double) * tree->m_uCacheCount); tree->m_dEdgeLength3 = (double *) CKMALLOC(sizeof(double) * tree->m_uCacheCount); #if USE_HEIGHT tree->m_dHeight = (double *) CKMALLOC(sizeof(double) * tree->m_uCacheCount); tree->m_bHasHeight = (bool *) CKMALLOC(sizeof(bool) * tree->m_uCacheCount); #endif tree->m_bHasEdgeLength1 = (bool *) CKMALLOC(sizeof(bool) * tree->m_uCacheCount); tree->m_bHasEdgeLength2 = (bool *) CKMALLOC(sizeof(bool) * tree->m_uCacheCount); tree->m_bHasEdgeLength3 = (bool *) CKMALLOC(sizeof(bool) * tree->m_uCacheCount); tree->m_ptrName = (char **) CKMALLOC(sizeof(char *) * tree->m_uCacheCount); for (uNodeIndex = 0; uNodeIndex < tree->m_uNodeCount; ++uNodeIndex) { InitNode(tree, uNodeIndex); } } /*** end: InitCache ***/ /** * * @note Replacing Tree::Clear but no freeing of memory! Just setting * everything to 0/NULL */ void TreeZero(tree_t *tree) { assert(NULL != tree); tree->m_uNodeCount = 0; tree->m_uCacheCount = 0; tree->m_uNeighbor1 = NULL; tree->m_uNeighbor2 = NULL; tree->m_uNeighbor3 = NULL; tree->m_dEdgeLength1 = NULL; tree->m_dEdgeLength2 = NULL; tree->m_dEdgeLength3 = NULL; #if USE_HEIGHT tree->m_dHeight = NULL; tree->m_bHasHeight = NULL; #endif tree->m_bHasEdgeLength1 = NULL; tree->m_bHasEdgeLength2 = NULL; tree->m_bHasEdgeLength3 = NULL; tree->m_ptrName = NULL; tree->m_Ids = NULL; tree->m_bRooted = FALSE; tree->m_uRootNodeIndex = 0; } /* end: TreeZero */ /** * */ void TreeToFileNodeRooted(tree_t *tree, uint uNodeIndex, FILE *fp) { bool bGroup; assert(IsRooted(tree)); assert(NULL != tree); bGroup = !IsLeaf(uNodeIndex, tree) || IsRoot(uNodeIndex, tree); if (bGroup) fprintf(fp, "(\n"); if (IsLeaf(uNodeIndex, tree)) { /* File.PutString(GetName(uNodeIndex)); */ fprintf(fp, "%s", tree->m_ptrName[uNodeIndex]); } else { TreeToFileNodeRooted(tree, GetLeft(uNodeIndex, tree), fp); fprintf(fp, ",\n"); TreeToFileNodeRooted(tree, GetRight(uNodeIndex, tree), fp); } if (bGroup) fprintf(fp, ")"); if (!IsRoot(uNodeIndex, tree)) { uint uParent = GetParent(uNodeIndex, tree); if (HasEdgeLength(uNodeIndex, uParent, tree)) fprintf(fp, ":%g", GetEdgeLength(uNodeIndex, uParent, tree)); } fprintf(fp, "\n"); } /*** end: TreeToFileNodeRooted ***/ /** * * */ void TreeValidate(tree_t *tree) { uint uNodeIndex; assert(NULL != tree); for (uNodeIndex = 0; uNodeIndex < tree->m_uNodeCount; ++uNodeIndex) { ValidateNode(uNodeIndex, tree); } /* FIXME: maybe set negative length to zero? What impact would * that have? */ } /*** end TreeValidate ***/ /** * * */ void ValidateNode(uint uNodeIndex, tree_t *tree) { uint uNeighborCount; uint n1, n2, n3; assert(NULL != tree); if (uNodeIndex >= tree->m_uNodeCount) Log(&rLog, LOG_FATAL, "ValidateNode(%u), %u nodes", uNodeIndex, tree->m_uNodeCount); uNeighborCount = GetNeighborCount(uNodeIndex, tree); if (2 == uNeighborCount) { if (!tree->m_bRooted) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode: Node %u has two neighbors, tree is not rooted", uNodeIndex); } if (uNodeIndex != tree->m_uRootNodeIndex) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode: Node %u has two neighbors, but not root node=%u", uNodeIndex, tree->m_uRootNodeIndex); } } n1 = tree->m_uNeighbor1[uNodeIndex]; n2 = tree->m_uNeighbor2[uNodeIndex]; n3 = tree->m_uNeighbor3[uNodeIndex]; if (NULL_NEIGHBOR == n2 && NULL_NEIGHBOR != n3) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode, n2=null, n3!=null", uNodeIndex); } if (NULL_NEIGHBOR == n3 && NULL_NEIGHBOR != n2) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode, n3=null, n2!=null", uNodeIndex); } if (n1 != NULL_NEIGHBOR) AssertAreNeighbors(uNodeIndex, n1, tree); if (n2 != NULL_NEIGHBOR) AssertAreNeighbors(uNodeIndex, n2, tree); if (n3 != NULL_NEIGHBOR) AssertAreNeighbors(uNodeIndex, n3, tree); if (n1 != NULL_NEIGHBOR && (n1 == n2 || n1 == n3)) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode, duplicate neighbors in node %u", uNodeIndex); } if (n2 != NULL_NEIGHBOR && (n2 == n1 || n2 == n3)) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode, duplicate neighbors in node %u", uNodeIndex); } if (n3 != NULL_NEIGHBOR && (n3 == n1 || n3 == n2)) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode, duplicate neighbors in node %u", uNodeIndex); } if (IsRooted(tree)) { if (NULL_NEIGHBOR == GetParent(uNodeIndex, tree)) { if (uNodeIndex != tree->m_uRootNodeIndex) { Log(&rLog, LOG_FATAL, "Tree::ValiateNode(%u), no parent", uNodeIndex); } } else if (GetLeft(GetParent(uNodeIndex, tree), tree) != uNodeIndex && GetRight(GetParent(uNodeIndex, tree), tree) != uNodeIndex) { Log(&rLog, LOG_FATAL, "Tree::ValidateNode(%u), parent / child mismatch", uNodeIndex); } } } /*** end: ValidateNode ***/ /** * * */ void AssertAreNeighbors(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree) { bool Has12, Has21; assert(NULL != tree); if (uNodeIndex1 >= tree->m_uNodeCount || uNodeIndex2 >= tree->m_uNodeCount) Log(&rLog, LOG_FATAL, "AssertAreNeighbors(%u,%u), are %u nodes", uNodeIndex1, uNodeIndex2, tree->m_uNodeCount); if (tree->m_uNeighbor1[uNodeIndex1] != uNodeIndex2 && tree->m_uNeighbor2[uNodeIndex1] != uNodeIndex2 && tree->m_uNeighbor3[uNodeIndex1] != uNodeIndex2) { Log(&rLog, LOG_FATAL, "AssertAreNeighbors(%u,%u) failed", uNodeIndex1, uNodeIndex2); } if (tree->m_uNeighbor1[uNodeIndex2] != uNodeIndex1 && tree->m_uNeighbor2[uNodeIndex2] != uNodeIndex1 && tree->m_uNeighbor3[uNodeIndex2] != uNodeIndex1) { Log(&rLog, LOG_FATAL, "AssertAreNeighbors(%u,%u) failed", uNodeIndex1, uNodeIndex2); } Has12 = HasEdgeLength(uNodeIndex1, uNodeIndex2, tree); Has21 = HasEdgeLength(uNodeIndex2, uNodeIndex1, tree); if (Has12 != Has21) { HasEdgeLength(uNodeIndex1, uNodeIndex2, tree); HasEdgeLength(uNodeIndex2, uNodeIndex1, tree); Log(&rLog, LOG_ERROR, "HasEdgeLength(%u, %u)=%c HasEdgeLength(%u, %u)=%c\n", uNodeIndex1, uNodeIndex2, Has12 ? 'T' : 'F', uNodeIndex2, uNodeIndex1, Has21 ? 'T' : 'F'); Log(&rLog, LOG_FATAL, "Tree::AssertAreNeighbors, HasEdgeLength not symmetric"); } if (Has12) { double d12 = GetEdgeLength(uNodeIndex1, uNodeIndex2, tree); double d21 = GetEdgeLength(uNodeIndex2, uNodeIndex1, tree); if (d12 != d21) { Log(&rLog, LOG_FATAL, "Tree::AssertAreNeighbors, Edge length disagrees %u-%u=%.3g, %u-%u=%.3g", uNodeIndex1, uNodeIndex2, d12, uNodeIndex2, uNodeIndex1, d21); } } } /*** end: AssertAreNeighbors ***/ /** * * @note see phyfromfile.cpp in Muscle3.7. Tree has to be a pointer to * an already allocated tree structure. * * return non-Zero on failure * * leafids will not be set here (FIXME:CHECK if true) */ int MuscleTreeFromFile(tree_t *tree, char *ftree) { double dEdgeLength; bool bEdgeLength; char szToken[16]; NEWICK_TOKEN_TYPE NTT; unsigned uThirdNode; FILE *fp = NULL; assert(tree!=NULL); assert(ftree!=NULL); if (NULL == (fp=fopen(ftree, "r"))) { Log(&rLog, LOG_ERROR, "Couldn't open tree-file '%s' for reading. Skipping", ftree); return -1; } /* Assume rooted. * If we discover that it is unrooted, will convert on the fly. */ TreeCreateRooted(tree); bEdgeLength = GetGroupFromFile(fp, 0, &dEdgeLength, tree); /* Next token should be either ';' for rooted tree or ',' for * unrooted. */ NTT = GetToken(fp, szToken, sizeof(szToken)); /* If rooted, all done. */ if (NTT_Semicolon == NTT) { if (bEdgeLength) Log(&rLog, LOG_WARN, " *** Warning *** edge length on root group in Newick file %s\n", ftree); TreeValidate(tree); fclose(fp); return 0; } if (NTT_Comma != NTT) Log(&rLog, LOG_FATAL, "Tree::FromFile, expected ';' or ',', got '%s'", szToken); uThirdNode = UnrootFromFile(tree); bEdgeLength = GetGroupFromFile(fp, uThirdNode, &dEdgeLength, tree); if (bEdgeLength) SetEdgeLength(0, uThirdNode, dEdgeLength, tree); TreeValidate(tree); fclose(fp); return 0; } /*** end MuscleTreeFromFile ***/ /** * */ void ExpandCache(tree_t *tree) { const uint uNodeCount = 100; uint uNewCacheCount; uint *uNewNeighbor1, *uNewNeighbor2, *uNewNeighbor3; uint *uNewIds; double *dNewEdgeLength1, *dNewEdgeLength2, *dNewEdgeLength3; #if USE_HEIGHT double *dNewHeight; bool *bNewHasHeight; #endif bool *bNewHasEdgeLength1, *bNewHasEdgeLength2, *bNewHasEdgeLength3; char **ptrNewName; assert(NULL != tree); uNewCacheCount = tree->m_uCacheCount + uNodeCount; uNewNeighbor1 = (uint *) CKMALLOC( uNewCacheCount * sizeof(uint)); uNewNeighbor2 = (uint *) CKMALLOC( uNewCacheCount * sizeof(uint)); uNewNeighbor3 = (uint *) CKMALLOC( uNewCacheCount * sizeof(uint)); uNewIds = (uint *) CKCALLOC( uNewCacheCount, sizeof(uint)); dNewEdgeLength1 = (double *) CKMALLOC( uNewCacheCount * sizeof(double)); dNewEdgeLength2 = (double *) CKMALLOC( uNewCacheCount * sizeof(double)); dNewEdgeLength3 = (double *) CKMALLOC( uNewCacheCount * sizeof(double)); #if USE_HEIGHT dNewHeight = (double *) CKMALLOC( uNewCacheCount * sizeof(double)); bNewHasHeight = (bool *) CKMALLOC( uNewCacheCount * sizeof(bool)); #endif bNewHasEdgeLength1 = (bool *) CKMALLOC( uNewCacheCount * sizeof(bool)); bNewHasEdgeLength2 = (bool *) CKMALLOC( uNewCacheCount * sizeof(bool)); bNewHasEdgeLength3 = (bool *) CKMALLOC( uNewCacheCount * sizeof(bool)); ptrNewName = (char **) CKCALLOC(uNewCacheCount, sizeof(char*)); if (tree->m_uCacheCount > 0) { uint uUnsignedBytes, uEdgeBytes; uint uBoolBytes, uNameBytes; uUnsignedBytes = tree->m_uCacheCount*sizeof(uint); memcpy(uNewNeighbor1, tree->m_uNeighbor1, uUnsignedBytes); memcpy(uNewNeighbor2, tree->m_uNeighbor2, uUnsignedBytes); memcpy(uNewNeighbor3, tree->m_uNeighbor3, uUnsignedBytes); memcpy(uNewIds, tree->m_Ids, uUnsignedBytes); uEdgeBytes = tree->m_uCacheCount*sizeof(double); memcpy(dNewEdgeLength1, tree->m_dEdgeLength1, uEdgeBytes); memcpy(dNewEdgeLength2, tree->m_dEdgeLength2, uEdgeBytes); memcpy(dNewEdgeLength3, tree->m_dEdgeLength3, uEdgeBytes); #if USE_HEIGHT memcpy(dNewHeight, tree->m_dHeight, uEdgeBytes); #endif uBoolBytes = tree->m_uCacheCount*sizeof(bool); memcpy(bNewHasEdgeLength1, tree->m_bHasEdgeLength1, uBoolBytes); memcpy(bNewHasEdgeLength2, tree->m_bHasEdgeLength2, uBoolBytes); memcpy(bNewHasEdgeLength3, tree->m_bHasEdgeLength3, uBoolBytes); #if USE_HEIGHT memcpy(bNewHasHeight, tree->m_bHasHeight, uBoolBytes); #endif uNameBytes = tree->m_uCacheCount*sizeof(char *); memcpy(ptrNewName, tree->m_ptrName, uNameBytes); /* similiar to FreeMuscleTree */ /* IsLeaf needs m_uNodeCount and all m_uNeighbor's * so free first */ #if 0 for (i=0; im_uNodeCount; i++) { if (IsLeaf(i, tree)) { #ifndef NDEBUG if (NULL==tree->m_ptrName[i]) { Log(&rLog, LOG_WARN, "FIXME tree->m_ptrName[%d] is already NULL", i); } #endif CKFREE(tree->m_ptrName[i]); } } #endif CKFREE(tree->m_ptrName); CKFREE(tree->m_uNeighbor1); CKFREE(tree->m_uNeighbor2); CKFREE(tree->m_uNeighbor3); CKFREE(tree->m_Ids); CKFREE(tree->m_dEdgeLength1); CKFREE(tree->m_dEdgeLength2); CKFREE(tree->m_dEdgeLength3); CKFREE(tree->m_bHasEdgeLength1); CKFREE(tree->m_bHasEdgeLength2); CKFREE(tree->m_bHasEdgeLength3); #if USE_HEIGHT CKFREE(tree->m_bHasHeight); CKFREE(tree->m_dHeight); #endif } tree->m_uCacheCount = uNewCacheCount; tree->m_uNeighbor1 = uNewNeighbor1; tree->m_uNeighbor2 = uNewNeighbor2; tree->m_uNeighbor3 = uNewNeighbor3; tree->m_Ids = uNewIds; tree->m_dEdgeLength1 = dNewEdgeLength1; tree->m_dEdgeLength2 = dNewEdgeLength2; tree->m_dEdgeLength3 = dNewEdgeLength3; #ifdef USE_HEIGHT tree->m_dHeight = dNewHeight; tree->m_bHasHeight = bNewHasHeight; #endif tree->m_bHasEdgeLength1 = bNewHasEdgeLength1; tree->m_bHasEdgeLength2 = bNewHasEdgeLength2; tree->m_bHasEdgeLength3 = bNewHasEdgeLength3; tree->m_ptrName = ptrNewName; } /*** end: ExpandCache ***/ /** * * Tree must be pointer to an already allocated tree structure * */ void TreeCreateRooted(tree_t *tree) { TreeZero(tree); ExpandCache(tree); tree->m_uNodeCount = 1; tree->m_uNeighbor1[0] = NULL_NEIGHBOR; tree->m_uNeighbor2[0] = NULL_NEIGHBOR; tree->m_uNeighbor3[0] = NULL_NEIGHBOR; tree->m_bHasEdgeLength1[0] = FALSE; tree->m_bHasEdgeLength2[0] = FALSE; tree->m_bHasEdgeLength3[0] = FALSE; #if USE_HEIGHT tree->m_bHasHeight[0] = FALSE; #endif tree->m_uRootNodeIndex = 0; tree->m_bRooted = TRUE; #ifndef NDEBUG TreeValidate(tree); #endif } /*** end: TreeCreateRooted ***/ /** * */ uint UnrootFromFile(tree_t *tree) { uint uThirdNode; #if TRACE Log("Before unroot:\n"); LogMe(); #endif if (!tree->m_bRooted) Log(&rLog, LOG_FATAL, "Tree::Unroot, not rooted"); /* Convention: root node is always node zero */ assert(IsRoot(0, tree)); assert(NULL_NEIGHBOR == tree->m_uNeighbor1[0]); uThirdNode = tree->m_uNodeCount++; tree->m_uNeighbor1[0] = uThirdNode; tree->m_uNeighbor1[uThirdNode] = 0; tree->m_uNeighbor2[uThirdNode] = NULL_NEIGHBOR; tree->m_uNeighbor3[uThirdNode] = NULL_NEIGHBOR; tree->m_dEdgeLength1[0] = 0; tree->m_dEdgeLength1[uThirdNode] = 0; tree->m_bHasEdgeLength1[uThirdNode] = TRUE; tree->m_bRooted = FALSE; #if TRACE Log("After unroot:\n"); LogMe(); #endif return uThirdNode; } /*** end: UnrootFromFile ***/ /** * * */ bool GetGroupFromFile(FILE *fp, uint uNodeIndex, double *ptrdEdgeLength, tree_t *tree) { char szToken[1024]; NEWICK_TOKEN_TYPE NTT = GetToken(fp, szToken, sizeof(szToken)); bool bRightLength; bool bEof; char c; /* Group is either leaf name or (left, right). */ if (NTT_String == NTT) { SetLeafName(uNodeIndex, szToken, tree); #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Group is leaf '%s'", szToken); #endif } else if (NTT_Lparen == NTT) { const unsigned uLeft = AppendBranch(tree, uNodeIndex); const unsigned uRight = uLeft + 1; double dEdgeLength; bool bLeftLength = GetGroupFromFile(fp, uLeft, &dEdgeLength, tree); /* Left sub-group... */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Got '(', group is compound, expect left sub-group"); if (bLeftLength) { Log(&rLog, LOG_FORCED_DEBUG, "Edge length for left sub-group: %.3g", dEdgeLength); } else { Log(&rLog, LOG_FORCED_DEBUG, "%s", "No edge length for left sub-group"); } #endif if (bLeftLength) SetEdgeLength(uNodeIndex, uLeft, dEdgeLength, tree); /* ... then comma ... */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Expect comma"); #endif NTT = GetToken(fp, szToken, sizeof(szToken)); if (NTT_Comma != NTT) Log(&rLog, LOG_FATAL, "Tree::GetGroupFromFile, expected ',', got '%s'", szToken); /* ...then right sub-group... */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Expect right sub-group"); #endif bRightLength = GetGroupFromFile(fp, uRight, &dEdgeLength, tree); if (bRightLength) SetEdgeLength(uNodeIndex, uRight, dEdgeLength, tree); #if TRACE if (bRightLength) Log(&rLog, LOG_FORCED_DEBUG, "Edge length for right sub-group: %.3g", dEdgeLength); else Log(&rLog, LOG_FORCED_DEBUG, "%s", "No edge length for right sub-group"); #endif /* ... then closing parenthesis. */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Expect closing parenthesis (or comma if > 2-ary)"); #endif NTT = GetToken(fp, szToken, sizeof(szToken)); if (NTT_Rparen == NTT) ; else if (NTT_Comma == NTT) { if (ungetc(',', fp)==EOF) Log(&rLog, LOG_FATAL, "%s" "ungetc failed"); return FALSE; } else Log(&rLog, LOG_FATAL, "Tree::GetGroupFromFile, expected ')' or ',', got '%s'", szToken); } else { Log(&rLog, LOG_FATAL, "Tree::GetGroupFromFile, expected '(' or leaf name, got '%s'", szToken); } /* Group may optionally be followed by edge length. */ bEof = FileSkipWhiteX(fp); if (bEof) return FALSE; if ((c = fgetc(fp))==EOF) /* GetCharX */ Log(&rLog, LOG_FATAL, "%s", "fgetc reached end of file"); #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Character following group, could be colon, is '%c'", c); #endif if (':' == c) { NTT = GetToken(fp, szToken, sizeof(szToken)); if (NTT_String != NTT) Log(&rLog, LOG_FATAL, "Tree::GetGroupFromFile, expected edge length, got '%s'", szToken); *ptrdEdgeLength = atof(szToken); return TRUE; } if (ungetc(c, fp)==EOF) Log(&rLog, LOG_FATAL, "%s" "ungetc failed"); return FALSE; } /*** end: GetGroupFromFile ***/ /** * */ void FileSkipWhite(FILE *fp) { bool bEof = FileSkipWhiteX(fp); if (bEof) Log(&rLog, LOG_FATAL, "%s", "End-of-file skipping white space"); } /*** end: FileSkipWhite ***/ /** * */ bool FileSkipWhiteX(FILE *fp) { for (;;) { int c; bool bEof; /* GetChar */ if ((c = fgetc(fp))==EOF) { bEof = TRUE; } else { bEof = FALSE; } if (bEof) return TRUE; if (!isspace(c)) { if (ungetc(c, fp)==EOF) Log(&rLog, LOG_FATAL, "%s" "ungetc failed"); break; } } return FALSE; } /*** end: FileSkipWhiteX ***/ /** * */ NEWICK_TOKEN_TYPE GetToken(FILE *fp, char szToken[], uint uBytes) { char c; unsigned uBytesCopied = 0; NEWICK_TOKEN_TYPE TT; /* Skip leading white space */ FileSkipWhite(fp); if ((c = fgetc(fp))==EOF) /* GetCharX */ Log(&rLog, LOG_FATAL, "%s", "fgetc reached end of file"); /* In case a single-character token */ szToken[0] = c; szToken[1] = 0; switch (c) { case '(': return NTT_Lparen; case ')': return NTT_Rparen; case ':': return NTT_Colon; case ';': return NTT_Semicolon; case ',': return NTT_Comma; case '\'': TT = NTT_SingleQuotedString; if ((c = fgetc(fp))==EOF) /* GetCharX */ Log(&rLog, LOG_FATAL, "%s", "fgetc reached end of file"); break; case '"': TT = NTT_DoubleQuotedString; if ((c = fgetc(fp))==EOF) /* GetCharX */ Log(&rLog, LOG_FATAL, "%s", "fgetc reached end of file"); break; case '[': TT = NTT_Comment; break; default: TT = NTT_String; break; } for (;;) { bool bEof; if (TT != NTT_Comment) { if (uBytesCopied < uBytes - 2) { szToken[uBytesCopied++] = c; szToken[uBytesCopied] = 0; } else { Log(&rLog, LOG_FATAL, "Tree::GetToken: input buffer too small, token so far='%s'", szToken); } } c = fgetc(fp); /* GetChar */ bEof = (c==EOF ? TRUE : FALSE); if (bEof) return TT; switch (TT) { case NTT_String: if (0 != strchr("():;,", c)) { if (ungetc(c, fp)==EOF) Log(&rLog, LOG_FATAL, "%s" "ungetc failed"); return NTT_String; } if (isspace(c)) return NTT_String; break; case NTT_SingleQuotedString: if ('\'' == c) return NTT_String; break; case NTT_DoubleQuotedString: if ('"' == c) return NTT_String; break; case NTT_Comment: if (']' == c) return GetToken(fp, szToken, uBytes); break; default: Log(&rLog, LOG_FATAL, "Tree::GetToken, invalid TT=%u", TT); } } } /*** end: GetToken ***/ /*** SetLeafName * */ void SetLeafName(unsigned uNodeIndex, const char *ptrName, tree_t *tree) { assert(uNodeIndex < tree->m_uNodeCount); assert(IsLeaf(uNodeIndex, tree)); free(tree->m_ptrName[uNodeIndex]); /*LOG_DEBUG("Setting tree->m_ptrName[uNodeIndex=%d] to %s", uNodeIndex, ptrName);*/ tree->m_ptrName[uNodeIndex] = CkStrdup(ptrName); } /*** end: SetLeafName ***/ /** * * Append a new branch. This adds two new nodes and joins them to an * existing leaf node. Return value is k, new nodes have indexes k and * k+1 respectively. * */ uint AppendBranch(tree_t *tree, uint uExistingLeafIndex) { uint uNewLeaf1; uint uNewLeaf2; assert(tree!=NULL); if (0 == tree->m_uNodeCount) { Log(&rLog, LOG_FATAL, "%s(): %s", __FUNCTION__, "tree has not been created"); } assert(NULL_NEIGHBOR == tree->m_uNeighbor2[uExistingLeafIndex]); assert(NULL_NEIGHBOR == tree->m_uNeighbor3[uExistingLeafIndex]); assert(uExistingLeafIndex < tree->m_uNodeCount); #ifndef NDEBUG if (!IsLeaf(uExistingLeafIndex, tree)) { Log(&rLog, LOG_FATAL, "AppendBranch(%u): not leaf", uExistingLeafIndex); } #endif if (tree->m_uNodeCount >= tree->m_uCacheCount - 2) { ExpandCache(tree); } uNewLeaf1 = tree->m_uNodeCount; uNewLeaf2 = tree->m_uNodeCount + 1; tree->m_uNodeCount += 2; tree->m_uNeighbor2[uExistingLeafIndex] = uNewLeaf1; tree->m_uNeighbor3[uExistingLeafIndex] = uNewLeaf2; tree->m_uNeighbor1[uNewLeaf1] = uExistingLeafIndex; tree->m_uNeighbor1[uNewLeaf2] = uExistingLeafIndex; tree->m_uNeighbor2[uNewLeaf1] = NULL_NEIGHBOR; tree->m_uNeighbor2[uNewLeaf2] = NULL_NEIGHBOR; tree->m_uNeighbor3[uNewLeaf1] = NULL_NEIGHBOR; tree->m_uNeighbor3[uNewLeaf2] = NULL_NEIGHBOR; tree->m_dEdgeLength2[uExistingLeafIndex] = 0; tree->m_dEdgeLength3[uExistingLeafIndex] = 0; tree->m_dEdgeLength1[uNewLeaf1] = 0; tree->m_dEdgeLength2[uNewLeaf1] = 0; tree->m_dEdgeLength3[uNewLeaf1] = 0; tree->m_dEdgeLength1[uNewLeaf2] = 0; tree->m_dEdgeLength2[uNewLeaf2] = 0; tree->m_dEdgeLength3[uNewLeaf2] = 0; tree->m_bHasEdgeLength1[uNewLeaf1] = FALSE; tree->m_bHasEdgeLength2[uNewLeaf1] = FALSE; tree->m_bHasEdgeLength3[uNewLeaf1] = FALSE; tree->m_bHasEdgeLength1[uNewLeaf2] = FALSE; tree->m_bHasEdgeLength2[uNewLeaf2] = FALSE; tree->m_bHasEdgeLength3[uNewLeaf2] = FALSE; #if USE_HEIGHT tree->m_bHasHeight[uNewLeaf1] = FALSE; tree->m_bHasHeight[uNewLeaf2] = FALSE; #endif tree->m_Ids[uNewLeaf1] = uInsane; tree->m_Ids[uNewLeaf2] = uInsane; return uNewLeaf1; } /*** end: AppendBranch ***/ /** * * */ void SetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, double dLength, tree_t *tree) { assert(uNodeIndex1 < tree->m_uNodeCount && uNodeIndex2 < tree->m_uNodeCount); assert(IsEdge(uNodeIndex1, uNodeIndex2, tree)); if (tree->m_uNeighbor1[uNodeIndex1] == uNodeIndex2) { tree->m_dEdgeLength1[uNodeIndex1] = dLength; tree->m_bHasEdgeLength1[uNodeIndex1] = TRUE; } else if (tree->m_uNeighbor2[uNodeIndex1] == uNodeIndex2) { tree->m_dEdgeLength2[uNodeIndex1] = dLength; tree->m_bHasEdgeLength2[uNodeIndex1] = TRUE; } else { assert(tree->m_uNeighbor3[uNodeIndex1] == uNodeIndex2); tree->m_dEdgeLength3[uNodeIndex1] = dLength; tree->m_bHasEdgeLength3[uNodeIndex1] = TRUE; } if (tree->m_uNeighbor1[uNodeIndex2] == uNodeIndex1) { tree->m_dEdgeLength1[uNodeIndex2] = dLength; tree->m_bHasEdgeLength1[uNodeIndex2] = TRUE; } else if (tree->m_uNeighbor2[uNodeIndex2] == uNodeIndex1) { tree->m_dEdgeLength2[uNodeIndex2] = dLength; tree->m_bHasEdgeLength2[uNodeIndex2] = TRUE; } else { assert(tree->m_uNeighbor3[uNodeIndex2] == uNodeIndex1); tree->m_dEdgeLength3[uNodeIndex2] = dLength; tree->m_bHasEdgeLength3[uNodeIndex2] = TRUE; } } /*** end: SetEdgeLength ***/ /** * * Debug output * * LogMe in phy.cpp * */ void LogTree(tree_t *tree, FILE *fp) { uint uNodeIndex; uint n1, n2, n3; char *ptrName; fprintf(fp, "This is a tree with %u nodes, which is ", tree->m_uNodeCount); if (IsRooted(tree)) { fprintf(fp, "rooted:\n"); fprintf(fp, "Index Parnt LengthP Left LengthL Right LengthR Id Name\n"); fprintf(fp, "----- ----- ------- ---- ------- ----- ------- ----- ----\n"); } else { fprintf(fp, "unrooted;\n"); fprintf(fp, "Index Nbr_1 Length1 Nbr_2 Length2 Nbr_3 Length3 Id Name\n"); fprintf(fp, "----- ----- ------- ----- ------- ----- ------- ----- ----\n"); } for (uNodeIndex = 0; uNodeIndex < tree->m_uNodeCount; ++uNodeIndex) { fprintf(fp, "%5u ", uNodeIndex); n1 = tree->m_uNeighbor1[uNodeIndex]; n2 = tree->m_uNeighbor2[uNodeIndex]; n3 = tree->m_uNeighbor3[uNodeIndex]; if (NULL_NEIGHBOR != n1) { fprintf(fp, "%5u ", n1); if (tree->m_bHasEdgeLength1[uNodeIndex]) fprintf(fp, "%7.3g ", tree->m_dEdgeLength1[uNodeIndex]); else fprintf(fp, " * "); } else { fprintf(fp, " "); } if (NULL_NEIGHBOR != n2) { fprintf(fp, "%5u ", n2); if (tree->m_bHasEdgeLength2[uNodeIndex]) fprintf(fp, "%7.3g ", tree->m_dEdgeLength2[uNodeIndex]); else fprintf(fp, " * "); } else { fprintf(fp, " "); } if (NULL_NEIGHBOR != n3) { fprintf(fp, "%5u ", n3); if (tree->m_bHasEdgeLength3[uNodeIndex]) fprintf(fp, "%7.3g ", tree->m_dEdgeLength3[uNodeIndex]); else fprintf(fp, " * "); } else { fprintf(fp, " "); } if (tree->m_Ids != 0 && IsLeaf(uNodeIndex, tree)) { unsigned uId = tree->m_Ids[uNodeIndex]; if (uId == uInsane) fprintf(fp, " *"); else fprintf(fp, "%5u", uId); } else { fprintf(fp, " "); } if (tree->m_bRooted && uNodeIndex == tree->m_uRootNodeIndex) fprintf(fp, " [ROOT] "); ptrName = tree->m_ptrName[uNodeIndex]; if (ptrName != 0) fprintf(fp, " %s", ptrName); fprintf(fp, "\n"); } } /*** end: LogTree ***/ /** * * replaces m_uLeafCount */ uint GetLeafCount(tree_t *tree) { assert(tree!=NULL); return (tree->m_uNodeCount+1)/2; } /*** GetLeafCount ***/ /** * */ uint GetNodeCount(tree_t *tree) { assert(tree!=NULL); return 2*(GetLeafCount(tree)) - 1; } /*** end: GetNodeCount ***/ /** * */ uint GetNeighbor(uint uNodeIndex, uint uNeighborSubscript, tree_t *prTree) { assert(uNodeIndex < prTree->m_uNodeCount); switch (uNeighborSubscript) { case 0: return prTree->m_uNeighbor1[uNodeIndex]; case 1: return prTree->m_uNeighbor2[uNodeIndex]; case 2: return prTree->m_uNeighbor3[uNodeIndex]; } Log(&rLog, LOG_FATAL, "Internal error in %s: sub=%u", __FUNCTION__, uNeighborSubscript); return NULL_NEIGHBOR; } /*** end: GetNeighbor ***/ /** * */ void SetLeafId(tree_t *tree, uint uNodeIndex, uint uId) { assert(uNodeIndex < tree->m_uNodeCount); assert(IsLeaf(uNodeIndex, tree)); tree->m_Ids[uNodeIndex] = uId; } /*** end: SetLeafId ***/ /** * */ uint GetRootNodeIndex(tree_t *tree) { assert(NULL!=tree); return tree->m_uRootNodeIndex; } /*** end: GetRootNodeIndex ***/ /** * @note avoid usage if you want to iterate over all indices, because * this will be slow * */ uint LeafIndexToNodeIndex(uint uLeafIndex, tree_t *prTree) { uint uLeafCount = 0; unsigned uNodeCount = GetNodeCount(prTree); uint uNodeIndex; for (uNodeIndex = 0; uNodeIndex < uNodeCount; uNodeIndex++) { if (IsLeaf(uNodeIndex, prTree)) { if (uLeafCount == uLeafIndex) { return uNodeIndex; } else { uLeafCount++; } } } Log(&rLog, LOG_FATAL, "Internal error: node index out of range"); return 0; } /*** end: LeafIndexToNodeIndex ***/ /** * @brief Append a (source) tree to a (dest) tree to a given node * which will be replaced. All other nodes in that tree will stay the * same. * * @param[out] prDstTree * The tree to append to * @param[in] uDstTreeReplaceNodeIndex * Dest tree node to which source tree will be appended * @param[in] prSrcTree * The tree to append * * @note No nodes inside prDstTree will change except * uDstTreeReplaceNodeIndex * * * @warning: Function won't check or touch the m_Ids/leaf-indices! * That means if you want to join two trees with leaf indices 1-10 and * 1-10 your m_Ids/leaf-indices won't be unique anymore and the * association between your sequences and the tree are broken. Make * sure m_Ids are unique before calling me. * * The easiest would have been to do this by recursively calling * AppendBranch() (after adding uSrcTreeNodeIndex as extra argument to * this function). But recursion is evil. Yet another version would be * to setup all the data and call MuscleTreeCreate() to create a third * tree, which seems complicated and wasteful. The approach taken here * is the following: increase dest tree memory, copy over each src * tree node data and update the indices and counters. This is tricky * and has a lot of potential for bugs if tree interface is changed * (and even if it isn't). * */ void AppendTree(tree_t *prDstTree, uint uDstTreeReplaceNodeIndex, tree_t *prSrcTree) { uint uSrcTreeNodeIndex; uint uOrgDstTreeNodeCount; assert(NULL!=prDstTree); assert(NULL!=prSrcTree); assert(uDstTreeReplaceNodeIndex < prDstTree->m_uNodeCount); assert(IsLeaf(uDstTreeReplaceNodeIndex, prDstTree)); assert(IsRooted(prDstTree) && IsRooted(prSrcTree)); uOrgDstTreeNodeCount = prDstTree->m_uNodeCount; /* increase dest tree memory */ while (prDstTree->m_uCacheCount < (GetNodeCount(prDstTree) + GetNodeCount(prSrcTree))) { ExpandCache(prDstTree); } /* copy all src tree nodes * */ for (uSrcTreeNodeIndex=0; uSrcTreeNodeIndexm_uNodeCount; /* distinguish 4 cases for src nodes to copy: * * 1. src node is the only node, i.e. root & leaf * * 2. src node is root: set only left & right, but not parent * and just replace the given dest index * * 3. src node is leaf: set only parent * * 4. src node is internal node: update all three neighbours * * FIXME: this is messy. Is there a cleaner way to do this by * merging all cases? * */ if (IsRoot(uSrcTreeNodeIndex, prSrcTree) && IsLeaf(uSrcTreeNodeIndex, prSrcTree)) { /* special case: if this is the only member in * tree, i.e. it's root and leaf. Copy leaf name and leaf * id. No neighbours to update */ /* free dst node name if set */ if (NULL != prDstTree->m_ptrName[uDstTreeReplaceNodeIndex]) { CKFREE(prDstTree->m_ptrName[uDstTreeReplaceNodeIndex]); } prDstTree->m_ptrName[uDstTreeReplaceNodeIndex] = CkStrdup(GetLeafName(uSrcTreeNodeIndex, prSrcTree)); prDstTree->m_Ids[uDstTreeReplaceNodeIndex] = prSrcTree->m_Ids[uSrcTreeNodeIndex]; /* no updated of uNodeCount, because we used the replace node */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Updated dst rpl node %d with the only src leaf node: parent=%d (%f)", uDstTreeReplaceNodeIndex, prDstTree->m_uNeighbor1[uDstTreeReplaceNodeIndex], prDstTree->m_dEdgeLength1[uDstTreeReplaceNodeIndex]); #endif } else if (IsRoot(uSrcTreeNodeIndex, prSrcTree)) { /* src node is root: replace uDstTreeReplaceNodeIndex * (not uNewDstNodeIndex) with src root, i.e. the * uDstTreeReplaceNodeIndex becomes an internal node now. * * We only have two neighbours 2 & 3 (no parent). Keep old * parent info (neighbor 1). */ /* free dst node name if set */ if (NULL != prDstTree->m_ptrName[uDstTreeReplaceNodeIndex]) { CKFREE(prDstTree->m_ptrName[uDstTreeReplaceNodeIndex]); } prDstTree->m_uNeighbor2[uDstTreeReplaceNodeIndex] = prSrcTree->m_uNeighbor2[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; prDstTree->m_uNeighbor3[uDstTreeReplaceNodeIndex] = prSrcTree->m_uNeighbor3[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; prDstTree->m_bHasEdgeLength2[uDstTreeReplaceNodeIndex] = prSrcTree->m_bHasEdgeLength2[uSrcTreeNodeIndex]; prDstTree->m_bHasEdgeLength3[uDstTreeReplaceNodeIndex] = prSrcTree->m_bHasEdgeLength3[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength2[uDstTreeReplaceNodeIndex] = prSrcTree->m_dEdgeLength2[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength3[uDstTreeReplaceNodeIndex] = prSrcTree->m_dEdgeLength3[uSrcTreeNodeIndex]; /* make Id invalid */ prDstTree->m_Ids[uDstTreeReplaceNodeIndex] = uInsane; /* no updated of uNodeCount, because we used the replace node */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Updated dst rpl node %d with the src root node: (untouched) parent=%d (%f) left=%d (%f) right=%d (%f)", uDstTreeReplaceNodeIndex, prDstTree->m_uNeighbor1[uDstTreeReplaceNodeIndex], prDstTree->m_dEdgeLength1[uDstTreeReplaceNodeIndex], prDstTree->m_uNeighbor2[uDstTreeReplaceNodeIndex], prDstTree->m_dEdgeLength2[uDstTreeReplaceNodeIndex], prDstTree->m_uNeighbor3[uDstTreeReplaceNodeIndex], prDstTree->m_dEdgeLength3[uDstTreeReplaceNodeIndex]); #endif } else if (IsLeaf(uSrcTreeNodeIndex, prSrcTree)) { /* src node is a leaf, which means we only have one * neighbour, and that is its parent, i.e. n1 * */ /* initialise/zero new node to default values */ InitNode(prDstTree, uNewDstNodeIndex); /* update m_ptrName/leaf name */ prDstTree->m_ptrName[uNewDstNodeIndex] = CkStrdup(GetLeafName(uSrcTreeNodeIndex, prSrcTree)); /* update parent node (beware of special case: parent was src tree root */ if (IsRoot(prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex], prSrcTree)) { prDstTree->m_uNeighbor1[uNewDstNodeIndex] = uDstTreeReplaceNodeIndex; } else { prDstTree->m_uNeighbor1[uNewDstNodeIndex] = prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; } /* update edge length info to parent */ prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] = prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength1[uNewDstNodeIndex] = prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex]; /* update sequence/object id */ prDstTree->m_Ids[uNewDstNodeIndex] = prSrcTree->m_Ids[uSrcTreeNodeIndex]; /* we used a new node so increase their count */ prDstTree->m_uNodeCount += 1; #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with a src leaf node: parent=%d (%f)", uNewDstNodeIndex, prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex]); #endif } else { /* src node is not root neither leaf, means we have an * internal node. Update all neighbour info * */ /* initialise/zero node values to default values */ InitNode(prDstTree, uNewDstNodeIndex); /* update neigbours */ /* parent: special case if parent was src tree root */ if (IsRoot(prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex], prSrcTree)) { prDstTree->m_uNeighbor1[uNewDstNodeIndex] = uDstTreeReplaceNodeIndex; } else { prDstTree->m_uNeighbor1[uNewDstNodeIndex] = prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; } /* left */ prDstTree->m_uNeighbor2[uNewDstNodeIndex] = prSrcTree->m_uNeighbor2[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; /* right */ prDstTree->m_uNeighbor3[uNewDstNodeIndex] = prSrcTree->m_uNeighbor3[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount; /* update edge length info */ /* parent */ prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] = prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength1[uNewDstNodeIndex] = prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex]; /* left */ prDstTree->m_bHasEdgeLength2[uNewDstNodeIndex] = prSrcTree->m_bHasEdgeLength2[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength2[uNewDstNodeIndex] = prSrcTree->m_dEdgeLength2[uSrcTreeNodeIndex]; /* right */ prDstTree->m_bHasEdgeLength3[uNewDstNodeIndex] = prSrcTree->m_bHasEdgeLength3[uSrcTreeNodeIndex]; prDstTree->m_dEdgeLength3[uNewDstNodeIndex] = prSrcTree->m_dEdgeLength3[uSrcTreeNodeIndex]; /* we used a new node so increase their count */ prDstTree->m_uNodeCount += 1; #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with an internal src node: parent=%d (%f) left=%d (%f) right=%d (%f)", uNewDstNodeIndex, prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex], prDstTree->m_uNeighbor2[uNewDstNodeIndex], prDstTree->m_dEdgeLength2[uNewDstNodeIndex], prDstTree->m_uNeighbor3[uNewDstNodeIndex], prDstTree->m_dEdgeLength3[uNewDstNodeIndex]); #endif } } /* end for each src tree node */ /* * m_uRootNodeIndex stays the same. * * No need to touch m_uCacheCount. * */ #if USE_HEIGHT Log(&rLog, LOG_FATAL, "Internal error: Height usage not implemented in %s", __FUNCTION__); #endif #ifndef NDEBUG TreeValidate(prDstTree); #endif return; } /*** end: AppendTree() ***/ clustal-omega-1.2.1/src/clustal/tree.c0000644000175100017510000001542412206661646014553 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: tree.c 278 2013-05-16 15:53:45Z fabian $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "util.h" #include "log.h" #include "muscle_upgma.h" #include "tree.h" /** * * @brief Creates a UPGMA guide tree. This is a frontend function to * the ported Muscle UPGMA code (). * * @param[out] tree * created upgma tree. will be allocated here. use FreeMuscleTree() * to free * @param[in] labels * pointer to nseq sequence names * @param[in] distmat * distance matrix * @param[in] ftree * optional: if non-NULL, tree will be written to this files * * @see FreeMuscleTree() * @see MuscleUpgma2() * */ void GuideTreeUpgma(tree_t **tree, char **labels, symmatrix_t *distmat, char *ftree) { linkage_t linkage = LINKAGE_AVG; FILE *fp = NULL; if (NULL != ftree) { if (NULL == (fp=fopen(ftree, "w"))) { Log(&rLog, LOG_ERROR, "Couldn't open tree-file '%s' for writing. Skipping", ftree); } /* fp NULL is handled later */ } (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); MuscleUpgma2((*tree), distmat, linkage, labels); if (rLog.iLogLevelEnabled <= LOG_DEBUG) { Log(&rLog, LOG_DEBUG, "tree logging..."); LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); } if (NULL != fp) { MuscleTreeToFile(fp, (*tree)); Log(&rLog, LOG_INFO, "Guide tree written to %s", ftree); fclose(fp); } } /*** end: guidetree_upgma ***/ /** * * @brief * * @param[out] tree * created upgma tree. will be allocated here. use FreeMuscleTree() * to free * @param[in] mseq * @param[in] ftree * * @return non-zero on error * */ int GuideTreeFromFile(tree_t **tree, mseq_t *mseq, char *ftree) { int iNodeCount; int iNodeIndex; (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); if (MuscleTreeFromFile((*tree), ftree)!=0) { Log(&rLog, LOG_ERROR, "%s", "MuscleTreeFromFile failed"); return -1; } /* Make sure tree is rooted */ if (!IsRooted((*tree))) { Log(&rLog, LOG_ERROR, "User tree must be rooted"); return -1; } if ((int)GetLeafCount((*tree)) != mseq->nseqs) { Log(&rLog, LOG_ERROR, "User tree does not match input sequences"); return -1; } /* compare tree labels and sequence names and set leaf-ids */ iNodeCount = GetNodeCount((*tree)); for (iNodeIndex = 0; iNodeIndex < iNodeCount; ++iNodeIndex) { char *LeafName; int iSeqIndex; if (!IsLeaf(iNodeIndex, (*tree))) continue; LeafName = GetLeafName(iNodeIndex, (*tree)); if ((iSeqIndex=FindSeqName(LeafName, mseq))==-1) { Log(&rLog, LOG_ERROR, "Label '%s' in tree could not be found in sequence names", LeafName); return -1; } SetLeafId((*tree), iNodeIndex, iSeqIndex); } if (rLog.iLogLevelEnabled <= LOG_DEBUG) { Log(&rLog, LOG_DEBUG, "tree logging..."); LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); } return 0; } /*** end: GuideTreeFromFile() ***/ /** * * @brief Depth first traversal of tree, i.e. leaf nodes (sequences) * will be visited first. Order can be used to guide progressive * alignment order. * * @param[out] piOrderLR_p * order in which left/right nodes (profiles) are to be aligned. * allocated here; caller must free. * @param[in] tree * The tree to traverse; has to be rooted * @param[in] mseq * corresponding multiple sequence structure * */ void TraverseTree(int **piOrderLR_p, tree_t *tree, mseq_t *mseq) { int tree_nodeindex = 0; int order_index = 0; int iLeafCount = 0; assert(NULL!=tree); assert(NULL!=mseq); assert(IsRooted(tree)); /* allocate memory for node/profile alignment order; * for every node allocate DIFF_NODE (3) int (1 left, 1 right, 1 parent) */ *piOrderLR_p = (int *)CKCALLOC(DIFF_NODE * GetNodeCount(tree), sizeof(int)); /* Log(&rLog, LOG_FORCED_DEBUG, "print tree->m_iNodeCount=%d", tree->m_iNodeCount); */ tree_nodeindex = FirstDepthFirstNode(tree); /*LOG_DEBUG("Starting with treenodeindex = %d", tree_nodeindex);*/ order_index = 0; do { if (IsLeaf(tree_nodeindex, tree)) { int leafid = GetLeafId(tree_nodeindex, tree); if (leafid >= mseq->nseqs){ Log(&rLog, LOG_FATAL, "Sequence index out of range during tree traversal (leafid=%d nseqs=%d)", leafid, mseq->nseqs); } if (NULL != mseq->tree_order){ mseq->tree_order[iLeafCount] = leafid; iLeafCount++; } /* this is a leaf node, * indicate this by registering same leafid for left/right */ (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = leafid; (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = leafid; (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = tree_nodeindex; Log(&rLog, LOG_DEBUG, "Tree traversal: Visited leaf-node %d (leaf-id %d = Seq '%s')", tree_nodeindex, leafid, mseq->sqinfo[leafid].name); } else { int merge_nodeindex; int left; int right; merge_nodeindex = tree_nodeindex; left = GetLeft(tree_nodeindex, tree); right = GetRight(tree_nodeindex, tree); /* this is not a leaf node but a merge node, * register left node (even) and right node (odd) */ (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = left; (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = right; (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = merge_nodeindex; Log(&rLog, LOG_DEBUG, "Tree traversal: Visited non-leaf node %d with siblings %d (L) and %d (R)", merge_nodeindex, left, right); } tree_nodeindex = NextDepthFirstNode(tree_nodeindex, tree); order_index++; } while (NULL_NEIGHBOR != tree_nodeindex); return; } /*** end: TraverseTree ***/ clustal-omega-1.2.1/src/clustal/hhalign_wrapper.h0000644000175100017510000000220712216025141016747 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhalign_wrapper.h 289 2013-09-17 10:09:37Z fabian $ */ extern void SetDefaultHhalignPara(hhalign_para *prHhalignPara); extern int PosteriorProbabilities(mseq_t *prMSeq, hmm_light rHMMalignment, hhalign_para rHhalignPara, char *pcPosteriorfile); extern double PileUp(mseq_t *prMSeq, hhalign_para rHhalignPara, int iClustersize); extern double HHalignWrapper(mseq_t *mseq, int *piOrderLR, double *pdSeqWeights, int iNodeCount, hmm_light *prHMMList, int iHMMCount, int iProfProfSeparator, hhalign_para rHhalignPara); void SanitiseUnknown(mseq_t *mseq); clustal-omega-1.2.1/src/clustal/hhalign_wrapper.c0000644000175100017510000017672112270470723016771 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhalign_wrapper.c 290 2013-09-20 15:18:12Z fabian $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "seq.h" #include "tree.h" #include "progress.h" #include "hhalign/general.h" #include "hhalign/hhfunc.h" #include "hhalign/hhalign.h" /* up to this level (from leaf) will background HMM info be applied */ #define APPLY_BG_HMM_UP_TO_TREE_DEPTH 10 #define TIMING 0 #define TRACE 0 /** * @brief FIXME * * @note prHalignPara has to point to an already allocated instance * */ void SetDefaultHhalignPara(hhalign_para *prHhalignPara) { prHhalignPara->iMacRamMB = 2048; /* 2048 default|give 2GB to MAC algorithm */ prHhalignPara->bIsDna = false; /* protein mode unless we say otherwise */ prHhalignPara->bIsRna = false; prHhalignPara->pca = -UNITY; prHhalignPara->pcb = -UNITY; prHhalignPara->pcc = -UNITY; prHhalignPara->pcw = -UNITY; prHhalignPara->gapb = -UNITY; prHhalignPara->gapd = -UNITY; prHhalignPara->gape = -UNITY; prHhalignPara->gapf = -UNITY; prHhalignPara->gapg = -UNITY; prHhalignPara->gaph = -UNITY; prHhalignPara->gapi = -UNITY; prHhalignPara->pcaV = -UNITY; prHhalignPara->pcbV = -UNITY; prHhalignPara->pccV = -UNITY; prHhalignPara->pcwV = -UNITY; prHhalignPara->gapbV = -UNITY; prHhalignPara->gapdV = -UNITY; prHhalignPara->gapeV = -UNITY; prHhalignPara->gapfV = -UNITY; prHhalignPara->gapgV = -UNITY; prHhalignPara->gaphV = -UNITY; prHhalignPara->gapiV = -UNITY; } /*** end: SetDefaultHhalignPara() ***/ /** * @brief get rid of unknown residues * * @note HHalignWrapper can be entered in 2 different ways: (i) all * sequences are un-aligned (ii) there are 2 (aligned) profiles. in * the un-aligned case (i) the sequences come straight from Squid, * that is, they have been sanitised, all non-alphabetic residues * have been rendered as X's. In profile mode (ii) one profile may * have been produced internally. In that case residues may have * been translated back into their 'native' form, that is, they may * contain un-sanitised residues. These will cause trouble during * alignment * FS, r213->214 */ void SanitiseUnknown(mseq_t *mseq) { int iS; /* iterator for sequence */ /*int iR;*/ /* iterator for residue */ /*int iLen;*/ /* length of sequence */ char *pcRes = NULL; for (iS = 0; iS < mseq->nseqs; iS++){ for (pcRes = mseq->seq[iS]; '\0' != *pcRes; pcRes++){ if (isgap(*pcRes)){ /* don't like MSF gap characters ('~'), sanitise them (and '.' and ' '); FS, r258 -> r259 */ *pcRes = '-'; continue; } if (mseq->seqtype==SEQTYPE_PROTEIN) { if (NULL == strchr(AMINO_ALPHABET, toupper(*pcRes))) { *pcRes = AMINOACID_ANY; } } else if (mseq->seqtype==SEQTYPE_DNA) { if (NULL == strchr(DNA_ALPHABET, toupper(*pcRes))) { *pcRes = NUCLEOTIDE_ANY; } } else if (mseq->seqtype==SEQTYPE_RNA) { if (NULL == strchr(RNA_ALPHABET, toupper(*pcRes))) { *pcRes = NUCLEOTIDE_ANY; } } } /* !EO String */ } /* 0 <= iS < mseq->nseqs */ return; } /*** end: SanitiseUnknown() ***/ /** * @brief translate unknown residues back to ambiguity codes; * hhalign translates ambiguity codes (B,Z) into unknown residue (X). * we still have the original (un-aligned) residue information, * by iterating along the original and aligned sequences we can * reconstruct where codes have been changed and restore them * to their original value * * @param[in,out] mseq * sequence/profile data, mseq->seq [in,out] is changed to conform * with mseq->orig_seq [in] * */ void TranslateUnknown2Ambiguity(mseq_t *mseq) { int iS; /* iterator for sequence */ int iR, iRo; /* iterator for residue (original) */ int iChange, iCase, iAmbi; /* counts how many replacements */ static int siOffset = 'a' - 'A'; for (iS = 0; iS < mseq->nseqs; iS++){ iR = iRo = 0; iChange = iCase = iAmbi = 0; while(('\0' != mseq->seq[iS][iR]) && ('\0' != mseq->orig_seq[iS][iRo])) { /* skip gaps in aligned sequences */ while(isgap(mseq->seq[iS][iR])) { iR++; } /* was gap in unaligned seq * this should probably not happen */ while(isgap(mseq->orig_seq[iS][iRo])) { iRo++; } /* was gap in aligned seq */ /* check if we reached the end of the sequence after * skipping the gaps */ if ( ('\0' == mseq->seq[iS][iR]) || ('\0' == mseq->orig_seq[iS][iRo]) ){ break; } if (mseq->seq[iS][iR] != mseq->orig_seq[iS][iRo]){ /* FIXME: count replacements, discard case changes */ iChange++; if ( (mseq->seq[iS][iR] == mseq->orig_seq[iS][iRo]+siOffset) || (mseq->seq[iS][iR] == mseq->orig_seq[iS][iRo]-siOffset) ){ iCase++; } else { iAmbi++; } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "seq=%d, pos=(%d:%d), (%c:%c)", iS, iR, iRo, mseq->seq[iS][iR], mseq->orig_seq[iS][iRo]); #endif mseq->seq[iS][iR] = mseq->orig_seq[iS][iRo]; } iR++; iRo++; } /* !EO seq */ Log(&rLog, LOG_DEBUG, "in seq %d re-translated %d residue codes (%d true, %d case)", iS, iChange, iAmbi, iCase); /* assert that both sequences (un/aligned) have terminated */ /* skip gaps in aligned sequences */ while(isgap(mseq->seq[iS][iR])) { iR++; } /* was gap in unaligned seq * this should probably not happen */ while(isgap(mseq->orig_seq[iS][iRo])) { iRo++; } /* was gap in aligned seq */ if ( ('\0' != mseq->seq[iS][iR]) || ('\0' != mseq->orig_seq[iS][iRo]) ){ Log(&rLog, LOG_FATAL, "inconsistency in un/aligned sequence %d\n>%s\n>%s\n", iS, mseq->seq[iS], mseq->orig_seq[iS]); } } /* 0 <= iS < mseq->nseqs */ } /*** end: TranslateUnknown2Ambiguity() ***/ /** * @brief re-attach leading and trailing gaps to alignment * * @param[in,out] prMSeq * alignment structure (at this stage there should be no un-aligned sequences) * @param[in] iProfProfSeparator * gives sizes of input profiles, -1 if no input-profiles but un-aligned sequences * * @note leading and tailing profile columns * that only contain gaps have no effect on the alignment * and are removed during the alignment. if they are * encountered a warning message is printed to screen. * some users like to preserve these gap columns * FS, r213->214 */ void ReAttachLeadingGaps(mseq_t *prMSeq, int iProfProfSeparator) { int i, j; int iSize1 = 0; /* #seqs in 1st profile */ int iSize2 = 0; /* #seqs in 2nd profile */ int iPPS = iProfProfSeparator; int iLeadO1 = 0; /* leading gaps in 1st seq of 1st profile */ int iLeadO2 = 0; /* leading gaps in 1st seq of 2nd profile */ int iLeadA1 = 0; /* leading gaps in 1st seq of final alignment */ int iLeadA2 = 0; /* leading gaps in PPS seq of final alignment */ int iTrailO1 = 0; /* trailing gaps in 1st seq of 1st profile */ int iTrailO2 = 0; /* trailing gaps in 1st seq of 2nd profile */ int iTrailA1 = 0; /* trailing gaps in 1st seq of final alignment */ int iTrailA2 = 0; /* trailing gaps in PPS seq of final alignment */ int iLen = 0; /* length of final alignment */ int iLen1 = 0; /* length of 1st profile */ int iLen2 = 0; /* length of 2nd profile */ int iCutHead = 0; /* make up truncation at head */ int iCutTail = 0; /* make up truncation at tail */ char *pcIter = NULL; if (-1 == iProfProfSeparator){ return; } else { assert(prMSeq->aligned); assert(prMSeq->nseqs > iProfProfSeparator); } iSize1 = iProfProfSeparator; iSize2 = prMSeq->nseqs - iProfProfSeparator; iLen = strlen(prMSeq->seq[0]); iLen1 = strlen(prMSeq->orig_seq[0]); iLen2 = strlen(prMSeq->orig_seq[iPPS]); /* count leading/trailing gaps in 1st sequence of 1st/2nd profile and final alignmant */ for (iLeadO1 = 0, pcIter = prMSeq->orig_seq[0]; isgap(*pcIter); pcIter++, iLeadO1++); for (iLeadO2 = 0, pcIter = prMSeq->orig_seq[iPPS]; isgap(*pcIter); pcIter++, iLeadO2++); for (iLeadA1 = 0, pcIter = prMSeq->seq[0]; isgap(*pcIter); pcIter++, iLeadA1++); for (iLeadA2 = 0, pcIter = prMSeq->seq[iPPS]; isgap(*pcIter); pcIter++, iLeadA2++); for (iTrailO1 = 0, pcIter = &prMSeq->orig_seq[0][iLen1-1]; isgap(*pcIter); pcIter--, iTrailO1++); for (iTrailO2 = 0, pcIter = &prMSeq->orig_seq[iPPS][iLen2-1]; isgap(*pcIter); pcIter--, iTrailO2++); for (iTrailA1 = 0, pcIter = &prMSeq->seq[0][iLen-1]; isgap(*pcIter); pcIter--, iTrailA1++); for (iTrailA2 = 0, pcIter = &prMSeq->seq[iPPS][iLen-1]; isgap(*pcIter); pcIter--, iTrailA2++); /* turn leading/trailing gaps into truncation */ iLeadO1 = iLeadO1 > iLeadA1 ? iLeadO1-iLeadA1 : 0; iLeadO2 = iLeadO2 > iLeadA2 ? iLeadO2-iLeadA2 : 0; iTrailO1 = iTrailO1 > iTrailA1 ? iTrailO1-iTrailA1 : 0; iTrailO2 = iTrailO2 > iTrailA2 ? iTrailO2-iTrailA2 : 0; iCutHead = iLeadO1 > iLeadO2 ? iLeadO1 : iLeadO2; iCutTail = iTrailO1 > iTrailO2 ? iTrailO1 : iTrailO2; /* re-allocate and shift memory */ if ( (iCutHead > 0) || (iCutTail > 0) ){ /* skip if no re-attachment, FS, r244 -> r245 */ for (i = 0; i < prMSeq->nseqs; i++){ CKREALLOC(prMSeq->seq[i], iLen+iCutHead+iCutTail+2); if (iCutHead > 0){ /* skip if no re-attachment, FS, r244 -> r245 */ memmove(prMSeq->seq[i]+iCutHead, prMSeq->seq[i], iLen); } for (j = 0; j < iCutHead; j++){ prMSeq->seq[i][j] = '-'; } for (j = iLen+iCutHead; j < iLen+iCutHead+iCutTail; j++){ prMSeq->seq[i][j] = '-'; } prMSeq->seq[i][j] = '\0'; } } /* (iCutHead > 0) || (iCutTail > 0) */ } /*** end: ReAttachLeadingGaps() ***/ /** * @brief reallocate enough memory for alignment and * attach sequence pointers to profiles * * @param[in,out] mseq * sequence/profile data, increase memory for sequences in profiles * @param[out] ppcProfile1 * pointers to sequencese in 1st profile * @param[out] ppcProfile2 * pointers to sequencese in 2nd profile * @param[out] pdWeightsL * weights (normalised to 1.0) for sequences in left profile * @param[out] pdWeightsR * weights (normalised to 1.0) for sequences in right profile * @param[in] pdSeqWeights * weights for _all_ sequences in alignment * @param[in] iLeafCountL * number of sequences in 1st profile * @param[in] piLeafListL * array of integer IDs of sequences in 1st profile * @param[in] iLeafCountR * number of sequences in 2nd profile * @param[in] piLeafListR * array of integer IDs of sequences in 2nd profile * */ void PrepareAlignment(mseq_t *mseq, char **ppcProfile1, char **ppcProfile2, double *pdWeightsL, double *pdWeightsR, double *pdSeqWeights, int iLeafCountL, int *piLeafListL, int iLeafCountR, int *piLeafListR) { int iLenL = 0; /* length of 1st profile */ int iLenR = 0; /* length of 2nd profile */ int iMaxLen = 0; /* maximum possible length of alignment */ int i; /* aux */ double dWeight = 0.00; double dWeightInv = 0.00; assert(NULL!=mseq); assert(NULL!=ppcProfile1); assert(NULL!=ppcProfile2); assert(NULL!=piLeafListL); assert(NULL!=piLeafListR); /* get length of profiles, * in a profile all sequences should have same length so only look at 1st */ iLenL = strlen(mseq->seq[piLeafListL[0]]); iLenR = strlen(mseq->seq[piLeafListR[0]]); iMaxLen = iLenL + iLenR + 1; /* reallocate enough memory for sequences in alignment (for adding * gaps) */ for (i = 0; i < iLeafCountL; i++){ mseq->seq[piLeafListL[i]] = CKREALLOC(mseq->seq[piLeafListL[i]], iMaxLen); } for (i = 0; i < iLeafCountR; i++){ mseq->seq[piLeafListR[i]] = CKREALLOC(mseq->seq[piLeafListR[i]], iMaxLen); } /* attach sequences to profiles */ for (i = 0; i < iLeafCountL; i++){ ppcProfile1[i] = mseq->seq[piLeafListL[i]]; } ppcProfile1[i] = NULL; for (i = 0; i < iLeafCountR; i++){ ppcProfile2[i] = mseq->seq[piLeafListR[i]]; } ppcProfile2[i] = NULL; /* remove terminal 'X' for single sequences: * it is a quirk of hhalign() to delete 2 individual sequences * if 2 terminal X's meet during alignment, * just replace (one of) them. * this can be undone at the end. * profiles -consisting of more than 1 sequence- * appear to be all-right. * there seems to be no problem with B's and Z's */ if ( (1 == iLeafCountL) && (1 == iLeafCountR) ){ if ( ('X' == ppcProfile1[0][0]) && ('X' == ppcProfile2[0][0]) ){ #define NOTX 'N' ppcProfile1[0][0] = NOTX; /* FIXME: arbitrary assignment */ ppcProfile2[0][0] = NOTX; /* FIXME: arbitrary assignment */ } if ( ('X' == ppcProfile1[0][iLenL-1]) && ('X' == ppcProfile2[0][iLenR-1]) ){ ppcProfile1[0][iLenL-1] = NOTX; /* FIXME: arbitrary assignment */ ppcProfile2[0][iLenR-1] = NOTX; /* FIXME: arbitrary assignment */ } } /* obtain sequence weights */ if (NULL != pdSeqWeights){ dWeight = 0.00; for (i = 0; i < iLeafCountL; i++){ register double dAux = pdSeqWeights[piLeafListL[i]]; #ifndef NDEBUG if (dAux <= 0.00){ Log(&rLog, LOG_DEBUG, "seq-weight %d = %f", piLeafListL[i], dAux); } #endif pdWeightsL[i] = dAux; dWeight += dAux; } /* 0 <= i < iLeafCountL */ dWeightInv = 1.00 / dWeight; for (i = 0; i < iLeafCountL; i++){ pdWeightsL[i] *= dWeightInv; } dWeight = 0.00; for (i = 0; i < iLeafCountR; i++){ register double dAux = pdSeqWeights[piLeafListR[i]]; #ifndef NDEBUG if (dAux <= 0.00){ Log(&rLog, LOG_DEBUG, "seq-weight %d = %f", piLeafListR[i], dAux); } #endif pdWeightsR[i] = dAux; dWeight += dAux; } /* 0 <= i < iLeafCountL */ dWeightInv = 1.00 / dWeight; for (i = 0; i < iLeafCountR; i++){ pdWeightsR[i] *= dWeightInv; } } /* (NULL != pdSeqWeights) */ else { pdWeightsL[0] = pdWeightsR[0] = -1.00; } #if TRACE for (i = 0; i < iLeafCountL; i++){ Log(&rLog, LOG_FORCED_DEBUG, "ppcProfile1[%d/%d] pointing to mseq %d = %s", i, iLeafCountR, piLeafListL[i], ppcProfile1[i]); } for (i = 0; i < iLeafCountR; i++){ Log(&rLog, LOG_FORCED_DEBUG, "ppcProfile2[%d/%d] pointing to mseq %d = %s", i, iLeafCountR, piLeafListR[i], ppcProfile2[i]); } #endif return; } /*** end: PrepareAlignment() ***/ /** * @brief PosteriorProbabilities() calculates posterior probabilities * of aligning a single sequences on-to an alignment containing this sequence * * @param[in] prMSeq * holds the aligned sequences [in] * @param[in] rHMMalignment * HMM of the alignment in prMSeq * @param[in] rHhalignPara * various parameters read from commandline, needed by hhalign() * @param[in] pcPosteriorfile * name of file into which posterior probability information is written * * @return score of the alignment FIXME what is this? * * @note the PP-loop can be parallelised easily FIXME */ int PosteriorProbabilities(mseq_t *prMSeq, hmm_light rHMMalignment, hhalign_para rHhalignPara, char *pcPosteriorfile) { double dScore = 0.0; int i; int iS; /* iterator for sequences */ int iNseq = prMSeq->nseqs; /* number of sequences */ int iLenHMM = rHMMalignment.L; /* length of alignment */ int iViterbiCount = 0; /* counts how often Viterbi is triggered */ char **ppcCopy = NULL; char **ppcRepresent = NULL; char zcAux[10000] = {0}; char zcError[10000] = {0}; hhalign_scores *prHHscores = NULL; FILE *pfPP = NULL; pfPP = fopen(pcPosteriorfile, "w"); fprintf(pfPP, "#1.i\t2.name\t\t3.L1\t4.L2\t5.sum\t\t6.sum/L1\t7.HH\n"); prHHscores = CKCALLOC(iNseq, sizeof(hhalign_scores)); for (iS = 0; iS < iNseq; iS++){ memset(&(prHHscores[iS]), 0, sizeof(hhalign_scores)); } ppcCopy = CKCALLOC(1, sizeof(char *)); ppcCopy[0] = CKCALLOC(2*iLenHMM, sizeof(char)); ppcRepresent = CKCALLOC(1, sizeof(char *)); ppcRepresent[0] = CKCALLOC(2*iLenHMM, sizeof(char)); for (i = 0; i < iLenHMM; i++){ ppcRepresent[0][i] = rHMMalignment.seq[rHMMalignment.ncons][i+1]; } /* FIXME: this loop can be parallelised, FS r288 */ iViterbiCount = 0; for (iS = 0; iS < iNseq; iS++){ /* single sequences may very well contain leading/trailing gaps, * this will trigger warning in Transfer:hhalignment-C.h */ char *pcIter = NULL; for (pcIter = prMSeq->orig_seq[iS]; ('-' == *pcIter) || ('.' == *pcIter); pcIter++); strcpy(ppcCopy[0], pcIter/*prMSeq->orig_seq[iS]*/); for (pcIter = &ppcCopy[0][strlen(ppcCopy[0])-1]; ('-' == *pcIter) || ('.' == *pcIter); pcIter--); pcIter++; *pcIter = '\0'; zcError[0] = '\0'; hhalign(ppcCopy, 1, NULL, ppcRepresent, 0, NULL, &dScore, &rHMMalignment, NULL, NULL, NULL, NULL, rHhalignPara, &prHHscores[iS], 0/* debug */, FALSE /* Log-Level*/, zcAux, zcError); if (NULL != strstr(zcError, "Viterbi")){ iViterbiCount++; } } /* 0 <= iS < iNseq */ Log(&rLog, LOG_INFO, "Viterbi algorithm triggered %d times (out of %d)", iViterbiCount, iNseq-1); for (iS = 0; iS < iNseq; iS++){ fprintf(pfPP, "%d\t%10s\t%3d" , iS, prMSeq->sqinfo[iS].name, (int)(strlen(prMSeq->orig_seq[iS]))); fprintf(pfPP, "\t%3d\t%f\t%f\t%f", prHHscores[iS].L, prHHscores[iS].sumPP, prHHscores[iS].sumPP/strlen(prMSeq->orig_seq[iS]), prHHscores[iS].hhScore); fprintf(pfPP, "\n"); } /* 0 <= iS < iNseq */ fclose(pfPP); pfPP = NULL; free(ppcRepresent[0]); ppcRepresent[0] = NULL; free(ppcCopy[0]); ppcCopy[0] = NULL; free(ppcRepresent); ppcRepresent = NULL; free(ppcCopy); ppcCopy = NULL; free(prHHscores); prHHscores = NULL; return 1; } /* this is the end of PosteriorProbabilities() */ /** * @brief sequentially align (chain) sequences * * @param[in,out] prMSeq * holds the un-aligned sequences (in) and the final alignment (out) * @param[in] rHhalignPara * various parameters needed by hhalign() * @param[in] iClustersize * parameter that controls how often HMM is updated * * @note chained alignment takes much longer than balanced alignment * because at every step ClustalO has to scan all previously aligned residues. * for a balanced tree this takes N*log(N) time but for a chained tree * it takes N^2 time. * This function has a short-cut, that the HMM need not be updated * for every single alignment step, but the HMM from the previous * step(s) can be re-cycled. The HMM is updated (i) at the very first step, * (ii) if a gap has been inserted into the HMM during alignment or * (iii) if the HMM has been used for too many steps without having * been updated. This update-frequency is controlled by the input * parameter iClustersize. iClustersize is the number of sequences used * to build a HMM to allow for one non-updating step. For example, * if iClustersize=100 and a HMM has been build from 100 sequences, * then this HMM can be used once without updating. If the HMM has * been built from 700 sequences (and iClustersize=100) then this * HMM can be used 7-times without having to be updated, etc. * For this reason the initial iClustersize sequences are always * aligned with fully updated HMMs. */ double PileUp(mseq_t *prMSeq, hhalign_para rHhalignPara, int iClustersize) { /* @ */ int iI; /* iterator for sequences */ int iCountPro = 0; /* count how many sequences are already in profile */ int *piLeafListSeq = NULL; /* lists required by PrepareAlignment() for attaching sequences pointers to ppcProfileSeq */ int *piLeafListPro = NULL; /* -"- ppcProfilePro */ double *pdWeightL = NULL; /* argument used by hhalign, not used here */ double *pdWeightR = NULL; /* -"- */ double *pdWeightP = NULL; /* -"- */ char **ppcProfileSeq = NULL; /* pointer to sequences in profile */ char **ppcProfilePro = NULL; /* pointer to sequences in profile */ double dScore = -1.0; /* alignment score, calculated by hhalign() */ hhalign_scores rHHscores = {0}; /* more explicit scores than dScore */ hmm_light *prHMM = NULL; /* HMM against which to align single sequence */ hmm_light rHMMprofile = {0}; /* HMM calculated externally from profile */ int iHHret = -1; /* return value of hhalign() */ char zcAux[10000] = {0}; /* auxilliary print string used by hhalign() */ char zcError[10000] = {0}; /* error message printed by hhalign() */ char *pcConsensPro = NULL, /* auxilliary sequence strings required by hhalign() */ *pcReprsntPro = NULL, /* not used here */ *pcConsensSeq = NULL, *pcReprsntSeq = NULL; bool bHMM_stale = YES; /* flag if HMM has to be updated */ int iSinceLastUpdate = -1; /* counts how often HMM has been used since last update */ progress_t *prProgress; /* structure required for progress report */ bool bPrintCR = (rLog.iLogLevelEnabled<=LOG_VERBOSE) ? FALSE : TRUE; /* progress report */ char **ppcReprsnt = NULL; /* string used to represent HMM */ ppcReprsnt = CKCALLOC(1, sizeof(char *)); /* weights are not really used, but hhalign() expects them */ pdWeightL = (double *)CKMALLOC(prMSeq->nseqs * sizeof(double)); pdWeightR = (double *)CKMALLOC(prMSeq->nseqs * sizeof(double)); pdWeightP = (double *)CKMALLOC(prMSeq->nseqs * sizeof(double)); /* lists used for attaching ppcProfileSeq/ppcProfilePro to prMSeq */ piLeafListSeq = (int *)CKMALLOC(1 * sizeof(int)); piLeafListPro = (int *)CKMALLOC(prMSeq->nseqs * sizeof(int)); ppcProfileSeq = (char **)CKMALLOC(1 * sizeof(char *)); ppcProfileSeq[0] = NULL; ppcProfilePro = (char **)CKMALLOC(prMSeq->nseqs * sizeof(char *)); for (iI = 0; iI < prMSeq->nseqs; iI++){ ppcProfilePro[iI] = NULL; } piLeafListPro[0] = 0; /* first sequences in profile is simply un-aligned sequence */ iCountPro = 1; /* 'profile' now contains 1 sequence */ NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO), "Progressive alignment progress", bPrintCR); /* build up the initial alignment: * sequences are chained but hhalign() is used normally, * that is, one sequence is aligned to a profile */ for (iI = 1; iI < MIN(prMSeq->nseqs, iClustersize); iI++){ piLeafListSeq[0] = iI; /* PrepareAlignment() connects ppcProfileSeq/ppcProfilePro and prMSeq */ PrepareAlignment(prMSeq, ppcProfilePro, ppcProfileSeq, pdWeightL, pdWeightR, pdWeightP, iI, piLeafListPro, 1, piLeafListSeq); /* align 1 (5th argument) sequence to the growing profile * (2nd argument number of sequences is iI), * external HMM not used at this stage (prHMM=NULL) */ iHHret = hhalign(ppcProfilePro, iI, NULL/*pdWeightL*/, ppcProfileSeq, 1, NULL/*pdWeightR*/, &dScore, prHMM, pcConsensPro, pcReprsntPro, pcConsensSeq, pcReprsntSeq, rHhalignPara, &rHHscores, CALL_FROM_REGULAR/* DEBUG ARGUMENT */, rLog.iLogLevelEnabled, zcAux, zcError); piLeafListPro[iI] = iI; iCountPro = iI+1; ProgressLog(prProgress, iI, prMSeq->nseqs-1, FALSE); /* FIXME: test! FS, r288 */ } /* 1 <= iI < MIN(prMSeq->nseqs, iClustersize) */ /* now align single sequences not to a profile but to a HMM of a potentially old profile */ while (iI < prMSeq->nseqs){ /* if HMM not up-to-date then create new HMM for profile: * HMM is stale (i) at the beginning, * (ii) if a gap has been inserted into the HMM during previous step, * (iii) too many steps after the last up-date */ if ( (YES == bHMM_stale) ){ FreeHMMstruct(&rHMMprofile); if (OK != AlnToHMM2(&rHMMprofile, rHhalignPara, prMSeq->seq, iI) ) { Log(&rLog, LOG_ERROR, "Couldn't convert alignment to HMM. Will not proceed with chained alignment, step %d", iI); } bHMM_stale = NO; iSinceLastUpdate = 0; } /* align single sequence to HMM */ piLeafListSeq[0] = iI; PrepareAlignment(prMSeq, ppcProfilePro, ppcProfileSeq, pdWeightL, pdWeightR, pdWeightP, iI, piLeafListPro, 1, piLeafListSeq); /* use representative sequence to track where gaps are inserted into HMM */ ppcReprsnt[0] = CKREALLOC(ppcReprsnt[0], strlen(ppcProfilePro[0])+strlen(ppcProfileSeq[0])+1); memcpy(ppcReprsnt[0], rHMMprofile.seq[rHMMprofile.ncons]+1, rHMMprofile.L); ppcReprsnt[0][rHMMprofile.L] = '\0'; /* align 1 (5th argument) sequence to a HMM (2nd argument number of sequences is '0', * not iI as for a profile or '1' for one representative sequence), * external HMM (rHMMprofile calculated by AlnToHMM2()) is used at this stage */ prHMM = &rHMMprofile; hhalign(ppcReprsnt, 0, NULL, ppcProfileSeq, 1, NULL, &dScore, prHMM, pcConsensPro, pcReprsntPro, pcConsensSeq, pcReprsntSeq, rHhalignPara, &rHHscores, CALL_FROM_ALN_HMM/* DEBUG ARGUMENT */, rLog.iLogLevelEnabled, zcAux, zcError); iSinceLastUpdate++; /* HMM has been used one more time */ ProgressLog(prProgress, iI, prMSeq->nseqs-1, FALSE); /* FIXME: test! FS, r288 */ /* check if gaps have been inserted into HMM. * if this is the case then HMM is stale * and the profile used to create the HMM must get gaps at the same positions. * gaps are shown in the representative sequence */ if (rHMMprofile.L != strlen(ppcReprsnt[0])){ int iSeq; /* iterate through sequences of profile */ /* manually insert gaps into existing profile, * there should already be enough memory */ #ifdef HAVE_OPENMP /* all sequences in profile obtain gaps at the same position, * can do this in parallel */ #pragma omp parallel for #endif for (iSeq = 0; iSeq < iI; iSeq++){ int iPtrRep, /* points to 'residue' in representative sequence */ iPtrPrf; /* points to the corresponding position in the profile */ for (iPtrRep = strlen(ppcReprsnt[0])-1, iPtrPrf = strlen(ppcProfilePro[iSeq])-1; iPtrRep >= 0; iPtrRep--){ if ('-' == ppcReprsnt[0][iPtrRep]){ /* gaps are newly introduced into profile */ ppcProfilePro[iSeq][iPtrRep] = '-'; } else { /* non-gap characters (residues) are shifted towards the back */ ppcProfilePro[iSeq][iPtrRep] = ppcProfilePro[iSeq][iPtrPrf]; iPtrPrf--; } if (iPtrRep == iPtrPrf){ /* if profile and representative seq point to same position then no more gaps */ break; } } /* strlen(ppcReprsnt[0])-1 >= iPtrRep >= 0 */ ppcProfilePro[iSeq][strlen(ppcReprsnt[0])] = '\0'; } /* 0 <= iSeq < iI */ /* make HMM stale */ bHMM_stale = YES; } /* strlen(represent) != HMM.L (gaps inserted into HMM) */ /* check if maximum number of sequences exceeded */ if ( (iClustersize <= 1) || (iSinceLastUpdate > (double)(rHMMprofile.N_in)/(double)(iClustersize)) ){ bHMM_stale = YES; } piLeafListPro[iI] = iI; iCountPro = iI+1; iI++; } /* iI < prMSeq->nseqs */ ProgressDone(prProgress); FreeProgress(&prProgress); FreeHMMstruct(&rHMMprofile); CKFREE(pdWeightL); CKFREE(pdWeightR); CKFREE(pdWeightP); if (NULL != ppcReprsnt){ if (NULL != ppcReprsnt[0]){ CKFREE(ppcReprsnt[0]); } CKFREE(ppcReprsnt); } CKFREE(piLeafListSeq); CKFREE(piLeafListPro); return 0.0; } /* this is the end of PileUp() */ /** * @brief wrapper for hhalign. This is a frontend function to * the ported hhalign code. * * @param[in,out] prMSeq * holds the unaligned sequences [in] and the final alignment [out] * @param[in] piOrderLR * holds order in which sequences/profiles are to be aligned, * even elements specify left nodes, odd elements right nodes, * if even and odd are same then it is a leaf * @param[in] pdSeqWeights * Weight per sequence. No weights used if NULL * @param[in] iNodeCount * number of nodes in tree, piOrderLR has 2*iNodeCount elements * @param[in] prHMMList * List of background HMMs (transition/emission probabilities) * @param[in] iHMMCount * Number of input background HMMs * @param[in] iProfProfSeparator * Gives the number of sequences in the first profile, if in * profile/profile alignment mode (iNodeCount==3). That assumes mseqs * holds the sequences of profile 1 and profile 2. * @param[in] rHhalignPara * various parameters read from commandline * * @return score of the alignment FIXME what is this? * * @note complex function. could use some simplification, more and * documentation and a struct'uring of piOrderLR * * @note HHalignWrapper can be entered in 2 different ways: * (i) all sequences are un-aligned (ii) there are 2 (aligned) profiles. * in the un-aligned case (i) the sequences come straight from Squid, * that is, they have been sanitised, all non-alphabetic residues * have been rendered as X's. In profile mode (ii) one profile may * have been produced internally. In that case residues may have * been translated back into their 'native' form, that is, they * may contain un-sanitised residues. These will cause trouble * during alignment * * @note: introduced argument hhalign_para rHhalignPara; FS, r240 -> r241 * @note: if hhalign() fails then try with Viterbi by setting MAC-RAM=0; FS, r241 -> r243 */ double HHalignWrapper(mseq_t *prMSeq, int *piOrderLR, double *pdSeqWeights, int iNodeCount, hmm_light *prHMMList, int iHMMCount, int iProfProfSeparator, hhalign_para rHhalignPara) { int iN; /* node iterator */ int *piLeafCount = NULL; /* number of leaves beneath a certain node */ int **ppiLeafList = NULL; /* list of leaves beneath a certain node */ char **ppcProfile1 = NULL; /* pointer to sequences in profile */ char **ppcProfile2 = NULL; /* pointer to sequences in profile */ char *pcReprsnt1 = NULL; /* representative of HMM aligned to left */ char *pcReprsnt2 = NULL; /* representative of HMM aligned to right */ char **ppcReprsnt1 = &pcReprsnt1; /* representative of HMM aligned to L */ char **ppcReprsnt2 = &pcReprsnt2; /* representative of HMM aligned to R */ char *pcConsens1 = NULL; /* copy of left sequence */ char *pcConsens2 = NULL; /* copy of right sequence */ char **ppcCopy1 = /*&pcCopy1*/NULL; /* copy of left sequences */ char **ppcCopy2 = /*&pcCopy2*/NULL; /* copy of right sequences */ double *pdScores = NULL; /* alignment scores (seq/HMM) */ double dScore = 0.0; /* alignment score (seq/HMM) */ int iAux_FS = 0; char zcAux[10000] = {0}; char zcError[10000] = {0}; int i; /* aux */ progress_t *prProgress; int iAlnLen; /* alignment length */ double *pdWeightsL = NULL; /* sequence weights of left profile */ double *pdWeightsR = NULL; /* sequence weights of right profile */ int iMergeNodeCounter = 0; hmm_light *prHMM = NULL; bool bPrintCR = (rLog.iLogLevelEnabled<=LOG_VERBOSE) ? FALSE : TRUE; #if TIMING char zcStopwatchMsg[1024]; Stopwatch_t *stopwatch = StopwatchCreate(); StopwatchZero(stopwatch); StopwatchStart(stopwatch); #endif hhalign_scores rHHscores = {0}; if (NULL != prHMMList) { if (iHMMCount>1) { Log(&rLog, LOG_WARN, "FIXME: Using only first of %u HMMs (needs implementation)", iHMMCount); } prHMM = &(prHMMList[0]); } else { /* FIXME: prHMM not allowed to be NULL and therefore pseudo allocated here */ prHMM = (hmm_light *) CKCALLOC(1, sizeof(hmm_light)); } assert(NULL!=prMSeq); if (NULL==piOrderLR) { assert(3==iNodeCount); } SanitiseUnknown(prMSeq); /* hhalign was not made for DNA/RNA. So warn if sequences are not * protein */ if (SEQTYPE_PROTEIN != prMSeq->seqtype) { /*Log(&rLog, LOG_WARN, "%s alignment is still experimental.", SeqTypeToStr(prMSeq->seqtype));*/ if(prMSeq->seqtype == SEQTYPE_DNA) rHhalignPara.bIsDna = true; if(prMSeq->seqtype == SEQTYPE_RNA) rHhalignPara.bIsRna = true; } /* hhalign produces funny results if sequences contain gaps, so * dealign. Only way to use alignment info is to use it as a * background HMM */ if (TRUE == prMSeq->aligned) { Log(&rLog, LOG_DEBUG, "Dealigning aligned sequences (inside %s)", __FUNCTION__); DealignMSeq(prMSeq); } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "iNodeCount = %d", iNodeCount); #endif /* allocate top-level memory for leaf tracking arrays and profiles, * and sequence weights*/ piLeafCount = CKCALLOC(iNodeCount, sizeof(int)); ppiLeafList = CKCALLOC(iNodeCount, sizeof(int *)); ppcProfile1 = CKCALLOC(prMSeq->nseqs*2-1, sizeof(char *)); ppcProfile2 = CKCALLOC(prMSeq->nseqs*2-1, sizeof(char *)); pdScores = CKCALLOC(iNodeCount, sizeof(double)); pdWeightsL = CKCALLOC(iNodeCount, sizeof(double)); pdWeightsR = CKCALLOC(iNodeCount, sizeof(double)); NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO), "Progressive alignment progress", bPrintCR); /* Profile-profile alignment? Then setup piLeafCount and * piLeafList here. FIXME this is just an awful haaaack */ if (iNodeCount==3 && NULL==piOrderLR) { int iSizeProf1 = iProfProfSeparator; int iSizeProf2 = prMSeq->nseqs - iProfProfSeparator; piLeafCount[0] = iSizeProf1; ppiLeafList[0] = (int *)CKMALLOC(iSizeProf1 * sizeof(int)); for (i=0;isqinfo[riLeaf].name); } else { Log(&rLog, LOG_FORCED_DEBUG, "node %d is a leaf with entry %d (seq %s) and weight %f", iN, riLeaf, prMSeq->sqinfo[riLeaf].name, pdSeqWeights[riLeaf]); } #endif /* left/right entry same, this is a leaf */ piLeafCount[piOrderLR[riAux+PRNT_NODE]] = 1; /* number of leaves is '1' */ ppiLeafList[piOrderLR[riAux+PRNT_NODE]] = (int *)CKMALLOC(1 * sizeof(int)); ppiLeafList[piOrderLR[riAux+PRNT_NODE]][0] = riLeaf; } /* was a leaf */ else { int iL, iR, iP; /* ID of left/right nodes, parent */ int i, j; /* aux */ Log(&rLog, LOG_DEBUG, "merge profiles at node %d", iN, piOrderLR[riAux]); /* iNodeCount - prMSeq->nseqs = total # of merge-nodes * unless in profile/profile alignment mode */ if (1 == iNodeCount) { ProgressLog(prProgress, ++iMergeNodeCounter, 1, FALSE); } else { ProgressLog(prProgress, ++iMergeNodeCounter, iNodeCount - prMSeq->nseqs, FALSE); } /* left/right entry are not same, this is a merge node */ iL = piOrderLR[riAux+LEFT_NODE]; iR = piOrderLR[riAux+RGHT_NODE]; iP = piOrderLR[riAux+PRNT_NODE]; piLeafCount[iP] = piLeafCount[iL] + piLeafCount[iR]; ppiLeafList[iP] = (int *)CKMALLOC(piLeafCount[iP] * sizeof(int)); for (i = j = 0; i < piLeafCount[iL]; i++, j++){ ppiLeafList[iP][j] = ppiLeafList[iL][i]; } for (i = 0; i < piLeafCount[iR]; i++, j++){ ppiLeafList[iP][j] = ppiLeafList[iR][i]; } /* prepare simulation arena: * - make sure enough memory in sequences * - attach sequence pointers to profiles */ /* idea: switch template and query according to nseq? */ PrepareAlignment(prMSeq, ppcProfile1, ppcProfile2, pdWeightsL, pdWeightsR, pdSeqWeights, piLeafCount[iL], ppiLeafList[iL], piLeafCount[iR], ppiLeafList[iR]); if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int i; FILE *fp = LogGetFP(&rLog, LOG_DEBUG); Log(&rLog, LOG_DEBUG, "merging profiles %d & %d", iL, iR); for (i = 0; i < piLeafCount[iL]; i++){ fprintf(fp, "L/#=%3d (ID=%3d, w=%f): %s\n", i, ppiLeafList[iL][i], pdWeightsL[i], ppcProfile1[i]); } for (i = 0; i < piLeafCount[iR]; i++){ fprintf(fp, "R/#=%3d (ID=%3d, w=%f): %s\n", i, ppiLeafList[iR][i], pdWeightsR[i], ppcProfile2[i]); } } /* align individual sequences to HMM; * - use representative sequence to get gapping * - create copies of both, individual/representative sequences * as we don't want to introduce gaps into original * * FIXME: representative sequence is crutch, should use * full HMM but that does not seem to work at all * -- try harder! Fail better! */ if ( (piLeafCount[iL] <= APPLY_BG_HMM_UP_TO_TREE_DEPTH) && (0 != prHMM->L) ){ int i, j; pcReprsnt1 = CKCALLOC(prHMM->L+strlen(ppcProfile1[0])+1, sizeof(char)); for (i = 0; i < prHMM->L; i++){ pcReprsnt1[i] = prHMM->seq[prHMM->ncons][i+1]; } ppcCopy1 = CKCALLOC(piLeafCount[iL], sizeof(char *)); for (j = 0; j < piLeafCount[iL]; j++){ ppcCopy1[j] = CKCALLOC(prHMM->L+strlen(ppcProfile1[0])+1, sizeof(char)); for (i = 0; i < (int) strlen(ppcProfile1[0]); i++){ ppcCopy1[j][i] = ppcProfile1[j][i]; } } { /* the size of the elements in the forward/backward matrices depends very much on the lengths of the profiles _and_ in which position (1st/2nd) the longer/shorter profile/HMM is. the matrix elements can easily exceed the size of a (long?) double if the longer profile/HMM is associated with the query (q) and the shorter with the target (t). FIXME: however, pseudo-count adding may also depend on position, this is only really tested for the HMM being in the 1st position (q) MUST TEST THIS MORE THOROUGHLY this switch appears to be most easily (although unelegantly) effected here. Don't want to do it (upstairs) in PrepareAlignment() because it might jumble up the nodes. Don't want to do it in hhalign() either because ppcProfile1/2 and q/t may be used independently. FS, r236 -> r237 */ int iLenA = strlen(ppcCopy1[0]); int iLenH = prHMM->L; int iHHret = 0; if (iLenH < iLenA){ iHHret = hhalign(ppcReprsnt1, 0/* only one representative seq*/, NULL, ppcCopy1, piLeafCount[iL], pdWeightsL, &dScore, prHMM, NULL, NULL, NULL, NULL, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); } else { iHHret = hhalign(ppcCopy1, piLeafCount[iL], pdWeightsL, ppcReprsnt1, 0/* only one representative seq*/, NULL, &dScore, prHMM, NULL, NULL, NULL, NULL, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); } if ( (0 != iHHret) && (rLog.iLogLevelEnabled <= LOG_VERBOSE) ){ /* FS, r255 -> */ fprintf(stderr, "%s:%s:%d: (not essential) HMM pre-alignment failed, error %d, \n" "\t#=%d (len=%d), lead-seq=%s, len(HMM)=%d\n%s\nCARRY ON REGARDLESS\n", __FUNCTION__, __FILE__, __LINE__, iHHret, piLeafCount[iL], (int)strlen(ppcCopy1[0]), prMSeq->sqinfo[ppiLeafList[iL][0]].name, (int)strlen(ppcReprsnt1[0]), zcError); } } pdScores[ppiLeafList[iL][0]] = dScore; #if 0 printf("score: %f\nL: %s\nH: %s\n", dScore, ppcCopy1[0], ppcReprsnt1[0]); #endif /* assemble 'consensus'; * this is not a real consensus, it is more a gap indicator, * for each position it consists of residues/gaps in the 1st sequences, * or a residue (if any) of the other sequences. * it only contains a gap if all sequences of the profile * have a gap at this position */ pcConsens1 = CKCALLOC(prHMM->L+strlen(ppcProfile1[0])+1, sizeof(char)); for (i = 0; i < prHMM->L; i++){ for (j = 0, pcConsens1[i] = '-'; (j < piLeafCount[iL]) && ('-' == pcConsens1[i]); j++){ pcConsens1[i] = ppcCopy1[j][i]; } } #if 0 for (j = 0; (j < piLeafCount[iL]); j++){ printf("L%d:%s\n", j, ppcCopy1[j]); } printf("LC:%s\n", pcConsens1); #endif } /* ( (1 == piLeafCount[iL]) && (0 != prHMM->L) ) */ if ( (piLeafCount[iR] <= APPLY_BG_HMM_UP_TO_TREE_DEPTH) && (0 != prHMM->L) ){ int i, j; pcReprsnt2 = CKCALLOC(prHMM->L+strlen(ppcProfile2[0])+1, sizeof(char)); for (i = 0; i < prHMM->L; i++){ pcReprsnt2[i] = prHMM->seq[prHMM->ncons][i+1]; } ppcCopy2 = CKCALLOC(piLeafCount[iR], sizeof(char *)); for (j = 0; j < piLeafCount[iR]; j++){ ppcCopy2[j] = CKCALLOC(prHMM->L+strlen(ppcProfile2[0])+1, sizeof(char)); for (i = 0; i < (int) strlen(ppcProfile2[0]); i++){ ppcCopy2[j][i] = ppcProfile2[j][i]; } } { /* the size of the elements in the forward/backward matrices depends very much on the lengths of the profiles _and_ in which position (1st/2nd) the longer/shorter profile/HMM is. the matrix elements can easily exceed the size of a (long?) double if the longer profile/HMM is associated with the query (q) and the shorter with the target (t). FIXME: however, pseudo-count adding may also depend on position, this is only really tested for the HMM being in the 1st position (q) MUST TEST THIS MORE THOROUGHLY this switch appears to be most easily (although unelegantly) effected here. Don't want to do it (upstairs) in PrepareAlignment() because it might jumble up the nodes. Don't want to do it in hhalign() either because ppcProfile1/2 and q/t may be used independently. FS, r236 -> r237 */ int iLenA = strlen(ppcCopy2[0]); int iLenH = prHMM->L; int iHHret = 0; if (iLenH < iLenA){ iHHret = hhalign(ppcReprsnt2, 0/* only one representative seq */, NULL, ppcCopy2, piLeafCount[iR], pdWeightsR, &dScore, prHMM, NULL, NULL, NULL, NULL, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); } else { iHHret = hhalign(ppcCopy2, piLeafCount[iR], pdWeightsR, ppcReprsnt2, 0/* only one representative seq */, NULL, &dScore, prHMM, NULL, NULL, NULL, NULL, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); } if ( (0 != iHHret) && (rLog.iLogLevelEnabled <= LOG_VERBOSE) ){ /* FS, r255 -> */ fprintf(stderr, "%s:%s:%d: (not essential) HMM pre-alignment failed, error %d, \n" "\t#=%d (len=%d), lead-seq=%s, len(HMM)=%d\n%s\nCARRY ON REGARDLESS\n", __FUNCTION__, __FILE__, __LINE__, iHHret, piLeafCount[iR], (int)strlen(ppcCopy2[0]), prMSeq->sqinfo[ppiLeafList[iR][0]].name, (int)strlen(ppcReprsnt2[0]), zcError); } } pdScores[ppiLeafList[iR][0]] = dScore; #if 0 printf("H: %s\nR: %s\nscore: %f\n", ppcReprsnt2[0], ppcCopy2[0], dScore); #endif /* assemble 'consensus'; * this is not a real consensus, it is more a gap indicator, * for each position it consists of residues/gaps in the 1st sequences, * or a residue (if any) of the other sequences. * it only contains a gap if all sequences of the profile * have a gap at this position */ pcConsens2 = CKCALLOC(prHMM->L+strlen(ppcProfile2[0])+1, sizeof(char)); for (i = 0; i < prHMM->L; i++){ for (j = 0, pcConsens2[i] = '-'; (j < piLeafCount[iR]) && ('-' == pcConsens2[i]); j++){ pcConsens2[i] = ppcCopy2[j][i]; } } #if 0 for (j = 0; (j < piLeafCount[iR]); j++){ printf("R%d:%s\n", j, ppcCopy2[j]); } printf("RC:%s\n", pcConsens2); #endif } /* ( (1 == piLeafCount[iR]) && (0 != prHMM->L) ) */ /* do alignment here (before free) */ { /* the size of the elements in the forward/backward matrices depends very much on the lengths of the profiles _and_ in which position (1st/2nd) the longer/shorter profile is. the matrix elements can easily exceed the size of a (long?) double if the longer profile is associated with the query (q) and the shorter with the target (t). this switch appears to be most easily (although unelegantly) effected here. Don't want to do it (upstairs) in PrepareAlignment() because it might jumble up the nodes. Don't want to do it in hhalign() either because ppcProfile1/2 and q/t may be used independently. FS, r228 -> 229 */ int iLen1 = strlen(ppcProfile1[0]); int iLen2 = strlen(ppcProfile2[0]); /* potential problem with empty profiles, FS, r249 -> r250 */ if ( (0 == iLen1) || (0 == iLen2) ){ Log(&rLog, LOG_FATAL, "strlen(prof1)=%d, strlen(prof2)=%d -- nothing to align\n", iLen1, iLen2); } if (iLen1 < iLen2){ int iHHret = 0; int iOldMacRam = rHhalignPara.iMacRamMB; iHHret = hhalign(ppcProfile1, piLeafCount[iL], pdWeightsL, ppcProfile2, piLeafCount[iR], pdWeightsR, &dScore, prHMM, pcConsens1, pcReprsnt1, pcConsens2, pcReprsnt2, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); if (RETURN_OK != iHHret){ /* FS, r241 -> */ /*fprintf(stderr, "%s:%d: emergency EXIT\n", __FILE__, __LINE__); exit(-1);*/ fprintf(stderr, "%s:%s:%d: problem in alignment (profile sizes: %d + %d) (%s + %s), forcing Viterbi\n" "\thh-error-code=%d (mac-ram=%d)\n%s", __FUNCTION__, __FILE__, __LINE__, piLeafCount[iL], piLeafCount[iR], prMSeq->sqinfo[ppiLeafList[iL][0]].name, prMSeq->sqinfo[ppiLeafList[iR][0]].name, iHHret, rHhalignPara.iMacRamMB, zcError); /* at this stage hhalign() has failed, the only thing we can do (easily) is to re-run it in Viterbi mode, for this set MAC-RAM=0, set it back to its original value after 2nd try. FS, r241 -> r243 */ if (RETURN_FROM_MAC == iHHret){ /* Note: the default way to run hhalign() is to initially select MAC by giving it all the memory it needs. MAC may fail due to overflow (repeats?). alternatively, the problem may be (genuinely) too big for MAC. in thses cases it is legitimate to switch to Viterbi. However, selecting Viterbi from the outset is an abuse (abomination!), should this 1st invocation of Viterbi fail, then we (FS) will overrule the user and hammer the system with a massive memory request. (Jos 2:19) If anyone goes outside your house into the street, his blood will be on his own head; we will not be responsible. FS, r246 -> r247 */ rHhalignPara.iMacRamMB = 0; } else { rHhalignPara.iMacRamMB = REALLY_BIG_MEMORY_MB; } iHHret = hhalign(ppcProfile1, piLeafCount[iL], pdWeightsL, ppcProfile2, piLeafCount[iR], pdWeightsR, &dScore, prHMM, pcConsens1, pcReprsnt1, pcConsens2, pcReprsnt2, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); if (RETURN_OK != iHHret){ /* at this stage hhalign() has failed twice, 1st time MAC, 2nd time Viterbi, don't know what to do else. FS, r241 -> r243 */ fprintf(stderr, "%s:%s:%d: problem in alignment, Viterbi did not work\n" "\thh-error-code=%d (mac-ram=%d)\n%s", __FUNCTION__, __FILE__, __LINE__, iHHret, rHhalignPara.iMacRamMB, zcError); Log(&rLog, LOG_FATAL, "could not perform alignment -- bailing out\n"); } else { fprintf(stderr, "%s:%s:%d: 2nd attempt worked", __FUNCTION__, __FILE__, __LINE__); } rHhalignPara.iMacRamMB = iOldMacRam; } /* 1st invocation failed */ } /* 1st profile was shorter than 2nd */ else { int iHHret = 0; int iOldMacRam = rHhalignPara.iMacRamMB; iHHret = hhalign(ppcProfile2, piLeafCount[iR], pdWeightsR, ppcProfile1, piLeafCount[iL], pdWeightsL, &dScore, prHMM, pcConsens2, pcReprsnt2, pcConsens1, pcReprsnt1, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); if (RETURN_OK != iHHret){ /* FS, r241 -> r243 */ /*fprintf(stderr, "%s:%d: emergency EXIT\n", __FILE__, __LINE__); exit(-1);*/ fprintf(stderr, "%s:%s:%d: problem in alignment (profile sizes: %d + %d) (%s + %s), forcing Viterbi\n" "\thh-error-code=%d (mac-ram=%d)\n%s", __FUNCTION__, __FILE__, __LINE__, piLeafCount[iL], piLeafCount[iR], prMSeq->sqinfo[ppiLeafList[iL][0]].name, prMSeq->sqinfo[ppiLeafList[iR][0]].name, iHHret, rHhalignPara.iMacRamMB, zcError); /* at this stage hhalign() has failed, the only thing we can do (easily) is to re-run it in Viterbi mode, for this set MAC-RAM=0, set it back to its original value after 2nd try. FS, r241 -> r243 */ if (RETURN_FROM_MAC == iHHret){ /* see above */ rHhalignPara.iMacRamMB = 0; } else { rHhalignPara.iMacRamMB = REALLY_BIG_MEMORY_MB; } iHHret = hhalign(ppcProfile2, piLeafCount[iR], pdWeightsR, ppcProfile1, piLeafCount[iL], pdWeightsL, &dScore, prHMM, pcConsens2, pcReprsnt2, pcConsens1, pcReprsnt1, rHhalignPara, &rHHscores, iAux_FS++, /* DEBUG ARGUMENT */ rLog.iLogLevelEnabled, zcAux, zcError); if (RETURN_OK != iHHret){ /* at this stage hhalign() has failed twice, 1st time MAC, 2nd time Viterbi, don't know what to do else. FS, r241 -> r243 */ fprintf(stderr, "%s:%s:%d: problem in alignment, Viterbi did not work\n" "\thh-error-code=%d (mac-ram=%d)\n%s", __FUNCTION__, __FILE__, __LINE__, iHHret, rHhalignPara.iMacRamMB, zcError); Log(&rLog, LOG_FATAL, "could not perform alignment -- bailing out\n"); } else { fprintf(stderr, "%s:%s:%d: 2nd attempt worked", __FUNCTION__, __FILE__, __LINE__); } rHhalignPara.iMacRamMB = iOldMacRam; } /* 1st invocation failed */ } /* 2nd profile was shorter than 1st */ if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int i; printf("@@iL=%d, #(iL)=%d, iR=%d, #(iR)=%d\n", iL, piLeafCount[iL], iR, piLeafCount[iR]); for (i = 0; i < piLeafCount[iL]; i++){ char *pc = ppcProfile1[i]; printf("@@>%s\n", prMSeq->sqinfo[ppiLeafList[iL][i]].name); printf("@@"); while('\0' != *pc){ printf("%c", toupper(*pc)); pc++; } printf("\n"); } for (i = 0; i < piLeafCount[iR]; i++){ char *pc = ppcProfile2[i]; printf("@@>%s\n", prMSeq->sqinfo[ppiLeafList[iR][i]].name); printf("@@"); while('\0' != *pc){ printf("%c", toupper(*pc)); pc++; } printf("\n"); } printf("\n"); } /* LOG_DEBUG */ } /* free left/right node lists, * after alignment left/right profiles no longer needed */ if (NULL != ppcCopy1){ int i; for (i = 0; i < piLeafCount[iL]; i++){ CKFREE(ppcCopy1[i]); } CKFREE(ppcCopy1); CKFREE(pcReprsnt1); CKFREE(pcConsens1); } if (NULL != ppcCopy2){ int i; for (i = 0; i < piLeafCount[iR]; i++){ CKFREE(ppcCopy2[i]); } CKFREE(ppcCopy2); CKFREE(pcReprsnt2); CKFREE(pcConsens2); } ppiLeafList[iL] = CKFREE(ppiLeafList[iL]); ppiLeafList[iR] = CKFREE(ppiLeafList[iR]); piLeafCount[iL] = piLeafCount[iR] = 0; } /* was a merge node */ if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int i, j; FILE *fp = LogGetFP(&rLog, LOG_DEBUG); for (i = 0; i < iNodeCount; i++){ if (0 == piLeafCount[i]){ continue; } fprintf(fp, "node %3d, #leaves=%d:\t", i, piLeafCount[i]); for (j = 0; ppiLeafList && (j < piLeafCount[i]); j++){ fprintf(fp, "%d,", ppiLeafList[i][j]); } fprintf(fp, "\n"); } } } /* 0 <= iN < iNodeCount */ ProgressDone(prProgress); /* check length and set length info */ iAlnLen = strlen(prMSeq->seq[0]); for (i=0; inseqs; i++) { #if 0 Log(&rLog, LOG_FORCED_DEBUG, "seq no %d: name %s; len %d; %s", i, prMSeq->sqinfo[i].name, strlen(prMSeq->seq[i]), prMSeq->seq[i]); #endif #ifndef NDEBUG assert(iAlnLen == strlen(prMSeq->seq[i])); #endif prMSeq->sqinfo[i].len = iAlnLen; } prMSeq->aligned = TRUE; if (rLog.iLogLevelEnabled <= LOG_DEBUG){ if (0 != prHMM->L){ int i; Log(&rLog, LOG_DEBUG, "Alignment scores with HMM:"); for (i = 0; /*pdScores[i] > 0.0*/i < prMSeq->nseqs; i++){ Log(&rLog, LOG_DEBUG, "%2d:\t%f\n", i, pdScores[i]); } } } /** translate back ambiguity residues * hhalign translates ambiguity codes (B,Z) into unknown residues (X). * as we still have the original input we can substitute them back */ TranslateUnknown2Ambiguity(prMSeq); ReAttachLeadingGaps(prMSeq, iProfProfSeparator); if (NULL == prHMMList){ CKFREE(prHMM); } CKFREE(ppcProfile2); CKFREE(ppcProfile1); CKFREE(ppiLeafList[piOrderLR[DIFF_NODE*(iNodeCount-1)+PRNT_NODE]]); CKFREE(ppiLeafList); CKFREE(piLeafCount); CKFREE(pdScores); FreeProgress(&prProgress); CKFREE(pdWeightsL); CKFREE(pdWeightsR); #if TIMING StopwatchStop(stopwatch); StopwatchDisplay(stdout, "Total time for HHalignWrapper():" , stopwatch); StopwatchFree(stopwatch); #endif return dScore; /* FIXME alternative: return averaged pdScores */ } /*** end: HHalignWrapper() ***/ clustal-omega-1.2.1/src/clustal/muscle_upgma.c0000644000175100017510000003446012206661646016276 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* This the fast UPGMA algorithm (O(N^2)) as implemented in Bob Edgar's * Muscle (UPGMA2.cpp; version 3.7) ported to pure C. * * Muscle's code is public domain and so is this code here. * * From http://www.drive5.com/muscle/license.htm: * """ * MUSCLE is public domain software * * The MUSCLE software, including object and source code and * documentation, is hereby donated to the public domain. * * Disclaimer of warranty * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * """ * */ /* * RCS $Id: muscle_upgma.c 230 2011-04-09 15:37:50Z andreas $ * * * Notes: * ------ * LINKAGE become linkage_t here * * Replaced the the following member functions for DistCalc DC: * DC.GetId = sequence id as int * DC.GetName = sequence name * DC.GetCount = matrix dim * DC.DistRange = vector / matrix row for object i with index j #include #include #include "util.h" #include "log.h" #include "symmatrix.h" #include "muscle_tree.h" #include "muscle_upgma.h" /* from distcalc.h */ typedef float dist_t; static const dist_t BIG_DIST = (dist_t) 1e29; /* from muscle.h */ static const unsigned uInsane = 8888888; /*static inline*/ ulong TriangleSubscript(uint uIndex1, uint uIndex2); #define TRACE 0 #ifndef MIN #define MIN(x, y) ((x) < (y) ? (x) : (y)) #endif #ifndef MIN #define MAX(x, y) ((x) > (y) ? (x) : (y)) #endif #define AVG(x, y) (((x) + (y))/2) static uint g_uLeafCount; static ulong g_ulTriangleSize; static uint g_uInternalNodeCount; static uint g_uInternalNodeIndex; /* Triangular distance matrix is g_Dist, which is allocated * as a one-dimensional vector of length g_ulTriangleSize. * TriangleSubscript(i,j) maps row,column=i,j to the subscript * into this vector. * Row / column coordinates are a bit messy. * Initially they are leaf indexes 0..N-1. * But each time we create a new node (=new cluster, new subtree), * we re-use one of the two rows that become available (the children * of the new node). This saves memory. * We keep track of this through the g_uNodeIndex vector. */ static dist_t *g_Dist; /* Distance to nearest neighbor in row i of distance matrix. * Subscript is distance matrix row. */ static dist_t *g_MinDist; /* Nearest neighbor to row i of distance matrix. * Subscript is distance matrix row. */ static uint *g_uNearestNeighbor; /* Node index of row i in distance matrix. * Node indexes are 0..N-1 for leaves, N..2N-2 for internal nodes. * Subscript is distance matrix row. */ static uint *g_uNodeIndex; /* The following vectors are defined on internal nodes, * subscripts are internal node index 0..N-2. * For g_uLeft/Right, value is the node index 0 .. 2N-2 * because a child can be internal or leaf. */ static uint *g_uLeft; static uint *g_uRight; static dist_t *g_Height; static dist_t *g_LeftLength; static dist_t *g_RightLength; /*** CalcDistRange * * Imitation of DistCalc.DistRange * * Sets values of row (vector / matrix row) to distances for object i with index j= g_uLeafCount || uIndex2 >= g_uLeafCount) Log(&rLog, LOG_FATAL, "TriangleSubscript(%u,%u) %u", uIndex1, uIndex2, g_uLeafCount); #endif if (uIndex1 >= uIndex2) v = uIndex2 + (uIndex1*(uIndex1 - 1))/2; else v = uIndex1 + (uIndex2*(uIndex2 - 1))/2; assert(v < (g_uLeafCount*(g_uLeafCount - 1))/2); return v; } #ifdef UNUSED static void ListState() { uint i, j; Info("Dist matrix\n"); Info(" "); for (i = 0; i < g_uLeafCount; ++i) { if (uInsane == g_uNodeIndex[i]) continue; Info(" %5u", g_uNodeIndex[i]); } Info("\n"); for (i = 0; i < g_uLeafCount; ++i) { if (uInsane == g_uNodeIndex[i]) continue; Info("%5u ", g_uNodeIndex[i]); for (j = 0; j < g_uLeafCount; ++j) { if (uInsane == g_uNodeIndex[j]) continue; if (i == j) Info(" "); else { ulong v = TriangleSubscript(i, j); Info("%5.2g ", g_Dist[v]); } } Info("\n"); } Info("\n"); Info(" i Node NrNb Dist\n"); Info("----- ----- ----- --------\n"); for (i = 0; i < g_uLeafCount; ++i) { if (uInsane == g_uNodeIndex[i]) continue; Info("%5u %5u %5u %8.3f\n", i, g_uNodeIndex[i], g_uNearestNeighbor[i], g_MinDist[i]); } Info("\n"); Info(" Node L R Height LLength RLength\n"); Info("----- ----- ----- ------ ------- -------\n"); for (i = 0; i <= g_uInternalNodeIndex; ++i) Info("%5u %5u %5u %6.2g %6.2g %6.2g\n", i, g_uLeft[i], g_uRight[i], g_Height[i], g_LeftLength[i], g_RightLength[i]); } #endif /* ifdef UNUSED */ /** * @brief Creates a UPGMA in O(N^2) tree from given distmat * * @param[out] tree * newly created rooted UPGMA tree * @param[in] distmat * distance matrix to be clustered * @param[in] linkage * linkage type * @param[in] names * leaf names, will be copied * * @note called UPGMA2() in Muscle3.7. * caller has to free with FreeMuscleTree() * * @see FreeMuscleTree() */ void MuscleUpgma2(tree_t *tree, symmatrix_t *distmat, linkage_t linkage, char **names) { int i, j; uint *Ids; /* only works on full symmetric matrices */ assert (distmat->nrows==distmat->ncols); g_uLeafCount = distmat->ncols; g_ulTriangleSize = (g_uLeafCount*(g_uLeafCount - 1))/2; g_uInternalNodeCount = g_uLeafCount - 1; g_Dist = (dist_t *) CKMALLOC(g_ulTriangleSize * sizeof(dist_t)); g_uNodeIndex = (uint*) CKMALLOC(sizeof(uint) * g_uLeafCount); g_uNearestNeighbor = (uint*) CKMALLOC(sizeof(uint) * g_uLeafCount); g_MinDist = (dist_t *) CKMALLOC(sizeof(dist_t) * g_uLeafCount); Ids = (uint*) CKMALLOC(sizeof(uint) * g_uLeafCount); /* NOTE: we replaced Names with argument names */ /** * left and right node indices, as well as left and right * branch-length and height for for internal nodes */ g_uLeft = (uint*) CKMALLOC(sizeof(uint) * g_uInternalNodeCount); g_uRight = (uint*) CKMALLOC(sizeof(uint) * g_uInternalNodeCount); g_Height = (dist_t*) CKMALLOC(sizeof(dist_t) * g_uInternalNodeCount); g_LeftLength = (dist_t*) CKMALLOC(sizeof(dist_t) * g_uInternalNodeCount); g_RightLength = (dist_t*) CKMALLOC(sizeof(dist_t) * g_uInternalNodeCount); for (i = 0; i < g_uLeafCount; ++i) { g_MinDist[i] = BIG_DIST; g_uNodeIndex[i] = i; g_uNearestNeighbor[i] = uInsane; Ids[i] = i; } for (i = 0; i < g_uInternalNodeCount; ++i) { g_uLeft[i] = uInsane; g_uRight[i] = uInsane; g_LeftLength[i] = BIG_DIST; g_RightLength[i] = BIG_DIST; g_Height[i] = BIG_DIST; } /* Compute initial NxN triangular distance matrix. * Store minimum distance for each full (not triangular) row. * Loop from 1, not 0, because "row" is 0, 1 ... i-1, * so nothing to do when i=0. */ for (i = 1; i < g_uLeafCount; ++i) { dist_t *Row = g_Dist + TriangleSubscript(i, 0); CalcDistRange(distmat, i, Row); for (j = 0; j < i; ++j) { const dist_t d = Row[j]; if (d < g_MinDist[i]) { g_MinDist[i] = d; g_uNearestNeighbor[i] = j; } if (d < g_MinDist[j]) { g_MinDist[j] = d; g_uNearestNeighbor[j] = i; } } } #if TRACE Info("Initial state:\n"); ListState(); #endif for (g_uInternalNodeIndex = 0; g_uInternalNodeIndex < g_uLeafCount - 1; ++g_uInternalNodeIndex) { dist_t dtNewMinDist = BIG_DIST; uint uNewNearestNeighbor = uInsane; #if TRACE Info("\n"); Info("Internal node index %5u\n", g_uInternalNodeIndex); Info("-------------------------\n"); #endif /* Find nearest neighbors */ uint Lmin = uInsane; uint Rmin = uInsane; dist_t dtMinDist = BIG_DIST; for (j = 0; j < g_uLeafCount; ++j) { dist_t d; if (uInsane == g_uNodeIndex[j]) continue; d = g_MinDist[j]; if (d < dtMinDist) { dtMinDist = d; Lmin = j; Rmin = g_uNearestNeighbor[j]; assert(uInsane != Rmin); assert(uInsane != g_uNodeIndex[Rmin]); } } assert(Lmin != uInsane); assert(Rmin != uInsane); assert(dtMinDist != BIG_DIST); #if TRACE Info("Nearest neighbors Lmin %u[=%u] Rmin %u[=%u] dist %.3g\n", Lmin, g_uNodeIndex[Lmin], Rmin, g_uNodeIndex[Rmin], dtMinDist); #endif /* Compute distances to new node * New node overwrites row currently assigned to Lmin */ for ( j = 0; j < g_uLeafCount; ++j) { ulong vL, vR; dist_t dL, dR; dist_t dtNewDist; if (j == Lmin || j == Rmin) continue; if (uInsane == g_uNodeIndex[j]) continue; vL = TriangleSubscript(Lmin, j); vR = TriangleSubscript(Rmin, j); dL = g_Dist[vL]; dR = g_Dist[vR]; dtNewDist = 0.0; switch (linkage) { case LINKAGE_AVG: dtNewDist = AVG(dL, dR); break; case LINKAGE_MIN: dtNewDist = MIN(dL, dR); break; case LINKAGE_MAX: dtNewDist = MAX(dL, dR); break; /* couldn't be arsed to figure out proper usage of g_dSUEFF */ #if 0 case LINKAGE_BIASED: dtNewDist = g_dSUEFF*AVG(dL, dR) + (1 - g_dSUEFF)*MIN(dL, dR); break; #endif default: Log(&rLog, LOG_FATAL, "UPGMA2: Invalid LINKAGE_%u", linkage); } /* Nasty special case. * If nearest neighbor of j is Lmin or Rmin, then make the new * node (which overwrites the row currently occupied by Lmin) * the nearest neighbor. This situation can occur when there are * equal distances in the matrix. If we don't make this fix, * the nearest neighbor pointer for j would become invalid. * (We don't need to test for == Lmin, because in that case * the net change needed is zero due to the change in row * numbering). */ if (g_uNearestNeighbor[j] == Rmin) g_uNearestNeighbor[j] = Lmin; #if TRACE Info("New dist to %u = (%u/%.3g + %u/%.3g)/2 = %.3g\n", j, Lmin, dL, Rmin, dR, dtNewDist); #endif g_Dist[vL] = dtNewDist; if (dtNewDist < dtNewMinDist) { dtNewMinDist = dtNewDist; uNewNearestNeighbor = j; } } assert(g_uInternalNodeIndex < g_uLeafCount - 1 || BIG_DIST != dtNewMinDist); assert(g_uInternalNodeIndex < g_uLeafCount - 1 || uInsane != uNewNearestNeighbor); const ulong v = TriangleSubscript(Lmin, Rmin); const dist_t dLR = g_Dist[v]; const dist_t dHeightNew = dLR/2; const uint uLeft = g_uNodeIndex[Lmin]; const uint uRight = g_uNodeIndex[Rmin]; const dist_t HeightLeft = uLeft < g_uLeafCount ? 0 : g_Height[uLeft - g_uLeafCount]; const dist_t HeightRight = uRight < g_uLeafCount ? 0 : g_Height[uRight - g_uLeafCount]; g_uLeft[g_uInternalNodeIndex] = uLeft; g_uRight[g_uInternalNodeIndex] = uRight; g_LeftLength[g_uInternalNodeIndex] = dHeightNew - HeightLeft; g_RightLength[g_uInternalNodeIndex] = dHeightNew - HeightRight; g_Height[g_uInternalNodeIndex] = dHeightNew; /* Row for left child overwritten by row for new node */ g_uNodeIndex[Lmin] = g_uLeafCount + g_uInternalNodeIndex; g_uNearestNeighbor[Lmin] = uNewNearestNeighbor; g_MinDist[Lmin] = dtNewMinDist; /* Delete row for right child */ g_uNodeIndex[Rmin] = uInsane; #if TRACE Info("\nInternalNodeIndex=%u Lmin=%u Rmin=%u\n", g_uInternalNodeIndex, Lmin, Rmin); ListState(); #endif } uint uRoot = g_uLeafCount - 2; #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "uRoot=%d g_uLeafCount=%d g_uInternalNodeCount=%d", uRoot, g_uLeafCount, g_uInternalNodeCount); for (i=0; i #include #include #include #include #ifndef CLUSTALO_UTIL_H #define CLUSTALO_UTIL_H #define CKMALLOC(b) CkMalloc((b), __FUNCTION__, __LINE__) #define CKCALLOC(c, s) CkCalloc((c), (s), __FUNCTION__, __LINE__) #define CKREALLOC(p, b) CkRealloc((p), (b), __FUNCTION__, __LINE__) #define CKFREE(b) ((b)=CkFree((b), __FUNCTION__, __LINE__)) #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* STR_EQ: strings are equal, case sensitive */ #define STR_EQ(a,b) (strcmp((a),(b)) == 0) /* STR_NC_EQ: strings are equal, ignoring case */ #define STR_NC_EQ(a,b) (strcasecmp((a),(b)) == 0) /* type boolean and false and true defined in stdbool.h */ #ifndef TRUE #define TRUE true #endif #ifndef FALSE #define FALSE false #endif /* clashes with hhalign #define FAIL -1 #define OK 0 */ /* don't use the following directly; use macros provided above instead */ void *CkMalloc(size_t size, const char *function, const int line); void *CkCalloc(size_t count, size_t size, const char *function, const int line); void *CkRealloc(void *ptr, size_t bytes, const char *function, const int line); void *CkFree(void *ptr, const char *function, const int line); char *CkStrdup(const char *s); void PermutationArray(int **array, const int len); void RandomUniqueIntArray(int *array, const int array_len, const int max_value); int IntCmp(const void *a, const void *b); bool FileIsWritable(char *pcFileName); void QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort, const int uArrayLen, const char cOrder, const bool bOverwriteArrayToSort); #endif clustal-omega-1.2.1/src/clustal/progress.h0000644000175100017510000000235111531472337015455 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: progress.h 193 2011-02-07 15:45:21Z andreas $ */ #ifndef CLUSTALO_PROGRESS_H #define CLUSTALO_PROGRESS_H #include "squid/stopwatch.h" typedef struct { /* where to write to */ FILE *prFile; /* prefix printed before each step */ char *pcPrefix; bool bPrintCR; char pcLastLogMsg[1024]; Stopwatch_t *prStopwatch; } progress_t; extern void NewProgress(progress_t **pprProgress, FILE *prFile, char *pcPrefix, bool bPrintCR); extern void FreeProgress(progress_t **pprProgress); extern void ProgressLog(progress_t *prProgress, unsigned long int iStep, unsigned long int iTotalSteps, bool bForceOutput); extern void ProgressDone(progress_t *pprProgress); #endif clustal-omega-1.2.1/src/clustal/list.h0000644000175100017510000000551711527010404014557 00000000000000/********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: list.h 193 2011-02-07 15:45:21Z andreas $ * * Generic single linked list storing pointers to data * */ #ifndef CLUSTALO_LIST_H #define CLUSTALO_LIST_H #include typedef struct list_elem_s { void *data; struct list_elem_s *next; } list_elem_t; typedef struct { /* size of list */ int size; /* user defined function for freeing data */ void (*destroy)(void *data); list_elem_t *head; list_elem_t *tail; } list_t; void ListInit(list_t *prList, void (*destroy)(void *data)); void ListDestroy(list_t *prList); int ListInsertNext(list_t *prList, list_elem_t *prElement, const void *data); #define LIST_APPEND(prList, data) ListInsertNext((prList), LIST_TAIL(prList), (data)) #define LIST_PREPEND(prList, data) ListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) int ListRemoveNext(list_t *prList, list_elem_t *prElement, void **data); #define LIST_SIZE(prList) ((prList)->size) #define CLUSTALO_LIST_HEAD(prList) ((prList)->head) #define LIST_TAIL(prList) ((prList)->tail) #define LIST_IS_HEAD(prList, prElement) ((prElement) == (prList)->head ? 1 : 0) #define LIST_IS_TAIL(prElement) ((prElement)->next == NULL ? 1 : 0) #define LIST_DATA(prElement) ((prElement)->data) #define LIST_NEXT(prElement) ((prElement)->next) /* special int list: stores ints by copying them (instead of storing * pointers as generic list) * */ typedef list_t int_list_t; #define INT_LIST_INIT(prList) ListInit((prList), free) #define INT_LIST_DESTROY(prList) ListDestroy((prList)); int IntListInsertNext(list_t *prList, list_elem_t *prElement, const int data); #define INT_LIST_APPEND(prList, data) IntListInsertNext((prList), LIST_TAIL(prList), (data)) #define INT_LIST_PREPEND(prList, data) IntListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) int IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *data); #define INT_LIST_SIZE(prList) LIST_SIZE(prList) #define INT_CLUSTALO_LIST_HEAD(prList) CLUSTALO_LIST_HEAD_INT((prList)) #define INT_LIST_TAIL(prList) LIST_TAIL_INT((prList) ) #define INT_LIST_IS_HEAD(prList, prElement) LIST_IS_HEAD(prList, prElement) #define INT_LIST_IS_TAIL(prElement) LIST_IS_TAIL((prElement)) #define INT_LIST_DATA(prElement) LIST_DATA((prElement)) #define INT_LIST_NEXT(prElement) LIST_NEXT((prElement)) #endif clustal-omega-1.2.1/src/clustal/list.c0000644000175100017510000002152312206661646014564 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: list.c 156 2010-11-18 10:52:40Z andreas $ * * Single linked list and FIFO/Queue * * Based on Kyle Loudon's Mastering Algorithms with C * http://oreilly.com/catalog/9781565924536 * * Allows generic data types by using void* pointers, which works fine * as long as your data is just pointers. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include /* for memset */ #include "list.h" #ifdef LIST_TEST #include #include "queue.h" #include "time.h" #endif /** * @brief Initialise data members of a list * * @param[in] prList * List to initialise * @param[in] destroy * A function to be called with pointer to data when destroying the * list. NULL if in doubt, free in most other cases. * Note: doxygen will always fail to parse this... */ void ListInit(list_t *prList, void (*destroy)(void *data)) { prList->size = 0; prList->destroy = destroy; prList->head = NULL; prList->tail = NULL; return; } /* end of ListInit() */ /** * @brief Calls user defined function to free data in list and resets * the list to NULL. Call even if your destroy function is NULL. * * @param[in] prList * The list to destroy * */ void ListDestroy(list_t *prList) { void *pvData; while (LIST_SIZE(prList) > 0) { if (0 == ListRemoveNext(prList, NULL, (void **)&pvData) && NULL != prList->destroy) { prList->destroy(pvData); } } /* precaution */ memset(prList, 0, sizeof(list_t)); return; } /* end of ListDestroy() */ /** * * @brief Insert data next to given element * * @param[in] prList * List into which to insert * @param[in] prElement * Current position/element. Element after which to insert. If NULL * head is used. * @param[in] pvData * Pointer to data to store * * @return Non-zero on failure */ int ListInsertNext(list_t *prList, list_elem_t *prElement, const void *pvData) { list_elem_t *prNewElement; if (NULL == (prNewElement = (list_elem_t *) malloc(sizeof(list_elem_t)))) return -1; prNewElement->data = (void *)pvData; if (NULL == prElement) { /* insertion at head */ if (LIST_SIZE(prList) == 0) prList->tail = prNewElement; prNewElement->next = prList->head; prList->head = prNewElement; } else { /* insert somewhere other than at head */ if (NULL == prElement->next) prList->tail = prNewElement; prNewElement->next = prElement->next; prElement->next = prNewElement; } prList->size++; return 0; } /* end of ListInsertNext() */ /** * @brief Remove next element from current element/position. * * @param[in] prList * List from which an element is to be removed. * @param[in] prElement * Current element/position. Next item will be removed. If NULL head * is used. * @param[out] pvData_p * Will be pointed to removed elements data. * * @return Non-zero on failure */ int ListRemoveNext(list_t *prList, list_elem_t *prElement, void **pvData_p) { list_elem_t *prOldElement; if (0 == LIST_SIZE(prList)) return -1; if (NULL == prElement) { /* handle removal from the head of the list */ *pvData_p = prList->head->data; prOldElement = prList->head; prList->head = prList->head->next; if (1 == LIST_SIZE(prList)) prList->tail = NULL; } else { /* handle removal from somewhere other than the head */ if (NULL == prElement->next) return -1; *pvData_p = prElement->next->data; prOldElement = prElement->next; prElement->next = prElement->next->next; if (NULL == prElement->next) prList->tail = prElement; } free(prOldElement); prList->size--; return 0; } /* end of ListRemoveNext() */ /** * @brief Insert int next to given element * * @param[in] prList * List into which to insert * @param[in] prElement * Current position/element. Element after which to insert. If NULL * head is used. * @param[in] data * int to store * * @return Non-zero on failure * */ int IntListInsertNext(list_t *prList, list_elem_t *prElement, const int data) { int *piInt; if (NULL == (piInt = malloc(sizeof(int)))) { return -1; } *piInt = data; return ListInsertNext(prList, prElement, piInt); } /* end if IntListInsertNext() */ /** * @brief Remove next element from current element/position. * * @param[in] prList * List from which an element is to be removed. * @param[in] prElement * Current element/position. Next item will be removed. If NULL head * is used. * @param[out] iData_p * Will be pointed to removed elements data. * * @return Non-zero on failure * */ int IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *iData_p) { int *piData; int res; res = ListRemoveNext(prList, prElement, (void **)&piData); *iData_p = *piData; prList->destroy(piData); return res; } /* end of IntListRemoveNext */ #ifdef LIST_TEST /* gcc list.c -o list_test -ansi -Wall -DLIST_TEST */ int main(int argc, char **argv) { int i; list_t *mylist; int_list_t *myintlist; queue_t *myqueue; int_queue_t *myintqueue; int res; int iSeed = (int)time(NULL); srand((unsigned int)iSeed); printf("%s", "list test! also delete #include!\n"); mylist = malloc(sizeof(list_t)); ListInit(mylist, NULL); printf("LIST test\n"); for (i=0; i #include #include "mbed.h" #include "pair_dist.h" #include "symmatrix.h" #include "ktuple_pair.h" #include "tree.h" #include "util.h" #include "progress.h" #include "queue.h" #include "log.h" #include "kmpp/KMeans.h" #include "mbed.h" #define TIMING 0 #if TIMING #include "squid/stopwatch.h" #endif /* If FULL_WITHIN_CLUSTER_DISTANCES is not 0, distances within each * bisecting kmeans subcluster are not estimated using the vectors, * but calculated normally (using ktuple or kimura). Surprisingly this * results in 3% loss on a Homfam p24-h2010-08-09 subset (100-5000 * seqs in test, at least 5 ref seqs; MAX_SEQ 100 vs 10000; NUM_SEEDS * log2 instead of log2^2). And of course it slows things down. */ #define FULL_WITHIN_CLUSTER_DISTANCES 1 #define COMPUTE_WITHIN_SUBCLUSTER_AVERAGE 0 /* Cluster size limits. Maximum is a soft limit, which might be * exceeded if a K-Means split was unsuccesful, where unsuccesful * might also mean that the minimum required number seqs. was not * reached */ #if FULL_WITHIN_CLUSTER_DISTANCES static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 100; static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 1; #else static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 10000; static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 100; #endif /* How many restarts per bisecting kmeans split. 10 give 0.5% increase * in quality on original HOMFAM over just 1. It also increases kmeans * time by a factor of ~3, but overall time is insignificant * compared to pairdist/progressive alignment part. */ static const int RESTARTS_PER_SPLIT = 10; /* Use standard kmeans (lloyds) or kmeans++. Both are almost * indistinguishable here, although kmeans++ is slightly ahead the * fewer seeds you pick (and it should be better in theory) */ #define USE_KMEANS_LLOYDS 0 #ifndef HAVE_LOG2 #define log2(x) (log(x) / 0.69314718055994530942) #endif #define NUMBER_OF_SEEDS(n) pow(log2(((double)n)), 2) /* Seed selection method: SAMPLE_SEEDS_BY_LENGTH is the original mBed * approach: Sample iSeeds sequence with constant stride from length-sorted X. * It might be better to pick the seeds randomly, because length sorting might * be more prone to including outliers (e.g. very long and very short seqs). * However, we could never observer such a thing. So just stick to the * original version as this also removes the random element. */ enum SEED_SELECTION_TYPE { SELECT_SEEDS_RANDOMLY, SELECT_SEEDS_BY_LENGTH }; #define SEED_SELECTION SELECT_SEEDS_BY_LENGTH /* Tests on BAliBase (RV11,12,20,30,40,50; 10 runs each) show there is * no difference between mbed-trees created from cosine or euclidean * distances (simple version, just using disparities). */ #define USE_EUCLIDEAN_DISTANCE 1 /* print some mbed pre-cluster usage to screen */ #define PRINT_CLUSTER_DISTRIBUTION 0 #define TRACE 0 typedef struct { /* Number of final clusters */ int iNClusters; /* Coordinates (columns) for each cluster (rows) * valid indices: [0...iNClusters][0...dim-1] */ double **ppdClusterCenters; /* Dimensionality of input data and cluster center coordinates */ int iDim; /* Number of objects per cluster */ int *piNObjsPerCluster; /* Objects (indices) for each cluster. [i][j] will point to (index * of) object j in cluster i */ int **ppiObjIndicesPerCluster; } bisecting_kmeans_result_t; /** * @brief Free KMeans result structure. * * @param[out] prResult_p * K-Means result to free * * @see NewKMeansResult() */ void FreeKMeansResult(bisecting_kmeans_result_t **prResult_p) { int iAux; CKFREE((*prResult_p)->piNObjsPerCluster); for (iAux=0; iAux<(*prResult_p)->iNClusters; iAux++) { CKFREE((*prResult_p)->ppiObjIndicesPerCluster[iAux]); CKFREE((*prResult_p)->ppdClusterCenters[iAux]); } CKFREE((*prResult_p)->ppiObjIndicesPerCluster); CKFREE((*prResult_p)->ppdClusterCenters); (*prResult_p)->iNClusters = 0; (*prResult_p)->iDim = 0; CKFREE(*prResult_p); } /*** end: FreeKMeansResult() ***/ /** * @brief Allocate new KMeans result * * @param[out] prKMeansResult_p * K-Means result to free * * @see NewKMeansResult() */ void NewKMeansResult(bisecting_kmeans_result_t **prKMeansResult_p) { (*prKMeansResult_p) = (bisecting_kmeans_result_t *) CKCALLOC(1, sizeof(bisecting_kmeans_result_t)); (*prKMeansResult_p)->iNClusters = 0; (*prKMeansResult_p)->iDim = 0; (*prKMeansResult_p)->ppdClusterCenters = NULL; (*prKMeansResult_p)->piNObjsPerCluster = NULL; (*prKMeansResult_p)->ppiObjIndicesPerCluster = NULL; } /*** end: NewKMeansResult() ***/ /** * @brief Calculate the euclidean distance between two vectors * * @param[in] v1 * First vector with dim dimensions * @param[in] v2 * Second vector with dim dimensions * @param[in] dim * Dimensionality of v1 and v2 * * @return euclidean distance as double * * @note Could probably be inlined. Also perfect for SSE */ double EuclDist(const double *v1, const double *v2, const int dim) { int i; /* aux */ double dist; /* returned distance */ assert(v1!=NULL); assert(v2!=NULL); dist = 0.0; for (i=0; i0 && iNumSeeds<=prMSeq->nseqs); piSortedSeeds = CKMALLOC(iNumSeeds * sizeof(int)); memcpy(piSortedSeeds, piSeeds, iNumSeeds*sizeof(int)); /* need them sorted, otherwise the swapping approach below might * break */ qsort(piSortedSeeds, iNumSeeds, sizeof(int), IntCmp); /* rearrange mseq order so that we can use ktuple_pairdist code as * is. That is, swap seeds and non-seeds such that the seeds end * up in front of mseq. This way we can use the KTuplePairDist() * code, without making a copy of mseq. Also, keep an array of * indices which serves to restore the original sequence order * after putting the seeds in front * */ restore = (int *) CKMALLOC(prMSeq->nseqs * sizeof(int)); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { restore[iSeqIndex] = iSeqIndex; } for (iSeedIndex=0; iSeedIndexnseqs; iSeqIndex++) { Log(&rLog, LOG_FORCED_DEBUG, "swapped seq no %d now: seq = %s", iSeqIndex, prMSeq->sqinfo[iSeqIndex].name); } #endif /* convert sequences into vectors of distances by calling pairwise * distance function for each seq/seed pair * */ /* 4th argument (FALSE) is bPercID, in mBed mode never use percent-identities */ if (0 != PairDistances(&prDistmat, prMSeq, iPairDistType, FALSE, 0, iNumSeeds, 0, prMSeq->nseqs, NULL, NULL)) { Log(&rLog, LOG_ERROR, "Could not compute pairwise distances for mbed."); FreeSymMatrix(&prDistmat); CKFREE(piSortedSeeds); CKFREE(restore); return -1; } #if TRACE { char **labels; labels = (char **) CKMALLOC(prMSeq->nseqs * sizeof(char *)); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { labels[iSeqIndex] = prMSeq->sqinfo[iSeqIndex].name; } SymMatrixPrint(prDistmat, labels, NULL, FALSE); CKFREE(labels); } #endif /* update ppdSeqVec according to prDistmat. keep in mind that we * changed mseq order * */ for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { for (iSeedIndex=0; iSeedIndexnseqs; iSeqIndex++) { Log(&rLog, LOG_FORCED_DEBUG, "restored seq no %d: seq = %s %s", iSeqIndex, prMSeq->sqinfo[iSeqIndex].name, prMSeq->seq[iSeqIndex]); } #endif #if TRACE for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { printf("DEBUG: seq %-4u as distance vector =", iSeqIndex); for (iSeedIndex=0; iSeedIndexnseqs); PermutationArray(&piPermArray, iNumSeeds); /* copy to piSeeds */ for (iSeedIndex=0; iSeedIndexnseqs * sizeof(int)); int *piOrder = CKMALLOC(prMSeq->nseqs * sizeof(int)); Log(&rLog, LOG_INFO, "Using %d seeds (chosen with constant stride from length sorted seqs) for mBed (from a total of %d sequences)", iNumSeeds, prMSeq->nseqs); iStep = prMSeq->nseqs / iNumSeeds; /* iStep will never get too big * due to rounding */ /* first get an array of seq indices order according to corresponding sequence length: piOrder */ for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { piSeqLen[iSeqIndex] = prMSeq->sqinfo[iSeqIndex].len; } QSortAndTrackIndex(piOrder, piSeqLen, prMSeq->nseqs, 'd', FALSE); #if 0 for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { Log(&rLog, LOG_FORCED_DEBUG, "Descending order (no %d): seq %d has len %d)", iSeqIndex, piOrder[iSeqIndex], piSeqLen[piOrder[iSeqIndex]]); } #endif CKFREE(piSeqLen); iSeedIndex = 0; for (iSeqIndex=0; iSeedIndexnseqs * sizeof(int)); double *pdKMeansClusterCenters = CKCALLOC(iNumSeeds * iNumSeeds, sizeof(double)); /* create a copy of ppdSeqVec suitable for KMeans */ double *pdKMeansVectors = CKMALLOC(prMSeq->nseqs * iNumSeeds * sizeof(double)); bool *pbClusterUsed = CKCALLOC(iNumSeeds, sizeof(bool)); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME Experimental feature: K-means on first round embedding to get better seeds"); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME Reuse seeds from clusters"); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME Could try log(n) instead of log(n)^2 in first round"); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME hardcoded iPairDistType PAIRDIST_KTUPLE"); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME Show that this is fast *and* good"); /* Log(&rLog, LOG_FORCED_DEBUG, "%s", "Overriding iNumSeeds"); iNumSeeds = (int) pow(log2((double)prMSeq->nseqs), 2); */ ppdSeqVec = (double **) CKMALLOC(prMSeq->nseqs * sizeof(double *)); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { ppdSeqVec[iSeqIndex] = (double *) CKMALLOC(iNumSeeds * sizeof(double)); } if (0 != SeqToVec(ppdSeqVec, prMSeq, piSeeds, iNumSeeds, PAIRDIST_KTUPLE)) { Log(&rLog, LOG_ERROR, "Could not convert sequences into vectors for mbed"); return -1; } for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { int iDim; for (iDim=0; iDimnseqs, iNumSeeds, iNumSeeds, pdKMeansVectors, RESTARTS_PER_SPLIT, USE_KMEANS_LLOYDS, pdKMeansClusterCenters, piKMeansClusterAssignments); Log(&rLog, LOG_FORCED_DEBUG, "Best split cost = %f", dCost); Log(&rLog, LOG_FORCED_DEBUG, "%s", "FIXME Check for Nan in cluster centers"); #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "K-Means output:"); for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { Log(&rLog, LOG_FORCED_DEBUG, " Raw assignment: Seq %u (%s) to cluster %d", iSeqIndex, prMSeq->sqinfo[iSeqIndex].name, piKMeansClusterAssignments[iSeqIndex]); } #endif Log(&rLog, LOG_FORCED_DEBUG, "FIXME %s", "proof of concept implementation: Pick first sequences from each clusters instead of reusing seeds"); iSeedIndex = 0; for (iSeqIndex=0; iSeqIndexnseqs; iSeqIndex++) { int iAssignedCluster = piKMeansClusterAssignments[iSeqIndex]; if (pbClusterUsed[iAssignedCluster]) { continue; } else { /*LOG_DEBUG("Picked seed %d from cluster %d", iSeqIndex,iAssignedCluster);*/ piSeeds[iSeedIndex++] = iSeqIndex; pbClusterUsed[iAssignedCluster] = TRUE; } } CKFREE(pbClusterUsed); CKFREE(pdKMeansVectors); CKFREE(pdKMeansClusterCenters); CKFREE(piKMeansClusterAssignments); } /* if (1) */ #endif if (LOG_DEBUG <= rLog.iLogLevelEnabled) { for (iSeedIndex=0; iSeedIndexsqinfo[piSeeds[iSeedIndex]].name, iSeedIndex); } } return 0; } /* end of SeedSelection() */ /** * @brief Bisecting K-Means clustering. Repeatedly calls K-Means with * a K of 2 until no cluster has more than iMaxAllowedObjsPerCluster. * * @param[out] prKMeansResult_p * Result of Bisecting KMeans. Will be allocated here. * Caller has to free. See @see FreeKMeansResult() * @param[in] iNObjs * Number of objects/sequences to cluster * @param[in] iDim * Dimensionality of input data * @param[in] ppdVectors * each row holds iDim points for this object's coordinates * @param[in] iMinRequiredObjsPerCluster * Minimum number of objects per Cluster (inclusive)/ * @param[in] iMaxAllowedObjsPerCluster * Maximum number of objects per Cluster (inclusive). Function returns once no * cluster contains more then this number of objects. Soft limit! * * @note Convoluted code. Could use some restructuring. My apologies. * AW * */ void BisectingKmeans(bisecting_kmeans_result_t **prKMeansResult_p, const int iNObjs, const int iDim, double **ppdVectors, const int iMinRequiredObjsPerCluster, const int iMaxAllowedObjsPerCluster, char ***ppcClusterSplits_p) { int iN, iD; /* cluster centers for each cluster created at each split */ double *pdKClusterCenters; /* keep track of updated object indices per newly created * cluster */ int *piCurObjToUpdate; /* number of times we called 2-means */ int iNRounds; /* flag for unsuccessful cluster split */ bool bNaNDetected = FALSE; /* flag for detected small cluster after split */ bool bSmallClusterDetected; /* queue of clusters which are to be split */ int_queue_t rClusterSplitQueue; /* */ int iLog2N2 = 0; #if TIMING Stopwatch_t *stopwatch = StopwatchCreate(); #endif piCurObjToUpdate = (int *) CKMALLOC(2 * sizeof(int)); NewKMeansResult(prKMeansResult_p); /* new cluster centers created at each split/KMeans run */ pdKClusterCenters = (double *) CKCALLOC(2 * iDim, sizeof(double)); /* init results by setting a first cluster that contains all objects */ (*prKMeansResult_p)->iNClusters = 1; (*prKMeansResult_p)->iDim = iDim; /* fake center coordinates of first cluster */ (*prKMeansResult_p)->ppdClusterCenters = (double **) CKMALLOC(1 * sizeof(double *)); (*prKMeansResult_p)->ppdClusterCenters[0] = (double *) CKMALLOC(iDim * sizeof(double)); /* objects per cluster */ (*prKMeansResult_p)->piNObjsPerCluster = (int *) CKMALLOC(1 * sizeof(int)); (*prKMeansResult_p)->piNObjsPerCluster[0] = iNObjs; /* object indices per cluster */ (*prKMeansResult_p)->ppiObjIndicesPerCluster = (int **) CKMALLOC(1 * sizeof(int *)); (*prKMeansResult_p)->ppiObjIndicesPerCluster[0] = (int *) CKMALLOC(iNObjs * sizeof(int)); for (iN=0; iNppiObjIndicesPerCluster[0][iN] = iN; } /* * this is an array that encodes where a sequences fell at a bisecting k-means * ppcClusterSplits_p can consume quite a bit of memory, but it is only needed if clustering info is written to file. Use ppcClusterSplits_p as a flag, initialise in the calling function (Mbed) to NULL, if no info written out then leave ppcClusterSplits_p=NULL. If info is to be written out then malloc one char*, so that ppcClusterSplits_p!=NULL. In that case realloc proper amount. Only expect a certain number of splits, iLog2N2. Worst case would be iNObjs but then ppcClusterSplits_p would be quadratic, which is too big for many sequences. */ if (NULL != *ppcClusterSplits_p){ /* (square) of logarithm (base 2) of number of objects */ double dLog2N = log10(iNObjs) / log10(2); iLog2N2 = (int)(dLog2N*dLog2N); *ppcClusterSplits_p = (char **)CKREALLOC(*ppcClusterSplits_p, iNObjs*sizeof(char *)); (*ppcClusterSplits_p)[0] = (char *)CKMALLOC(iNObjs*iLog2N2); (*ppcClusterSplits_p)[0][0] = '\0'; for (iN = 1; iN < iNObjs; iN++){ (*ppcClusterSplits_p)[iN] = (*ppcClusterSplits_p)[iN-1] + iLog2N2; (*ppcClusterSplits_p)[iN][0] = '\0'; } } /* Starting with the first cluster that now contains all the * sequences keep splitting until no cluster contains more than * iMaxAllowedObjsPerCluster * * Keep a queue of clusters (rClusterSplitQueue) to split * * At each split values/memory of the just split cluster will be * reused and exactly one new only allocated. * * Example: * Given the following cluster assignments * 0 0 0 0 1 1 2 2 2 3 3 3 3 3 3 3 4 4 * and a K-Means split in cluster 3 at |: * 0 0 0 0 1 1 2 2 2 3 3 3 | 3 3 3 3 4 4 * The result should be this: * 0 0 0 0 1 1 2 2 2 3 3 3 | 5 5 5 5 4 4 * * */ INT_QUEUE_INIT(&rClusterSplitQueue); if (iNObjs>iMaxAllowedObjsPerCluster) { /* pish fake first cluster index */ INT_QUEUE_PUSH(&rClusterSplitQueue, 0); } iNRounds = 0; while (! INT_QUEUE_EMPTY(&rClusterSplitQueue)) { /* assignments for each seq to the K newly created clusters */ int *piKClusterAssignments; /* number of objects in cluster that is to be split */ int iNObjsInClusterToSplit; /* coordinates of points in cluster that is to be split * array of size n*d where [d*i + j] gives coordinate j of point i */ double *pdVectorsInClusterToSplit; /* copy of object indices in split cluster */ int *piObjIndicesOfSplitCluster; /* best cost of kmeans rounds */ double dCost = -1.0; /* indices for the two created clusters */ /* index of cluster to split */ int iClusterToSplot; /* index of newly created cluster at each round. data for the other created cluster goes to the one just split, i.e. (*piClusterToSplot) */ int iNewClusterIdx; #if TIMING StopwatchZero(stopwatch); StopwatchStart(stopwatch); #endif INT_QUEUE_POP(&rClusterSplitQueue, &iClusterToSplot); iNObjsInClusterToSplit = (*prKMeansResult_p)->piNObjsPerCluster[iClusterToSplot]; piKClusterAssignments = (int *) CKMALLOC(iNObjsInClusterToSplit * sizeof(int)); pdVectorsInClusterToSplit = (double *) CKMALLOC(iNObjsInClusterToSplit * iDim * sizeof(double)); for (iN=0; iNppiObjIndicesPerCluster[iClusterToSplot][iN]; pdVectorsInClusterToSplit[iDim*iN + iD] = ppdVectors[iThisObjIdx][iD]; } } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Round %d: Will split cluster %d which has %d objects", iNRounds, iClusterToSplot, iNObjsInClusterToSplit); fprintf(stderr, "DEBUG(%s|%s():%d): Object indices in cluster to split are:", __FILE__, __FUNCTION__, __LINE__); for (iN=0; iNppiObjIndicesPerCluster[iClusterToSplot][iN]); } fprintf(stderr, "\n"); (void) fflush(stderr); #endif #if TRACE for (iN=0; iNppiObjIndicesPerCluster[iClusterToSplot][iN]); for (iD=0; iDiNClusters; /* We don't want Clusters which are too small. Check here if a * split created a small cluster and if yes, discard the * solution. Because the cluster has already been removed from * the queue, we can just continue. */ bSmallClusterDetected = FALSE; if (iMinRequiredObjsPerCluster>1) { int iNObjsCluster[2]; iNObjsCluster[0] = 0; /* first cluster */ iNObjsCluster[1] = 0; /* second cluster */ for (iN=0; iNppdClusterCenters[iClusterToSplot][iN] = dCoord; } /* realloc and set new one */ (*prKMeansResult_p)->ppdClusterCenters = (double **) CKREALLOC((*prKMeansResult_p)->ppdClusterCenters, ((*prKMeansResult_p)->iNClusters+1) * sizeof(double *)); (*prKMeansResult_p)->ppdClusterCenters[iNewClusterIdx] = (double *) CKMALLOC(iDim * sizeof(double)); for (iD=0; iDppdClusterCenters[iNewClusterIdx][iD] = dCoord; } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "* Update of cluster centers done. Cluster centers so far:"); for (iN=0; iN<(*prKMeansResult_p)->iNClusters+1; iN++) { fprintf(stderr, "DEBUG(%s|%s():%d): Center %u =", __FILE__, __FUNCTION__, __LINE__, iN); for (iD=0; iDppdClusterCenters[iN][iD]); } fprintf(stderr, "\n"); (void) fflush(stderr); } #endif /* update #seqs per cluster: piNObjsPerCluster * */ (*prKMeansResult_p)->piNObjsPerCluster = (int *) CKREALLOC((*prKMeansResult_p)->piNObjsPerCluster, ((*prKMeansResult_p)->iNClusters+1) * sizeof(int)); /* init new and old one to zero */ (*prKMeansResult_p)->piNObjsPerCluster[iClusterToSplot] = 0; (*prKMeansResult_p)->piNObjsPerCluster[iNewClusterIdx] = 0; /* now update values */ for (iN=0; iNpiNObjsPerCluster[iClusterToSplot] += 1; } else if (1 == piKClusterAssignments[iN]) { (*prKMeansResult_p)->piNObjsPerCluster[iNewClusterIdx] += 1; } else { /* there used to be code for iK>=2 in r101 */ Log(&rLog, LOG_FATAL, "Internal error: split into more than two clusters (got assignment %d)", piKClusterAssignments[iN]); } } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "* Update of NObjs per cluster done:"); for (iN=0; iN<(*prKMeansResult_p)->iNClusters+1; iN++) { Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d contains %d sequences", iN, (*prKMeansResult_p)->piNObjsPerCluster[iN]); } #endif /* queue clusters if still they are still too big */ if ((*prKMeansResult_p)->piNObjsPerCluster[iClusterToSplot] > iMaxAllowedObjsPerCluster) { INT_QUEUE_PUSH(&rClusterSplitQueue, iClusterToSplot); } if ((*prKMeansResult_p)->piNObjsPerCluster[iNewClusterIdx] > iMaxAllowedObjsPerCluster) { INT_QUEUE_PUSH(&rClusterSplitQueue, iNewClusterIdx); } /* update which objects belong to which cluster: * * note: piNObjsPerCluster needs to be already updated * */ /* create a copy of the object indices in the split cluster * (original will be overwritten) */ piObjIndicesOfSplitCluster = (int *) CKMALLOC(iNObjsInClusterToSplit * sizeof(int)); memcpy(piObjIndicesOfSplitCluster, (*prKMeansResult_p)->ppiObjIndicesPerCluster[iClusterToSplot], iNObjsInClusterToSplit * sizeof(int)); (*prKMeansResult_p)->ppiObjIndicesPerCluster = (int **) CKREALLOC((*prKMeansResult_p)->ppiObjIndicesPerCluster, ((*prKMeansResult_p)->iNClusters+1) * sizeof(int *)); (*prKMeansResult_p)->ppiObjIndicesPerCluster[iClusterToSplot] = (int *) CKREALLOC((*prKMeansResult_p)->ppiObjIndicesPerCluster[iClusterToSplot], (*prKMeansResult_p)->piNObjsPerCluster[iClusterToSplot] * sizeof(int)); (*prKMeansResult_p)->ppiObjIndicesPerCluster[iNewClusterIdx] = (int *) CKMALLOC((*prKMeansResult_p)->piNObjsPerCluster[iNewClusterIdx] * sizeof(int)); /* now reassign the object indices to the assigned cluster */ piCurObjToUpdate[0] = 0; piCurObjToUpdate[1] = 0; for (iN=0; iN=2 in r101 */ Log(&rLog, LOG_FATAL, "Internal error: split into more than two clusters (got assignment %d)", piKClusterAssignments[iN]); } #if 0 Log(&rLog, LOG_FORCED_DEBUG, "Setting (*prKMeansResult_p)->ppiObjIndicesPerCluster[%d][%d] = %d", iThisClusterIndex, iThisOffset, iThisObjIdx); #endif (*prKMeansResult_p)->ppiObjIndicesPerCluster[iThisClusterIndex][iThisOffset] = iThisObjIdx; piCurObjToUpdate[iThisClusterAssignment]+=1; } CKFREE(piObjIndicesOfSplitCluster); #if TRACE for (iN=0; iN<(*prKMeansResult_p)->iNClusters+1; iN++) { int iObj; fprintf(stderr, "DEBUG(%s|%s():%d): Objects in cluster %u: ", __FILE__, __FUNCTION__, __LINE__, iN); for (iObj=0; iObj<(*prKMeansResult_p)->piNObjsPerCluster[iN]; iObj++) { fprintf(stderr, " %u", (*prKMeansResult_p)->ppiObjIndicesPerCluster[iN][iObj]); } fprintf(stderr, "\n"); (void) fflush(stderr); } #endif #if TIMING StopwatchStop(stopwatch); StopwatchDisplay(stdout, "Total time after next round in Bisecting-KMeans: ", stopwatch); #endif /* finally: increase number of clusters */ (*prKMeansResult_p)->iNClusters += 1; iNRounds += 1; CKFREE(piKClusterAssignments); CKFREE(pdVectorsInClusterToSplit); } /* while */ INT_QUEUE_DESTROY(&rClusterSplitQueue); Log(&rLog, LOG_DEBUG, "Bisecting K-means finished after %d rounds (no more clusters to split)", iNRounds); #if TIMING StopwatchFree(stopwatch); #endif /* @note could use progress/timer */ CKFREE(pdKClusterCenters); CKFREE(piCurObjToUpdate); return; } /*** end: BisectingKmeans() ***/ /** * * @brief From scratch reimplementation of mBed: Blackshields et al. * (2010); PMID 20470396. * * Idea is a follows: * - convert sequences into vectors of distances * - cluster the vectors using k-means * - cluster each of the k clusters using upgma (used cached distances * from above?) * - join the sub-clusters to create on tree (use UPGMA on k-means * medoids) * * * @param[out] prMbedTree_p * Created upgma tree. will be allocated here. use FreeMuscleTree() * to free * @param[in] prMSeq * Multiple sequences * @param[in] iPairDistType * Distance measure for pairwise alignments * @param[in] pcGuidetreeOut * Passed down to GuideTreeUpgma() * * @note: if the number of sequences is smaller than * MAX_ALLOWED_SEQ_PER_PRECLUSTER then there's no need to do the subclustering * first. In fact it costs some extra time. However, it's insignificant and * for simplicities sake we don't do any special checks * * @return Zero on success, non-zero on error * */ int Mbed(tree_t **prMbedTree_p, mseq_t *prMSeq, const int iPairDistType, const char *pcGuidetreeOut, int iClustersizes, const char *pcClusterFile) { /* number of seeds */ int iNumSeeds = 0; /* seed indices matching prMSeq */ int *piSeeds = NULL; /* seqs represented as distance vectors */ double **ppdSeqVec = NULL; /* kmeans result */ bisecting_kmeans_result_t *prKMeansResult = NULL; /* distance matrix of kmeans (pre-)cluster centers */ symmatrix_t *prPreClusterDistmat = NULL; /* auxiliary for symmetric matrix output; tree routines etc */ char **ppcLabels = NULL; int iNodeIndex = 0; /* mapping of cluster-center tree node indices to corresponding cluster */ int *piClusterToTreeNode = NULL; int iClusterIndex = 0; int iI, iJ; FILE *pfOut = NULL; progress_t *prSubClusterDistanceProgress = NULL; bool bPrintCR = (rLog.iLogLevelEnabled<=LOG_VERBOSE) ? FALSE : TRUE; char **ppcClusterSplits = NULL; #if FULL_WITHIN_CLUSTER_DISTANCES Log(&rLog, LOG_DEBUG, "Computing real distances within subclusters for mBed."); #else Log(&rLog, LOG_DEBUG, "Computing vector distances within subclusters for mBed."); #endif #if MBED_TIMING Stopwatch_t *stopwatch = StopwatchCreate(); #endif assert(NULL != prMbedTree_p); assert(NULL != prMSeq); iNumSeeds = (int) NUMBER_OF_SEEDS(prMSeq->nseqs); if (iNumSeeds >= prMSeq->nseqs) { /* -1 is condition for RandomUniqueIntArray */ iNumSeeds = prMSeq->nseqs-1; Log(&rLog, LOG_DEBUG, "Automatically determined number of seeds is bigger (or equal) the number of sequences. Will set it to %d", iNumSeeds); } /* Turn sequences into vectors of distances to the seeds * */ piSeeds = (int *) CKMALLOC(iNumSeeds * sizeof(int)); if (0 != SeedSelection(piSeeds, iNumSeeds, SEED_SELECTION, prMSeq)) { Log(&rLog, LOG_ERROR, "Something went wrong during seed selection for mbed"); return -1; } ppdSeqVec = (double **) CKMALLOC(prMSeq->nseqs * sizeof(double *)); for (iI=0; iInseqs; iI++) { ppdSeqVec[iI] = (double *) CKMALLOC(iNumSeeds * sizeof(double)); } if (0 != SeqToVec(ppdSeqVec, prMSeq, piSeeds, iNumSeeds, iPairDistType)) { Log(&rLog, LOG_ERROR, "Could not convert sequences into vectors for mbed"); return -1; } CKFREE(piSeeds); /* Calculate (pre-)clusters of sequence vectors by applying * bisecting kmeans * */ #if MBED_TIMING /* start clock only here, to make sure we don't include pairwise * distance computation */ StopwatchZero(stopwatch); StopwatchStart(stopwatch); #endif /* ppcClusterSplits can consume quite a bit of memory, however, it is only needed if cluster information is to be written to file. If no pcClusterFile is specified, then ppcClusterSplits does not have to be allocated. Use ppcClusterSplits as a flag, initialise to NULL, if NULL is passed into BisectingKmeans then do NOT malloc, if !NULL is passed in then realloc the appropriate memory */ if (NULL != pcClusterFile){ ppcClusterSplits = (char **)malloc(sizeof(char*)); } else { ppcClusterSplits = NULL; } BisectingKmeans(&prKMeansResult, prMSeq->nseqs, iNumSeeds, ppdSeqVec, MIN_REQUIRED_SEQ_PER_PRECLUSTER, iClustersizes/*MAX_ALLOWED_SEQ_PER_PRECLUSTER*/, &ppcClusterSplits); Log(&rLog, LOG_INFO, "mBed created %u cluster/s (with a minimum of %d and a soft maximum of %d sequences each)", prKMeansResult->iNClusters, MIN_REQUIRED_SEQ_PER_PRECLUSTER, iClustersizes/*MAX_ALLOWED_SEQ_PER_PRECLUSTER*/); if (NULL != pcClusterFile){ /* print clustering: FS, r275 -> */ FILE *pfClust = NULL; if (NULL == (pfClust = fopen(pcClusterFile, "w"))){ Log(&rLog, LOG_FATAL, "Could not open file %s for writing", pcClusterFile); } for (iI = 0; iI < prKMeansResult->iNClusters; iI++) { for (iJ=0; iJpiNObjsPerCluster[iI]; iJ++) { int iRealIndex = prKMeansResult->ppiObjIndicesPerCluster[iI][iJ]; fprintf(pfClust, "Cluster %u: object %u has index %u (=seq %s )\t %s\n", iI, iJ, iRealIndex, prMSeq->sqinfo[iRealIndex].name, ppcClusterSplits[iRealIndex]); } } fclose(pfClust); pfClust = NULL; /* if there is no pcClusterFile then no memory will have been allocated */ CKFREE(ppcClusterSplits[0]); CKFREE(ppcClusterSplits); } /* there was a request to write out clustering */ #if PRINT_CLUSTER_DISTRIBUTION Log(&rLog, LOG_FORCED_DEBUG, "Bisecting Kmeans returned %d clusters", prKMeansResult->iNClusters); for (iI=0; iIiNClusters; iI++) { #if TRACE int iD; Log(&rLog, LOG_FORCED_DEBUG, "Diagnostic output for cluster %d follows:", iI); fprintf(stderr, "DEBUG(%s|%s():%d): center coordinates =", __FILE__, __FUNCTION__, __LINE__); for (iD=0; iDppdClusterCenters[iI][iD]); } fprintf(stderr, "\n"); fflush(stderr); #endif Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d has %d objects assigned", iI, prKMeansResult->piNObjsPerCluster[iI]); #if TRACE for (iJ=0; iJpiNObjsPerCluster[iI]; iJ++) { int iRealIndex = prKMeansResult->ppiObjIndicesPerCluster[iI][iJ]; Log(&rLog, LOG_FORCED_DEBUG, "Cluster %u: object %u has index %u (= seq %s)", iI, iJ, iRealIndex, prMSeq->sqinfo[iRealIndex].name); } #endif } #endif /* Cluster pre-clusters produced by k-means. * * Do this by calculating the vector distances of the cluster * centers and applying UPGMA. * * @note could try to force-balance the tree here * */ if (0 != NewSymMatrix(&prPreClusterDistmat, prKMeansResult->iNClusters, prKMeansResult->iNClusters)) { Log(&rLog, LOG_FATAL, "%s", "Memory allocation for pre-cluster distance-matrix failed"); } for (iI=0; iIiNClusters; iI++) { for (iJ=iI+1; iJiNClusters; iJ++) { double dDist; dDist = EuclDist(prKMeansResult->ppdClusterCenters[iI], prKMeansResult->ppdClusterCenters[iJ], iNumSeeds); SymMatrixSetValue(prPreClusterDistmat, iI, iJ, dDist); /* Log(&rLog, LOG_FORCED_DEBUG, "Euclidean distance between clusters %d and %d = %f", iI, iJ, dDist); */ } } /* labels needed for the guide tree building routine only */ ppcLabels = (char **) CKMALLOC(prKMeansResult->iNClusters * sizeof(char*)); for (iI=0; iIiNClusters; iI++) { ppcLabels[iI] = (char *) CKMALLOC(32 * sizeof(char)); (void) snprintf(ppcLabels[iI], 32, "Subcluster-%u", iI); } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Distance matrix for pre-cluster centers:"); SymMatrixPrint(prPreClusterDistmat, ppcLabels, NULL, FALSE); #endif GuideTreeUpgma(prMbedTree_p, ppcLabels, prPreClusterDistmat, NULL); for (iI=0; iIiNClusters; iI++) { CKFREE(ppcLabels[iI]); } CKFREE(ppcLabels); #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Cluster-center guide-tree:"); LogTree(*prMbedTree_p, stderr); #endif /* Now replace each leaf in the pre-cluster-center tree * appropriately, i.e. with the corresponding sub-cluster. * * For each leaf/sub-cluster, create a distance matrix for the * corresponding sequences. Use distances between vectors as * approximated distances between sequences. Then create a * guide-tree by applying UPGMA. * */ /* Get a mapping of (pre)cluster number and leaf-node indices in * the cluster-center tree. We can add trees to prMbedTree_p * because AppendTrees() guarantees that no other than the node to * append to changes. */ piClusterToTreeNode = (int*) CKMALLOC(prKMeansResult->iNClusters * sizeof(int)); iNodeIndex = FirstDepthFirstNode(*prMbedTree_p); do { if (IsLeaf(iNodeIndex, *prMbedTree_p)) { int iLeafId = GetLeafId(iNodeIndex, *prMbedTree_p); piClusterToTreeNode[iLeafId] = iNodeIndex; } iNodeIndex = NextDepthFirstNode(iNodeIndex, *prMbedTree_p); } while (NULL_NEIGHBOR != iNodeIndex); /* Now step through all the leafs and replace them with the * corresponding sub-trees */ NewProgress(&prSubClusterDistanceProgress, LogGetFP(&rLog, LOG_INFO), "Distance calculation within sub-clusters", bPrintCR); /* for each cluster */ for (iClusterIndex=0; iClusterIndex < prKMeansResult->iNClusters; iClusterIndex++) { /* distance matrix for the sub-cluster */ symmatrix_t *prWithinClusterDistances = NULL; int iNSeqInCluster; tree_t *prSubClusterTree = NULL; ProgressLog(prSubClusterDistanceProgress, iClusterIndex, prKMeansResult->iNClusters, FALSE); #if FULL_WITHIN_CLUSTER_DISTANCES mseq_t *prSubClusterMSeq; int iPairDistType; int iSeqIndex; int iOldLogLevel; Log(&rLog, LOG_DEBUG, "%s\n", "Calling new Mbed use makes only sense if nseq>MAX_ALLOWED_SEQ_PER_PRECLUSTER"); if (TRUE == prMSeq->aligned) { if (SEQTYPE_PROTEIN == prMSeq->seqtype){ iPairDistType = PAIRDIST_SQUIDID_KIMURA; } else { iPairDistType = PAIRDIST_SQUIDID; } } else { iPairDistType = PAIRDIST_KTUPLE; } #endif iNSeqInCluster = prKMeansResult->piNObjsPerCluster[iClusterIndex]; #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "#seqs in subcluster no %d = %d", iClusterIndex, iNSeqInCluster); #endif #if FULL_WITHIN_CLUSTER_DISTANCES /* create an mseq structure for sequences in this cluster * don't need most of the members (e.g. orig_seq) but copy * them anyway for the sake of completeness */ NewMSeq(&prSubClusterMSeq); prSubClusterMSeq->nseqs = iNSeqInCluster; prSubClusterMSeq->seqtype = prMSeq->seqtype; if (NULL!=prMSeq->filename) { prSubClusterMSeq->filename = CkStrdup(prMSeq->filename); } prSubClusterMSeq->aligned = prMSeq->aligned; /* FS, r252 */ prSubClusterMSeq->seq = (char **) CKMALLOC(prSubClusterMSeq->nseqs * sizeof(char *)); prSubClusterMSeq->orig_seq = (char **) CKMALLOC(prSubClusterMSeq->nseqs * sizeof(char *)); prSubClusterMSeq->sqinfo = (SQINFO *) CKMALLOC(prSubClusterMSeq->nseqs * sizeof(SQINFO)); for (iSeqIndex=0; iSeqIndexppiObjIndicesPerCluster[iClusterIndex][iSeqIndex]; prSubClusterMSeq->seq[iSeqIndex] = CkStrdup(prMSeq->seq[iRealSeqIndex]); prSubClusterMSeq->orig_seq[iSeqIndex] = CkStrdup(prMSeq->orig_seq[iRealSeqIndex]); SeqinfoCopy(&prSubClusterMSeq->sqinfo[iSeqIndex], &prMSeq->sqinfo[iRealSeqIndex]); #if TRACE Log(&rLog, LOG_DEBUG, "seq no %d in cluster %d is %s (real index = %d)", iSeqIndex, iClusterIndex, prSubClusterMSeq->sqinfo[iSeqIndex].name, iRealSeqIndex); #endif } #endif /* Create a distance matrix for this sub-cluster * (prWithinClusterDistances) by using the vector distances or * ktuple distances. * * Then apply UPGMA to get a subcluster tree * (prSubClusterTree) and append created tree to the * pre-cluster-tree (prMbedTree_p) * */ #if FULL_WITHIN_CLUSTER_DISTANCES iOldLogLevel = rLog.iLogLevelEnabled; rLog.iLogLevelEnabled = LOG_WARN; /* compute distances, but be quiet */ /* 4th argument (FALSE) is bPercID, in mBed mode never use percent-identities */ if (PairDistances(&prWithinClusterDistances, prSubClusterMSeq, iPairDistType, FALSE, 0, prSubClusterMSeq->nseqs, 0, prSubClusterMSeq->nseqs, NULL, NULL)) { Log(&rLog, LOG_ERROR, "Couldn't compute pair distances"); return -1; } rLog.iLogLevelEnabled = iOldLogLevel; #if COMPUTE_WITHIN_SUBCLUSTER_AVERAGE { double dSum = 0.0; for (iI=0; iInseqs; iI++) { for (iJ=iI+1; iJnseqs; iJ++) { dSum += SymMatrixGetValue(prWithinClusterDistances, iI, iJ); } } Log(&rLog, LOG_FORCED_DEBUG, "mean pair-wise distance within subcluster %d of %d = %f", iClusterIndex, prKMeansResult->iNClusters, dSum/prSubClusterMSeq->nseqs); } #endif #else if (NewSymMatrix(&prWithinClusterDistances, iNSeqInCluster, iNSeqInCluster)!=0) { Log(&rLog, LOG_FATAL, "%s", "Memory allocation for disparity matrix failed"); } for (iI=0; iIppiObjIndicesPerCluster[iClusterIndex][iI]; for (iJ=iI+1; iJppiObjIndicesPerCluster[iClusterIndex][iJ]; double dist; /* Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d: compute distance between %d:%s and %d:%s", iClusterIndex, i, prMSeq->sqinfo[iRealIndexI].name, iJ, prMSeq->sqinfo[iRealIndexJ].name); */ if (1 == USE_EUCLIDEAN_DISTANCE) { dist = EuclDist(ppdSeqVec[iRealIndexI], ppdSeqVec[iRealIndexJ], iNumSeeds); } else { dist = CosDist(ppdSeqVec[iRealIndexI], ppdSeqVec[iRealIndexJ], iNumSeeds); } SymMatrixSetValue(prWithinClusterDistances, iI, iJ, dist); } } #endif /* labels needed for the guide tree building routine only */ ppcLabels = (char**) CKMALLOC(iNSeqInCluster * sizeof(char*)); for (iI=0; iIsqinfo[iI].name; #else int iRealIndex = prKMeansResult->ppiObjIndicesPerCluster[iClusterIndex][iI]; ppcLabels[iI] = prMSeq->sqinfo[iRealIndex].name; #endif } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Distance matrix for seqs within sub cluster %d/%d", iClusterIndex, prKMeansResult->iNClusters); SymMatrixPrint(prWithinClusterDistances, ppcLabels, NULL, FALSE); #endif GuideTreeUpgma(&prSubClusterTree, ppcLabels, prWithinClusterDistances, NULL); CKFREE(ppcLabels); /* don't free members, they just point */ #if 0 Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d guide-tree:", iClusterIndex); LogTree(prSubClusterTree); #endif /* The guide tree id's (that point to the sequences) now start * from 0, i.e. the association with the prMSeq numbering is * broken and fixed in the following */ for (iNodeIndex = 0; iNodeIndex < (int)GetNodeCount(prSubClusterTree); iNodeIndex++) { if (IsLeaf(iNodeIndex, prSubClusterTree)) { int iLeafId = GetLeafId(iNodeIndex, prSubClusterTree); int iRealId = prKMeansResult->ppiObjIndicesPerCluster[iClusterIndex][iLeafId]; #if 0 Log(&rLog, LOG_FORCED_DEBUG, "Correcting leaf node %d which has (wrong) id %d and name %s to id %d (prMSeq name %s)", iNodeIndex, iLeafId, GetLeafName(iNodeIndex, prSubClusterTree), iRealId, prMSeq->sqinfo[iRealId].name); #endif SetLeafId(prSubClusterTree, iNodeIndex, iRealId); } } /* Append the newly created tree (prSubClusterTree) to the * corresponding node index of prMbedTree_p. */ #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Will join trees at leaf node %d = %s", piClusterToTreeNode[iClusterIndex], GetLeafName(piClusterToTreeNode[iClusterIndex], *prMbedTree_p)); #endif AppendTree(*prMbedTree_p, piClusterToTreeNode[iClusterIndex], prSubClusterTree); /* Note: piClusterToTreeNode is still valid, because * AppendTrees() guarantees that no other than the node to * append to changes. */ #if 0 Log(&rLog, LOG_FORCED_DEBUG, "%s", "prMbedTree_p after cluster %d has appended:", iClusterIndex); LogTree(*prMbedTree_p); if (0) { char fname[] = "mbed-joined-tree.dnd"; FILE *pfOut; if (NULL == (pfOut = fopen(fname, "w"))) { Log(&rLog, LOG_FATAL, "Couldn't open %s for writing", fname); } MuscleTreeToFile(pfOut, *prMbedTree_p); Log(&rLog, LOG_FORCED_DEBUG, "Joined tree written to %s", fname); fclose(pfOut); Log(&rLog, LOG_FATAL, "DEBUG EXIT"); } #endif /* cleanup */ FreeMuscleTree(prSubClusterTree); FreeSymMatrix(&prWithinClusterDistances); #if FULL_WITHIN_CLUSTER_DISTANCES FreeMSeq(&prSubClusterMSeq); #endif } /* end for each cluster */ ProgressDone(prSubClusterDistanceProgress); FreeProgress(&prSubClusterDistanceProgress); if (NULL != pcGuidetreeOut) { if (NULL == (pfOut = fopen(pcGuidetreeOut, "w"))) { Log(&rLog, LOG_ERROR, "Couldn't open %s for writing", pcGuidetreeOut); } else { MuscleTreeToFile(pfOut, *prMbedTree_p); Log(&rLog, LOG_INFO, "Guide tree written to %s", pcGuidetreeOut); (void) fclose(pfOut); } } /* cleanup * */ #if MBED_TIMING StopwatchStop(stopwatch); StopwatchDisplay(stdout, "mBed time (without pairwise distance computation): ", stopwatch); StopwatchFree(stopwatch); #endif FreeKMeansResult(&prKMeansResult); FreeSymMatrix(&prPreClusterDistmat); for (iI=0; iInseqs; iI++) { CKFREE(ppdSeqVec[iI]); } CKFREE(ppdSeqVec); CKFREE(piClusterToTreeNode); #ifndef NDEBUG TreeValidate(*prMbedTree_p); #endif return 0; } /*** end: Mbed() ***/ clustal-omega-1.2.1/src/clustal/ktuple_pair.c0000644000175100017510000005622512206661646016137 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: ktuple_pair.c 230 2011-04-09 15:37:50Z andreas $ * * * K-Tuple code for pairwise alignment (Wilbur and Lipman, 1983; PMID * 6572363). Most code taken from showpair.c (Clustal 1.83) * DD: some functions now have lots of parameters as static variables * were removed to make code OpenMP-friendly * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef HAVE_OPENMP #include #endif #include "squid/squid.h" #include "util.h" #include "symmatrix.h" #include "ktuple_pair.h" #include "log.h" #include "progress.h" #define END_MARK -3 /* see interface.c in 1.83 */ #define NUMRES 32 /* max size of comparison matrix */ /* see notes below */ #undef SORT_LAST_ELEMENT_AS_WELL /* gap_pos1 = NUMRES-2; /@ code for gaps inserted by clustalw @/ */ static const int GAP_POS2 = NUMRES-1; /* code for gaps already in alignment */ static bool DNAFLAG = FALSE; static const char *AMINO_ACID_CODES = "ABCDEFGHIKLMNPQRSTUVWXYZ-"; static const char *NUCLEIC_ACID_CODES = "ACGTUN-"; /* As far as I understand the gap symbol should not be necessary here, * because we use isgap for testing later anyway. But changing this, * will affect max_res_code and max_nuc as well. So I leave it for now * as it is. AW */ static bool percent = TRUE; static void make_ptrs(int *tptr, int *pl, const int naseq, const int l, const int ktup, const int max_res_code, char **seq_array); static void put_frag(const int fs, const int v1, const int v2, const int flen, const int curr_frag, int *next, int *maxsf, int **accum); static bool frag_rel_pos(int a1, int b1, int a2, int b2, int ktup); static void des_quick_sort(int *array1, int *array2, const int array_size); static void pair_align(int seq_no, int l1, int l2, int max_res_code, ktuple_param_t *aln_param, char **seq_array, int *maxsf, int **accum, int max_aln_length, int *zza, int *zzb, int *zzc, int *zzd); static void encode(char *seq, char *naseq, int l, const char *res_codes); static int res_index(const char *lookup, char c); typedef struct { int i1; int i2; } two_ints_t; /* default ktuple pairwise alignment parameters * */ /* protein */ /* designated initializer */ const ktuple_param_t default_protein_param = { .ktup = 1, .wind_gap = 3, .signif = 5, .window = 5, }; /* dna */ /* designated initializer */ const ktuple_param_t default_dna_param = { .ktup = 2, .wind_gap = 5, .signif = 4, .window = 4, }; /** * note: naseq should be unit-offset */ static void encode(char *seq, char *naseq, int l, const char *res_codes) { /* code seq as ints .. use GAP_POS2 for gap */ register int i; bool seq_contains_unknown_char = FALSE; /*LOG_DEBUG("seq=%s naseq=%p l=%d", &(seq[1]), naseq, l); */ for (i=1; i<=l; i++) { char res = toupper(seq[i]); if (isgap(res)) { naseq[i] = GAP_POS2; /* gap in input */ } else { naseq[i] = res_index(res_codes, res); } /*LOG_DEBUG("Character '%c' at pos %d", res, i);*/ if (-1 == naseq[i]) { seq_contains_unknown_char = TRUE; /*LOG_DEBUG("Unknown character '%c' at pos %d", res, i);*/ } /*LOG_DEBUG("na_seq[%d]=%d", i, naseq[i]);*/ } if (TRUE == seq_contains_unknown_char) Log(&rLog, LOG_WARN, "Unknown character in seq '%s'", &(seq[1])); naseq[i] = END_MARK; return; } /* end of encode */ /** * */ static int res_index(const char *t, char c) { register int i; for (i=0; t[i] && t[i] != c; i++) ; if (t[i]) { return (i); } else { return -1; } } /* end of res_index */ /** * */ static void make_ptrs(int *tptr, int *pl, const int naseq, const int l, const int ktup, const int max_res_code, char **seq_array) { /* FIXME make 10 a constant and give it a nice name */ static int a[10]; int i, j, code, flag; char residue; const int limit = (int) pow((double)(max_res_code+1),(double)ktup); for (i=1;i<=ktup;i++) a[i] = (int) pow((double)(max_res_code+1),(double)(i-1)); for (i=1; i<=limit; ++i) pl[i]=0; for (i=1; i<=l; ++i) tptr[i]=0; for (i=1; i<=(l-ktup+1); ++i) { code=0; flag=FALSE; for (j=1; j<=ktup; ++j) { /* Log(&rLog, LOG_FORCED_DEBUG, "naseq=%d i=%d j=%d seq_array[naseq]=%p", * naseq, i, j, seq_array[naseq]); */ residue = seq_array[naseq][i+j-1]; /* Log(&rLog, LOG_FORCED_DEBUG, "residue = %d", residue); */ if ((residue<0) || (residue > max_res_code)){ flag=TRUE; break; } code += ((residue) * a[j]); } if (flag) continue; ++code; if (0 != pl[code]) tptr[i] =pl[code]; pl[code] = i; } return; } /* end of make_ptrs */ /** * * FIXME Why hardcoding of 5? */ static void put_frag(const int fs, const int v1, const int v2, const int flen, const int curr_frag, int *next, int *maxsf, int **accum) { int end; accum[0][curr_frag]=fs; accum[1][curr_frag]=v1; accum[2][curr_frag]=v2; accum[3][curr_frag]=flen; if (!*maxsf) { *maxsf=1; accum[4][curr_frag]=0; return; } if (fs >= accum[0][*maxsf]) { accum[4][curr_frag]=*maxsf; *maxsf=curr_frag; return; } else { *next=*maxsf; while (TRUE) { end=*next; *next=accum[4][*next]; if (fs>=accum[0][*next]) break; } accum[4][curr_frag]=*next; accum[4][end]=curr_frag; } return; } /* end of put_frag */ /** * */ static bool frag_rel_pos(int a1, int b1, int a2, int b2, int ktup) { if (a1-b1 == a2-b2) { if (a2 0) { if (lst[p] >= ust[p]) { p--; } else { i = lst[p] - 1; j = ust[p]; pivlin = array1[j]; while (i < j) { for (i=i+1; array1[i] < pivlin; i++) ; for (j=j-1; j > i; j--) if (array1[j] <= pivlin) break; if (i < j) { temp1 = array1[i]; array1[i] = array1[j]; array1[j] = temp1; temp2 = array2[i]; array2[i] = array2[j]; array2[j] = temp2; } } j = ust[p]; temp1 = array1[i]; array1[i] = array1[j]; array1[j] = temp1; temp2 = array2[i]; array2[i] = array2[j]; array2[j] = temp2; if (i-lst[p] < ust[p] - i) { lst[p+1] = lst[p]; ust[p+1] = i - 1; lst[p] = i + 1; } else { lst[p+1] = i + 1; ust[p+1] = ust[p]; ust[p] = i - 1; } p = p + 1; } } #if 0 for (i=1; i<=array_size; i++) { Log(&rLog, LOG_FORCED_DEBUG, "after sort array1[%d]=%d array2[%d]=%d", i, array1[i], i, array2[i]); } #endif return; } /* end of des_quick_sort */ /** * * FIXME together with des_quick_sort most time consuming routine * according to gprof on r110 * */ static void pair_align(int seq_no, int l1, int l2, int max_res_code, ktuple_param_t *aln_param, char **seq_array, int *maxsf, int **accum, int max_aln_length, int *zza, int *zzb, int *zzc, int *zzd) { int next; /* forrmerly static */ int pot[8],i, j, l, m, flag, limit, pos, vn1, vn2, flen, osptr, fs; int tv1, tv2, encrypt, subt1, subt2, rmndr; char residue; int *diag_index; int *displ; char *slopes; int curr_frag; const int tl1 = (l1+l2)-1; assert(NULL!=aln_param); /* Log(&rLog, LOG_FORCED_DEBUG, "DNAFLAG=%d seq_no=%d l1=%d l2=%d window=%d ktup=%d signif=%d wind_gap=%d", DNAFLAG, seq_no, l1, l2, window, ktup, signif, wind_gap); */ slopes = (char *) CKCALLOC(tl1+1, sizeof(char)); displ = (int *) CKCALLOC(tl1+1, sizeof(int)); diag_index = (int *) CKMALLOC((tl1+1) * sizeof(int)); for (i=1; i<=tl1; ++i) { /* unnecessary, because we calloced: slopes[i] = displ[i] = 0; */ diag_index[i] = i; } for (i=1;i<=aln_param->ktup;i++) pot[i] = (int) pow((double)(max_res_code+1),(double)(i-1)); limit = (int) pow((double)(max_res_code+1),(double)aln_param->ktup); /* increment diagonal score for each k_tuple match */ for (i=1; i<=limit; ++i) { vn1=zzc[i]; while (TRUE) { if (!vn1) break; vn2 = zzd[i]; while (0 != vn2) { osptr = vn1-vn2+l2; ++displ[osptr]; vn2 = zzb[vn2]; } vn1=zza[vn1]; } } /* choose the top SIGNIF diagonals */ #ifdef QSORT_REPLACEMENT /* This was an attempt to replace des_quick_sort with qsort(), * which turns out to be much slower, so don't use this */ /* FIXME: if we use this branch, we don't need to init diag_index * before, because that is done in QSortAndTrackIndex() * automatically. */ #if 0 for (i=1; i<=tl1; i++) { Log(&rLog, LOG_FORCED_DEBUG, "b4 sort disp[%d]=%d diag_index[%d]=%d", i, diag_index[i], i, displ[i]); } #endif QSortAndTrackIndex(&(diag_index[1]), &(displ[1]), tl1, 'a', TRUE); #if 0 for (i=1; i<=tl1; i++) { Log(&rLog, LOG_FORCED_DEBUG, "after sort disp[%d]=%d diag_index[%d]=%d", i, diag_index[i], i, displ[i]); } #endif #else des_quick_sort(displ, diag_index, tl1); #endif j = tl1 - aln_param->signif + 1; if (j < 1) { j = 1; } /* flag all diagonals within WINDOW of a top diagonal */ for (i=tl1; i>=j; i--) { if (displ[i] > 0) { pos = diag_index[i]; l = (1 > pos - aln_param->window) ? 1 : pos - aln_param->window; m = (tl1 < pos + aln_param->window) ? tl1 : pos + aln_param->window; for (; l <= m; l++) slopes[l] = 1; } } for (i=1; i<=tl1; i++) { displ[i] = 0; } curr_frag=*maxsf=0; for (i=1; i<=(l1-aln_param->ktup+1); ++i) { encrypt=flag=0; for (j=1; j<=aln_param->ktup; ++j) { residue = seq_array[seq_no][i+j-1]; if ((residue<0) || (residue>max_res_code)) { flag=TRUE; break; } encrypt += ((residue)*pot[j]); } if (flag) { continue; } ++encrypt; vn2=zzd[encrypt]; flag=FALSE; while (TRUE) { if (!vn2) { flag=TRUE; break; } osptr=i-vn2+l2; if (1 != slopes[osptr]) { vn2=zzb[vn2]; continue; } flen=0; fs=aln_param->ktup; next=*maxsf; /* * A-loop */ while (TRUE) { if (!next) { ++curr_frag; if (curr_frag >= 2*max_aln_length) { Log(&rLog, LOG_VERBOSE, "(Partial alignment)"); goto free_and_exit; /* Yesss! Always wanted to * use a goto (AW) */ } displ[osptr]=curr_frag; put_frag(fs, i, vn2, flen, curr_frag, &next, maxsf, accum); } else { tv1=accum[1][next]; tv2=accum[2][next]; if (frag_rel_pos(i, vn2, tv1, tv2, aln_param->ktup)) { if (i-vn2 == accum[1][next]-accum[2][next]) { if (i > accum[1][next]+(aln_param->ktup-1)) { fs = accum[0][next]+aln_param->ktup; } else { rmndr = i-accum[1][next]; fs = accum[0][next]+rmndr; } flen=next; next=0; continue; } else { if (0 == displ[osptr]) { subt1=aln_param->ktup; } else { if (i > accum[1][displ[osptr]]+(aln_param->ktup-1)) { subt1=accum[0][displ[osptr]]+aln_param->ktup; } else { rmndr=i-accum[1][displ[osptr]]; subt1=accum[0][displ[osptr]]+rmndr; } } subt2=accum[0][next] - aln_param->wind_gap + aln_param->ktup; if (subt2>subt1) { flen=next; fs=subt2; } else { flen=displ[osptr]; fs=subt1; } next=0; continue; } } else { next=accum[4][next]; continue; } } break; } /* * End of Aloop */ vn2=zzb[vn2]; } } free_and_exit: CKFREE(displ); CKFREE(slopes); CKFREE(diag_index); return; } /* end of pair_align */ /** * * Will compute ktuple scores and store in tmat * Following values will be set: tmat[i][j], where * istart <= i nseqs+1) * sizeof(int)); for (i=0; inseqs; i++) { seqlen_array[i+1] = mseq->sqinfo[i].len; } /* setup alignment parameters */ if (SEQTYPE_PROTEIN == mseq->seqtype) { DNAFLAG = FALSE; max_res_code = strlen(AMINO_ACID_CODES)-2; aln_param = default_protein_param; } else if (SEQTYPE_RNA == mseq->seqtype || SEQTYPE_DNA == mseq->seqtype) { DNAFLAG = TRUE; max_res_code = strlen(NUCLEIC_ACID_CODES)-2; aln_param = default_dna_param; } else { Log(&rLog, LOG_FATAL, "Internal error in %s: Unknown sequence type.", __FUNCTION__); } if (NULL!=param_override) { aln_param.ktup = param_override->ktup; aln_param.wind_gap = param_override->wind_gap; aln_param.signif = param_override->signif; aln_param.window = param_override->window; } /*LOG_DEBUG("DNAFLAG = %d max_res_code = %d", DNAFLAG, max_res_code);*/ /* convert mseq to clustal's old-style int encoded sequences (unit-offset) */ max_aln_length = 0; max_seq_len = 0; seq_array = (char **) CKMALLOC((mseq->nseqs+1) * sizeof(char *)); seq_array[0] = NULL; /* FIXME check that non of the seqs is smaller than ktup (?). * Otherwise segfault occurs */ for (i=0; inseqs; i++) { seq_array[i+1] = (char *) CKMALLOC((seqlen_array[i+1]+2) * sizeof (char));; } for (i=0; inseqs; i++) { /*LOG_DEBUG("calling encode with seq_array[%d+1] len=%d and seq=%s", i, seqlen_array[i+1], mseq->seq[i]);*/ if (TRUE == DNAFLAG) { encode(&(mseq->seq[i][-1]), seq_array[i+1], seqlen_array[i+1], NUCLEIC_ACID_CODES); } else { encode(&(mseq->seq[i][-1]), seq_array[i+1], seqlen_array[i+1], AMINO_ACID_CODES); } if (seqlen_array[i+1]>max_seq_len) { max_seq_len = seqlen_array[i+1]; } } max_aln_length = max_seq_len * 2; /* see sequence.c in old source */ /* FIXME: short sequences can cause seg-fault * because max_aln_length can get shorter * than (max_res_code+1)^k * FS, r222->r223 */ max_aln_length = max_aln_length > pow((max_res_code+1), aln_param.ktup)+1 ? max_aln_length : pow((max_res_code+1), aln_param.ktup)+1; /* * * conversion to old style clustal done (in no time) */ accum = (int **) CKCALLOC(5, sizeof (int *)); for (i=0;i<5;i++) { accum[i] = (int *) CKCALLOC((2*max_aln_length+1), sizeof(int)); } zza = (int *) CKCALLOC( (max_aln_length+1), sizeof(int)); zzb = (int *) CKCALLOC( (max_aln_length+1), sizeof(int)); zzc = (int *) CKCALLOC( (max_aln_length+1), sizeof(int)); zzd = (int *) CKCALLOC( (max_aln_length+1), sizeof(int)); /* estimation of total number of steps (if istart and jstart are * both 0) (now handled in the calling routine) */ /* uTotalStepNo = iend*jend - iend*iend/2 + iend/2; uStepNo = 0; */ /*LOG_DEBUG("istart=%d iend=%d jstart=%d jend=%d", istart, iend, jstart, jend);*/ for (i=istart+1; i<=iend; ++i) { /* by definition a sequence compared to itself should give a score of 0. AW */ SymMatrixSetValue(tmat, i-1, i-1, 0.0); make_ptrs(zza, zzc, i, seqlen_array[i], aln_param.ktup, max_res_code, seq_array); #ifdef HAVE_OPENMP #pragma omp critical(ktuple) #endif { ProgressLog(prProgress, *ulStepNo, ulTotalStepNo, FALSE); } for (j=MAX(i+1, jstart+1); j<=jend; ++j) { (*ulStepNo)++; private_step_no++; /*LOG_DEBUG("comparing pair %d:%d", i, j);*/ make_ptrs(zzb, zzd, j, seqlen_array[j], aln_param.ktup, max_res_code, seq_array); pair_align(i, seqlen_array[i], seqlen_array[j], max_res_code, &aln_param, seq_array, &maxsf, accum, max_aln_length, zza, zzb, zzc, zzd); if (!maxsf) { calc_score=0.0; } else { calc_score=(double)accum[0][maxsf]; if (percent) { dsr=(seqlen_array[i]nseqs; i++) { CKFREE(seq_array[i]); } CKFREE(seq_array); } /* end of KTuplePairDist */ clustal-omega-1.2.1/src/clustal/Makefile.in0000644000175100017510000004076212304116376015512 00000000000000# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/clustal DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libclustal_la_LIBADD = am_libclustal_la_OBJECTS = hhalign_wrapper.lo ktuple_pair.lo list.lo \ log.lo muscle_upgma.lo muscle_tree.lo mbed.lo pair_dist.lo \ progress.lo seq.lo symmatrix.lo tree.lo util.lo weights.lo libclustal_la_OBJECTS = $(am_libclustal_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libclustal_la_SOURCES) DIST_SOURCES = $(libclustal_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(library_includedir)" library_includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(library_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @OPENMP_CFLAGS@ @AM_CFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENMP_CFLAGS = @OPENMP_CFLAGS@ OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CODENAME = @PACKAGE_CODENAME@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libclustal.la libclustal_la_SOURCES = \ hhalign_wrapper.c hhalign_wrapper.h \ ktuple_pair.c ktuple_pair.h \ list.c list.h \ log.c log.h \ muscle_upgma.c muscle_upgma.h \ muscle_tree.c muscle_tree.h \ mbed.c mbed.h \ pair_dist.h pair_dist.c \ progress.c progress.h \ queue.h \ seq.c seq.h \ symmatrix.c symmatrix.h \ tree.c tree.h \ util.c util.h \ weights.c weights.h library_includedir = $(includedir)/clustalo/clustal library_include_HEADERS = \ hhalign_wrapper.h \ ktuple_pair.h \ log.h \ mbed.h \ muscle_tree.h \ pair_dist.h \ progress.h \ seq.h \ symmatrix.h \ tree.h \ util.h \ weights.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/clustal/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/clustal/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libclustal.la: $(libclustal_la_OBJECTS) $(libclustal_la_DEPENDENCIES) $(LINK) $(libclustal_la_OBJECTS) $(libclustal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hhalign_wrapper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ktuple_pair.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muscle_tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/muscle_upgma.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pair_dist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symmatrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weights.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(library_includedir)" || $(MKDIR_P) "$(DESTDIR)$(library_includedir)" @list='$(library_include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(library_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(library_includedir)/$$f'"; \ $(library_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(library_includedir)/$$f"; \ done uninstall-library_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(library_include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(library_includedir)/$$f'"; \ rm -f "$(DESTDIR)$(library_includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(library_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-library_includeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-library_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-library_includeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-library_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clustal-omega-1.2.1/src/clustal/util.c0000644000175100017510000002737512206661646014601 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: util.c 235 2011-04-13 14:13:19Z andreas $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "log.h" #include "util.h" /* struct for QSortAndTrackIndex and SortAndTrackIndexCmp[Asc|Desc] */ typedef struct { int piIndex; int piValue; } sortwithindex_t; /** * @brief Copy of squid's FileExists(). Copied here to make squid independent. */ int CheckIfFileExists(char *pcFilename) { FILE *prFile; if ((prFile = fopen(pcFilename, "r"))) { fclose(prFile); return TRUE; } return FALSE; } /* end of CheckIfFileExists */ /** * @brief Allocates memory (malloc) * * @param[in] bytes * bytes to allocated * @param[in] function * calling function name * @param[in] line * calling function line * * @return void pointer to the newly allocated memory * * @note use provided macro CKMALLOC() which automatically adds * function name and line number * */ void * CkMalloc(size_t bytes, const char *function, const int line) { void *ret; if(NULL == (ret = malloc(bytes * sizeof(char)))) { Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\n", function, line); } return ret; } /*** end: ckmalloc ***/ /** * @brief Allocates memory (calloc). Memory will be * set to zero. * * @param[in] count * Allocate space for count objects * @param[in] size * Objects are of this size * @param[in] function * calling function name * @param[in] line * calling function line * * @return void pointer to the newly allocated and zeroed memory (calloc). * * @note use provided macro CKCALLOC() which automatically adds * function name and line number * * */ void * CkCalloc(size_t count, size_t size, const char *function, const int line) { void *ret; if(NULL == (ret = calloc(count, size))) { Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\n", function, line); exit(EXIT_FAILURE); } return ret; } /*** end: CkCalloc ***/ /** * @brief Reallocates memory * * @param[in] ptr * Pointer to memory to be reallocated * @param[in] bytes * bytes to allocated * @param[in] function * calling function name * @param[in] line * calling function line * * @return void pointer to the newly allocated memory * * @note use provided macro CKREALLOC() which automatically adds * function name and line number * */ void * CkRealloc(void *ptr, size_t bytes, const char *function, const int line) { void *ret=NULL; if(NULL == (ret = realloc(ptr, bytes))) { Log(&rLog, LOG_FATAL, "FATAL: Out of memory (requested from %s:%d)\n", function, line); } return ret; } /*** end: ckrealloc ***/ /** * * @brief Frees memory * * @param[in] ptr * Pointer to memory to be freed * @param[in] function * calling function name * @param[in] line * calling function line * * @return void pointer to the now zeroed memory * * @note use provided macro CKFREE() * */ void * CkFree(void *ptr, const char *function, const int line) { if (ptr == NULL) { Log(&rLog, LOG_WARN, "Bad call to CkFree from %s:%d (pointer was NULL)\n", function, line); } else { free(ptr); ptr = NULL; } return ptr; } /*** end: CkFree ***/ /** * @brief safe version of strdup * * @param[in] src * String to copy from * * @return copy of string * * @note src is not allowed to be NULL. * */ char * CkStrdup(const char *src) { char *cp; assert(NULL!=src); /*cp = strdup(src); always makes trouble... */ cp = (char *) CKMALLOC(strlen(src) +1); strcpy(cp, src); return cp; } /*** end: CkStrdup ***/ /** * @brief Creates an int array of size len with len-1 random but unique * integers with values 0--len-1. This is "a modified version of * Fisher-Yates known as Durstenfeld-Fisher-Yates or * Knuth-Fisher-Yates". See * http://stackoverflow.com/questions/196017/unique-random-numbers-in-o1 * * @param[in] perm * The permutation array. Has to be preallocated * @param[out] len * Length of the permutation array * */ void PermutationArray(int **perm, const int len) { int max, i; assert(len>0); srand((unsigned int) time(0)); (*perm) = (int *) CKMALLOC(len * sizeof(int)); max = len-1; for (i=0; i=0) { int tmp, randno; /* randno = addrand((unsigned long) len); / returns 0--n-1 */ randno = (rand()%len); /* swap */ tmp = (*perm)[randno]; (*perm)[randno] = (*perm)[max]; (*perm)[max] = tmp; max--; } return; } /*** end: PermutationArray() ***/ /** * @brief Creates an array filled with random, but unique ints of * given range. Implementation of the Floyd algorithm. See * http://stackoverflow.com/questions/1608181/unique-random-numbers-in-an-integer-array-in-the-c-programming-language * Assuming M is the length of the desired array and N is the numeric * range: "This approach has the complexity of about O(M) (depends on * the search structure used), so it is better suitable when M << N. * This approach keeps track of already generated random numbers, so * it requires extra memory. However, the beauty of it is that it does * not make any of those horrendous "trial and error" iterations, * trying to find an unused random number. This algorithm is * guaranteed to generate one unique random number after each single * call to the random number generator." * * @warning This won't work if max_value<=array_len. Only use for * cases where array_len<piValue; const int ib = (const int) b_t->piValue; return ia - ib; } /*** end: SortAndTrackIndexCmpAsc ***/ /** * @brief Compare two sortwithindex_t pointers and return the * difference between the int value of the 2nd sortwithindex_t and the * 1st. Used for descending sort order in QSortWithIndexes() * * @see SortAndTrackIndexCmpDesc() and QSortAndTrackIndex() */ int SortAndTrackIndexCmpDesc(const void *a, const void *b) { const sortwithindex_t *a_t = (const sortwithindex_t *)a; const sortwithindex_t *b_t = (const sortwithindex_t *)b; const int ia = (const int) a_t->piValue; const int ib = (const int) b_t->piValue; return ib - ia; } /*** end: SortAndTrackIndexCmpDesc ***/ /** * @brief Sort a given int array in ascending or descending order, * while keeping track of the element order. * * @param[out] piSortedIndices * Will contain the indices of the sorted elements. Has to be preallocated. * @param[out] piArrayToSort * Array with values to sort. Will only be overwritten if * bOverwriteArrayToSort it true. * @param[in] iArrayLen * Number of elements in piArrayToSort. * @param[in] cOrder * Sort order. 'a' for ascending, 'd' for descending. * @param[in] bOverwriteArrayToSort * If false do not overwrite the array to sort. * */ void QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort, const int iArrayLen, const char cOrder, const bool bOverwriteArrayToSort) { int iCtr; /**< aux */ sortwithindex_t *prSort; assert(NULL!=piSortedIndices); assert(iArrayLen>0); assert(NULL!=piArrayToSort); assert('a'==cOrder || 'd'==cOrder); prSort = (sortwithindex_t *) CKMALLOC(iArrayLen * sizeof(sortwithindex_t)); for (iCtr=0; iCtr #include "log.h" #include "muscle_tree.h" #include "weights.h" /* #undef DEBUG */ /** * @brief FIXME * * @param[out] puLeavesUnderNode * FIXME * @param[in] prTree * FIXME * @param[in] uNodeIndex * FIXME * * @return The return value * * @note see Muscle3.7:clwwt.cpp * */ uint CountLeaves(uint *puLeavesUnderNode, tree_t *prTree, uint uNodeIndex) { uint uLeft; uint uRight; uint uRightCount; uint uLeftCount; uint uCount; if (IsLeaf(uNodeIndex, prTree)) { puLeavesUnderNode[uNodeIndex] = 1; return 1; } uLeft = GetLeft(uNodeIndex, prTree); uRight = GetRight(uNodeIndex, prTree); uRightCount = CountLeaves(puLeavesUnderNode, prTree, uRight); uLeftCount = CountLeaves(puLeavesUnderNode, prTree, uLeft); uCount = uRightCount + uLeftCount; puLeavesUnderNode[uNodeIndex] = uCount; return uCount; } /*** end: CountLeaves() ***/ /** * @brief Normalise values in a double array to values between 0 and 1. * * @param[out] p * double array with n elements * @param[in] n * number of elements in p * * @note From Muscle3.7: intmath.cpp:Normalize() * */ void Normalise(double *p, uint n) { unsigned i; double dSum = 0.0; for (i = 0; i < n; ++i) { dSum += p[i]; } if (0.0 == dSum) { Log(&rLog, LOG_FATAL, "Normalise, sum=0"); } for (i = 0; i < n; ++i) { p[i] /= dSum; } } /*** end: Normalise() ***/ /** * @brief Calculate "Clustal" weights from a tree. * * FIXME see doc in muscle:clwwt.cpp * * @param[out] pdWeights_p * Will contain a weight for each leaf/sequence. Allocated here. User * has to free * @param[in] prTree * Tree to derive weights from * * @return 0 on success, non-zero otherwise * * @note Largely copied from Muscle3.7: clwwt.cpp:CalcClustalWWeights() * * @warning FIXME Not sure if Muscle routines are most efficient here. * Couldn't we do all this while traversing the tree and thereby safe * time? * */ int CalcClustalWeights(double **pdWeights_p, tree_t *prTree) { int i; /* aux */ uint uLeafCount; uint uNodeCount; uint *puLeavesUnderNode; uint uLeavesUnderRoot; uint uRootNodeIndex; double *pdStrengths; uint uNodeIndex; bool bLogWeights = FALSE; /* verbose output of weights */ assert(NULL != pdWeights_p); assert(NULL != prTree); if (rLog.iLogLevelEnabled <= LOG_DEBUG) { bLogWeights = TRUE; } uLeafCount = GetLeafCount(prTree); uNodeCount = GetNodeCount(prTree); (*pdWeights_p) = (double *) CKMALLOC(uNodeCount * sizeof(double)); if (0 == uLeafCount) { return 0; } else if (1 == uLeafCount) { (*pdWeights_p)[0] = 1.0; return 0; } else if (2 == uLeafCount) { (*pdWeights_p)[0] = 0.5; (*pdWeights_p)[1] = 0.5; return 0; } if (!IsRooted(prTree)) { Log(&rLog, LOG_ERROR, "Tree must be rooted to get weights"); CKFREE(pdWeights_p); return -1; } #ifdef TRACE Log(&rLog, LOG_FORCED_DEBUG, "%s", "Weights follow"); fprintf(stderr, "Node Leaves Length Strength\n"); fprintf(stderr, "---- ------ -------- --------\n"); /* 1234 123456 12345678 12345678 */ #endif uRootNodeIndex = GetRootNodeIndex(prTree); puLeavesUnderNode = (uint *) CKCALLOC(uNodeCount, sizeof(uint)); uLeavesUnderRoot = CountLeaves(puLeavesUnderNode, prTree, uRootNodeIndex); if (uLeavesUnderRoot != uLeafCount) { Log(&rLog, LOG_FATAL, "Internal error, root count %u %u", uLeavesUnderRoot, uLeafCount); } #if 0 for (uNodeIndex=0; uNodeIndex%u(%g)", uNode, pdStrengths[uNode]); } } /* AW: no idea what this is, but it's done like this in Muscle */ if (dWeight < 0.0001) { #ifdef TRACE fprintf(stderr, "zero->one"); #endif dWeight = 1.0; } /* @note: the only difference to the muscle code is here: we * use the input index for storing weights, instead of the * tree leaf index */ (*pdWeights_p)[GetLeafId(uLeafNodeIndex, prTree)] = dWeight; if (bLogWeights){ fprintf(stderr, " = %g\n", dWeight); } } #if 0 for (i=0; i #include #ifndef LOG_H #define LOG_H #define LOG_DEBUG 0 #define LOG_VERBOSE 1 #define LOG_INFO 2 #define LOG_WARN 3 #define LOG_FORCED_DEBUG 4 #define LOG_ERROR 5 #define LOG_CRITICAL 6 #define LOG_FATAL 7 #define LOG_NUM_LEVELS 8 typedef struct { /* the higher the level, the more priority it has. numbers must be * sequential */ /* array of function pointers */ void (*prFunc[LOG_NUM_LEVELS]) (FILE *prFP, char *pcFormat, va_list rVArgList); FILE *prFP[LOG_NUM_LEVELS]; char *prPrefix[LOG_NUM_LEVELS]; /* everything above this level will be printed */ int iLogLevelEnabled; } log_t; /* a standard logger */ extern log_t rLog; void LogDefaultSetup(log_t *log); void Log(log_t *prLog, int iLevel, char *pcFmt, ...); void LogSetFP(log_t *log, int level, FILE *fp); void LogSetFPForAll(log_t *log, FILE *fp); FILE * LogGetFP(log_t *prLog, int iLevel); void LogMute(log_t *log, int level); void LogMuteAll(log_t *log); void LogFuncOverwrite(log_t *prLog, int iLevel, void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList)); #endif clustal-omega-1.2.1/src/clustal/symmatrix.c0000644000175100017510000003256112206661646015652 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: symmatrix.c 288 2013-07-29 13:15:50Z andreas $ * * * Functions for symmetric (square) matrices including diagonal. * supports the notion of non-square sub-matrices of a symmetric * matrix, i.e. where |rows|<|cols|. * * FIXME Allocating one big chunk of memory is probably * much faster and also easier to maintain. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "symmatrix.h" #include "util.h" #if 0 #define DEBUG #endif #define MAX_BUF_SIZE 65536 /** * @brief Allocates symmat and its members and initialises them. Data * will be calloced, i.e. initialised with zeros. * * @param[out] symmat * newly allocated and initialised symmatrix instance * @param[in] nrows * number of rows * @param[in] * ncols number of columns * * @return: non-zero on error * * @see FreeSymMatrix() * * @note: symmat data will be of fake shape nrows x ncols * */ int NewSymMatrix(symmatrix_t **symmat, int nrows, int ncols) { int i; /* aux */ assert(nrows>0 && ncols>0 && ncols>=nrows); assert(ncols>0 && ncols>=nrows); (*symmat) = (symmatrix_t *) malloc(1*sizeof(symmatrix_t)); if (NULL == (*symmat)) { fprintf(stderr, "Couldn't allocate memory (%s|%s)\n", __FILE__, __FUNCTION__); return -1; } (*symmat)->data = (double **) malloc(nrows * sizeof(double *)); if (NULL == (*symmat)->data) { fprintf(stderr, "Couldn't allocate memory (%s|%s)\n", __FILE__, __FUNCTION__); free(*symmat); *symmat = NULL; return -1; } for (i=0; idata[i] = (double *) calloc((ncols-i), sizeof(double)); if (NULL == (*symmat)->data[i]) { fprintf(stderr, "Couldn't allocate memory (%s|%s)\n", __FILE__, __FUNCTION__); while (0!=--i) { free((*symmat)->data[i]); } free((*symmat)->data); free(*symmat); *symmat = NULL; return -1; } #ifdef TRACE fprintf(stderr, "DEBUG(%s|%s():%d) initialising symmat with the number of the beast\n", __FILE__, __FUNCTION__, __LINE__); { int j; for (j=0; jdata[i][j] = -666.0; } } #endif } (*symmat)->nrows = nrows; (*symmat)->ncols = ncols; return 0; } /*** end: new_symmatrix ***/ /** * @brief Sets symmat data of given index to given value * * @param[in] symmat * symmatrix_t whose data is to be set * @param[in] i * first index * @param[in] j * second index * @param[in] value * value used to set data point * * @see SymMatrixGetValue() * * @note This is a convenience function that checks index order. * */ void SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value) { assert(NULL != symmat); if (i<=j) { assert(i < symmat->nrows && j < symmat->ncols); symmat->data[i][j-i] = value; } else { assert(j < symmat->nrows && i < symmat->ncols); symmat->data[j][i-j] = value; } } /*** end: symmatrix_setvalue ***/ /** * @brief Returns element of symmat corresponding to given indices * * @param[in] symmat * symmatrix_t of question * @param[in] i * index i * @param[in] j * index j * * @return requested value * * @see SymMatrixSetValue() * * @note This is a convenience function that checks index order. */ double SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j) { assert(NULL != symmat); if (i<=j) { assert(i < symmat->nrows && j < symmat->ncols); return symmat->data[i][j-i]; } else { assert(j < symmat->nrows && i < symmat->ncols); return symmat->data[j][i-j]; } } /*** end: symmatrix_getvalue ***/ /** * @brief Returns a pointer to an element of symmat corresponding to * given indices * * @param[out] val * Value to be set * @param[in] symmat * symmatrix_t of question * @param[in] i * index i * @param[in] j * index j * * @return pointer to value * * @see SymMatrixGetValue() * * @note This is a convenience function that checks index order. * */ void SymMatrixGetValueP(double **val, symmatrix_t *symmat, const int i, const int j) { assert(NULL != symmat); if (i<=j) { assert(i < symmat->nrows && j < symmat->ncols); *val = &(symmat->data[i][j-i]); } else { assert(j < symmat->nrows && i < symmat->ncols); *val = &(symmat->data[j][i-j]); } } /*** end: symmatrix_getvaluep ***/ /** * @brief Frees memory allocated by data members of symmat and symmat * itself. * * @param[in] symmat * symmatrix_t to be freed * * @note Use in conjunction with NewSymMatrix() * * @see NewSymMatrix() * */ void FreeSymMatrix(symmatrix_t **symmat) { int i; if (NULL != (*symmat)) { if (NULL != (*symmat)->data) { for (i=0; i<(*symmat)->nrows; i++) { free((*symmat)->data[i]); } free((*symmat)->data); } } free(*symmat); *symmat = NULL; } /*** end: free_symmatrix ***/ /** * @brief Print out a symmat in phylip style. Distances are printed on * one line per sequence/object. Since we also support matrices with * rows\nrows; i++) { int this_len; assert(NULL != labels[i]); this_len = strlen(labels[i]); if (this_len>max_label_len) max_label_len = this_len; } if (symmat->ncols==symmat->nrows) { fprintf(fp, "%u\n", symmat->ncols); } else { /* this is not standard phylip, but necessary to indicate seed matrices */ fprintf(fp, "%u x %u\n", symmat->nrows, symmat->ncols); } for (i=0; inrows; i++) { /* phylip restriction is 10 characters. we don't care here */ fprintf(fp, "%-*s", max_label_len, labels[i]); /* we are lazy and do it like fastdist: write all distances * for one seq to one line */ if (TRUE == bPercID){ for (j=0; jncols; j++) { fprintf(fp, " %f", 100*(1.00-SymMatrixGetValue(symmat, i, j))); } } else{ for (j=0; jncols; j++) { fprintf(fp, " %f", SymMatrixGetValue(symmat, i, j)); } } fprintf(fp, "%s", "\n"); } if (NULL != path) { (void) fclose(fp); } else { (void) fflush(fp); } } /*** end: SymMatrixPrint ***/ /** * * @brief Read a distance matrix in phylip format * * @param[in] pcFileIn * distance matrix filename * @param[in] prMSeq * optional mseq pointer. only used for consistency checking of names/labels * @param[out] prSymMat_p * the symmatrix_t. will be allocated here. * @return: * non-zero on error * * @note: * FIXME untested code */ int SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p, mseq_t *prMSeq) { FILE *prFilePointer; char *buf; /* number of parsed sequences */ int iNParsedSeq = 0; /* number of parsed distances per sequence */ int iNParsedDists = 0; /* total number of sequences/objects */ int iTotalNSeq = 0; int iRetCode = 0; assert(NULL!=pcFileIn); /* could pass down prMSeq for label checking if non NULL */ if (NULL == (buf = (char *) malloc(MAX_BUF_SIZE * sizeof(char)))) { fprintf(stderr, "ERROR: couldn't allocate memory at %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__); return -1; } if (NULL == (prFilePointer = fopen(pcFileIn, "r"))) { fprintf(stderr, "ERROR: Couldn't open %s for reading\n", pcFileIn); free(buf); return -1; } /* get number of sequences from first line and allocate memory for * distance matrix * */ if (NULL == fgets(buf, MAX_BUF_SIZE, prFilePointer) ) { fprintf(stderr, "Couldn't read first line from %s\n", pcFileIn); iRetCode = -1; goto closefile_and_freebuf; } if (strlen(buf)==MAX_BUF_SIZE-1) { fprintf(stderr, "%s\n", "Looks like I couldn't read complete line. Wrong format (or too small MAX_BUF_SIZE)"); iRetCode = -1; goto closefile_and_freebuf; } if (sscanf(buf, "%d", &iTotalNSeq)!=1) { fprintf(stderr, "ERROR: couldn't parse number of sequences from first line of %s\n", pcFileIn); iRetCode = -1; goto closefile_and_freebuf; } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "iTotalNSeq parsed from %s is %d\n", pcFileIn, iTotalNSeq); #endif if (NewSymMatrix(prSymMat_p, iTotalNSeq, iTotalNSeq)) { fprintf(stderr, "FATAL %s", "Memory allocation for distance matrix failed"); iRetCode = -1; goto closefile_and_freebuf; } /* parse file line by line * */ while (NULL != fgets(buf, MAX_BUF_SIZE, prFilePointer)) { char *szToken; int is_newseq; if (MAX_BUF_SIZE-1 == strlen(buf)) { fprintf(stderr, "%s\n", "Looks like I couldn't read complete line. Wrong format (or too small MAX_BUF_SIZE)"); iRetCode = -1; goto closefile_and_freebuf; } #ifdef DEBUG Log(&rLog, LOG_FORCED_DEBUG, "Got line: %s\n", buf); #endif /* new sequence label at beginning of line? */ if (isblank(buf[0])) { is_newseq = 0; } else { is_newseq = 1; } /* tokenise line and treat new sequence specially */ szToken = strtok(buf, " \t"); if (is_newseq==1) { iNParsedSeq++; iNParsedDists=0; /* if format is lower dimensional matrix then first * sequence has no distances but might have newline * character at it's end. */ while (isspace(szToken[strlen(szToken)-1])) { szToken[strlen(szToken)-1]='\0'; } if (strcmp(szToken, prMSeq->sqinfo[iNParsedSeq-1].name) != 0) { fprintf(stderr, "Sequence ordering in mseq and distmat differ (expected %s and got %s from distmat %s)n", prMSeq->sqinfo[iNParsedSeq-1].name, szToken, pcFileIn); iRetCode = -1; goto closefile_and_freebuf; } szToken = strtok(NULL, " \t"); } /* from here on it's only parsing of distances */ while (szToken != NULL) { double dist; iNParsedDists++; /* only parse what's needed */ if (iNParsedDists!=iNParsedSeq) { /* parse and store distance */ if (sscanf(szToken, "%lf", &dist)!=1) { fprintf(stderr, "Couldn't parse float from entry '%s'\n", szToken); iRetCode = -1; goto closefile_and_freebuf; } #if TRACE Log(&rLog, LOG_FORCED_DEBUG, "Parsed distance %d for seq %d = %f\n", iNParsedDists-1, iNParsedSeq-1, dist); #endif SymMatrixSetValue(*prSymMat_p, iNParsedSeq-1, iNParsedDists-1, dist); SymMatrixSetValue(*prSymMat_p, iNParsedDists-1, iNParsedSeq-1, dist); } szToken = strtok(NULL, " \t"); } } if (iTotalNSeq!=iNParsedSeq) { fprintf(stderr, "expected %d seqs, but only parsed %d\n", iTotalNSeq, iNParsedSeq); iRetCode = -1; goto closefile_and_freebuf; } #if TRACE for (i=0; i= MAXRES const int MAXRES=15002; //max number of columns in HMM; must be <= LINELEN #else const int MAXCOL=2/*131072*/; //max number of residues in input files; must be <= LINELEN and >= MAXRES const int MAXRES=1/*65536*/; //max number of columns in HMM; must be <= LINELEN #endif const int LINELEN=262144; //max length of line read in from input files; must be >= MAXCOL const int MAXSEQDIS=3; //10238;//max number of sequences stored in 'hit' objects and displayed in output alignment const int IDLEN=255; //max length of scop hierarchy id and pdb-id const int DESCLEN=32765;//max length of sequence description (longname) const int NAMELEN=511; //max length of file names etc. const int MAXOPT=127; //Maximum number of options to be read in from .hhconfig or command line const int NAA=20; //number of amino acids (0-19) const int NTRANS=10; //number of transitions recorded in HMM (M2M,M2I,M2D,I2M,I2I,D2M,D2D,M2M_GAPOPEN,GAPOPEN,GAPEXTD) const int NCOLMIN=10; //min number of cols in subalignment for calculating pos-specific weights w[k][i] const int ANY=20; //number representing an X (any amino acid) internally const int GAP=21; //number representing a gap internally const int ENDGAP=22; //Important to distinguish because end gaps do not contribute to tansition counts const int HMMSCALE=1000;//Scaling number for log2-values in HMMs const int NFAMMAX=5119; //Size of hash for counting number of HMMs in each family const int MAXPROF=32766;//Maximum number of HMM scores for fitting EVD const float MAXENDGAPFRAC=0.1; //For weighting: include only columns into subalignment i that have a max fraction of seqs with endgap const float SMIN= 20.; //Minimum score of hit needed to search for another repeat of same profile: p=exp(-(4-mu)/lamda)=0.01 const float LAMDA=0.388; //lamda in score EVD used for -local mode in length correction: S = S-log(Lq*Lt)/LAMDA) const float LAMDA_GLOB=0.42; //lamda in score EVD used for -global mode const float PMAX=1E-2; //Maximum single-repeat p-value that can contribute to whole-protein p-value const float MINEVALEXCL=0.5; //above this E-value from first ML fit hits are not used for final ML fit of EVD const int SELFEXCL=3; // exclude self-alignments with j-i internal numbers a // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // A C D E F G H I K L M N P Q R S T V W Y X const int s2a[]={ 0, 4, 3, 6,13, 7, 8, 9,11,10,12, 2,14, 5, 1,15,16,19,17,18,20}; //Internal numbers a for amino acids -> amino acids Sorted by alphabet: // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // A R N D C Q E G H I L K M F P S T W Y V X const int a2s[]={ 0,14,11, 2, 1,13, 3, 5, 6, 7, 9, 8,10, 4,12,15,16,18,19,17,20}; // Secondary structure const int NDSSP=8; //number of different ss states determined by dssp: 0-7 (0: no state available) const int NSSPRED=4; //number of different ss states predicted by psipred: 0-3 (0: no prediction availabe) const int MAXCF=11; //number of different confidence values: 0-10 (0: no prediction availabe) const int NSA=7; //number of classes relative solvent accesiblity (0:no coord, 1:<2%, 2:<14%, 3:<33%, 4:<55%, 5:>55%, 6:S-S bridge) ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// // Input parameters class Parameters // Parameters for gap penalties and pseudocounts { public: char** argv; //command line parameters char argc; //dimension of argv char infile[NAMELEN]; // input filename char outfile[NAMELEN]; // output filename char pairwisealisfile[NAMELEN]; // output filename with pairwise alignments char alnfile[NAMELEN]; // name of output alignment file in A3M format (for iterative search) char hhmfile[NAMELEN]; // name of output HHM file for (iterative search) char psifile[NAMELEN]; // name of output alignmen file in PSI-BLAST format (iterative search) char scorefile[NAMELEN];// table of scores etc for all HMMs in searched database char tfile[NAMELEN]; // template filename (in hhalign) char buffer[NAMELEN]; // buffer to write results for other programs into char pngfile[NAMELEN]; // png image file for dotplot char wfile[NAMELEN]; // weights file generated with hhformat char* blafile; // output of 'blastpgp -m 8' with PSI-BLAST E-values for HHblast char* dbfiles; // database filenames, separated by colons char* exclstr; // optional string containing list of excluded residues, e.g. '1-33,97-168' int aliwidth; // number of characters per line in output alignments for HMM search char append; // append to output file? (hhmake) float p; // minimum probability for inclusion in hit list and alignments float E; // maximum E-value for inclusion in hit list and alignment list float e; // maximum E-value for inclusion in output alignment, output HMM, and PSI-BLAST checkpoint model int Z; // max number of lines in hit list int z; // min number of lines in hit list int B; // max number of lines in alignment list int b; // min number of lines in alignment list int showcons; // 0: don't show consensus sequence in alignments 1:show int showdssp; // 0: don't show consensus sequence in alignments 1:show int showpred; // 0: don't show consensus sequence in alignments 1:show int nseqdis; // maximum number of query or template sequences in output alignments char cons; // if set to 1, include consensus as first representative sequence of HMM char mark; // which sequences to mark for display in output alignments? 0: auto; 1:all char outformat; // 0: hhr 1: FASTA 2:A2M 3:A3M char mode; // //0:MAC alignment, master-slave 1:MAC blending, master-slave 2:MAC alignment, combining int max_seqid; // Maximum sequence identity with all other sequences in alignment int qid; // Minimum sequence identity with query sequence (sequence 0) float qsc; // Minimum score per column with query sequence (sequence 0) int coverage; // Minimum coverage threshold int Ndiff; // Pick Ndiff most different sequences that passed the other filter thresholds int coverage_core; // Minimum coverage for sequences in core alignment float qsc_core; // Minimum sequence identity with query for sequences in core alignment float coresc; // Minimum score per column with core alignment (HMM) int maxResLen; /* length of longest sequence/profile, FS 2010-11-05 */ int maxColCnt; /* maximum number of columns in HMM, FS 2010-11-05 */ int Mgaps; // Maximum percentage of gaps for match states int M; // Match state assignment by 1:upper/lower case 2:percentage rule 3:marked sequence char matrix; // Subst.matrix 0: Gonnet, 1: HSDM, 2: BLOSUM50 char wg; // 0: use local sequence weights 1: use local ones double *pdWg1; /* seq weights 1st profile, derived from tree */ double *pdWg2; /* seq weights 2nd profile, derived from tree */ char pcm; // 0:no pseudocounts, 1:pos-specific pcs, 2:PSIBLAST pcs /* pseudo-count parameters for MAC*/ float pca; // Pseudocount matrix = (1-tau(i))*I + tau(i)*S float pcb; // tau(i) = pca/(1 + ((Neff-1)/pcb)^pcc float pcc; // float pcw; // Decrease pseudocounts for conserved columns /* gap parameters for MAC*/ float gapb; // Diversity threshold for adding pseudocounts to transitions from M state float gapd; // Gap open penalty factor for deletions float gape; // Gap extend penalty: factor to multiply hmmer values (def=1) float gapf; // factor for increasing/reducing the gap opening penalty for deletes float gapg; // factor for increasing/reducing the gap opening penalty for inserts float gaph; // factor for increasing/reducing the gap extension penalty for deletes float gapi; // factor for increasing/reducing the gap extension penalty for inserts /* pseudo-count parameters for Viterbi, FS, r226->r227 */ float pcaV; // Pseudocount matrix = (1-tau(i))*I + tau(i)*S float pcbV; // tau(i) = pca/(1 + ((Neff-1)/pcb)^pcc float pccV; // float pcwV; // Decrease pseudocounts for conserved columns /* gap parameters for Viterbi, FS, r226->r227 */ float gapbV; // Diversity threshold for adding pseudocounts to transitions from M state float gapdV; // Gap open penalty factor for deletions float gapeV; // Gap extend penalty: factor to multiply hmmer values (def=1) float gapfV; // factor for increasing/reducing the gap opening penalty for deletes float gapgV; // factor for increasing/reducing the gap opening penalty for inserts float gaphV; // factor for increasing/reducing the gap extension penalty for deletes float gapiV; // factor for increasing/reducing the gap extension penalty for inserts float egq; // penalty for end gaps when query not fully covered float egt; // penalty for end gaps when template not fully covered float neffa; // Coefficients to estimate Neff-dependent weights for HMM merging procedure float neffb; // Coefficients to estimate Neff-dependent weights for HMM merging procedure char ssgap; // 1: add secondary structure-dependent gap penalties 0:off float ssgapd; // secondary structure-dependent gap-opening penalty (per residue) float ssgape; // secondary structure-dependent gap-extension penalty (per residue) char ssgapi; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd char ssm; // SS comparison mode: 0:no ss scoring 1:ss scoring AFTER alignment 2:ss score in column score float ssw; // SS weight as compared to column score float ssa; // SS state evolution matrix M1 = (1-ssa)*I + ssa*M0 char loc; // 0: local alignment (wrt. query), 1: global alignement char forward; // 0:Viterbi algorithm 1:Forward algorithm 2: MAC char realign; // realign database hits to be displayed with MAC algorithm char altali; // find up to this many possibly overlapping alignments int columnscore; // 0: no aa comp corr 1: 1/2(qav+tav) 2: template av freqs 3: query av freqs 4:... float corr; // Weight of correlations between scores with |i-j|<=4 float shift; // Score offset for match-match states float mact; // Score threshold (negative offset) in MAC alignment char calibrate; // calibration of query HMM? 0:no, 1:yes (write lamda,mu into query profile) char calm; // derive P-values from: 0:query calibration 1:template calibration 2:both int opt; // for optimization: compare only every opt'th negative; 0: mode off int readdefaultsfile ; // read defaults file ./.hhdefaults or HOME/.hhdefaults? int min_overlap; // all cells of dyn. programming matrix with L_T-j+i or L_Q-i+j < min_overlap will be ignored int hitrank; // rank of hit to be printed as a3m alignment char notags; // neutralize His-tags, FLAG tags, C-myc tags? unsigned int maxdbstrlen; // maximum length of database string to be printed in 'Command' line of hhr file char trans; // 0: normal pairwise scoring; 1:transitive scoring float Emax_trans; // max E-value for intermediate HMMs in transitive scoring (i.e. l is intermediate HMM if E_lq, E_lk // cin, cout, cerr #include // ofstream, ifstream #include // printf #include // exit #include // clock #endif #include ///////////////////////////////////////////////////////////////////////////////////// // Arithmetics ///////////////////////////////////////////////////////////////////////////////////// //// max and min inline double dmax(double x, double y) { return (x>y? x : y);} inline double dmin(double x, double y) { return (xy? x : y);} inline int imin(int x, int y) { return (x=0? x : -x);} // Rounding up, rounding down and rounding to nearest integer inline int iceil(double x) {return int(ceil(x));} inline int ifloor(double x) {return int(floor(x));} inline int iround(double x) {return int(floor(x+0.5));} //// Generalized mean: d=0: sqrt(x*y) d=1: (x+y)/2 d->-inf: min(x,y) d->+inf: max(x,y) inline double fmean(double x, double y, double d) { return pow( (pow(x,d)+pow(y,d))/2 ,1./d);} // log base 2 inline float log2(float x) {return (x<=0? (float)(-100000):1.442695041*log(x));} inline float log10(float x) {return (x<=0? (float)(-100000):0.434294481*log(x));} ///////////////////////////////////////////////////////////////////////////////////// // fast log base 2 ///////////////////////////////////////////////////////////////////////////////////// // This function returns log2 with a max abolute deviation of +/- 1.5E-5 (typically 0.8E-5). // It takes 1.42E-8 s whereas log2(x) takes 9.5E-7 s. It is hence 9.4 times faster. // It makes use of the representation of 4-byte floating point numbers: // seee eeee emmm mmmm mmmm mmmm mmmm mmmm // s is the sign, // the following 8 bits, eee eee e, give the exponent + 127 (in hex: 0x7f). // The following 23 bits, m, give the mantisse, the binary digits behind the decimal point. // In summary: x = (-1)^s * 1.mmmmmmmmmmmmmmmmmmmmmm * 2^(eeeeeee-127) // The expression (((*(int *)&x) & 0x7f800000 ) >>23 )-0x7f is the exponent eeeeeeee, i.e. // the largest integer that is smaller than log2(x) (e.g. -1 for 0.9). *(int *)&x is an integer which // contains the bytes as the floating point variable x is represented in memory. // Check: assert( sizeof(f) == sizeof(int) ); // Check: assert( sizeof(f) == 4 ); inline float fast_log2(float x) { static float lg2[1025]; // lg2[i] = log2[1+x/1024] static float diff[1025]; // diff[i]= (lg2[i+1]-lg2[i])/8096 (for interpolation) static char initialized; if (x<=0) return -100000; if (!initialized) //First fill in the arrays lg2[i] and diff[i] { float prev = 0.0f; lg2[0] = 0.0f; for (int i=1; i<=1024; ++i) { lg2[i] = log(float(1024+i))*1.442695041-10.0f; diff[i-1] = (lg2[i]-prev)*1.2352E-4; prev = lg2[i]; } initialized=1; } int a = (((*((int *)&x)) & 0x7F800000) >>23 )-0x7f; int b = ((*((int *)&x)) & 0x007FE000) >>13; int c = ((*((int *)&x)) & 0x00001FFF); return a + lg2[b] + diff[b]*(float)(c); } ///////////////////////////////////////////////////////////////////////////////////// // fast 2^x // ATTENTION: need to compile with g++ -fno-strict-aliasing when using -O2 or -O3!!! // Relative deviation < 1.5E-4 ///////////////////////////////////////////////////////////////////////////////////// inline float fpow2(float x) { if (x>=128) return FLT_MAX; if (x<=-128) return FLT_MIN; int *px = (int*)(&x); // store address of float as pointer to long float tx = (x-0.5f) + (3<<22); // temporary value for truncation: x-0.5 is added to a large integer (3<<22) int lx = *((int*)&tx) - 0x4b400000; // integer value of x float dx = x-(float)(lx); // float remainder of x x = 1.0f + dx*(0.6960656421638072f // cubic apporoximation of 2^x + dx*(0.224494337302845f // for x in the range [0, 1] + dx*(0.07944023841053369f))); *px += (lx<<23); // add integer power of 2 to exponent return x; } ///////////////////////////////////////////////////////////////////////////////////// // ATTENTION: // Can't be used with -O2/-O3 optimization on some compilers ! // Works with g++ version 4.1, but not with 3.4, in which case it returns values // that are a factor 1.002179942 too low // // Fast pow2 routine (Johannes Soeding) // Same speed as fpow2(), but *relative* deviation < 1.2E-7 // Makes use of the binary representation of floats in memory: // x = (-1)^s * 1.mmmmmmmmmmmmmmmmmmmmmm * 2^(eeeeeee-127) // is represented as // 31 23 7654 3210 // seee eeee emmm mmmm mmmm mmmm mmmm mmmm // s is the sign, the 8 bits eee eee e are the exponent + 127 (in hex: 0x7f), // and the following 23 bits m give the mantisse. // We decompose the argument x = a + b, with integer a and 0 <= b < 1 // Therefore 2^x = 2^a * 2^b where a is the binary exponent of 2^x // and 1 <= 2^b < 2, i.e. 2^b determines the mantisse uniquely. // To calculate 2^b, we split b into the first 10 bits and the last 13 bits, // b = b' + c, and then look up the mantisse of 2^b' in a precomputed table. // We use the residual c to interpolate between the mantisse for 2^b' and 2(b'+1/1024) ///////////////////////////////////////////////////////////////////////////////////// inline float fast_pow2(float x) { if (x<=-127) return 5.9E-39; if (x>=128) return 3.4E38; static char initialized=0; static unsigned int pow2[1025]; static unsigned int diff[1025]; static int y = 0; if (!initialized) //First fill in the pow2-vector { float f; unsigned int prev = 0; pow2[0] = 0; for (int b=1; b<1024; b++) { f=pow(2.0,float(b)/1024.0); pow2[b]=(*((unsigned int *)(&f)) & 0x7FFFFF); // store the mantisse of 2^(1+b/1024) diff[b-1]=pow2[b]-prev; prev=pow2[b]; } pow2[1024]=0x7FFFFF; diff[1023]=pow2[1024]-prev; initialized=1; } int *px = (int *)(&x); // store address of float as pointer to int int E = ((*px & 0x7F800000)>>23)-127; // E is exponent of x and is <=6 unsigned int M=(*px & 0x007FFFFF) | 0x00800000; // M is the mantisse 1.mmm mmmm mmmm mmmm mmmm mmmm int a,b,c; if (x>=0) { if (E>=0) { a = 0x3F800000 + ((M<>13; c = ((M<>(-E)) & 0x007FE000)>>13; c = ((M>>(-E)) & 0x00001FFF); } } else { if (E>=0) { a = 0x3F000000 - ((M<>13; c = (0x00800000-(int)((M<>(-E)) & 0x007FFFFF)) >>13; c = (0x00800000-(int)((M>>(-E)) & 0x007FFFFF)) & 0x00001FFF; } } /* printf("x=%0X\n",*px); */ /* printf("E=%0X\n",E); */ /* printf("M=%0X\n",M); */ /* printf("a=%0X\n",a); */ /* printf("b=%0X\n",b); */ y = a | (pow2[b] + ((diff[b]*c)>>13) ); /* printf("2^x=%0X\n",*px); */ return *((float*)&y); } // Normalize a float array such that it sums to one // If it sums to 0 then assign def_array elements to array (optional) inline float NormalizeTo1(float* array, int length, float* def_array=NULL) { float sum=0.0f; int k; for (k=0; k= w-neg-1 || -log10val > 3) { // positive exponential 1.234E+06 // negative exponential 1.234E-06 int d = w-6-neg; sprintf(str,"%*.*e",w,d<1?1:d,val); } else { int d = log10val>0? w-2-neg-int(log10val): w-2-neg; sprintf(str,"%#*.*f",w,d,val); } return str; } ///////////////////////////////////////////////////////////////////////////////////// // String utilities ///////////////////////////////////////////////////////////////////////////////////// //the integer. If no integer is found, returns INT_MIN and sets ptr to NULL /* MR1 */ inline int strtoi(const char*& ptr) { int i; const char* ptr0=ptr; if (!ptr) return INT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9')) ptr++; if (*ptr=='\0') { ptr=0; return INT_MIN; } if (*(ptr-1)=='-' && ptr>ptr0) i=-atoi(ptr); else i=atoi(ptr); while (*ptr>='0' && *ptr<='9') ptr++; return i; } //Same as strint, but interpretes '*' as default /* MR1 */ inline int strtoi_(const char*& ptr, int deflt=INT_MAX) { int i; if (!ptr) return INT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9') && *ptr!='*') ptr++; if (*ptr=='\0') { ptr=0; return INT_MIN; } if (*ptr=='*') { ptr++; return deflt; } if (*(ptr-1)=='-') i=atoi(ptr-1); else i=atoi(ptr); while (*ptr>='0' && *ptr<='9') ptr++; return i; } // Returns leftmost integer in ptr and sets the pointer to first char after // the integer. If no integer is found, returns INT_MIN and sets pt to NULL int strint(char*& ptr) { int i; char* ptr0=ptr; if (!ptr) return INT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9')) ptr++; if (*ptr=='\0') { ptr=0; return INT_MIN; } if (*(ptr-1)=='-' && ptr>ptr0) i=-atoi(ptr); else i=atoi(ptr); while (*ptr>='0' && *ptr<='9') ptr++; return i; } // Same as strint, but interpretes '*' as default int strinta(char*& ptr, int deflt=99999) { int i; if (!ptr) return INT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9') && *ptr!='*') ptr++; if (*ptr=='\0') { ptr=0; return INT_MIN; } if (*ptr=='*') { ptr++; return deflt; } if (*(ptr-1)=='-') i=atoi(ptr-1); else i=atoi(ptr); while (*ptr>='0' && *ptr<='9') ptr++; return i; } // Returns leftmost float in ptr and sets the pointer to first char after // the float. If no float is found, returns FLT_MIN and sets pt to NULL /* MR1 */ float strflt(char*& ptr) { float i; char* ptr0=ptr; if (!ptr) return FLT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9')) ptr++; if (*ptr=='\0') { ptr=0; return FLT_MIN; } if (ptr>ptr0 && *(ptr-1)=='-') i=-atof(ptr); else i=atof(ptr); while ((*ptr>='0' && *ptr<='9') || *ptr=='.') ptr++; return i; } // Same as strint, but interpretes '*' as default /* MR1 */ float strflta(char*& ptr, float deflt=99999) { float i; if (!ptr) return FLT_MIN; while (*ptr!='\0' && !(*ptr>='0' && *ptr<='9') && *ptr!='*') ptr++; if (*ptr=='\0') { ptr=0; return FLT_MIN; } if (*ptr=='*') { ptr++; return deflt; } if (*(ptr-1)=='-') i=-atof(ptr); else i=atof(ptr); while ((*ptr>='0' && *ptr<='9') || *ptr=='.') ptr++; return i; } // Removes the newline and other control characters at the end of a string (if present) // and returns the new length of the string (-1 if str is NULL) inline int chomp(char str[]) { if (!str) return -1; int l=0; for (l=strlen(str)-1; l>=0 && str[l]<32; l--); str[++l]='\0'; return l; } // Emulates the ifstream::getline method; similar to fgets(str,maxlen,FILE*), // but removes the newline at the end and returns NULL if at end of file or read error inline char* fgetline(char str[], const int maxlen, FILE* file) { if (!fgets(str,maxlen,file)) return NULL; if (chomp(str)+1>=maxlen) // if line is cut after maxlen characters... while (fgetc(file)!='\n'); // ... read in rest of line return(str); } // copies substring str[a,b] into substr and returns substr char *substr(char* substr, char* str, int a, int b) { if (b1000) {printf("Function substr: >1000 chars to copy. Exiting.\n"); exit(6);} char* dest=substr; char* source=str+a; char* send=str+b; while (*source!='\0' && source<=send) *(dest++) = *(source++); *dest='\0'; return substr; } // Returns pointer to first non-white-space character in str OR to NULL if none found inline char* strscn(char* str) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr<=32) ptr++; return (*ptr=='\0')? NULL: ptr; } // Returns pointer to first white-space character in str OR to NULL if none found /* MR1 */ inline char* strscn_ws(char* str) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr>32) ptr++; return (*ptr=='\0')? NULL: ptr; } //Returns pointer to first non-white-space character in str OR to NULL if none found /* MR1 */ inline const char* strscn_c(const char* str) { if (!str) return NULL; const char* ptr=str; while (*ptr!='\0' && isspace(*ptr)) ptr++; return (*ptr=='\0') ? NULL : ptr; } // Returns pointer to first non-white-space character in str OR to end of string '\0' if none found inline char* strscn_(char* str) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr<=32) ptr++; return ptr; } // Returns pointer to first non-c character in str OR to NULL if none found inline char* strscn(char* str, const char c) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr==c) ptr++; return (*ptr=='\0')? NULL: ptr; } // Returns pointer to first non-c character in str OR to end of string '\0' if none found inline char* strscn_(char* str, const char c) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr==c) ptr++; return ptr; } // Cuts string at first white space character found by overwriting it with '\0'. // Returns pointer to next non-white-space char OR to NULL if no such char found inline char* strcut(char* str) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr>32) ptr++; if (*ptr=='\0') return NULL; *ptr='\0'; ptr++; while (*ptr!='\0' && *ptr<=32) ptr++; return (*ptr=='\0')? NULL:ptr; } // Cuts string at first white space character found by overwriting it with '\0'. // Returns pointer to next non-white-space char OR to end of string '\0' if none found inline char* strcut_(char* str) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr>32) ptr++; if (*ptr=='\0') return ptr; *ptr='\0'; ptr++; while (*ptr!='\0' && *ptr<=32) ptr++; return ptr; } // Cuts string at first occurence of charcter c, by overwriting it with '\0'. // Returns pointer to next char not equal c, OR to NULL if none found inline char* strcut(char* str, const char c) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr!=c) ptr++; if (*ptr=='\0') return NULL; *ptr='\0'; ptr++; while (*ptr!='\0' && *ptr==c) ptr++; return (*ptr=='\0')? NULL:ptr; } // Cuts string at first occurence of charcter c, by overwriting it with '\0'. // Returns pointer to next char not equal c, OR to end of string '\0' if none found inline char* strcut_(char* str, const char c) { if (!str) return NULL; char* ptr=str; while (*ptr!='\0' && *ptr!=c) ptr++; if (*ptr=='\0') return ptr; *ptr='\0'; ptr++; while (*ptr!='\0' && *ptr==c) ptr++; return ptr; } // Cuts string at first occurence of substr, by overwriting the first letter with '\0'. // Returns pointer to next char after occurence of substr, OR to NULL if no such char found inline char* strcut(char* str, const char* substr) { char* ptr; //present location in str being compared to substr const char* sptr=substr; //present location in substr being compared to substr // while not at end of str and not all of substr is matched yet while (1) { for (ptr=str, sptr=substr; *ptr==*sptr && *ptr!='\0'; ptr++, sptr++) ; if (*sptr=='\0') {*str='\0'; return ptr;} if (*ptr=='\0') return NULL; str++; } } // Cuts string at first occurence of substr, by overwriting the first letter with '\0'. // Returns pointer to next char after occurence of substr, OR to end of string '\0' if no such char found inline char* strcut_(char* str, const char* substr) { char* ptr; //present location in str being compared to substr const char* sptr=substr; //present location in substr being compared to str // while not at end of str and not all of substr is matched yet while (1) { for (ptr=str, sptr=substr; *ptr==*sptr && *ptr!='\0'; ptr++, sptr++) ; if (*sptr=='\0') {*str='\0'; return ptr;} if (*ptr=='\0') return ptr; str++; } } // Copies first word in ptr to str. In other words, copies first block of non whitespace characters, // beginning at ptr, to str. If a word is found, returns address of second word in ptr or, if no second // word is found, returns address to end of word ('\0' character) in ptr string. If no word is found // in ptr NULL is returned. inline char* strwrd(char* str, char* ptr) { ptr=strscn(ptr); // advance to beginning of next word if (ptr) { while (*ptr!='\0' && *ptr>32) *(str++) = *(ptr++); *str='\0'; while (*ptr!='\0' && *ptr<=32) ptr++; return ptr; } else return NULL; } // Copies first word ***delimited by char c*** in ptr to str. In other words, copies first block of non-c characters, // beginning at ptr, to str. If a word is found, returns address of second word in ptr or, if no second // word is found, returns address to end of word ('\0' character) in ptr string. If no word is found // in ptr NULL is returned. inline char* strwrd(char* str, char* ptr, const char c) { ptr=strscn(ptr,c); // advance to beginning of next word if (ptr) { while (*ptr!='\0' && *ptr!=c) *(str++) = *(ptr++); *str='\0'; while (*ptr!='\0' && *ptr==c) ptr++; return ptr; } else return NULL; } // Similar to Perl's tr/abc/ABC/: Replaces all chars in str found in one list with characters from the second list // Returns the number of replaced charactrs int strtr(char* str, const char oldchars[], const char newchars[]) { char* ptr; const char *plist; int ntr=0; for (ptr=str; *ptr!='\0'; ptr++) for (plist=oldchars; *plist!='\0'; plist++) if (*ptr==*plist) { *ptr=newchars[plist-oldchars]; ntr++; break; } return ntr; } // Similar to Perl's tr/abc//d: deletes all chars in str found in the list // Returns number of removed characters int strtrd(char* str, const char chars[]) { char* ptr0=str; char* ptr1=str; const char *plist; while (*ptr1!='\0') { for (plist=chars; *plist!='\0'; plist++) if (*ptr1==*plist) break; if (*plist=='\0') {*ptr0=*ptr1; ptr0++;} ptr1++; } return ptr1-ptr0; } // Similar to Perl's tr/a-z//d: deletes all chars in str found in the list // Returns number of removed characters int strtrd(char* str, char char1, char char2) { char* ptr0=str; char* ptr1=str; while (*ptr1!='\0') { if (*ptr1>=char1 && *ptr1<=char2) {*ptr0=*ptr1; ptr0++;} ptr1++; } return ptr1-ptr0; } // transforms str into an all uppercase string char* uprstr(char* str) { char* s=str; while (*s !='\0') {if (*s>='a' && *s<='z') *s+='A'-'a';s++;} return(str); } // transforms str into an all uppercase string char* lwrstr(char* str) { char* s=str; while (*s !='\0') {if (*s>='A' && *s<='Z') *s+='a'-'A'; s++;} return(str); } // transforms chr into an uppercase character inline char uprchr(char chr) { return (chr>='a' && chr<='z')? chr+'A'-'a' : chr; } // transforms chr into an lowercase character inline char lwrchr(char chr) { return (chr>='A' && chr<='Z')? chr-'A'+'a' : chr; } // Replaces first occurence of str1 by str2 in str. Returns pointer to first occurence or NULL if not found // ATTENTION: if str2 is longer than str1, allocated memory of str must be long enough!! inline char* strsubst(char* str, const char str1[], const char str2[]) { char* ptr = strstr(str,str1); strcpy(ptr,str2); return ptr; } // Gives elapsed time since first call to this function inline void ElapsedTimeSinceFirstCall(const char str[]) { timeval t; static double tfirst=0; if (tfirst==0) { gettimeofday(&t, NULL); tfirst = 1E-6*t.tv_usec + t.tv_sec; } gettimeofday(&t, NULL); printf("Elapsed time since first call:%12.3fs %s\n",1E-6*t.tv_usec + t.tv_sec - tfirst,str); } // Gives elapsed time since last call to this function inline void ElapsedTimeSinceLastCall(const char str[]) { timeval t; static double tlast=0.0; if (tlast==0.0) { gettimeofday(&t, NULL); tlast = 1.0E-6*t.tv_usec + t.tv_sec; } gettimeofday(&t, NULL); printf("Elapsed time since last call:%12.3fs %s\n",1.0E-6*t.tv_usec + t.tv_sec - tlast,str); tlast = 1.0E-6*t.tv_usec + t.tv_sec; } inline char* RemovePath(char outname[], char filename[]) { char* ptr; #ifdef WINDOWS ptr=strrchr(filename,92); //return adress for LAST \ (backslash) in name #else ptr=strrchr(filename,'/'); //return adress for LAST / in name #endif if (!ptr) ptr=filename; else ptr++; strcpy(outname,ptr); return outname; } inline char* RemoveExtension(char outname[], char filename[]) { char *ptr1; ptr1=strrchr(filename,'.'); //return adress for LAST '.' in name if (ptr1) {*ptr1='\0'; strcpy(outname,filename); *ptr1='.';} else strcpy(outname,filename); return outname; } inline char* RemovePathAndExtension(char outname[], char filename[]) { char *ptr, *ptr1; #ifdef WINDOWS ptr=strrchr(filename,92); //return adress for LAST \ (backslash) in name #else ptr=strrchr(filename,'/'); //return adress for LAST / in name #endif if (!ptr) ptr=filename; else ptr++; ptr1=strrchr(filename,'.'); //return adress for LAST '.' in name if (ptr1) {*ptr1='\0'; strcpy(outname,ptr); *ptr1='.';} else strcpy(outname,ptr); return outname; } inline char* Extension(char extension[], char filename[]) { char* ptr; ptr=strrchr(filename,'.'); //return adress for LAST '.' in name if (ptr) strcpy(extension,ptr+1); else *extension='\0'; return extension; } // Path includes last '/' inline char* Pathname(char pathname[], char filename[]) { char* ptr; char chr; #ifdef WINDOWS ptr=strrchr(filename,92); //return adress for LAST \ (backslash) in name #else ptr=strrchr(filename,'/'); //return adress for LAST / in name #endif if (ptr) {chr=*(++ptr); *ptr='\0'; strcpy(pathname,filename); *ptr=chr;} else *pathname='\0'; return pathname; } // Swaps two integer elements in array k inline void swapi(int k[], int i, int j) { int temp; temp=k[i]; k[i]=k[j]; k[j]=temp; } // QSort sorting routine. time complexity of O(N ln(N)) on average // Sorts the index array k between elements i='left' and i='right' in such a way that afterwards // v[k[i]] is sorted downwards (up=-1) or upwards (up=+1) void QSortInt(int v[], int k[], int left, int right, int up=+1) { int i; int last; // last element to have been swapped if (left>=right) return; // do nothing if less then 2 elements to sort // Put pivot element in the middle of the sort range to the side (to position 'left') ... swapi(k,left,(left+right)/2); last=left; // ... and swap all elements i SMALLER than the pivot // with an element that is LARGER than the pivot (element last+1): if (up==1) { for (i=left+1; i<=right; i++) if (v[k[i]]v[k[left]]) swapi(k,++last,i); // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER swapi(k,left,last); // Sort the elements left from the pivot and right from the pivot QSortInt(v,k,left,last-1,up); QSortInt(v,k,last+1,right,up); } // QSort sorting routine. time complexity of O(N ln(N)) on average // Sorts the index array k between elements i='left' and i='right' in such a way that afterwards // v[k[i]] is sorted downwards (up=-1) or upwards (up=+1) void QSortFloat(float v[], int k[], int left, int right, int up=+1) { int i; int last; // last element to have been swapped void swapi(int k[], int i, int j); if (left>=right) return; // do nothing if less then 2 elements to sort // Put pivot element in the middle of the sort range to the side (to position 'left') ... swapi(k,left,(left+right)/2); last=left; // ... and swap all elements i SMALLER than the pivot // with an element that is LARGER than the pivot (element last+1): if (up==1) { for (i=left+1; i<=right; i++) if (v[k[i]]v[k[left]]) swapi(k,++last,i); // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER swapi(k,left,last); // Sort the elements left from the pivot and right from the pivot QSortFloat(v,k,left,last-1,up); QSortFloat(v,k,last+1,right,up); } /** * @brief comparison function for qsort, * sorts floating point numbers ascendingly * * @param cv1 ponter to 1st entry to be sorted * @param cv2 ponter to 2nd entry to be sorted * * @return 0 if entries are equal, * +/-1 if 1st greater/smaller than 2nd */ int CompFltAsc(const void *cv1, const void *cv2){ float f1 = *(float *)cv1; float f2 = *(float *)cv2; if (f1 > f2) { return +1; } else if (f1 < f2) { return -1; } else { return 0; } } /* this is the end of CompFltAsc() */ //Return random number in the range [0,1] inline float frand() { return rand()/(RAND_MAX+1.0); } ///////////////////////////////////////////////////////////////////////////////////// //// Execute system command ///////////////////////////////////////////////////////////////////////////////////// void runSystem(std::string cmd, int v = 2) { if (v>2) cout << "Command: " << cmd << "!\n"; int res = system(cmd.c_str()); if (res!=0) { cerr << endl << "ERROR when executing: " << cmd << "!\n"; exit(1); } } clustal-omega-1.2.1/src/hhalign/hhhalfalignment-C.h0000644000175100017510000003032311544137515017065 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhhalfalignment-C.h 227 2011-03-28 17:03:09Z fabian $ */ // hhfullalignment.C #ifndef MAIN #define MAIN #include // cin, cout, cerr #include // ofstream, ifstream #include // printf #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // clock #include // islower, isdigit etc using std::ios; using std::ifstream; using std::ofstream; using std::cout; using std::cerr; using std::endl; #include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "list.h" // list data structure #include "hash.h" // hash data structure #include "hhdecl-C.h" // constants, class #include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "hhhmm.h" // class HMM #include "hhalignment.h" // class Alignment #include "hhhit.h" #endif ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Methods of class HalfAlignment ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Constructor HalfAlignment::HalfAlignment(int maxseqdis) { n=0; sname=seq=NULL; nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1; h = new(int[maxseqdis]); //h[k] = next position of sequence k to be written s = new(char*[maxseqdis]); //s[k][h] = character in column h, sequence k of output alignment l = new(int*[maxseqdis]); //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k m = new(int*[maxseqdis]); //counts positions: m[k][i] = position of match state i in string seq[k] } ///////////////////////////////////////////////////////////////////////////////////// // Destructor HalfAlignment::~HalfAlignment() { Unset(); delete[] h; h = NULL; delete[] s; s = NULL; delete[] l; l = NULL; delete[] m; m = NULL; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Free memory in HalfAlignment arrays s[][], l[][], and m[][] */ void HalfAlignment::Unset() { // Free memory for alignment characters and residue counts for (int k=0; k=5) { printf(" i chr m l\n"); for(i=0;i<=L+1;i++) printf("%3i %1c %3i %3i\n",i,seq[0][m[0][i]],m[0][i],l[0][i]); printf("\n"); } } /*** end HalfAlignment::Set() ***/ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Fill in insert states following match state i (without inserting '.' to fill up) */ void HalfAlignment::AddInserts(int i) { for (int k=0; k'9')) s[k][h[k]++]=InsertChr(c); pos++; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Remove all characters c from template sequences */ void HalfAlignment::RemoveChars(char c) { int k,h,hh; for (k=0; k=1; step--) { state = hit.states[step]; i = hit.i[step]; switch(state) { case MM: //MM pair state (both query and template in Match state) AddColumn(i); AddInserts(i); break; case DG: //D- state case MI: //MI state AddColumnAsInsert(i); AddInserts(i); break; case GD: //-D state case IM: //IM state AddChar('-'); break; } if (par.outformat<=2) FillUpGaps(); } if(0) { //par.loc==0) { //////////////////////////////////////////// STILL NEEDED?? // If in global mode: Add part of alignment after last MM state for (i=hit.i[1]+1; i<=L; i++) { AddColumnAsInsert(i); AddInserts(i); if (par.outformat==2) FillUpGaps(); } } // Add endgaps for (j=hit.j[1]+1; j<=hit.L; j++) { AddChar('-'); } // Add end-of-string character AddChar('\0'); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Write the a2m/a3m alignment into alnfile */ void HalfAlignment::Print(char* alnfile) { int k; //counts sequences int omitted=0; // counts number of sequences with no residues in match states FILE *outf; if (strcmp(alnfile,"stdout")) { if (par.append) outf=fopen(alnfile,"a"); else outf=fopen(alnfile,"w"); if (!outf) OpenFileError(alnfile); } else outf = stdout; if (v>=3) cout<<"Writing alignment to "<%s\n",sname[k]); fprintf(outf,"%s\n",s[k]); } else { omitted++; if (v>=3) printf("%-14.14s contains no residue in match state. Omitting sequence\n",sname[k]); } } if (v>=2 && omitted) printf("Omitted %i sequences in %s which contained no residue in match state\n",omitted,alnfile); fclose(outf); } /** EOF hhhalfalignment-C.h **/ clustal-omega-1.2.1/src/hhalign/hhfullalignment-C.h0000644000175100017510000005063312156044404017115 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhfullalignment-C.h 284 2013-06-12 10:10:11Z fabian $ */ // hhfullalignment.C #ifndef MAIN #define MAIN #include // cin, cout, cerr #include // ofstream, ifstream #include // printf #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // clock #include // islower, isdigit etc using std::ios; using std::ifstream; using std::ofstream; using std::cout; using std::cerr; using std::endl; #include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "list.h" // list data structure #include "hash.h" // hash data structure #include "hhdecl-C.h" // constants, class #include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "hhhmm.h" // class HMM #include "hhalignment.h" // class Alignment #include "hhhit.h" #include "hhhalfalignment.h" #endif ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Methods of class FullAlignment ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Output Results: use classes HalfAlignment and FullAlignment // // Example: // Each column list contains at least a match state // Insert states between the match states are omitted // // step 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 // i 0 0 1 2 3 4 5 6 7 8 9 9 9 9 10 11 12 13 14 // // Q ~ ~ X X X X X X X X X ~ ~ ~ X X X X X // T Y Y Y Y Y Y Y Y ~ Y Y Y Y Y Y Y Y ~ ~ // // j 7 8 9 10 11 12 13 14 14 15 16 17 18 19 20 21 22 22 22 // state IM IM MM MM MM MM MM MM DG MM MM GD GD GD MM MM MM MI MI // // nsteps=19 // ////////////////////////////////////////////////////////////////////////////// // Constructor FullAlignment::FullAlignment(int maxseqdis) { qa = new HalfAlignment(maxseqdis); ta = new HalfAlignment(maxseqdis); for (int h=0; hUnset(); ta->Unset(); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Add columns for match (and delete) states. */ void FullAlignment::AddColumns(int i, int j, char prev_state, char state, float S) { switch(state) { case MM: //MM pair state (both query and template in Match state) AddGaps(); //fill up gaps until query and template parts have same length symbol[qa->pos] =ScoreChr(S); qa->AddColumn(i); ta->AddColumn(j); qa->AddInsertsAndFillUpGaps(i); ta->AddInsertsAndFillUpGaps(j); break; case GD: //-D state if (prev_state==DG) AddGaps(); symbol[ta->pos]='Q'; ta->AddColumn(j); //query has gap -> add nothing ta->AddInsertsAndFillUpGaps(j); break; case IM: //IM state if (prev_state==MI) AddGaps(); symbol[ta->pos]='Q'; ta->AddColumn(j); //query has gap -> add nothing ta->AddInsertsAndFillUpGaps(j); break; case DG: //D- state if (prev_state==GD) AddGaps(); symbol[qa->pos]='T'; qa->AddColumn(i);//template has gap -> add nothing qa->AddInsertsAndFillUpGaps(i); break; case MI: //MI state if (prev_state==IM) AddGaps(); symbol[qa->pos]='T'; qa->AddColumn(i);//template has gap -> add nothing qa->AddInsertsAndFillUpGaps(i); break; } } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Fill up gaps until query and template parts have same length */ void FullAlignment::AddGaps() { while (qa->pospos) qa->AddChar('.'); while (ta->pospos) ta->AddChar('.'); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Build full alignment -> qa->s[k][h] and ta->s[k][h] */ int FullAlignment::Build(HMM& q, Hit& hit, char zcError[]) { int step; char prev_state=MM, state=MM; int n; int hh; int k; identities=0; // number of identical residues in query and template sequence score_sim=0.0f;// substitution matrix similarity score between query and template ClearSymbols(); // Set up half-alignments // n is the sequence index up to which sequences are prepared for display n = imin( q.n_display,par.nseqdis+( q.nss_dssp>=0)+( q.nsa_dssp>=0)+( q.nss_pred>=0)+( q.nss_conf>=0)+( q.ncons>=0)); qa->Set( q.name, q.seq, q.sname, n, q.L, q.nss_dssp , q.nss_pred , q.nss_conf, q.nsa_dssp, q.ncons, hit.L/*<--FS*/); n = imin(hit.n_display,par.nseqdis+(hit.nss_dssp>=0)+(hit.nsa_dssp>=0)+(hit.nss_pred>=0)+(hit.nss_conf>=0)+(hit.ncons>=0)); ta->Set(hit.name,hit.seq,hit.sname, n,hit.L,hit.nss_dssp,hit.nss_pred,hit.nss_conf,hit.nsa_dssp, hit.ncons, q.L/*<--FS*/); // printf("HMM: %s\nstep nst i j state hq ht\n",hit.name); #ifdef CLUSTALO if ((1 == hit.i1) && (1 == hit.j1)){ /* do nothing */ } else if ((1 == hit.i1) && (1 != hit.j1)){ for (int j = 1; j < hit.j1; j++){ AddColumns(0, j, MM, IM, 0.0); } if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int iK, iL; printf("%d: j1=%d -> temp has leading gaps\n", __LINE__, hit.j1); for (iK = 0; iK < ta->n; iK++){ //printf("T%d: %s\n", iK, ta->s[iK]); for (iL = 0; iL < hit.j1; iL++){ ta->s[iK][iL] = tolower(ta->s[iK][iL]); } } } } else if ((1 != hit.i1) && (1 == hit.j1)){ for (int i = 1; i < hit.i1; i++){ AddColumns(i, 0, MM, MI, 0.0); } if (rLog.iLogLevelEnabled <= LOG_DEBUG){ FILE *fp = rLog.prFP[LOG_DEBUG]; fprintf(fp, "%d: i1=%d -> query has leading gaps\n", __LINE__, hit.i1); int iK, iL; for (iK = 0; iK < qa->n; iK++){ //printf("Q%d: %s\n", iK, qa->s[iK]); for (iL = 0; iL < hit.i1; iL++){ qa->s[iK][iL] = tolower(qa->s[iK][iL]); } } } } else { sprintf(zcError, "+-------------------------------+\n" "| both sequences truncated left |\n" "+-------------------------------+\n" "i1 = %d, j1 = %d\n", hit.i1, hit.j1); return FAILURE; /* FS, r241 -> r243 */ } #endif for (step=hit.nsteps; step>=1; step--) { prev_state = state; state = hit.states[step]; // Add column to alignment and compute identities and sequence-sequence similarity score AddColumns(hit.i[step],hit.j[step],prev_state,state,hit.S[step]); if (state==MM) { char qc=qa->seq[ q.nfirst][ qa->m[ q.nfirst][hit.i[step]] ]; char tc=ta->seq[hit.nfirst][ ta->m[hit.nfirst][hit.j[step]] ]; if (qc==tc) identities++; // count identical amino acids score_sim += S[(int)aa2i(qc)][(int)aa2i(tc)]; // fprintf(stderr,"%3i %3i %3i %3i %3i %1c %1c %6.2f %6.2f %6.2f %6.2f \n",step,hit.nsteps,hit.i[step],hit.j[step],int(state),qc,tc,S[(int)aa2i(qc)][(int)aa2i(tc)],score_sim,hit.P_posterior[step],hit.sum_of_probs); //DEBUG } } #ifdef CLUSTALO if ((qa->L == hit.i2) && (ta->L == hit.j2)){ /* do nothing */ } else if ((qa->L == hit.i2) && (ta->L != hit.j2)){ for (int j = hit.j2+1; j <= ta->L; j++){ AddColumns(0, j, MM, IM, 0.0); } if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int iK; unsigned int uiL; FILE *fp = rLog.prFP[LOG_DEBUG]; fprintf(fp, "%d: j2=%d (%d) -> temp has trailing gaps\n", __LINE__, hit.j2, ta->L); for (iK = 0; iK < ta->n; iK++){ //printf("T%d: %s\n", iK, ta->s[iK]+strlen(ta->s[iK])-(ta->L-hit.j2)); for (uiL = strlen(ta->s[iK])-(ta->L-hit.j2); uiL < strlen(ta->s[iK]); uiL++){ ta->s[iK][uiL] = tolower(ta->s[iK][uiL]); } } } } else if ((qa->L != hit.i2) && (ta->L == hit.j2)){ for (int i = hit.i2+1; i <= qa->L; i++){ AddColumns(i, 0, MM, MI, 0.0); } if (rLog.iLogLevelEnabled <= LOG_DEBUG){ int iK; unsigned int uiL; printf("%d: i2=%d (%d)-> query has trailing gaps\n", __LINE__, hit.i2, qa->L); for (iK = 0; iK < qa->n; iK++){ //printf("Q%d: %s\n", iK, qa->s[iK]+strlen(qa->s[iK])-(qa->L-hit.i2)); for (uiL = strlen(qa->s[iK])-(qa->L-hit.i2); uiL < strlen(qa->s[iK]); uiL++){ qa->s[iK][uiL] = tolower(qa->s[iK][uiL]); } } } } else{ sprintf(zcError, "+--------------------------------+\n" "| both sequences truncated right |\n" "+--------------------------------+\n" "i2 = %d != %d = qa->L, j2 = %d != %d = ta->L\n", hit.i2, qa->L, hit.j2, ta->L); return FAILURE; /* FS, r241 -> r243 */ } #endif AddGaps(); //fill up gaps until query and template parts have same length qa->AddChar('\0'); ta->AddChar('\0'); // Change gap symbol '.' (gap aligned to insert) to '~' if one HMM has gap with respect to other HMM for (hh=1; hhpos; hh++) { if (symbol[hh]=='Q') { // Gap in query (IM or GD state) symbol[hh]=' '; for (k=0; kn; k++) if (qa->s[k][hh]=='.') qa->s[k][hh]='-'; } else if (symbol[hh]=='T') { // Gap in target (MI or DG state) symbol[hh]=' '; for (k=0; kn; k++) if (ta->s[k][hh]=='.') ta->s[k][hh]='-'; } } return OK; } /* this is the end of FullAlignment::Build() */ ////////////////////////////////////////////////////////////////////////////// /** * @brief Print out header before full alignment */ void FullAlignment::PrintHeader(FILE* outf, HMM& q, Hit& hit) { fprintf(outf,">%s\n",hit.longname); fprintf(outf,"Probab=%-.2f E-value=%-.2g Score=%-.2f Aligned_cols=%i Identities=%i%% Similarity=%-.3f Sum_probs=%.1f\n\n", hit.Probab,hit.Eval,hit.score,hit.matched_cols,iround(100.0*identities/hit.matched_cols),score_sim/hit.matched_cols,hit.sum_of_probs); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Print out full alignment in HHR format */ void FullAlignment::PrintHHR(FILE* outf, Hit& hit) { const int NLEN=14; //Length of name field in front of multiple alignment int h=0; //counts position (column) in alignment int hh=0; //points to column at start of present output block of alignment int k; //counts sequences in query and template //short unsigned int lq[MAXSEQ]; // lq[k] counts index of residue from query sequence k to be printed next; short unsigned int *lq = NULL; // lq[k] counts index of residue from query sequence k to be printed next; //short unsigned int lt[MAXSEQ]; // lt[k] counts index of residue from template sequence k to be printed next; short unsigned int *lt = NULL; // lt[k] counts index of residue from template sequence k to be printed next; char namestr[NAMELEN]; //name of sequence int iq=hit.i1; // match state counter for query HMM (displayed in consensus line) int jt=hit.j1; // match state counter for template HMM (displayed in consensus line) lq = new(short unsigned int[qa->n+2]); lt = new(short unsigned int[ta->n+2]); for (k=0; kn; k++) lq[k]=qa->l[k][hit.i1]; for (k=0; kn; k++) lt[k]=ta->l[k][hit.j1]; while (hhpos-1) // print alignment block { // Print query secondary structure sequences for (k=0; kn; k++) { if (k==qa->nsa_dssp) continue; if (!(k==qa->nss_dssp || k==qa->nsa_dssp || k==qa->nss_pred || k==qa->nss_conf)) continue; if (k==qa->nss_dssp && !par.showdssp) continue; if ((k==qa->nss_pred || k==qa->nss_conf) && !par.showpred) continue; strncpy(namestr,qa->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"Q %-*.*s ",NLEN,NLEN,namestr); for (h=hh; hpos-1); h++) fprintf(outf,"%1c",qa->s[k][h]); fprintf(outf,"\n"); } // Print query sequences for (k=0; kn; k++) { if (k==qa->nss_dssp || k==qa->nsa_dssp || k==qa->nss_pred || k==qa->nss_conf || k==qa->ncons) continue; strncpy(namestr,qa->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"Q %-*.*s %4i ",NLEN,NLEN,namestr,lq[k]); for (h=hh; hpos-1); h++) {fprintf(outf,"%1c",qa->s[k][h]); lq[k]+=WordChr(qa->s[k][h]);} //WordChr() returns 1 if a-z or A-Z; 0 otherwise fprintf(outf," %4i (%i)\n",lq[k]-1,qa->l[k][qa->L+1]); } // Print query consensus sequence if (par.showcons && qa->ncons>=0) { k=qa->ncons; strncpy(namestr,qa->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"Q %-*.*s %4i ",NLEN,NLEN,namestr,iq); for (h=hh; hpos-1); h++) { if (qa->s[k][h]=='x') qa->s[k][h]='~'; if (qa->s[k][h]!='-' && qa->s[k][h]!='.') iq++; fprintf(outf,"%1c",qa->s[k][h]); } fprintf(outf," %4i (%i)\n",iq-1,qa->L); } // Print symbols representing the score fprintf(outf," %*.*s ",NLEN,NLEN," "); for (h=hh; hpos-1); h++) fprintf(outf,"%1c",symbol[h]); fprintf(outf,"\n"); // Print template consensus sequence if (par.showcons && ta->ncons>=0) { k=ta->ncons; strncpy(namestr,ta->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"T %-*.*s %4i ",NLEN,NLEN,namestr,jt); for (h=hh; hpos-1); h++) { if (ta->s[k][h]=='x') ta->s[k][h]='~'; if (ta->s[k][h]!='-' && ta->s[k][h]!='.') jt++; fprintf(outf,"%1c",ta->s[k][h]); } fprintf(outf," %4i (%i)\n",jt-1,ta->L); } // Print template sequences for (k=0; kn; k++) { if (k==ta->nss_dssp || k==ta->nsa_dssp || k==ta->nss_pred || k==ta->nss_conf || k==ta->ncons) continue; strncpy(namestr,ta->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"T %-*.*s %4i ",NLEN,NLEN,namestr,lt[k]); for (h=hh; hpos-1); h++) {fprintf(outf,"%1c",ta->s[k][h]); lt[k]+=WordChr(ta->s[k][h]);} //WordChr() returns 1 if a-z or A-Z; 0 otherwise fprintf(outf," %4i (%i)\n",lt[k]-1,ta->l[k][ta->L+1]); } // Print template secondary structure sequences for (k=0; kn; k++) { if (k==ta->nsa_dssp) continue; if (!(k==ta->nss_dssp || k==ta->nss_pred || k==ta->nss_conf)) continue; if (k==ta->nss_dssp && !par.showdssp) continue; if ((k==ta->nss_pred || k==ta->nss_conf)&& !par.showpred) continue; strncpy(namestr,ta->sname[k],NAMELEN-2); namestr[NAMELEN-1]='\0'; strcut(namestr); fprintf(outf,"T %-*.*s ",NLEN,NLEN,namestr); for (h=hh; hpos-1); h++) fprintf(outf,"%1c",ta->s[k][h]); fprintf(outf,"\n"); } hh=h; fprintf(outf,"\n\n"); } delete[](lq); lq = NULL; delete[](lt); lt = NULL; } /* this is the rnd of PrintHHR() */ ////////////////////////////////////////////////////////////////////////////// // Print out full alignment in A2M format ////////////////////////////////////////////////////////////////////////////// #define TELOMER_PRINT 0 void FullAlignment::PrintA2M(FILE* outf, Hit& hit) { int k; //counts sequences in query and template int h,hh; #if TELOMER_PRINT int iTelomerLeft = hit.i1 - hit.j1; int iTelomerRght = (qa->L - hit.i2) - (ta->L - hit.j2); #endif // Print query sequences for (k=0; kn; k++) { if (k==qa->nsa_dssp) continue; if (k==qa->nss_dssp && !par.showdssp) continue; if ((k==qa->nss_pred || k==qa->nss_conf) && !par.showpred) continue; if (k==qa->ncons && !par.showcons) continue; fprintf(outf,">%s\n",qa->sname[k]); #if TELOMER_PRINT /* @ */ if (iTelomerLeft > 0){ for (int iI = 1; iI <= iTelomerLeft; iI++){ fprintf(outf, "%1c", qa->seq[k][iI]); } /* this may be unnecessary */ for (int iI = iTelomerLeft+1; iI < hit.i1; iI++){ fprintf(outf, "%1c", qa->seq[k][iI]); } } else { for (int iI = iTelomerLeft; iI < 0; iI++){ fprintf(outf, "%1c", '-'); } /* this may be unnecessary */ /* think about it */ } /* @ */ for (h = 0; qa->s[k][h] > 0; h++){ fprintf(outf, "%1c", qa->s[k][h]); } /* @ */ for (int iI = hit.i2+1; iI <= qa->L; iI++){ fprintf(outf, "%1c", qa->seq[k][iI]); } for (int iI = 0; iI > iTelomerRght; iI--){ fprintf(outf, "%1c", '-'); } #else for (h=0,hh=-par.aliwidth; qa->s[k][h]>0; h++,hh++) { if (!hh) {fprintf(outf,"\n"); hh-=par.aliwidth;} fprintf(outf,"%1c",qa->s[k][h]); } #endif fprintf(outf,"\n"); } // Print template sequences for (k=0; kn; k++) { if (k==ta->nsa_dssp) continue; if (k==ta->nss_dssp && !par.showdssp) continue; if ((k==ta->nss_pred || k==ta->nss_conf) && !par.showpred) continue; if (k==ta->ncons && !par.showcons) continue; fprintf(outf,">%s\n",ta->sname[k]); #if TELOMER_PRINT /* @ */ if (iTelomerLeft > 0){ for (int iI = 1; iI <= iTelomerLeft; iI++){ fprintf(outf, "%1c", '-'); } /* this may be unnecessary */ for (int iI = iTelomerLeft+1; iI < hit.j1; iI++){ fprintf(outf, "%1c", ta->seq[k][iI]); } } else{ for (int iI = 1; iI <= -iTelomerLeft; iI++){ fprintf(outf, "%1c", ta->seq[k][iI]); } /* this may be unnecessary */ /* think about it */ } /* @ */ for (h = 0; ta->s[k][h] > 0; h++){ fprintf(outf, "%1c", ta->s[k][h]); } /* @ */ for (int iI = hit.j2+1; iI <= ta->L; iI++){ fprintf(outf, "%1c", ta->seq[k][iI]); } for (int iI = 0; iI < iTelomerRght; iI++){ fprintf(outf, "%1c", '-'); } #else for (h=0,hh=-par.aliwidth; ta->s[k][h]>0; h++,hh++) { if (!hh) {fprintf(outf,"\n"); hh-=par.aliwidth;} fprintf(outf,"%1c",ta->s[k][h]); } #endif fprintf(outf,"\n"); } fprintf(outf,"\n"); } /* this is the end of PrintA2M() */ //////////////////////////////////////////////////////////////////////////// /** * @brief Print out full alignment in A2M format */ void FullAlignment::PrintFASTA(FILE* outf, Hit& hit) { // Transform sequences to uppercase and '.' to '-' qa->ToFASTA(); ta->ToFASTA(); PrintA2M(outf,hit); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Print out full alignment in A2M format */ void FullAlignment::PrintA3M(FILE* outf, Hit& hit) { // Remove all '.' from sequences qa->RemoveChars('.'); ta->RemoveChars('.'); PrintA2M(outf,hit); } /* * @* OverWriteSeqs() */ void FullAlignment::OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf){ int iS, iR; char cRes; for (iS = 0; iS < qa->n; iS++){ for (iR = 0; iR < qa->pos; iR++){ cRes = qa->s[iS][iR]; ppcFirstProf[iS][iR] = ('.' == cRes) ? '-' : cRes; } /* 0 <= iR < qa.L */ ppcFirstProf[iS][iR] = '\0'; } /* 0 <= iS < qa.n */ for (iS = 0; iS < ta->n; iS++){ for (iR = 0; iR < ta->pos; iR++){ cRes = ta->s[iS][iR]; ppcSecndProf[iS][iR] = ('.' == cRes) ? '-' : cRes; } /* 0 <= iR < ta.L */ ppcSecndProf[iS][iR] = '\0'; } /* 0 <= iS < ta.n */ } /* this is the end of OverWriteSeqs() */ clustal-omega-1.2.1/src/hhalign/hhfunc-C.h0000644000175100017510000012704712217063464015220 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhfunc-C.h 290 2013-09-20 15:18:12Z fabian $ */ /* * Changelog: Michael Remmert made changes to hhalign stand-alone code * FS implemented some of the changes on 2010-11-11 -> MR1 * * did not incorporate SS prediction PSIpred (yet); functions are: * CalculateSS(3), */ // hhfunc.C /** * AddBackgroundFrequencies() * * @brief add background frequencies (derived from HMM) to * sequence/profile * * @param[in,out] ppfFreq, * [in] residue frequencies of sequence/profile, * [out] overlayed with HMM background frequencies * @param[in,out] ppfPseudoF, * [in] residue frequencies+pseudocounts of sequence/profile, * [out] overlayed with HMM background frequencies+pseudocounts * @param[in] iSeqLen, * length of sequence/profile (not aligned to HMM) * @pram[in] prHMM, * background HMM * @param[in] ppcSeq, * sequences/profile to be 'softened' * @param[in] pcPrealigned, * sequence aligned to HMM, this is not quite a consensus, * it is identical to 1st sequence but over-writes gap information, * if other sequences in profile have (non-gap) residues * @param[in] iPreCnt * number of sequences pre-aligned (pcPrealigned is 'consensus' of these sequences) * @param[in] pcRepresent * sequence representative of HMM, aligned to pcSeq0 */ void AddBackgroundFrequencies(float **ppfFreq, float **ppfPseudoF, float **ppfPseudoTr, int iSeqLen, hmm_light *prHMM, char **ppcSeq, char *pcPrealigned, int iPreCnt, char *pcRepresent) { char *pcS = pcPrealigned; /* current residue in pre-aligned sequence */ char *pcH = pcRepresent; /* current residue in pre-aligned HMM */ int iS = 0; /* position in un-aligned sequence (corresponds to pcS) */ int iH = 0; /* position in un-aligned HMM (corresponds to pcH) */ int iA; /* residue iterator */ //int iT; /* transition state iterator */ float fFWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud frequencies */ /* FIXME: tune value, 0.50 default */ //float fFWeight = 0.75; float fFThgiew = UNITY - fFWeight; /* weight of 'true' frequencies */ //float fGWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */ //float fGWeight = 0.50 /*/ (float)(iPreCnt)*/; /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */ //float fGThgiew = UNITY - fGWeight; /* weight of 'true' transitions */ float fAux; if ( (NULL == pcPrealigned) || (NULL == pcRepresent) ){ /*printf("%s/%s:%d: WARNING HMM=NULL -- didn't think I would get here (carry on, no danger)\n", __FUNCTION__, __FILE__, __LINE__);*/ return; } if (NULL == prHMM->p){ printf("%s:%s:%d: WARNING -- Background Pseudocounts point to NULL\n" "\tthis is not intended - don't add background but CONTINUE\n", __FUNCTION__, __FILE__, __LINE__); return; } /* FIXME: should be 0 (FS thinks) but -1 gives better results */ iH = iS = 0/*-1*//*+1*/; while ( ('\0' != *pcS) && ('\0' != *pcH) ){ if ( ('-' != *pcH) && ('-' != *pcS) ){ iH++; iS++; #if 0 /* match state * - HMM had a gap in previous position (now closed) * FIXME: this does not really work */ if ((iH > 0) && ('-' == *(pcH-1))){ for (iT = 0; iT < STATE_TRANSITIONS; iT++){ ppfPseudoTr[iS-1][iT] = log2f(zf1SeqRevrt[iT]); } } #endif #if 1 /* do frequencies -- this is not really useful; frequencies are derived from HMM and contain already pseudocounts (PCs), adding frequencies and then PCs will add PCs _twice_ results are better than not to add them, but not as good as PCs */ for (iA = 0; iA < AMINOACIDS; iA++){ fAux = fFThgiew * ppfFreq[iS][iA] + fFWeight * prHMM->f[iH][iA]; ppfFreq[iS][iA] = fAux; } #endif /* do pseudo-counts */ for (iA = 0; iA < AMINOACIDS; iA++){ fAux = fFThgiew * ppfPseudoF[iS][iA] + fFWeight * prHMM->p[iH][iA]; ppfPseudoF[iS][iA] = fAux; } #if 0 /* do state transitions */ for (iT = 0; iT < STATE_TRANSITIONS; iT++){ #if 1 /* this is a very crude method, which averages the logarithms of the transitions, effectively performing a geometric mean - this presumably violates normalisation. however, results are surprisingly good */ fAux = fGThgiew * ppfPseudoTr[iS][iT] + fGWeight * prHMM->tr[iH][iT]; ppfPseudoTr[iS][iT] = fAux; #else /* crude averaging */ /* There are 2 things to consider: (1) one should really blend the probabilities of the transitions, however, by default we have the logarithms thereof. So must exponentiate, blend, and then take log again. This is expensive, and does not seem to lead to better results than blending the logarithms (and violating normalisation) (2) transition probabilities for a single sequence are really easy, there are no insert/delete transitions. However, there is a begin state that is different from the main body. But again, this does not seem to make a blind bit of difference */ if (iS > 0){ fAux = fGThgiew * zf1SeqTrans[iT] + fGWeight * prHMM->linTr[iH][iT]; ppfPseudoTr[iS][iT] = log2f(fAux); } else { fAux = fGThgiew * zf1SeqInit[iT] + fGWeight * prHMM->linTr[iH][iT]; ppfPseudoTr[iS][iT] = log2f(fAux); } #endif /* mixing of linear/log */ } /* 0 <= iT < STATE_TRANSITIONS */ #endif /* did state transitions */ } /* was Match -- neither HMM nor sequence have gap */ else if ('-' == *pcH){ /* sequence opened up gap in HMM */ #if 0 if ((iH > 0) && ('-' != *(pcH-1)) && (iS > 0)){ /* this is the first gap in HMM * FIXME: this does not really work */ for (iT = 0; iT < STATE_TRANSITIONS; iT++){ ppfPseudoTr[iS-1][iT] = log2f(zf1SeqDel[iT]); } } else { /* do nothing, keep single sequence values exactly as they are*/ } #endif iS++; } else if ('-' == *pcS){ /* here the single sequence has a gap, and the HMM (as a whole) does not. There may be individual gaps in the HMM at this stage. By ignoring this we say that the HMM dominates the overall behaviour - as in the M2M state as well */ iH++; } pcH++; pcS++; } /* !EO[seq/hmm] */ return; } /* this is the end of AddBackgroundFrequencies() */ /** * ReadAndPrepare() * * @brief Read HMM input file or transfer alignment * and add pseudocounts etc. * * @param[in] iRnPtype * type of read/prepare * enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM}; * @param[in] ppcProf * alignment * @param[in] iCnt * number of seqs in alignment * @param[in,out] prHMM, * [in] if sequences read/prepared, [out] if HMM from file * @param[in] pcPrealigned, * (single) sequence aligned to background HMM * @param[in] pcRepresent, * sequence representing HMM aligned to individual sequence * param[in] pdExWeights * (external) sequence weights, derived from tree * @param[in] infile * name of file with HMM info (formerly also alignment) * @param[out] q * HMM structure with transition probabilities, residue frequencies etc * @param[???] qali * FIXME: what is qali? * * @return FAILURE on error, OK otherwise */ int ReadAndPrepare(int iRnPtype, char **ppcProf, int iCnt, hmm_light *prHMM, char *pcPrealigned, char *pcRepresent, double *pdExWeights, char* infile, HMM& q, Alignment* qali=NULL) { //#ifndef CLUSTALO_NOFILE char path[NAMELEN]; /* NOTE: there are different scenarios: (i) ("" != infile) - read HMM from file, transfer frequency/transition/pseudo-count (f/t/p) info into prHMM (ii) ('\0' != ppcProf[0]) - transfer sequence/alignment into q/qali, don't save f/t/p into prHMM, on the contrary, if prior f/t/p available then add it to q/qali, this is only done if (1==iCnt) (iii) ('\0' == ppcProf[0]) - re-cycle old HMM information recreate a HMM from previous data */ /********************************/ /*** (o) Recycle internal HMM ***/ /********************************/ if ( (INTERN_ALN_2_HMM == iRnPtype) && (iCnt <= 0) ){ /* NOTE: here we are writing into a HMM structure/class; memory has been allocated for this in hhalign.cpp; however, as iCnt<=0, there may not be memory for prHMM->n_display sequences/names. But then, there doesn't have to be. At this stage we are just copying one HMM into another HMM, sequences are irrelevant. The only sequence of (marginal) interest is the consensus sequence */ /* FIXME: check that prHMM is valid -- how? */ const int ciCons = 0; const int ciNoof = ciCons+1; const int ciInvalid = -1; q.n_display = ciNoof; /* only consensus */ q.sname = NULL; q.ncons = ciCons; q.nfirst = ciCons;//prHMM->nfirst; q.nss_dssp = ciInvalid;//prHMM->nss_dssp; q.nsa_dssp = ciInvalid;//prHMM->nsa_dssp; q.nss_pred = ciInvalid;//prHMM->nss_pred; q.nss_conf = ciInvalid;//prHMM->nss_conf; q.L = prHMM->L; q.N_in = prHMM->N_in; q.N_filtered = prHMM->N_filtered; /* NOTE: I (FS) think that only ever 1 sequence will be transferred here, that is, the consensus sequence. However, we might want to allow (in the future) to transfer more sequences, hence the awkward for() loop */ #if 0 for (int i = prHMM->ncons+0; i < prHMM->ncons+q.n_display; i++){ /* NOTE: In the original hhalign code the first position is kept open ('\0'). This makes it difficult to use string functions like strlen/strdup etc. Insert a temporary gap (.) to facilitate string operations */ char cHead = prHMM->seq[i][0]; prHMM->seq[i][0] = '.'; q.seq[i] = strdup(prHMM->seq[i]); prHMM->seq[i][0] = q.seq[i][0] = cHead; } #else { char cHead = prHMM->seq[prHMM->ncons][0]; prHMM->seq[prHMM->ncons][0] = '.'; q.seq[q.ncons] = strdup(prHMM->seq[prHMM->ncons]); prHMM->seq[prHMM->ncons][0] = q.seq[q.ncons][0] = cHead; } #endif for (int i = 0; i < prHMM->L+1; i++){ q.Neff_M[i] = prHMM->Neff_M[i]; q.Neff_I[i] = prHMM->Neff_I[i]; q.Neff_D[i] = prHMM->Neff_D[i]; } q.Neff_HMM = prHMM->Neff_HMM; /* skip longname,name,file,fam,sfam,fold,cl */ q.lamda = prHMM->lamda; q.mu = prHMM->mu; HMMshadow rShadow = {0}; /* friend of HMM to access private members */ rShadow.copyShadowToHMM(q, *prHMM); /* skip trans_lin,ss_dssp,sa_dssp,ss_pred,ss_conf,Xcons */ /* pav already done in copyShadowToHMM */ /* skip pnul */ return OK; } /* INTERN_ALN_2_HMM && iCnt<=0 */ /******************************/ /*** (i) Read HMM from file ***/ /******************************/ char line[LINELEN] = {0}; // input line FILE *inf = NULL; //if ( (0 != strcmp(infile,"")) /*&& (iCnt > 0)*/ ) if ( (READ_HMM_2_HMM == iRnPtype) || (READ_ALN_2_HMM == iRnPtype)) { if (0 == strcmp(infile,"")){ printf("%s:%s:%d:\n" "\texpected to re %s from file but no file specified\n" "" , __FUNCTION__, __FILE__, __LINE__ , (READ_HMM_2_HMM==iRnPtype?"HMM":"alignment")); return FAILURE; } inf = fopen(infile, "r"); if (!inf) OpenFileError(infile); Pathname(path,infile); //} //else { //inf = stdin; //if (v>=2) printf("Reading HMM / multiple alignment from standard input ...\n(To get a help list instead, quit and type %s -h.)\n",program_name); //*path='\0'; //} fgetline(line,LINELEN-1,inf); } //if ( (0 != strcmp(infile,"")) && (iCnt > 0) ) if ( (READ_HMM_2_HMM == iRnPtype) ){ if (0 == strcmp(infile,"")){ printf("%s:%s:%d: expected to read HMM from file but no file-name\n", __FUNCTION__, __FILE__, __LINE__); } // Is infile a HMMER3 file? /* MR1 */ if (!strncmp(line,"HMMER3",6)) { if (v>=2) { cout<<"Query file is in HMMER3 format\n"; cout<<"WARNING! Use of HMMER3 format as input results in dramatically loss of sensitivity!\n"; } // Read 'query HMMER file rewind(inf); q.ReadHMMer3(inf,path); // Don't add transition pseudocounts to query!! // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] q.PreparePseudocounts(); // DON'T ADD amino acid pseudocounts to query: pcm=0! q.p[i][a] = f[i][a] q.AddAminoAcidPseudocounts(0, par.pca, par.pcb, par.pcc); /* further down there is a q.Log2LinTransitionProbs but only if (iCnt>0), however, we still need it it here (i think), there is no danger of doing this twice, as trans_lin is checked FIXME (FS, 2011-01-12) */ /* further down there is a q.Log2LinTransitionProbs but only if (iCnt>0), however, we still need it it here (i think), there is no danger of doing this twice, as trans_lin is checked FIXME (FS, 2011-01-12) */ //if (par.forward >= 1) { q.Log2LinTransitionProbs(1.0); } } // ... or Is infile an old HMMER file? else if (!strncmp(line,"HMMER",5)) { if (v>=2) { cout<<"Query file is in HMMER format\n"; cout<<"WARNING! Use of HMMER format as input results in dramatically loss of sensitivity!\n"; } // Read 'query HMMER file q.ReadHMMer(inf,path); if (v>=2 && q.Neff_HMM>11.0) fprintf(stderr,"WARNING: HMM %s looks too diverse (Neff=%.1f>11). Better check the underlying alignment... \n",q.name,q.Neff_HMM); // Don't add transition pseudocounts to query!! // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] q.PreparePseudocounts(); // DON'T ADD amino acid pseudocounts to query: pcm=0! q.p[i][a] = f[i][a] q.AddAminoAcidPseudocounts(0, par.pca, par.pcb, par.pcc); /* further down there is a q.Log2LinTransitionProbs but only if (iCnt>0), however, we still need it it here (i think), there is no danger of doing this twice, as trans_lin is checked FIXME (FS, 2011-01-12) */ //if (par.forward >= 1) { q.Log2LinTransitionProbs(1.0); } } /* it was a HMMer file */ // ... or is it an hhm file? else if (!strncmp(line,"NAME",4) || !strncmp(line,"HH",2)) { if (v>=2) cout<<"Query file is in HHM format\n"; // Rewind to beginning of line and read query hhm file rewind(inf); q.Read(inf,path); if (v>=2 && q.Neff_HMM>11.0) fprintf(stderr,"WARNING: HMM %s looks too diverse (Neff=%.1f>11). Better check the underlying alignment... \n",q.name,q.Neff_HMM); // Add transition pseudocounts to query -> q.p[i][a] q.AddTransitionPseudocounts(); // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] q.PreparePseudocounts(); // Add amino acid pseudocounts to query: q.p[i][a] = (1-tau)*f[i][a] + tau*g[i][a] q.AddAminoAcidPseudocounts(); } /* it was a HHM file */ else { fprintf(stderr, "%s:%s:%d: Unknown HMM format in infile\n" "infile=%s, #seq=%d\n" , __FUNCTION__, __FILE__, __LINE__ , infile, iCnt); return FAILURE; } /*fclose(inf);*/ /*** transfer class info to struct */ prHMM->n_display = q.n_display; /* ignore sname*/ prHMM->seq = (char **)calloc((q.n_display+1), sizeof(char *)); /* FIXME valgrind says bytes get lost in the above calloc during * hmm-iteration */ for (int i = 0; i < q.n_display; i++){ /* NOTE: In the original hhalign code the first position is kept open ('\0'). This makes it difficult to use string functions like strlen/strdup etc. Insert a temporary gap (.) to facilitate string operations */ char cHead = q.seq[i][0]; q.seq[i][0] = '.'; prHMM->seq[i] = strdup(q.seq[i]); q.seq[i][0] = prHMM->seq[i][0] = cHead; } prHMM->ncons = q.ncons; prHMM->nfirst = q.nfirst; prHMM->nss_dssp = q.nss_dssp; prHMM->nsa_dssp = q.nsa_dssp; prHMM->nss_pred = q.nss_pred; prHMM->nss_conf = q.nss_conf; prHMM->L = q.L; prHMM->N_in = q.N_in; prHMM->N_filtered = q.N_filtered; prHMM->Neff_M = (float *)calloc(prHMM->L+1, sizeof(float)); prHMM->Neff_I = (float *)calloc(prHMM->L+1, sizeof(float)); prHMM->Neff_D = (float *)calloc(prHMM->L+1, sizeof(float)); prHMM->Neff_HMM = q.Neff_HMM; /* skip longname,name,file,fam,sfam,fold,cl */ prHMM->lamda = q.lamda; prHMM->mu = q.mu; HMMshadow rShadow = {0}; /* friend of HMM to access private members */ rShadow.copyHMMtoShadow(q); prHMM->f = (float **)calloc(prHMM->L+1, sizeof(float *)); prHMM->g = (float **)calloc(prHMM->L+1, sizeof(float *)); prHMM->p = (float **)calloc(prHMM->L+1, sizeof(float *)); prHMM->tr = (float **)calloc(prHMM->L+1, sizeof(float *)); prHMM->linTr = (float **)calloc(prHMM->L+1, sizeof(float *)); for (int i = 0; i < prHMM->L+1; i++){ prHMM->f[i] = (float *)calloc(AMINOACIDS, sizeof(float)); prHMM->g[i] = (float *)calloc(AMINOACIDS, sizeof(float)); prHMM->p[i] = (float *)calloc(AMINOACIDS, sizeof(float)); for (int j = 0; j < AMINOACIDS; j++){ prHMM->f[i][j] = (float)rShadow.f[i][j]; prHMM->g[i][j] = (float)rShadow.g[i][j]; prHMM->p[i][j] = (float)rShadow.p[i][j]; } prHMM->tr[i] = (float *)calloc(STATE_TRANSITIONS, sizeof(float)); prHMM->linTr[i] = (float *)calloc(STATE_TRANSITIONS, sizeof(float)); for (int j = 0; j< STATE_TRANSITIONS; j++){ prHMM->tr[i][j] = (float)rShadow.tr[i][j]; prHMM->linTr[i][j] = fpow2(rShadow.tr[i][j]); } } /*0 <= i < prHMM->L+1 */ /* skip trans_lin,ss_dssp,sa_dssp,ss_pred,ss_conf,Xcons */ for (int j = 0; j < AMINOACIDS; j++){ prHMM->pav[j] = (float)rShadow.pav[j]; } /* skip pnul */ } /* have read HHM from file */ /*else if ( ((NULL != ppcProf) && (iCnt > 0) && ('\0' != ppcProf[0][0])) || ( (0 != strcmp(infile,"") && (0 == iCnt) )) )*/ else if ( (INTERN_ALN_2_HMM == iRnPtype) || (READ_ALN_2_HMM == iRnPtype) ) { if ( (INTERN_ALN_2_HMM == iRnPtype) && ( (NULL == ppcProf) || (iCnt <= 0) || ('\0' == ppcProf[0][0]) ) ){ printf("%s:%s:%d: was expecting internal alignment but\n" "\tppcProf=%p, #seq=%d, ppcProf[0][0]=%c\n" , __FUNCTION__, __FILE__, __LINE__ , ppcProf, iCnt, ppcProf[0][0]); return FAILURE; } else if ( (READ_ALN_2_HMM == iRnPtype) && (0 == strcmp(infile,"")) ){ printf("%s:%s:%d: was expecting to read alignment from file but no filename\n" , __FUNCTION__, __FILE__, __LINE__); return FAILURE; } /*******************************/ /*** (ii) it is an alignment ***/ /*******************************/ /* transfer alignment information from clustal character array into pali/q/t classes */ /* * NOTE that emissions in HMMer file format contain pseudo-counts. * HHM file format does not contain emission pseudo-counts. * the structure that stores background HMM information does contain pseudo-counts */ Alignment* pali; if (qali==NULL){ pali=new Alignment(iCnt); /* FIXME: pass in iCnt to get rid of MAXSEQ */ } else{ pali=qali; } if (par.calibrate) { printf("\nError in %s: only HHM files can be calibrated.\n",program_name); printf("Build an HHM file from your alignment with 'hhmake -i %s' and rerun hhsearch with the hhm file\n\n",infile); exit(1); } if (v>=2 && strcmp(infile,"stdin")) cout< 0) if (INTERN_ALN_2_HMM == iRnPtype){ pali->Transfer(ppcProf, iCnt); } //else if (0 == iCnt) else if (READ_ALN_2_HMM == iRnPtype){ pali->Read(inf, infile, line); } else { printf("%s:%s:%d: FATAL problem\n" "infile = (%s), #seq = %d\n" , __FUNCTION__, __FILE__, __LINE__ , infile, iCnt); return FAILURE; } /* Convert ASCII to int (0-20), throw out all insert states, record their number in I[k][i] and store marked sequences in name[k] and seq[k] */ pali->Compress(infile); /* Sort out the nseqdis most dissimilar sequences for display in the output alignments */ pali->FilterForDisplay(par.max_seqid, par.coverage, par.qid, par.qsc,par.nseqdis); // Filter alignment for min score per column with core query profile, defined by coverage_core and qsc_core //if (par.coresc>-10) pali->HomologyFilter(par.coverage_core, par.qsc_core, par.coresc); /* Remove sequences with seq. identity larger than seqid percent (remove the shorter of two) */ pali->N_filtered = pali->Filter(par.max_seqid, par.coverage, par.qid, par.qsc, par.Ndiff); /* Calculate pos-specific weights, AA frequencies and transitions -> f[i][a], tr[i][a] */ pali->FrequenciesAndTransitions(q); if (v>=2 && q.Neff_HMM>11.0) fprintf(stderr,"WARNING: alignment %s looks too diverse (Neff=%.1f>11). Better check it with an alignment viewer... \n",q.name,q.Neff_HMM); /*printf("%d %d %f %d (N,Nf,Neff,L) %s:%s:%d\n" , q.N_in, q.N_filtered, q.Neff_HMM, q.L, __FUNCTION__, __FILE__, __LINE__);*/ // Add transition pseudocounts to query -> p[i][a] q.AddTransitionPseudocounts(); /* Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] */ q.PreparePseudocounts(); /* Add amino acid pseudocounts to query: p[i][a] = (1-tau)*f[i][a] + tau*g[i][a] */ q.AddAminoAcidPseudocounts(); /* ****** add aligned background pseudocounts ***** */ HMMshadow rShadowQ = {0}; rShadowQ.copyHMMtoShadow(q); AddBackgroundFrequencies(rShadowQ.f, rShadowQ.p, rShadowQ.tr, q.L, prHMM, q.seq, pcPrealigned, iCnt, pcRepresent); if (qali==NULL){ delete(pali); pali = NULL; } } /* else if (NULL != ppcProf) // not hmmer/hhalign but alignment */ //else if ((prHMM->L > 0) && ('\0' == ppcProf[0][0])) else if (INTERN_HMM_2_HMM == iRnPtype){ /******************************************/ /*** (iii) re-cycle old HMM information ***/ /******************************************/ if (prHMM->L <= 0){ printf("%s:%s:%d: was expecting to copy HMM structure but L=%d\n" , __FUNCTION__, __FILE__, __LINE__, prHMM->L); } printf("%s:%s:%d: RE-CYCLING HMM\n", __FUNCTION__, __FILE__, __LINE__); #if 0 q.n_display = prHMM->n_display; /* ignore sname*/ for (int i = 0; i < q.n_display; i++){ /* NOTE: In the original hhalign code the first position is kept open ('\0'). This makes it difficult to use string functions like strlen/strdup etc. Insert a temporary gap (.) to facilitate string operations */ char cHead = prHMM->seq[i][0]; prHMM->seq[i][0] = '.'; q.seq[i] = strdup(prHMM->seq[i]); q.seq[i][0] = prHMM->seq[i][0] = cHead; } q.nfirst = prHMM->nfirst; #else q.n_display = 1; q.nfirst = 0; char cHead = prHMM->seq[prHMM->nfirst][0]; prHMM->seq[prHMM->nfirst][0] = '.'; q.seq[0] = strdup(prHMM->seq[prHMM->nfirst]); q.seq[q.n_display-1][0] = prHMM->seq[prHMM->nfirst][0] = cHead; #endif q.ncons = prHMM->ncons; q.nss_dssp = prHMM->nss_dssp; q.nsa_dssp = prHMM->nsa_dssp; q.nss_pred = prHMM->nss_pred; q.nss_conf = prHMM->nss_conf; q.L = prHMM->L; q.N_in = prHMM->N_in; q.N_filtered = prHMM->N_filtered; #define NEFF_SCORE 10 /* FIXME: Magic Number */ /*for (int i; i < prHMM->L+1; i++){ q.Neff_M[i] = q.Neff_I[i] = q.Neff_D[i] = NEFF_SCORE; }*/ q.Neff_HMM = prHMM->Neff_HMM; /* skip longname,name,file,fam,sfam,fold,cl */ q.lamda = prHMM->lamda; q.mu = prHMM->mu; HMMshadow rShadow = {0}; /* friend of HMM to access private members */ rShadow.copyShadowToHMM(q, *prHMM); } if (iCnt > 0){ if (par.forward>=1) q.Log2LinTransitionProbs(1.0); } if (NULL != inf){ fclose(inf); } return OK; } /*** end: ReadAndPrepare() ***/ /** * FreeHMMstruct() * * @brief FIXME * * @param[in,out] */ extern "C" void FreeHMMstruct(hmm_light *prHMM) { int i; if (NULL != prHMM->f){ for (i = 0; i < prHMM->L+1; i++){ if (NULL != prHMM->f[i]){ free(prHMM->f[i]); prHMM->f[i] = NULL; } } /* 0 <= i < prHMM->L+1 */ free(prHMM->f); prHMM->f = NULL; } if (NULL != prHMM->g){ for (i = 0; i < prHMM->L+1; i++){ if (NULL != prHMM->g[i]){ free(prHMM->g[i]); prHMM->g[i] = NULL; } } /* 0 <= i < prHMM->L+1 */ free(prHMM->g); prHMM->g = NULL; } if (NULL != prHMM->p){ for (i = 0; i < prHMM->L+1; i++){ if (NULL != prHMM->p[i]){ free(prHMM->p[i]); prHMM->p[i] = NULL; } } /* 0 <= i < prHMM->L+1 */ free(prHMM->p); prHMM->p = NULL; } if (NULL != prHMM->tr){ for (i = 0; i < prHMM->L+1; i++){ if (NULL != prHMM->tr[i]){ free(prHMM->tr[i]); prHMM->tr[i] = NULL; } } /* 0 <= i < prHMM->L+1 */ free(prHMM->tr); prHMM->tr = NULL; } if (NULL != prHMM->linTr){ for (i = 0; i < prHMM->L+1; i++){ if (NULL != prHMM->linTr[i]){ free(prHMM->linTr[i]); prHMM->linTr[i] = NULL; } } /* 0 <= i < prHMM->L+1 */ free(prHMM->linTr); prHMM->linTr = NULL; } if (NULL != prHMM->Neff_M){ free(prHMM->Neff_M); prHMM->Neff_M = NULL; } if (NULL != prHMM->Neff_I){ free(prHMM->Neff_I); prHMM->Neff_I = NULL; } if (NULL != prHMM->Neff_D){ free(prHMM->Neff_D); prHMM->Neff_D = NULL; } if (NULL != prHMM->seq){ for (i = 0; i < prHMM->n_display; i++){ if (NULL != prHMM->seq[i]){ free(prHMM->seq[i]); prHMM->seq[i] = NULL; } } free(prHMM->seq); prHMM->seq = NULL; } memset(prHMM, 0, sizeof(hmm_light)); } /*** end: FreeHMMstruct() ***/ /** * @brief comparisin function for ascending qsort() of doubles */ int CompDblAsc(const void *pv1, const void *pv2){ double d1 = *(double *)pv1; double d2 = *(double *)pv2; if (d1 > d2) { return +1; } else if (d1 < d2) { return -1; } else { return 0; } } /*** end: CompDblAsc() ***/ /** * AlnToHMM2() * * @brief convert alignment into HMM (hhmake) * * @param[out] prHMM * structure with pseudocounts etc * @param[in] pcHMM_input * name of file with HMM * */ extern "C" int AlnToHMM2(hmm_light *rHMM_p, hhalign_para rHhalignPara, char **ppcSeq, int iN){ if (0 == par.M){ SetDefaults(rHhalignPara); SetSubstitutionMatrix(); par.cons = 1; par.M = 2; par.forward=2; par.Mgaps=100; const int ciGoodMeasureSeq = 10; int iAuxLen = strlen(ppcSeq[0]); par.maxResLen = iAuxLen; par.maxResLen += ciGoodMeasureSeq; par.maxColCnt = iAuxLen + ciGoodMeasureSeq; par.max_seqid=DEFAULT_FILTER; par.loc=0; par.mact=0; /* some minor parameters, affecting alignment (i think) */ par.p = 0.0; /* minimum threshold for inclusion in hit list */ par.Z = 100; /* minimum threshold for inclusion in hit list and alignment listing */ par.z = 1; /* min number of lines in hit list */ par.B = 100; /* max number of alignments */ par.b = 1; /* min number of alignments */ par.E = 1e6; /* maximum threshold for inclusion in hit list and alignment listing */ par.altali=1;par.hitrank=0;par.showcons=1; par.showdssp=1;par.showpred=1;par.nseqdis=iN;par.cons=1; } const int ciGoodMeasure = 10; int iLen = strlen(ppcSeq[0]) + ciGoodMeasure; if (iLen > par.maxResLen){ par.maxResLen = par.maxColCnt = iLen; } HMM rTemp(iN+2, iLen); /* temporary template */ Alignment rTempAli(iN+2, iLen); /* temporary alignment */ int iParCons = par.cons; /*printf(">>>>>>>>>>> %s:%s:%d: there are %d sequences\n", __FUNCTION__, __FILE__, __LINE__, iN);*/ par.cons = 1; if (OK != ReadAndPrepare(INTERN_ALN_2_HMM, ppcSeq, iN, rHMM_p, NULL/*prealigned*/, NULL/*representative*/, NULL/*weights*/, //YES/*transfer*/, (char*)("")/*in-file*/, rTemp, &rTempAli)) { return FAILURE; } par.cons = iParCons; /******/ /*** transfer class info to struct */ rHMM_p->n_display = rTemp.n_display; rHMM_p->sname = NULL; rHMM_p->seq = (char **)calloc((rTemp.n_display+1), sizeof(char *)); for (int i = 0; i < rTemp.n_display; i++){ /* NOTE: In the original hhalign code the first position is kept open ('\0'). This makes it difficult to use string functions like strlen/strdup etc. Insert a temporary gap (.) to facilitate string operations */ char cHead = rTemp.seq[i][0]; rTemp.seq[i][0] = '.'; rHMM_p->seq[i] = strdup(rTemp.seq[i]); rTemp.seq[i][0] = rHMM_p->seq[i][0] = cHead; } rHMM_p->ncons = rTemp.ncons; rHMM_p->nfirst = rTemp.nfirst; if (-1 == rHMM_p->ncons){ /* ncons needed later for alignment of representative sequence and copy of profile. ncons not always set (-1 default), this will cause segmentation fault. nfirst (probably) right index - no problem if not */ rHMM_p->ncons = rTemp.nfirst; } rHMM_p->nss_dssp = rTemp.nss_dssp; rHMM_p->nsa_dssp = rTemp.nsa_dssp; rHMM_p->nss_pred = rTemp.nss_pred; rHMM_p->nss_conf = rTemp.nss_conf; rHMM_p->L = rTemp.L; rHMM_p->N_in = rTemp.N_in; rHMM_p->N_filtered = rTemp.N_filtered; #define NEFF_SCORE 10 /* FIXME: Magic Number */ //// get rid of that, FS, 2010-12-22 rHMM_p->Neff_M = (float *)calloc(rHMM_p->L+1, sizeof(float)); rHMM_p->Neff_I = (float *)calloc(rHMM_p->L+1, sizeof(float)); rHMM_p->Neff_D = (float *)calloc(rHMM_p->L+1, sizeof(float)); for (int i = 0; i < rHMM_p->L+1; i++){ rHMM_p->Neff_M[i] = rHMM_p->Neff_I[i] = rHMM_p->Neff_D[i] = NEFF_SCORE; //// get rid of that, FS, 2010-12-22 } rHMM_p->Neff_HMM = rTemp.Neff_HMM; /* skip longname,name,file,fam,sfam,fold,cl */ rHMM_p->lamda = rTemp.lamda; rHMM_p->mu = rTemp.mu; HMMshadow rShadow = {0}; /* friend of HMM to access private members */ rShadow.copyHMMtoShadow(rTemp); rHMM_p->Neff_M = (float *)calloc(rHMM_p->L+1, sizeof(float)); rHMM_p->Neff_I = (float *)calloc(rHMM_p->L+1, sizeof(float)); rHMM_p->Neff_D = (float *)calloc(rHMM_p->L+1, sizeof(float)); rHMM_p->f = (float **)calloc(rHMM_p->L+1, sizeof(float *)); rHMM_p->g = (float **)calloc(rHMM_p->L+1, sizeof(float *)); rHMM_p->p = (float **)calloc(rHMM_p->L+1, sizeof(float *)); rHMM_p->tr = (float **)calloc(rHMM_p->L+1, sizeof(float *)); rHMM_p->linTr = (float **)calloc(rHMM_p->L+1, sizeof(float *)); for (int i = 0; i < rHMM_p->L+1; i++){ rHMM_p->Neff_M[i] = (float)rShadow.Neff_M[i]; rHMM_p->Neff_I[i] = (float)rShadow.Neff_I[i]; rHMM_p->Neff_D[i] = (float)rShadow.Neff_D[i]; rHMM_p->f[i] = (float *)calloc(AMINOACIDS, sizeof(float)); rHMM_p->g[i] = (float *)calloc(AMINOACIDS, sizeof(float)); rHMM_p->p[i] = (float *)calloc(AMINOACIDS, sizeof(float)); for (int j = 0; j < AMINOACIDS; j++){ rHMM_p->f[i][j] = (float)rShadow.f[i][j]; rHMM_p->g[i][j] = (float)rShadow.g[i][j]; rHMM_p->p[i][j] = (float)rShadow.p[i][j]; } rHMM_p->tr[i] = (float *)calloc(STATE_TRANSITIONS, sizeof(float)); rHMM_p->linTr[i] = (float *)calloc(STATE_TRANSITIONS, sizeof(float)); for (int j = 0; j< STATE_TRANSITIONS; j++){ rHMM_p->tr[i][j] = (float)rShadow.tr[i][j]; rHMM_p->linTr[i][j] = fpow2(rShadow.tr[i][j]); } } /*0 <= i < prHMM->L+1 */ /* skip trans_lin,ss_dssp,sa_dssp,ss_pred,ss_conf,Xcons */ for (int j = 0; j < AMINOACIDS; j++){ rHMM_p->pav[j] = (float)rShadow.pav[j]; } /* skip pnul */ /******/ rTemp.ClobberGlobal(); rTempAli.ClobberGlobal(); return OK; } /*** end of AlnToHMM2() ***/ /** * HHMake_Wrapper() * * @brief turn alignment (from file) into HHM (HMM) on file * * @param[out] hmm_out * name of file with HMM info corresponding to tmp_aln * @param[in] tmp_aln * name of file with alignment, to be turned into HMM (HHM) * */ extern "C" int HHMake_Wrapper(char *tmp_aln, char *hmm_out) { HMM rTemp; /* temporary template */ Alignment rTempAli; /* temporary alignment */ hmm_light *rHMM_p = NULL; /** Note: this is a wrapper for a stand-alone program hhmake. hhmake uses a different set of parameters than hhalign. However, all parameters are GLOBAL. So at this point we register the hhalign settings, reset them to hhmake settings and set them back at the end of the function */ /* save settings from hhalign */ int iParShowcons=par.showcons; int iParAppend=par.append; int iParNseqdis=par.nseqdis; int iParMark=par.mark; int iParMaxSeqid=par.max_seqid; int iParQid=par.qid; double dParQsc=par.qsc; int iParCoverage=par.coverage; int iParNdiff=par.Ndiff; int iParCoverageCore=par.coverage_core; double dParQscCore=par.qsc_core; double dParCoresc=par.coresc; int iParM=par.M; int iParMgaps=par.Mgaps; int iParMatrix=par.matrix; int iParPcm=par.pcm; double dParPcw=par.pcw; double dParGapb=par.gapb; int iParWg=par.wg; /* these are settings suitable for hhmake */ par.showcons=1; // write consensus sequence into hhm file par.append=0; // overwrite output file par.nseqdis=10; // maximum number of query or template sequences to be recoreded in HMM and diplayed in output alignments par.mark=0; // 1: only marked sequences (or first) get displayed; 0: most divergent ones get displayed par.max_seqid=90; // default for maximum sequence identity threshold par.qid=0; // default for maximum sequence identity threshold par.qsc=-20.0f; // default for minimum score per column with query par.coverage=0; // default for minimum coverage threshold par.Ndiff=100; // pick Ndiff most different sequences from alignment par.coverage_core=30; // Minimum coverage for sequences in core alignment par.qsc_core=0.3f; // Minimum score per column with core alignment (HMM) par.coresc=-20.0f; // Minimum score per column with core alignment (HMM) par.M=1; // match state assignment is by A2M/A3M par.Mgaps=50; // above this percentage of gaps, columns are assigned to insert states par.matrix=0; // Subst.matrix 0: Gonnet, 1: HSDM, 2: BLOSUM50 3: BLOSUM62 par.pcm=0; // no amino acid and transition pseudocounts added par.pcw=0; // wc>0 weighs columns according to their intra-clomun similarity par.gapb=0.0; // default values for transition pseudocounts; 0.0: add no transition pseudocounts! par.wg=0; // 0: use local sequence weights 1: use local ones if (OK != ReadAndPrepare(READ_ALN_2_HMM, NULL, 0, rHMM_p, NULL, NULL, NULL, tmp_aln, rTemp, &rTempAli)) { return FAILURE; } rTemp.WriteToFile(hmm_out); /* restore settings from hhalign */ par.showcons=iParShowcons; par.append=iParAppend; par.nseqdis=iParNseqdis; par.mark=iParMark; par.max_seqid=iParMaxSeqid; par.qid=iParQid; par.qsc=dParQsc; par.coverage=iParCoverage; par.Ndiff=iParNdiff; par.coverage_core=iParCoverageCore; par.qsc_core=dParQscCore; par.coresc=dParCoresc; par.M=iParM; par.Mgaps=iParMgaps; par.matrix=iParMatrix; par.pcm=iParPcm; par.pcw=dParPcw; par.gapb=dParGapb; par.wg=iParWg; /* prepare exit */ rTemp.ClobberGlobal(); rTempAli.ClobberGlobal(); return OK; } /** * readHMMWrapper() * * @brief read HMM from file, copy (relevant) info into struct * * @param[out] prHMM * structure with pseudocounts etc, probably uninitialised on entry * @param[in] pcHMM_input * name of file with HMM * */ extern "C" int readHMMWrapper(hmm_light *rHMM_p, char *pcHMM_input) { par.maxResLen = 15002; HMM rTemp(1000,par.maxResLen); /* temporary template */ Alignment rTempAli; /* temporary alignment */ /* AW changed init from {0} to 0 because it failed to compile with * gcc 4.3.3 with the following error: * error: braces around initializer for non-aggregate type */ /* FS taken out initialiser alltogether */ /* 0th arg of RnP is the type of RnP, ie, enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM};*/ /* 1st arg of ReadAndPrepare() is ppcSeqs, 2nd is #seq */ /* FIXME: at this stage the 3rd arg, rHMM_p, only acts as a dummy. this is rather silly, as it is the actual struct that will carry the HMM info at the end. If we write it already in ReadAndPrepare() then we could dispense with all this friend-class nonsense */ if (OK != ReadAndPrepare(READ_HMM_2_HMM, NULL, 0, rHMM_p, NULL, NULL, NULL, pcHMM_input, rTemp, &rTempAli)) { return FAILURE; } /* an important piece of information I want to get out of here is the consenssus sequence. there are however certain Pfam HMMs that don't trigger consensus calculation. at the moment I (FS) don't understand why this is (or rather why this is not). The proper place to do this should be inside ReadAndPrepare():ReadHMMer(), but I have not quite penetrated the logic there. Therefore I try to catch this condition at this point (here) and rectify it. */ if (-1 == rHMM_p->ncons){ int i, iA; rHMM_p->ncons = rHMM_p->nfirst; for (i = 0; i < rHMM_p->L; i++){ double dPmax = 0.00; int iAmax = -1; for (iA = 0; iA < AMINOACIDS; iA++){ if (rHMM_p->f[i][iA] > dPmax){ iAmax = iA; dPmax = rHMM_p->f[i][iA]; } } /* (0 <= iA < AMINOACIDS) */ rHMM_p->seq[rHMM_p->ncons][i] = i2aa(iAmax); } /* (0 <= i < rHMM_p->L) */ } /* ncons not set */ rTemp.ClobberGlobal(); rTempAli.ClobberGlobal(); return OK; } /*** end: readHMMWrapper() ***/ ///////////////////////////////////////////////////////////////////////////// /** * @brief Do precalculations for q and t to prepare comparison */ void PrepareTemplate(HMM& q, HMM& t, int format) { if (format==0) // HHM format { // Add transition pseudocounts to template t.AddTransitionPseudocounts(); // Generate an amino acid frequency matrix from t.f[i][a] with max pseudocounts (tau=1) -> t.g[i][a] t.PreparePseudocounts(); // Add amino acid pseudocounts to template: t.p[i][a] = (1-tau)*f[i][a] + tau*g[i][a] t.AddAminoAcidPseudocounts(); } else // HHMER format { // Don't add transition pseudocounts to template // t.AddTransitionPseudocounts(par.gapd, par.gape, par.gapf, par.gapg, par.gaph, par.gapi, 0.0); // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] t.PreparePseudocounts(); // DON'T ADD amino acid pseudocounts to temlate: pcm=0! t.p[i][a] = t.f[i][a] t.AddAminoAcidPseudocounts(0, par.pca, par.pcb, par.pcc); } // Modify transition probabilities to include SS-dependent penalties if (par.ssgap) t.UseSecStrucDependentGapPenalties(); if (par.forward>=1) t.Log2LinTransitionProbs(1.0); // Factor Null model into HMM t // ATTENTION! t.p[i][a] is divided by pnul[a] (for reasons of efficiency) => do not reuse t.p t.IncludeNullModelInHMM(q,t); // Can go BEFORE the loop if not dependent on template return; } /*** end of hhfunc-C.h ***/ clustal-omega-1.2.1/src/hhalign/hhutil-C.h0000644000175100017510000010526312217063464015236 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhutil-C.h 290 2013-09-20 15:18:12Z fabian $ */ #define PARAMETERSFROMFILE 0 extern bool nucleomode; ////////////////////////////////////////////////////////////////////////////// // Transform a character to lower case and '.' to '-' and vice versa ////////////////////////////////////////////////////////////////////////////// inline char MatchChr(char c) {return ((c>='a' && c<='z')? c-'a'+'A' : (c=='.'? '-':c) );} inline char InsertChr(char c) {return ((c>='A' && c<='Z')? c+'a'-'A' : ((c>='0' && c<='9') || c=='-')? '.':c );} inline int WordChr(char c) {return (int)((c>='A' && c<='Z') || (c>='a' && c<='z'));} ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms the one-letter amino acid code into an integer between 0 and 22 */ inline char aa2i(char c) { if (c>='a' && c<='z') c+='A'-'a'; if(!nucleomode) { // proteins! // A R N D C Q E G H I L K M F P S T W Y V switch (c) { case 'A': return 0; case 'R': return 1; case 'N': return 2; case 'D': return 3; case 'C': return 4; case 'Q': return 5; case 'E': return 6; case 'G': return 7; case 'H': return 8; case 'I': return 9; case 'L': return 10; case 'K': return 11; case 'M': return 12; case 'F': return 13; case 'P': return 14; case 'S': return 15; case 'T': return 16; case 'W': return 17; case 'Y': return 18; case 'V': return 19; case 'X': return ANY; case 'J': return ANY; case 'O': return ANY; case 'U': return 4; //Selenocystein -> Cystein case 'B': return 3; //D (or N) case 'Z': return 6; //E (or Q) case '-': return GAP; case '.': return GAP; case '_': return GAP; } } else { // nucleotides! switch(c) { case 'A': return 0; case 'C': return 1; case 'G': return 2; case 'T': return 3; case 'U': return 4; case 'N': return ANY; case '-': return GAP; case '.': return GAP; case '_': return GAP; default: return ANY; } } if (c>=0 && c<=32) return -1; // white space and control characters return -2; } /////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms integers between 0 and 22 into the one-letter amino acid code */ inline char i2aa(char c) { //A R N D C Q E G H I L K M F P S T W Y V if(!nucleomode) { switch (c) { case 0: return 'A'; case 1: return 'R'; case 2: return 'N'; case 3: return 'D'; case 4: return 'C'; case 5: return 'Q'; case 6: return 'E'; case 7: return 'G'; case 8: return 'H'; case 9: return 'I'; case 10: return 'L'; case 11: return 'K'; case 12: return 'M'; case 13: return 'F'; case 14: return 'P'; case 15: return 'S'; case 16: return 'T'; case 17: return 'W'; case 18: return 'Y'; case 19: return 'V'; case ANY: return 'X'; case GAP: return '-'; case ENDGAP: return '-'; } } else { // DNA/RNA switch(c) { case 0: return 'A'; case 1: return 'C'; case 2: return 'G'; case 3: return 'T'; case 4: return 'U'; case ANY: return 'N'; case GAP: return '-'; case ENDGAP: return '-'; } } return '?'; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms the dssp/psipred secondary structure code into an integer number */ inline char ss2i(char c) { //- H E C S T G B if (c>='a' && c<='z') c+='A'-'a'; switch (c) { case '.': return 0; case '-': return 0; case 'X': return 0; case 'H': return 1; case 'E': return 2; case 'C': return 3; case '~': return 3; case 'S': return 4; case 'T': return 5; case 'G': return 6; case 'B': return 7; case 'I': return 3; case ' ': return -1; case '\t': return -1; case '\n': return -1; } return -2; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms integers between 0 and 8 into the dssp/psipred secondary structure code */ inline char i2ss(int c) { //- H E C S T G B switch (c) { case 0: return '-'; case 1: return 'H'; case 2: return 'E'; case 3: return 'C'; case 4: return 'S'; case 5: return 'T'; case 6: return 'G'; case 7: return 'B'; case 8: return 'I'; } return '?'; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms the solvend accessiblity code into an integer number */ inline char sa2i(char c) { //- A B C D E if (c>='a' && c<='z') c+='A'-'a'; switch (c) { case '.': return 0; case '-': return 0; case 'A': return 1; case 'B': return 2; case 'C': return 3; case 'D': return 4; case 'E': return 5; case 'F': return 6; case ' ': return -1; case '\t': return -1; case '\n': return -1; } return -2; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms integers between 0 and 5 into the solvent accessibility code */ inline char i2sa(int c) { //- H E C S T G B switch (c) { case 0: return '-'; case 1: return 'A'; case 2: return 'B'; case 3: return 'C'; case 4: return 'D'; case 5: return 'E'; case 6: return 'F'; } return '?'; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms alternative secondary structure symbols into symbols */ inline char ss2ss(char c) { //- H E C S T G B switch (c) { case '~': return 'C'; case 'I': return 'C'; case 'i': return 'c'; case 'H': case 'E': case 'C': case 'S': case 'T': case 'G': case 'B': case 'h': case 'e': case 'c': case 's': case 't': case 'g': case 'b': case '.': return c; } return '-'; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms confidence values of psipred into internal code */ inline char cf2i(char c) { switch (c) { case '-': return 0; case '.': return 0; case '0': return 1; case '1': return 2; case '2': return 3; case '3': return 4; case '4': return 5; case '5': return 6; case '6': return 7; case '7': return 8; case '8': return 9; case '9': return 10; } return 0; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Transforms internal representation of psipred confidence values into printable chars */ inline char i2cf(char c) { switch (c) { case 0: return '-'; case 1: return '0'; case 2: return '1'; case 3: return '2'; case 4: return '3'; case 5: return '4'; case 6: return '5'; case 7: return '6'; case 8: return '7'; case 9: return '8'; case 10: return '9'; } return '-'; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Fast lookup of log2(1+2^(-x)) for x>=0 (precision < 0.35%) */ inline float fast_addscore(float x) { static float val[2001]; // val[i]=log2(1+2^(-x)) static char initialized; if (x>20) return 0.0; if (x<0) { fprintf(stderr,"Error in function fast_addscore: argument %g is negative\n",x); exit(7); } if (!initialized) //First fill in the log2-vector { for (int i=0; i<=2000; i++) val[i]=log2(1.0+pow(2,-0.01*(i+0.5))); initialized=1; } return val[(int)(100.0*x)]; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Little utilities for output */ inline void fout(FILE* outf, int d) { if (d>=99999) fprintf(outf,"*\t"); else fprintf(outf,"%i\t",d); return; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Errors */ int FormatError(const char infile[], const char details[]="") { cerr<<"Error in "<0 && outf.getline(line,LINELEN); n--) cout<=3) cerr<<"Warning: could not find ./.hhdefaults or "< need no warning // Scan file until line 'program_nameANYTHING' while (fgets(line,LINELEN,configf)) if (!strncmp(line,program_name,6)) break; // Found line 'program_nameANYTHING'? if (!strncmp(line,program_name,6)) { // Read in options until end-of-file or empty line while (fgets(line,LINELEN,configf) && strcmp(line,"\n")) { // Analyze line c=line; do { // Find next word while (*c==' ' || *c=='\t') c++; //Advance until next non-white space if (*c=='\0' || *c=='\n' || *c=='#') break; //Is next word empty string? c_first=c; while (*c!=' ' && *c!='\t' && *c!='#' && *c!='\0' && *c!='\n' ) c++; //Advance until next white space or '#' if (*c=='\0' || *c=='\n' || *c=='#') //Is end of line reached? { *c='\0'; argv_conf[argc_conf]=new(char[strlen(c_first)+1]); strcpy(argv_conf[argc_conf++],c_first); break; } *c='\0'; argv_conf[argc_conf]=new(char[strlen(c_first)+1]); strcpy(argv_conf[argc_conf++],c_first); printf("Argument: %s\n",c_first); c++; } while (1); } //end read line if (v>=3) { cout<<"Arguments read in from .hhdefaults:"; for (int argc=1; argc=3) cout<<"Read in "<=3) cerr<0 weighs columns according to their intra-clomun similarity par.gapb=1.405220; // default values for transition pseudocounts par.gapd=1.316760; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gape=1.793780; // gap extension penalty pseudocount par.gapf=1.034710; // factor for increasing gap open penalty for deletes par.gapg=0.894772; // factor for increasing gap open penalty for inserts par.gaph=0.544072; // factor for increasing gap extension penalty for deletes par.gapi=0.862559; // factor for increasing gap extension penalty for inserts #else /* Soeding's default*/ par.pca=1.0f; // default values for substitution matrix pseudocounts par.pcb=1.5f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pcc=1.0f; // pcs are reduced prop. to 1/Neff^pcc par.pcw=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapb=1.0; // default values for transition pseudocounts par.gapd=0.15; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gape=1.0; // gap extension penalty pseudocount par.gapf=0.6; // factor for increasing gap open penalty for deletes par.gapg=0.6; // factor for increasing gap open penalty for inserts par.gaph=0.6; // factor for increasing gap extension penalty for deletes par.gapi=0.6; // factor for increasing gap extension penalty for inserts #endif #if 0 /* Viterbi parameters optimised on Sabre (R228), FS, r228 -> r229 */ par.pcaV=1.245150f; // default values for substitution matrix pseudocounts par.pcbV=1.682110f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=1.483840f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=0.818625; // default values for transition pseudocounts par.gapdV=0.666110; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=1.028050; // gap extension penalty pseudocount par.gapfV=0.710760; // factor for increasing gap open penalty for deletes par.gapgV=1.649800; // factor for increasing gap open penalty for inserts par.gaphV=0.470604; // factor for increasing gap extension penalty for deletes par.gapiV=0.829479; // factor for increasing gap extension penalty for inserts #elif 1 /* Viterbi parameters optimised on Balibase, r244 -> r245 */ par.pcaV=1.333860f; // default values for substitution matrix pseudocounts par.pcbV=1.934480f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=1.655610f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=0.334525; // default values for transition pseudocounts par.gapdV=0.074534; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=0.320336; // gap extension penalty pseudocount par.gapfV=0.151634; // factor for increasing gap open penalty for deletes par.gapgV=0.641516; // factor for increasing gap open penalty for inserts par.gaphV=0.266434; // factor for increasing gap extension penalty for deletes par.gapiV=0.598414; // factor for increasing gap extension penalty for inserts #else /* Soeding default*/ par.pcaV=1.0f; // default values for substitution matrix pseudocounts par.pcbV=1.5f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=1.0f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=1.0; // default values for transition pseudocounts par.gapdV=0.15; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=1.0; // gap extension penalty pseudocount par.gapfV=0.6; // factor for increasing gap open penalty for deletes par.gapgV=0.6; // factor for increasing gap open penalty for inserts par.gaphV=0.6; // factor for increasing gap extension penalty for deletes par.gapiV=0.6; // factor for increasing gap extension penalty for inserts #endif par.ssm=2; // ss scoring mode: 0:no ss score 1:score after alignment 2:score during alignment par.ssw=0.11f; // weight of ss scoring par.ssa=1.0f; // weight of ss evolution matrix par.shift=-0.01f; // Shift match score up par.mact=0.3001f; // Score threshold for MAC alignment in local mode (set to 0.5001 to track user modification) par.corr=0.1f; // Weight of correlations of scores for |i-j|<=4 par.wstruc=1.0f; // Weight of structure scores par.egq=0.0f; // no charge for end gaps as default par.egt=0.0f; // no charge for end gaps as default par.trans=0; // no transitive scoring as default par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM par.wtrans=1.0f; // Ztot[k] = Zq[k] + wtrans * (Zforward[k]+Zreverse[k]) par.ssgap=0; // 1: add secondary structure-dependent gap penalties 0:off par.ssgapd=1.0f; // secondary structure-dependent gap-opening penalty (per residue) par.ssgape=0.0f; // secondary structure-dependent gap-extension penalty (per residue) par.ssgapi=4; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd par.loc=1; // local vs. global alignment as default par.altali=2; // find up to two (possibly overlapping) subalignments par.forward=0; // 0: Viterbi algorithm; 1: Viterbi+stochastic sampling; 3:Maximum Accuracy (MAC) algorithm par.realign=1; // realign with MAC algorithm par.repmode=0; // repeats score independently of one another par.columnscore=1; // Default column score is 1: null model pnul = 1/2 * (q_av(a)+p_av(a)) par.min_overlap=0; // automatic minimum overlap used par.opt=0; // Default = optimization mode off par.readdefaultsfile=0; // Default = do not read a defaults file ./.hhdefaults or HOME/.hhdefaults par.maxdbstrlen=200; // maximum length of database string to be printed in 'Command' line of hhr file par.mode=0; par.idummy=par.jdummy=0; // par.notags=1; // neutralize His-tags, FLAG-tags, C-myc-tags // Initialize strings strcpy(par.infile,"stdin"); strcpy(par.outfile,""); strcpy(par. pairwisealisfile,""); strcpy(par.buffer,"buffer.txt"); strcpy(par.scorefile,""); strcpy(par.wfile,""); strcpy(par.alnfile,""); strcpy(par.hhmfile,""); strcpy(par.psifile,""); par.exclstr=NULL; //#if PARAMETERSFROMFILE /* read parameter file from home-dir */ //#include "hhutil-C-help.h" //#endif /* read parameter file from home-dir */ if (rHhalignPara.pca >= 0.00){ par.pca = rHhalignPara.pca; } if (rHhalignPara.pcb >= 0.00){ par.pcb = rHhalignPara.pcb; } if (rHhalignPara.pcc >= 0.00){ par.pcc = rHhalignPara.pcc; } if (rHhalignPara.pcw >= 0.00){ par.pcw = rHhalignPara.pcw; } if (rHhalignPara.gapb >= 0.00){ par.gapb = rHhalignPara.gapb; } if (rHhalignPara.gapd >= 0.00){ par.gapd = rHhalignPara.gapd; } if (rHhalignPara.gape >= 0.00){ par.gape = rHhalignPara.gape; } if (rHhalignPara.gapf >= 0.00){ par.gapf = rHhalignPara.gapf; } if (rHhalignPara.gapg >= 0.00){ par.gapg = rHhalignPara.gapg; } if (rHhalignPara.gaph >= 0.00){ par.gaph = rHhalignPara.gaph; } if (rHhalignPara.gapi >= 0.00){ par.gapi = rHhalignPara.gapi; } if (rHhalignPara.pcaV >= 0.00){ par.pcaV = rHhalignPara.pcaV; } if (rHhalignPara.pcbV >= 0.00){ par.pcbV = rHhalignPara.pcbV; } if (rHhalignPara.pccV >= 0.00){ par.pccV = rHhalignPara.pccV; } if (rHhalignPara.pcwV >= 0.00){ par.pcwV = rHhalignPara.pcwV; } if (rHhalignPara.gapbV >= 0.00){ par.gapbV = rHhalignPara.gapbV; } if (rHhalignPara.gapdV >= 0.00){ par.gapdV = rHhalignPara.gapdV; } if (rHhalignPara.gapeV >= 0.00){ par.gapeV = rHhalignPara.gapeV; } if (rHhalignPara.gapfV >= 0.00){ par.gapfV = rHhalignPara.gapfV; } if (rHhalignPara.gapgV >= 0.00){ par.gapgV = rHhalignPara.gapgV; } if (rHhalignPara.gaphV >= 0.00){ par.gaphV = rHhalignPara.gaphV; } if (rHhalignPara.gapiV >= 0.00){ par.gapiV = rHhalignPara.gapiV; } return; } /** this is the end of SetDefaults() **/ void SetRnaDefaults(hhalign_para rHhalignPara) { par.pca=1.28f; // default values for substitution matrix pseudocounts par.pcb=1.75f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pcc=0.87f; // pcs are reduced prop. to 1/Neff^pcc par.pcw=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapb=0.80; // default values for transition pseudocounts par.gapd=0.34; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gape=2.25; // gap extension penalty pseudocount par.gapf=0.51; // factor for increasing gap open penalty for deletes par.gapg=1.01; // factor for increasing gap open penalty for inserts par.gaph=1.24; // factor for increasing gap extension penalty for deletes par.gapi=0.45; // factor for increasing gap extension penalty for inserts #if 0 /* these are the parameters determined by Dave (pre r274) */ par.pcaV=2.57f; // default values for substitution matrix pseudocounts par.pcbV=2.34f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=0.88f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=1.41; // default values for transition pseudocounts par.gapdV=1.8; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=1.5; // gap extension penalty pseudocount par.gapfV=1.03; // factor for increasing gap open penalty for deletes par.gapgV=0.89; // factor for increasing gap open penalty for inserts par.gaphV=0.54; // factor for increasing gap extension penalty for deletes par.gapiV=0.86; // factor for increasing gap extension penalty for inserts #else /* parameters determined for r274, using Bralibase, FS */ par.pcaV=1.655620f; // default values for substitution matrix pseudocounts par.pcbV=0.438399f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=0.371491f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=1.914490; // default values for transition pseudocounts par.gapdV=0.104278; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=1.100210; // gap extension penalty pseudocount par.gapfV=0.335152; // factor for increasing gap open penalty for deletes par.gapgV=0.786688; // factor for increasing gap open penalty for inserts par.gaphV=0.667143; // factor for increasing gap extension penalty for deletes par.gapiV=0.711993; // factor for increasing gap extension penalty for inserts #endif //#if PARAMETERSFROMFILE /* read parameter file from home-dir */ //#include "hhutil-C-help.h" //#endif /* read parameter file from home-dir */ if (rHhalignPara.pca >= 0.00){ par.pca = rHhalignPara.pca; } if (rHhalignPara.pcb >= 0.00){ par.pcb = rHhalignPara.pcb; } if (rHhalignPara.pcc >= 0.00){ par.pcc = rHhalignPara.pcc; } if (rHhalignPara.pcw >= 0.00){ par.pcw = rHhalignPara.pcw; } if (rHhalignPara.gapb >= 0.00){ par.gapb = rHhalignPara.gapb; } if (rHhalignPara.gapd >= 0.00){ par.gapd = rHhalignPara.gapd; } if (rHhalignPara.gape >= 0.00){ par.gape = rHhalignPara.gape; } if (rHhalignPara.gapf >= 0.00){ par.gapf = rHhalignPara.gapf; } if (rHhalignPara.gapg >= 0.00){ par.gapg = rHhalignPara.gapg; } if (rHhalignPara.gaph >= 0.00){ par.gaph = rHhalignPara.gaph; } if (rHhalignPara.gapi >= 0.00){ par.gapi = rHhalignPara.gapi; } if (rHhalignPara.pcaV >= 0.00){ par.pcaV = rHhalignPara.pcaV; } if (rHhalignPara.pcbV >= 0.00){ par.pcbV = rHhalignPara.pcbV; } if (rHhalignPara.pccV >= 0.00){ par.pccV = rHhalignPara.pccV; } if (rHhalignPara.pcwV >= 0.00){ par.pcwV = rHhalignPara.pcwV; } if (rHhalignPara.gapbV >= 0.00){ par.gapbV = rHhalignPara.gapbV; } if (rHhalignPara.gapdV >= 0.00){ par.gapdV = rHhalignPara.gapdV; } if (rHhalignPara.gapeV >= 0.00){ par.gapeV = rHhalignPara.gapeV; } if (rHhalignPara.gapfV >= 0.00){ par.gapfV = rHhalignPara.gapfV; } if (rHhalignPara.gapgV >= 0.00){ par.gapgV = rHhalignPara.gapgV; } if (rHhalignPara.gaphV >= 0.00){ par.gaphV = rHhalignPara.gaphV; } if (rHhalignPara.gapiV >= 0.00){ par.gapiV = rHhalignPara.gapiV; } } /* this is the end of SetRnaDefaults() */ void SetDnaDefaults(hhalign_para rHhalignPara) { par.pca=2.89f; // default values for substitution matrix pseudocounts par.pcb=1.17f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pcc=0.88f; // pcs are reduced prop. to 1/Neff^pcc par.pcw=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapb=0.80; // default values for transition pseudocounts par.gapd=0.34; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gape=2.25; // gap extension penalty pseudocount par.gapf=0.78; // factor for increasing gap open penalty for deletes par.gapg=1.01; // factor for increasing gap open penalty for inserts par.gaph=1.24; // factor for increasing gap extension penalty for deletes par.gapi=0.45; // factor for increasing gap extension penalty for inserts #if 0 /* these are the parameters determined by Dave (pre r274) */ par.pcaV=1.712f; // default values for substitution matrix pseudocounts par.pcbV=1.039f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=0.266f; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=1.405; // default values for transition pseudocounts par.gapdV=1.8; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=2.25; // gap extension penalty pseudocount par.gapfV=1.034; // factor for increasing gap open penalty for deletes par.gapgV=2.025; // factor for increasing gap open penalty for inserts par.gaphV=0.544; // factor for increasing gap extension penalty for deletes par.gapiV=1.35; // factor for increasing gap extension penalty for inserts } #else /* parameters determined for r274, using mdsa, FS */ par.pcaV=2.196; // default values for substitution matrix pseudocounts par.pcbV=0.329; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb par.pccV=0.393; // pcs are reduced prop. to 1/Neff^pcc par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity par.gapbV=0.570; // default values for transition pseudocounts par.gapdV=0.048; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits par.gapeV=1.692; // gap extension penalty pseudocount par.gapfV=0.398; // factor for increasing gap open penalty for deletes par.gapgV=0.121; // factor for increasing gap open penalty for inserts par.gaphV=0.012; // factor for increasing gap extension penalty for deletes par.gapiV=0.645; // factor for increasing gap extension penalty for inserts } #endif //#if PARAMETERSFROMFILE /* read parameter file from home-dir */ //#include "hhutil-C-help.h" //#endif /* read parameter file from home-dir */ if (rHhalignPara.pca >= 0.00){ par.pca = rHhalignPara.pca; } if (rHhalignPara.pcb >= 0.00){ par.pcb = rHhalignPara.pcb; } if (rHhalignPara.pcc >= 0.00){ par.pcc = rHhalignPara.pcc; } if (rHhalignPara.pcw >= 0.00){ par.pcw = rHhalignPara.pcw; } if (rHhalignPara.gapb >= 0.00){ par.gapb = rHhalignPara.gapb; } if (rHhalignPara.gapd >= 0.00){ par.gapd = rHhalignPara.gapd; } if (rHhalignPara.gape >= 0.00){ par.gape = rHhalignPara.gape; } if (rHhalignPara.gapf >= 0.00){ par.gapf = rHhalignPara.gapf; } if (rHhalignPara.gapg >= 0.00){ par.gapg = rHhalignPara.gapg; } if (rHhalignPara.gaph >= 0.00){ par.gaph = rHhalignPara.gaph; } if (rHhalignPara.gapi >= 0.00){ par.gapi = rHhalignPara.gapi; } if (rHhalignPara.pcaV >= 0.00){ par.pcaV = rHhalignPara.pcaV; } if (rHhalignPara.pcbV >= 0.00){ par.pcbV = rHhalignPara.pcbV; } if (rHhalignPara.pccV >= 0.00){ par.pccV = rHhalignPara.pccV; } if (rHhalignPara.pcwV >= 0.00){ par.pcwV = rHhalignPara.pcwV; } if (rHhalignPara.gapbV >= 0.00){ par.gapbV = rHhalignPara.gapbV; } if (rHhalignPara.gapdV >= 0.00){ par.gapdV = rHhalignPara.gapdV; } if (rHhalignPara.gapeV >= 0.00){ par.gapeV = rHhalignPara.gapeV; } if (rHhalignPara.gapfV >= 0.00){ par.gapfV = rHhalignPara.gapfV; } if (rHhalignPara.gapgV >= 0.00){ par.gapgV = rHhalignPara.gapgV; } if (rHhalignPara.gaphV >= 0.00){ par.gaphV = rHhalignPara.gaphV; } if (rHhalignPara.gapiV >= 0.00){ par.gapiV = rHhalignPara.gapiV; } } /* this is the end of SetDnaDefaults() */ /* * EOF hhutil-C.h */ clustal-omega-1.2.1/src/hhalign/hash-C.h0000644000175100017510000004315511457540746014675 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $ */ // hash.C // Class for Hash data structure // * works in the same way as a hash in Perl // * keys are strings of type char* // * data elements are of type Typ // * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2) // * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots /* * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $ */ #ifndef HASH #define HASH #ifndef MAIN #include // cin, cout, cerr #include // printf #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // islower, isdigit etc #include // clock #include // perror() using std::cout; using std::cerr; using std::endl; using std::ios; using std::ifstream; using std::ofstream; #endif #ifndef JLIST #define JLIST #include "list.h" // List #include "list-C.h" ////////////////////////////////// DEBUG #endif #include "hash.h" ////////////////////////////////////////////////////////////////////////////// ////////////////////// Methods of class Hash ///////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Private Methods ////////////////////////////////////////////////////////////////////////////// // Constructor and Destructor of Hash ////////////////////////////////////////////////////////////////////////////// // Constructor of class Hash ////////////////////////////////////////////////////////////////////////////// template Hash::Hash() { num_keys=0; max_len=0; prev=curr=num_slots = 0; slot=NULL; } template Hash::Hash(int nslots) { num_keys=0; max_len=0; prev=curr=num_slots = nslots; slot = new Slot*[num_slots]; //Create array of num_slots slots for (int i=0; i(0); } template Hash::Hash(int nslots, Typ f) { num_keys=0; max_len=0; prev=curr=num_slots = nslots; slot = new Slot*[num_slots]; //Create array of num_slots slots for (int i=0; i Hash::~Hash() { RemoveAll(); delete[] slot; slot = NULL; } //////////////////////////////////////////////////////////////////////////////////////////// // Hash function //////////////////////////////////////////////////////////////////////////////////////////// template inline unsigned int Hash::HashValue(char* key) //returns the hash value for key { // Calculate a hash value by the division method: // Transform key into a natural number k = sum ( key[i]*128^(L-i) ) and calculate i= k % num_slots. // Since calculating k would lead to an overflow, i is calculated iteratively // and at each iteration the part divisible by num_slots is subtracted, i.e. (% num_slots is taken). if (key==NULL) {printf("Warning from hash.C: key=NULL\n"); return 0;} unsigned int i=0; // Start of iteration: k is zero char* c = key; while(*c) i = ((i<<7) + *(c++)) % num_slots; key_len = c - key; // cerr<<" Hash value for \'"< void Hash::New(int nslots, Typ f) { fail=f; RemoveAll(); delete[] slot; slot = NULL; num_keys=0; max_len=0; prev=curr=num_slots = nslots; slot = new Slot*[num_slots]; //Create array of num_slots slots for (int i=0; i Typ Hash::Show(char* key) { Slot* pslot; int i = HashValue(key); pslot = slot[i]; if (!pslot) return fail; pslot->Reset(); do{ if(!strcmp(pslot->ReadNext().key,key)) return pslot->ReadCurrent().data; } while(!pslot->End()); return fail; } //////////////////////////////////////////////////////////////////////////////////////////// // Add/replace key/data pair to hash and return address of data element //////////////////////////////////////////////////////////////////////////////////////////// template Typ* Hash::Add(char* key, Typ data) { Pair* pairp; Slot* pslot; int i = HashValue(key); pslot = slot[i]; if (!pslot) { num_keys++; KeyLen(); slot[i]=new(Slot); return slot[i]->Push(key_len,key,data);} pslot->Reset(); do { pairp = pslot->ReadNextAddress(); if(!strcmp(pairp->key,key)) { pairp->data=data; pslot->Overwrite(*pairp); return &(pairp->data); } } while(!pslot->End()); num_keys++; KeyLen(); return pslot->Push(key_len,key,data); } //////////////////////////////////////////////////////////////////////////////////////////// // Add key to hash and return address of data element. // If key exists leave data element unchanged, else set it to 'fail'. //////////////////////////////////////////////////////////////////////////////////////////// template Typ* Hash::Add(char* key) { Slot* pslot; int i = HashValue(key); pslot = slot[i]; if (!pslot) { num_keys++; KeyLen(); slot[i]=new(Slot); return slot[i]->Push(key_len,key,fail);} pslot->Reset(); do { if(!strcmp(pslot->ReadNext().key,key)) { return &((pslot->ReadCurrentAddress())->data); } } while(!pslot->End()); num_keys++; KeyLen(); return pslot->Push(key_len,key,fail); } ///////////////////////////////////////////////////////////////////////////////////////////// // Remove key from hash and return data element for key ('fail' if key does not exist) ///////////////////////////////////////////////////////////////////////////////////////////// template Typ Hash::Remove(char* key) { Slot* pslot; int i = HashValue(key); pslot = slot[i]; if (!pslot) return fail; pslot->Reset(); do { if(!strcmp(pslot->ReadNext().key,key)) { num_keys--; pslot->Delete(); // if key was the only element in pslot then delete whole list if (pslot->Size()==0) {delete pslot; pslot = NULL;slot[i]=0;} return pslot->ReadCurrent().data; } } while(!pslot->End()); return fail; } ////////////////////////////////////////////////////////////////////////////// // Remove all keys from hash; ////////////////////////////////////////////////////////////////////////////// template void Hash::RemoveAll() { for(int i=0; i Typ Hash::ReadNext() { Pair* pairp; Slot* pslot; if (curr>=num_slots) {return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = pslot->ReadNextAddress(); if (pslot->End()) { prev=curr; do // move on to next non-empty list { if (++curr>=num_slots) return pairp->data; pslot = slot[curr]; } while (!pslot); pslot->Reset(); } return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Write next key into variable key and return data. Return 'fail' data and empty key if at end // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! ////////////////////////////////////////////////////////////////////////////// template Typ Hash::ReadNext(char* key) { Pair* pairp; Slot* pslot; if (curr>=num_slots) {*key='\0'; return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = pslot->ReadNextAddress(); strcpy(key,pairp->key); if (pslot->End()) { prev=curr; do // move on to next non-empty list { if (++curr>=num_slots) return pairp->data; pslot = slot[curr]; } while (!pslot); pslot->Reset(); } return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Return data of current key ////////////////////////////////////////////////////////////////////////////// template Typ Hash::ReadCurrent() { Pair* pairp; Slot* pslot; curr=prev; if (curr>=num_slots) {return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = &(pslot->ReadCurrent()); if (pslot->End()) { do // move on to next non-empty list { if (++curr>=num_slots) return pairp->data; pslot = slot[curr]; } while (!pslot); pslot->Reset(); } return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Write key last read into variable key and return data // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! ////////////////////////////////////////////////////////////////////////////// template Typ Hash::ReadCurrent(char* key) { Pair* pairp; Slot* pslot; curr=prev; if (curr>=num_slots) {*key='\0'; return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = &(pslot->ReadCurrent()); strcpy(key,pairp->key); if (pslot->End()) { do // move on to next non-empty list { if (++curr>=num_slots) return pairp->data; pslot = slot[curr]; } while (!pslot); pslot->Reset(); } return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Remove current key, return data, and advance to next key (after Reset() remove first element) ////////////////////////////////////////////////////////////////////////////// template Typ Hash::RemoveCurrent() { Pair* pairp; Slot* pslot; curr=prev; if (curr>=num_slots) {return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = &(pslot->Delete()); num_keys--; // if key was the only element in pslot then delete whole list if (pslot->Size()==0) {delete pslot; pslot = NULL; slot[curr]=0;} if (!pslot || pslot->End()) { do // move on to next non-empty list { if (++curr>=num_slots) {prev=curr; return pairp->data;} pslot = slot[curr]; } while (!pslot); pslot->Reset(); } prev=curr; return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Remove current key, return data, copy current key into key, and advance to next key // (After Reset() remove first element) // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! ////////////////////////////////////////////////////////////////////////////// template Typ Hash::RemoveCurrent(char* key) { Pair* pairp; Slot* pslot; curr=prev; if (curr>=num_slots) {*key='\0'; return fail;} pslot = slot[curr]; // current list is never empty, except when current=num_slots pairp = &(pslot->Delete()); strcpy(key,pairp->key); num_keys--; // if key was the only element in pslot then delete whole list if (pslot->Size()==0) {delete pslot; pslot = NULL; slot[curr]=0;} if (!pslot || pslot->End()) { do // move on to next non-empty list { if (++curr>=num_slots) {prev=curr; return pairp->data;} pslot = slot[curr]; } while (!pslot); pslot->Reset(); } prev=curr; return pairp->data; } ////////////////////////////////////////////////////////////////////////////// // Reset current position to beginning of hash ////////////////////////////////////////////////////////////////////////////// template void Hash::Reset() { curr=-1; Slot* pslot; do { curr++; if (curr>=num_slots) {prev=curr; return;} pslot = slot[curr]; } while (!pslot); pslot->Reset(); prev=curr; return; } ///////////////////////////////////////////////////////////////////////////////////////////// // Methods that return usefull information about the data stored in Hash: //////////////////////////////////////////////////////////////////////////////////////////// // Returns 1 if the hash contains key, 0 otherwise //////////////////////////////////////////////////////////////////////////////////////////// template int Hash::Contains(char* key) { Slot* pslot; int i = HashValue(key); pslot = slot[i]; if (!pslot) return 0; pslot->Reset(); do{ if(!strcmp(pslot->ReadNext().key,key)) return 1; } while(!pslot->End()); return 0; } ///////////////////////////////////////////////////////////////////////////////////////////// //print out list of keys and data ///////////////////////////////////////////////////////////////////////////////////////////// template void Hash::Print() { char key[MaxLen()+1]; cout<<"\nPrint hash:\n"; Reset(); while(!End()) cout<"< void Hash::DebugPrint() { Pair* pairp; Slot* pslot; cout<<"\n"; cout<<"Debug-print hash:"; for(int i=0; iReset(); while(!pslot->End()) { pairp = pslot->ReadNextAddress(); cout<<" "<key<<"->"<data; } } } cout<<"\n\n"; return; } #endif /* HASH */ //////////////////////////////////////////////////////////////////////////////// // Main program: test class Hash //////////////////////////////////////////////////////////////////////////////// // int main() // { // Hash ihash(5); // char* key=new char[128]; // int data; // ihash.Fail(1000); // ihash.Add("So many monsters",36); // ihash.Add("So many chickens",25); // // cerr<<"Address of ihash(\"So many monsters\") is "<"<"<"<ss_ or >sa sequences int kss_dssp; /* index of sequence with secondary structure by dssp -1:no >ss_dssp line found */ int ksa_dssp; /* index of sequence with solvent accessibility by dssp -1:no >sa_dssp line found */ int kss_pred; /* index of sequence with predicted secondary structure -1:no >ss_pred line found */ int kss_conf; /* index of sequence with confidence values of prediction -1:no >ss_conf line found */ int kfirst; // index of first real sequence char* longname; /* Full name of first sequence of original alignment (NAME field) */ char name[NAMELEN]; // HMM name = first word in longname in lower case char fam[NAMELEN]; // family ID (derived from name) (FAM field) char file[NAMELEN]; /* Rootname (w/o path, with extension) of alignment file that is used to construct the HMM */ int n_display; /* number of sequences to be displayed (INCLUDING >ss_pred, >ss_conf, >ss_dssp sequences) */ char** sname; // names of display sequences (first seq=0, first char=0) char** seq; // residues of display sequences (first char=1) int* l; // l[i] = position of i'th match state in alignment char* keep; /* keep[k]=1 if sequence is included in amino acid frequencies; 0 otherwise (first=0) */ double *pdExWeight; /* external sequence weight as given by tree FIXME (FS) */ Alignment(int maxseq=MAXSEQ, int maxres=/*MAXRES*/par.maxResLen); ~Alignment(); // Read alignment into X (uncompressed) in ASCII characters void Read(FILE* inf, char infile[NAMELEN], char* line=NULL); #ifdef CLUSTALO void Transfer(char **ppcProf, int iCnt); void ClobberGlobal(); #endif /* Convert ASCII to numbers between 0 and 20, throw out all insert states, record their number in I[k][i] and store sequences to be displayed in sname[k] and seq[k] */ void Compress(const char infile[NAMELEN]); // Apply sequence identity filter inline int FilterForDisplay(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); inline int Filter(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); int Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, int seqid2, int Ndiff); bool FilterNeff(); /* MR1 */ float filter_by_qsc(float qsc, char* dummy); /* MR1 */ // Filter alignment for min score per column with core query profile, defined by min_coverage_core and min_seqid_core int HomologyFilter(int coverage_core, float qsc_core, float coresc); // Calculate AA frequencies q.p[i][a] and transition probabilities q.tr[i][a] from alignment void FrequenciesAndTransitions(HMM& q, char* in=NULL); // Calculate freqs q.f[i][a] and transitions q.tr[i][a] (a=MM,MI,MD) with pos-specific subalignments void Amino_acid_frequencies_and_transitions_from_M_state(HMM& q, char* in); // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments void Transitions_from_D_state(HMM& q, char* in); // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments void Transitions_from_I_state(HMM& q, char* in); // Write alignment without insert states to alignment file void WriteWithoutInsertsToFile(char* alnfile); // Write alignment to alignment file void WriteToFile(char* alnfile, const char format[]=NULL); // Read a3m slave alignment of hit from ta3mfile and merge into (query) master alignment void MergeMasterSlave(Hit& hit, char ta3mfile[]); // Read a3m alignment of hit from ta3mfile and merge-combine with query alignment void Merge(Hit& hit, char ta3mfile[]); // Add a sequence to Qali void AddSequence(char Xk[], int Ik[]=NULL); // Determine matrix of position-specific weights w[k][i] for multiple alignment void GetPositionSpecificWeights(float* w[]); char readCommentLine; // Set to 1, if a comment line with '#' is read /* MR1 */ private: char** X; // X[k][i] contains column i of sequence k in alignment (first seq=0, first char=1) (0-3: ARND ..., 20:X, 21:GAP) short unsigned int** I; // I[k][i] contains the number of inserts AFTER match state i (first=0) char* display; // display[k]=1 if sequence will be displayed in output alignments; 0 otherwise (first=0) float* wg; // w[k] = global weight of sequence k int* nseqs; // number of sequences in subalignment i (only for DEBUGGING) int* nres; // number of residues in sequence k int* first; // first residue in sequence k int* last; // last residue in sequence k int* ksort; // index for sorting sequences: X[ksort[k]] int FilterWithCoreHMM(char in[], float coresc, HMM& qcore); }; clustal-omega-1.2.1/src/hhalign/hhhit-C.h0000644000175100017510000023720112156044404015036 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhhit-C.h 284 2013-06-12 10:10:11Z fabian $ */ // hhhit.C #ifndef MAIN #define MAIN #include // cin, cout, cerr #include // ofstream, ifstream #include // printf using std::cout; using std::cerr; using std::endl; using std::ios; using std::ifstream; using std::ofstream; #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // clock #include // islower, isdigit etc #include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "list.h" // list data structure #include "hash.h" // hash data structure #include "hhdecl-C.h" // constants, class #include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "hhhmm.h" // class HMM #include "hhalignment.h" // class Alignment #include "hhhitlist.h" // class HitList #endif #define CALCULATE_MAX6(max, var1, var2, var3, var4, var5, var6, varb) \ if (var1>var2) { max=var1; varb=STOP;} \ else { max=var2; varb=MM;}; \ if (var3>max) { max=var3; varb=GD;}; \ if (var4>max) { max=var4; varb=IM;}; \ if (var5>max) { max=var5; varb=DG;}; \ if (var6>max) { max=var6; varb=MI;}; #define CALCULATE_SUM6(sum, var1, var2, var3, var4, var5, var6, varb) \ if (var1>var2) { sum=var1; varb=STOP;} \ else { sum=var2; varb=MM;}; \ if (var3>sum) { sum=var3; varb=GD;}; \ if (var4>sum) { sum=var4; varb=IM;}; \ if (var5>sum) { sum=var5; varb=DG;}; \ if (var6>sum) { sum=var6; varb=MI;}; \ sum = var1 + var2 + var3 + var4 + var5 + var6; #define CALCULATE_MAX4(max, var1, var2, var3, var4, varb) \ if (var1>var2) { max=var1; varb=STOP;} \ else { max=var2; varb=MM;}; \ if (var3>max) { max=var3; varb=MI;}; \ if (var4>max) { max=var4; varb=IM;}; // Generate random number in [0,1[ #define frand() ((float) rand()/(RAND_MAX+1.0)) // Function declarations inline float Score(float* qi, float* tj); inline float ProbFwd(float* qi, float* tj); inline float max2(const float& xMM, const float& xX, char& b); inline int pickprob2(const double& xMM, const double& xX, const int& state); inline int pickprob3_GD(const double& xMM, const double& xDG, const double& xGD); inline int pickprob3_IM(const double& xMM, const double& xMI, const double& xIM); inline int pickprob6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); inline int pickmax2(const double& xMM, const double& xX, const int& state); inline int pickmax3_GD(const double& xMM, const double& xDG, const double& xGD); inline int pickmax3_IM(const double& xMM, const double& xMI, const double& xIM); inline int pickmax6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); inline double Pvalue(double x, double a[]); inline double Pvalue(float x, float lamda, float mu); inline double logPvalue(float x, float lamda, float mu); inline double logPvalue(float x, double a[]); inline double Probab(Hit& hit); ////////////////////////////////////////////////////////////////////////////// //// Constructor ////////////////////////////////////////////////////////////////////////////// Hit::Hit() { longname = name = file = dbfile = NULL; sname = NULL; seq = NULL; bMM = bGD = bDG = bIM = bMI = NULL; self = 0; i = j = NULL; states = NULL; S = S_ss = P_posterior = NULL; Xcons = NULL; B_MM=B_MI=B_IM=B_DG=B_GD=NULL; F_MM=F_MI=F_IM=F_DG=F_GD=NULL; cell_off = NULL; scale = NULL; sum_of_probs=0.0; Neff_HMM=0.0; score_ss = Pval = logPval = Eval = Probab = Pforward = 0.0; nss_conf = nfirst = i1 = i2 = j1 = j2 = matched_cols = ssm1 = ssm2 = 0; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Free all allocated memory (to delete list of hits) */ void Hit::Delete() { if (i){ delete[] i; i = NULL; } if (j){ delete[] j; j = NULL; } if (states){ delete[] states; states = NULL; } if (S){ delete[] S; S = NULL; } if (S_ss){ delete[] S_ss; S_ss = NULL; } if (P_posterior){ delete[] P_posterior; P_posterior = NULL; } if (Xcons){ delete[] Xcons; Xcons = NULL; } // delete[] l; l = NULL; i = j = NULL; states = NULL; S = S_ss = P_posterior = NULL; Xcons = NULL; if (irep==1) // if irep>1 then longname etc point to the same memory locations as the first repeat. { // but these have already been deleted. // printf("Delete name = %s\n",name);////////////////// delete[] longname; longname = NULL; delete[] name; name = NULL; delete[] file; file = NULL; delete[] dbfile; dbfile = NULL; for (int k=0; k r260 */ for (i=0; i r260 */ for (int i=0; i r260 */ for (int i=0; i=i+3 */ void Hit::Viterbi(HMM& q, HMM& t, float** Sstruc) { // Linear topology of query (and template) HMM: // 1. The HMM HMM has L+2 columns. Columns 1 to L contain // a match state, a delete state and an insert state each. // 2. The Start state is M0, the virtual match state in column i=0 (j=0). (Therefore X[k][0]=ANY) // This column has only a match state and it has only a transitions to the next match state. // 3. The End state is M(L+1), the virtual match state in column i=L+1.(j=L+1) (Therefore X[k][L+1]=ANY) // Column L has no transitions to the delete state: tr[L][M2D]=tr[L][D2D]=0. // 4. Transitions I->D and D->I are ignored, since they do not appear in PsiBlast alignments // (as long as the gap opening penalty d is higher than the best match score S(a,b)). // Pairwise alignment of two HMMs: // 1. Pair-states for the alignment of two HMMs are // MM (Q:Match T:Match) , GD (Q:Gap T:Delete), IM (Q:Insert T:Match), DG (Q:Delelte, T:Match) , MI (Q:Match T:Insert) // 2. Transitions are allowed only between the MM-state and each of the four other states. // Saving space: // The best score ending in pair state XY sXY[i][j] is calculated from left to right (j=1->t.L) // and top to bottom (i=1->q.L). To save space, only the last row of scores calculated is kept in memory. // (The backtracing matrices are kept entirely in memory [O(t.L*q.L)]). // When the calculation has proceeded up to the point where the scores for cell (i,j) are caculated, // sXY[i-1][j'] = sXY[j'] for j'>=j (A below) // sXY[i][j'] = sXY[j'] for j'=5) printf("\n"); if (self) { // If q is compared to itself, ignore cells below diagonal+SELFEXCL jmin = i+SELFEXCL; jmax = t.L; if (jmin>jmax) continue; } else { // If q is compared to t, exclude regions where overlap of q with t < min_overlap residues jmin=imax( 1, i+min_overlap-q.L); // Lq-i+j>=Ovlap => j>=i+Ovlap-Lq => jmin=max{1, i+Ovlap-Lq} jmax=imin(t.L,i-min_overlap+t.L); // Lt-j+i>=Ovlap => j<=i-Ovlap+Lt => jmax=min{Lt,i-Ovlap+Lt} } // Initialize cells if (jmin==1) { sMM_i_1_j_1 = -(i-1)*par.egq; // initialize at (i-1,0) sMM[0] = -i*par.egq; // initialize at (i,0) sIM_i_1_j_1 = sMI_i_1_j_1 = sDG_i_1_j_1 = sGD_i_1_j_1 = -FLT_MAX; // initialize at (i-1,jmin-1) } else { // Initialize at (i-1,jmin-1) if lower left triagonal is excluded due to min overlap sMM_i_1_j_1 = sMM[jmin-1]; // initialize at (i-1,jmin-1) sIM_i_1_j_1 = sIM[jmin-1]; // initialize at (i-1,jmin-1) sMI_i_1_j_1 = sMI[jmin-1]; // initialize at (i-1,jmin-1) sDG_i_1_j_1 = sDG[jmin-1]; // initialize at (i-1,jmin-1) sGD_i_1_j_1 = sGD[jmin-1]; // initialize at (i-1,jmin-1) sMM[jmin-1] = -FLT_MAX; // initialize at (i,jmin-1) } if (jmaxj+1) = sMM(i-1,(j+1)-1) = sMM[j] sGD_i_1_j_1 = sGD[j]; sIM_i_1_j_1 = sIM[j]; sDG_i_1_j_1 = sDG[j]; sMI_i_1_j_1 = sMI[j]; sMM[j]=sMI[j]=sIM[j]=sDG[j]=sGD[j]=-FLT_MAX; // sMM[j] = sMM(i,j) is cell_off } else { // Recursion relations // printf("S[%i][%i]=%4.1f ",i,j,Score(q.p[i],t.p[j])); // DEBUG!! CALCULATE_MAX6( sMM_i_j, smin, sMM_i_1_j_1 + q.tr[i-1][M2M] + t.tr[j-1][M2M], sGD_i_1_j_1 + q.tr[i-1][M2M] + t.tr[j-1][D2M], sIM_i_1_j_1 + q.tr[i-1][I2M] + t.tr[j-1][M2M], sDG_i_1_j_1 + q.tr[i-1][D2M] + t.tr[j-1][M2M], sMI_i_1_j_1 + q.tr[i-1][M2M] + t.tr[j-1][I2M], bMM[i][j] ); sMM_i_j += Score(q.p[i],t.p[j]) + ScoreSS(q,t,i,j) + par.shift + (Sstruc==NULL? 0: Sstruc[i][j]); sGD_i_j = max2 ( sMM[j-1] + t.tr[j-1][M2D], // MM->GD gap opening in query sGD[j-1] + t.tr[j-1][D2D], // GD->GD gap extension in query bGD[i][j] ); sIM_i_j = max2 ( // sMM[j-1] + q.tr[i][M2I] + t.tr[j-1][M2M] , sMM[j-1] + q.tr[i][M2I] + t.tr[j-1][M2M_GAPOPEN], // MM->IM gap opening in query sIM[j-1] + q.tr[i][I2I] + t.tr[j-1][M2M], // IM->IM gap extension in query bIM[i][j] ); sDG_i_j = max2 ( // sMM[j] + q.tr[i-1][M2D], // sDG[j] + q.tr[i-1][D2D], //gap extension (DD) in query sMM[j] + q.tr[i-1][M2D] + t.tr[j][GAPOPEN], // MM->DG gap opening in template sDG[j] + q.tr[i-1][D2D] + t.tr[j][GAPEXTD], // DG->DG gap extension in template bDG[i][j] ); sMI_i_j = max2 ( sMM[j] + q.tr[i-1][M2M] + t.tr[j][M2I], // MM->MI gap opening M2I in template sMI[j] + q.tr[i-1][M2M] + t.tr[j][I2I], // MI->MI gap extension I2I in template bMI[i][j] ); sMM_i_1_j_1 = sMM[j]; sGD_i_1_j_1 = sGD[j]; sIM_i_1_j_1 = sIM[j]; sDG_i_1_j_1 = sDG[j]; sMI_i_1_j_1 = sMI[j]; sMM[j] = sMM_i_j; sGD[j] = sGD_i_j; sIM[j] = sIM_i_j; sDG[j] = sDG_i_j; sMI[j] = sMI_i_j; //if (isnan(sMM_i_j)||isinf(sMM_i_j)){ // printf("."); /* FS*/ //} // Find maximum score; global alignment: maxize only over last row and last column if(sMM_i_j>score && (par.loc || i==q.L)) { i2=i; j2=j; score=sMM_i_j; } } // end if //printf("i= %d\tj= %d\ti2= %d\tj2= %d\tsMM= %f\tscore= %f\n", i, j, i2, j2, sMM_i_j, score); } //end for j // if global alignment: look for best cell in last column if (!par.loc && sMM_i_j>score) { i2=i; j2=jmax; score=sMM_i_j; } } // end for i state=MM; // state with maximum score is MM state // If local alignment do length correction: -log(length) if (par.loc) { if (self) score=score-log(0.5*t.L*q.L/200.0/200.0)/LAMDA - 11.2; // offset of -11.2 to get approx same mean as for -global else if (par.idummy==0 && q.lamda>0) ////////////////////////////////////////////// score=score-log(t.L*q.L/200.0/200.0)/q.lamda - 11.2; // offset of -11.2 to get approx same mean as for -global else if (par.idummy<=1) ////////////////////////////////////////////// score=score-log(t.L*q.L/200.0/200.0)/LAMDA - 11.2; // offset of -11.2 to get approx same mean as for -global } // printf("Template=%-12.12s i=%-4i j=%-4i score=%6.3f\n",t.name,i2,j2,score); delete[] sMM; sMM = NULL; delete[] sGD; sGD = NULL; delete[] sDG; sDG = NULL; delete[] sIM; sIM = NULL; delete[] sMI; sMI = NULL; return; } /* this is the end of Hit::Viterbi() */ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Compare two HMMs with Forward Algorithm in lin-space (~ 2x faster than in log-space) */ int Hit::Forward(HMM& q, HMM& t, float** Pstruc) { // Variable declarations int i,j; // query and template match state indices double pmin=(par.loc? 1.0: 0.0); // used to distinguish between SW and NW algorithms in maximization double Cshift = pow(2.0,par.shift); // score offset transformed into factor in lin-space double Pmax_i; // maximum of F_MM in row i double scale_prod=1.0; // Prod_i=1^i (scale[i]) int jmin; // First alignment of this pair of HMMs? if(irep==1) { q.tr[0][M2D] = q.tr[0][M2I] = 0.0; q.tr[0][I2M] = q.tr[0][I2I] = 0.0; q.tr[0][D2M] = q.tr[0][D2D] = 0.0; t.tr[0][M2M] = 1.0; t.tr[0][M2D] = t.tr[0][M2I] = 0.0; t.tr[0][I2M] = t.tr[0][I2I] = 0.0; t.tr[0][D2M] = t.tr[0][D2D] = 0.0; q.tr[q.L][M2M] = 1.0; q.tr[q.L][M2D] = q.tr[q.L][M2I] = 0.0; q.tr[q.L][I2M] = q.tr[q.L][I2I] = 0.0; q.tr[q.L][D2M] = 1.0; q.tr[q.L][D2D] = 0.0; t.tr[t.L][M2M] = 1.0; t.tr[t.L][M2D] = t.tr[t.L][M2I] = 0.0; t.tr[t.L][I2M] = t.tr[t.L][I2I] = 0.0; t.tr[t.L][D2M] = 1.0; t.tr[t.L][D2D] = 0.0; InitializeForAlignment(q,t); } // Initialization of top row, i.e. cells (0,j) F_MM[1][0] = F_IM[1][0] = F_GD[1][0] = F_MM[0][1] = F_MI[0][1] = F_DG[0][1] = 0.0; for (j=1; j<=t.L; j++) { if (cell_off[1][j]) F_MM[1][j] = F_MI[1][j] = F_DG[1][j] = F_IM[1][j] = F_GD[1][j] = 0.0; else { F_MM[1][j] = ProbFwd(q.p[1],t.p[j]) * fpow2(ScoreSS(q,t,1,j)) * Cshift * (Pstruc==NULL? 1: Pstruc[1][j]) ; F_MI[1][j] = F_DG[1][j] = 0.0; F_IM[1][j] = F_MM[1][j-1] * q.tr[1][M2I] * t.tr[j-1][M2M] + F_IM[1][j-1] * q.tr[1][I2I] * t.tr[j-1][M2M]; F_GD[1][j] = F_MM[1][j-1] * t.tr[j-1][M2D] + F_GD[1][j-1] * t.tr[j-1][D2D]; } } scale[0]=scale[1]=scale[2]=1.0; // Forward algorithm for (i=2; i<=q.L; i++) // Loop through query positions i { // if (v>=5) printf("\n"); if (self) jmin = imin(i+SELFEXCL+1,t.L); else jmin=1; if (scale_prod MM (BB = Begin/Begin, for local alignment) + F_GD[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][D2M] // GD -> MM + F_IM[i-1][j-1] * q.tr[i-1][I2M] * t.tr[j-1][M2M] // IM -> MM + F_DG[i-1][j-1] * q.tr[i-1][D2M] * t.tr[j-1][M2M] // DG -> MM + F_MI[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][I2M] // MI -> MM ); F_GD[i][j] = ( F_MM[i][j-1] * t.tr[j-1][M2D] // GD -> MM + F_GD[i][j-1] * t.tr[j-1][D2D] // GD -> GD + (Pstruc==NULL? 0 : F_DG[i][j-1] * t.tr[j-1][M2D] * q.tr[i][D2M] ) // DG -> GD (only when structure scores given) ); F_IM[i][j] = ( F_MM[i][j-1] * q.tr[i][M2I] * t.tr[j-1][M2M] // MM -> IM + F_IM[i][j-1] * q.tr[i][I2I] * t.tr[j-1][M2M] // IM -> IM + (Pstruc==NULL? 0 : F_MI[i][j-1] * q.tr[i][M2I] * t.tr[j-1][I2M] ) // MI -> IM (only when structure scores given) ); F_DG[i][j] = scale[i] * ( F_MM[i-1][j] * q.tr[i-1][M2D] // DG -> MM + F_DG[i-1][j] * q.tr[i-1][D2D] // DG -> DG ) ; F_MI[i][j] = scale[i] * ( F_MM[i-1][j] * q.tr[i-1][M2M] * t.tr[j][M2I] // MI -> MM + F_MI[i-1][j] * q.tr[i-1][M2M] * t.tr[j][I2I] // MI -> MI ); if(F_MM[i][j]>Pmax_i) Pmax_i=F_MM[i][j]; } // end else } //end for j pmin *= scale[i]; scale[i+1] = 1.0/(Pmax_i+1.0); // scale[i+1] = 1.0; } // end for i // Calculate P_forward * Product_{i=1}^{Lq+1}(scale[i]) if (par.loc) { Pforward = 1.0; // alignment contains no residues (see Mueckstein, Stadler et al.) for (i=1; i<=q.L; i++) // Loop through query positions i { for (j=1; j<=t.L; j++) // Loop through template positions j Pforward += F_MM[i][j]; Pforward *= scale[i+1]; } } else // global alignment { Pforward = 0.0; for (i=1; i=6) { const int i0=0, i1=q.L; const int j0=0, j1=t.L; scale_prod=1; printf("\nFwd scale "); for (j=j0; j<=j1; j++) printf("%3i ",j); printf("\n"); for (i=i0; i<=i1; i++) { scale_prod *= scale[i]; printf("%3i: %9.3G ",i,1/scale_prod); for (j=j0; j<=j1; j++) printf("%7.4f ",(F_MM[i][j]+F_MI[i][j]+F_IM[i][j]+F_DG[i][j]+F_GD[i][j])); printf("\n"); // printf(" MM %9.5f ",1/scale[i]); // for (j=j0; j<=j1; j++) // printf("%7.4f ",F_MM[i][j]); // printf("\n"); } } // printf("Template=%-12.12s score=%6.3f i2=%i j2=%i \n",t.name,score,i2,j2); /* check for NaN and or infinities, FS, r241 -> r243 */ if (isnan(score) || isinf(score) || isnan(Pforward) || isinf(Pforward) ){ fprintf(stderr, "%s:%s:%d: Forward score is %g, Pforward is %g\n", __FUNCTION__, __FILE__, __LINE__, score, Pforward); return FAILURE; } /* alignment might fail if no useful characters in sequence, FS, r259 -> r260 */ if ( (q.L <= 0) || (t.L <= 0) ){ fprintf(stderr, "%s:%s:%d: length(s) of profile(s) invalid (q.L=%d/t.L=%d)\n", __FUNCTION__, __FILE__, __LINE__, q.L, t.L); return FAILURE; } i = q.L-1; j = t.L-1; /* FS, r241 -> r243 */ if (isinf(F_MM[i][j]+F_MI[i][j]+F_IM[i][j]+F_DG[i][j]+F_GD[i][j])){ fprintf(stderr, "%s:%s:%d: F_MM[i][j]=%g, F_IM[i][j]=%g, F_MI[i][j]=%g, F_DG[i][j]=%g, F_GD[i][j]=%g (i=%d,j=%d)\n", __FUNCTION__, __FILE__, __LINE__, F_MM[i][j], F_MI[i][j], F_IM[i][j], F_DG[i][j], F_GD[i][j], i, j); return FAILURE; } return OK; } /* this is the end of Hit::Forward() */ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Compare two HMMs with Backward Algorithm (in lin-space, 2x faster), for use in MAC alignment */ int Hit::Backward(HMM& q, HMM& t) { // Variable declarations int i,j; // query and template match state indices double pmin=(par.loc? 1.0: 0.0); // used to distinguish between SW and NW algorithms in maximization double Cshift = pow(2.0,par.shift); // score offset transformed into factor in lin-space double scale_prod=scale[q.L+1]; int jmin; //double dMaxB = -1.0; // Initialization of top row, i.e. cells (0,j) for (j=t.L; j>=1; j--) { if (cell_off[q.L][j]) B_MM[q.L][j] = 0.0; else B_MM[q.L][j] = scale[q.L+1]; //dMaxB = dMaxB>B_MM[q.L][j]?dMaxB:B_MM[q.L][j]; B_IM[q.L][j] = B_MI[q.L][j] = B_DG[q.L][j] = B_GD[q.L][j] = 0.0; } if (par.loc) pmin = scale[q.L+1]; // transform pmin (for local alignment) to scale of present (i'th) row // Backward algorithm for (i=q.L-1; i>=1; i--) // Loop through query positions i { // if (v>=5) printf("\n"); if (self) jmin = imin(i+SELFEXCL,t.L); else jmin=1; // jmin = i+SELFEXCL and not (i+SELFEXCL+1) to set matrix element at boundary to zero // Initialize cells at (i,t.L+1) scale_prod *= scale[i+1]; if (cell_off[i][t.L]) B_MM[i][t.L] = 0.0; else B_MM[i][t.L] = scale_prod; //if (isnan(B_MM[i][t.L])||isinf(B_MM[i][t.L])){ // printf("."); /* FS*/ //} //dMaxB = dMaxB>B_MM[i][t.L]?dMaxB:B_MM[i][t.L]; B_IM[i][t.L] = B_MI[i][t.L] = B_DG[i][t.L] = B_GD[i][t.L] = 0.0; pmin *= scale[i+1]; // transform pmin (for local alignment) to scale of present (i'th) row for (j=t.L-1; j>=jmin; j--) // Loop through template positions j { // Recursion relations // printf("S[%i][%i]=%4.1f ",i,j,Score(q.p[i],t.p[j])); if (cell_off[i][j]) B_MM[i][j] = B_GD[i][j] = B_IM[i][j] = B_DG[i][j] = B_MI[i][j] = 0.0; else { double pmatch = B_MM[i+1][j+1] * ProbFwd(q.p[i+1],t.p[j+1]) * fpow2(ScoreSS(q,t,i+1,j+1)) * Cshift * scale[i+1]; //if (isnan(pmatch)||isinf(pmatch)){ // printf("."); /* FS*/ //} B_MM[i][j] = ( + pmin // MM -> EE (End/End, for local alignment) + pmatch * q.tr[i][M2M] * t.tr[j][M2M] // MM -> MM + B_GD[i][j+1] * t.tr[j][M2D] // MM -> GD (q.tr[i][M2M] is already contained in GD->MM) + B_IM[i][j+1] * q.tr[i][M2I] * t.tr[j][M2M] // MM -> IM + B_DG[i+1][j] * q.tr[i][M2D] * scale[i+1] // MM -> DG (t.tr[j][M2M] is already contained in DG->MM) + B_MI[i+1][j] * q.tr[i][M2M] * t.tr[j][M2I] * scale[i+1] // MM -> MI ); //if (isnan(B_MM[i][j])||isinf(B_MM[i][j])){ // printf("."); /* FS*/ //} //dMaxB = dMaxB>B_MM[i][j]?dMaxB:B_MM[i][j]; B_GD[i][j] = ( + pmatch * q.tr[i][M2M] * t.tr[j][D2M] // GD -> MM + B_GD[i][j+1] * t.tr[j][D2D] // DG -> DG ); B_IM[i][j] = ( + pmatch * q.tr[i][I2M] * t.tr[j][M2M] // IM -> MM + B_IM[i][j+1] * q.tr[i][I2I] * t.tr[j][M2M] // IM -> IM ); B_DG[i][j] = ( + pmatch * q.tr[i][D2M] * t.tr[j][M2M] // DG -> MM + B_DG[i+1][j] * q.tr[i][D2D] * scale[i+1] // DG -> DG // + B_GD[i][j+1] * q.tr[i][D2M] * t.tr[j][M2D] // DG -> GD ); B_MI[i][j] = ( + pmatch * q.tr[i][M2M] * t.tr[j][I2M] // MI -> MM + B_MI[i+1][j] * q.tr[i][M2M] * t.tr[j][I2I] * scale[i+1] // MI -> MI // + B_IM[i][j+1] * q.tr[i][M2I] * t.tr[j][I2M] // MI -> IM ); } // end else } //end for j } // end for i // Debugging output if (v>=6) { const int i0=0, i1=q.L; const int j0=0, j1=t.L; double scale_prod[q.L+2]; scale_prod[q.L] = scale[q.L+1]; for (i=q.L-1; i>=1; i--) scale_prod[i] = scale_prod[i+1] * scale[i+1]; printf("\nBwd scale "); for (j=j0; j<=j1; j++) printf("%3i ",j); printf("\n"); for (i=i0; i<=i1; i++) { printf("%3i: %9.3G ",i,1/scale_prod[i]); for (j=j0; j<=j1; j++) printf("%7.4f ",(B_MM[i][j]+B_MI[i][j]+B_IM[i][j]+B_DG[i][j]+B_GD[i][j]) * (ProbFwd(q.p[i],t.p[j])*fpow2(ScoreSS(q,t,i,j)) * Cshift)); printf("\n"); // printf("MM %9.5f ",1/scale[i]); // for (j=j0; j<=j1; j++) // printf("%7.4f ",B_MM[i][j] * (ProbFwd(q.p[i],t.p[j])*fpow2(ScoreSS(q,t,i,j)) * Cshift)); // printf("\n"); } printf("\nPost scale "); for (j=j0; j<=j1; j++) printf("%3i ",j); printf("\n"); for (i=i0; i<=i1; i++) { printf("%3i: %9.3G ",i,1/scale_prod[i]); for (j=j0; j<=j1; j++) printf("%7.4f ",B_MM[i][j]*F_MM[i][j]/Pforward); printf("\n"); } printf("\n"); } if (v>=4) printf("\nForward total probability ratio: %8.3G\n",Pforward); // Calculate Posterior matrix and overwrite Backward matrix with it for (i=1; i<=q.L; i++) { for (j=1; j<=t.L; j++) { B_MM[i][j] *= F_MM[i][j]/Pforward; //if (isnan(B_MM[i][j]) || isinf(B_MM[i][j])){ // printf("."); /* FS*/ //} //dMaxB = dMaxB>B_MM[i][j]?dMaxB:B_MM[i][j]; } } //printf("Max-B_MM = %f\n", dMaxB); /* check for NaN and or infinities, FS, r241 -> r243 */ if (isnan(score) || isinf(score)){ fprintf(stderr, "%s:%s:%d: Backward score is %g\n", __FUNCTION__, __FILE__, __LINE__, score); return FAILURE; } i = j = 1; if (isinf(B_MM[i][j]+B_MI[i][j]+B_IM[i][j]+B_DG[i][j]+B_GD[i][j])){ fprintf(stderr, "%s:%s:%d: B_MM[1][1]=%g, B_IM[1][1]=%g, B_MI[1][1]=%g, B_DG[1][1]=%g, B_GD[1][1]=%g\n", __FUNCTION__, __FILE__, __LINE__, B_MM[i][j], B_MI[i][j], B_IM[i][j], B_DG[i][j], B_GD[i][j]); for (i = 1; (i < q.L) && isinf(B_MM[i][1]); i++); i--; for (j = 1; (j < t.L) && isinf(B_MM[i][j]); j++); j--; fprintf(stderr, "%s:%s:%d: B_MM[%d][%d]=%g, B_MM[%d][%d]=%g, B_MM[%d][%d]=%g\n", __FUNCTION__, __FILE__, __LINE__, i, j, B_MM[i][j], i+1, 1, B_MM[i+1][1], i, j+1, B_MM[i][j+1]); return FAILURE; } return OK; } /* this is the end of Hit::Backward() */ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Maximum Accuracy alignment */ void Hit::MACAlignment(HMM& q, HMM& t) { // Use Forward and Backward matrices to find that alignment which // maximizes the expected number of correctly aligned pairs of residues (mact=0) // or, more generally, which maximizes the expectation value of the number of // correctly aligned pairs minus (mact x number of aligned pairs) // "Correctly aligned" can be based on posterior probabilities calculated with // a local or a global version of the Forward-Backward algorithm. int i,j; // query and template match state indices int jmin,jmax; // range of dynamic programming for j double** S=F_MI; // define alias for new score matrix double score_MAC; // score of the best MAC alignment // Initialization of top row, i.e. cells (0,j) for (j=0; j<=t.L; j++) S[0][j] = 0.0; score_MAC=-INT_MAX; i2=j2=0; bMM[0][0]=STOP; // Dynamic programming for (i=1; i<=q.L; i++) // Loop through query positions i { if (self) { // If q is compared to itself, ignore cells below diagonal+SELFEXCL jmin = i+SELFEXCL; jmax = t.L; if (jmin>jmax) continue; } else { // If q is compared to t, exclude regions where overlap of q with t < min_overlap residues jmin=imax( 1, i+min_overlap-q.L); // Lq-i+j>=Ovlap => j>=i+Ovlap-Lq => jmin=max{1, i+Ovlap-Lq} jmax=imin(t.L,i-min_overlap+t.L); // Lt-j+i>=Ovlap => j<=i-Ovlap+Lt => jmax=min{Lt,i-Ovlap+Lt} } // Initialize cells S[i][jmin-1] = 0.0; if (jmaxscore_MAC && (par.loc || i==q.L)) { i2=i; j2=j; score_MAC=S[i][j]; } } // end if } //end for j // if global alignment: look for best cell in last column if (!par.loc && S[i][jmax]>score_MAC) { i2=i; j2=jmax; score_MAC=S[i][jmax]; } } // end for i // DEBUG if (v>=5) { printf("\nScore "); for (j=0; j<=t.L; j++) printf("%3i ",j); printf("\n"); for (i=0; i<=q.L; i++) { printf("%2i: ",i); for (j=0; j<=t.L; j++) printf("%5.2f ",S[i][j]); printf("\n"); } printf("\n"); printf("Template=%-12.12s i=%-4i j=%-4i score=%6.3f\n",t.name,i2,j2,score); } return; } /* this is the end of Hit::MACAlignment() */ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Trace back alignment of two profiles based on matrices bXX[][] */ void Hit::Backtrace(HMM& q, HMM& t) { // Trace back trough the matrices bXY[i][j] until first match state is found (STOP-state) int step; // counts steps in path through 5-layered dynamic programming matrix int i,j; // query and template match state indices InitializeBacktrace(q,t); // Make sure that backtracing stops when t:M1 or q:M1 is reached (Start state), e.g. sMM[i][1], or sIM[i][1] (M:MM, B:IM) for (i=0; i<=q.L; i++) bMM[i][1]=bGD[i][1]=bIM[i][1] = STOP; for (j=1; j<=t.L; j++) bMM[1][j]=bDG[1][j]=bMI[1][j] = STOP; // Back-tracing loop matched_cols=0; // for each MACTH (or STOP) state matched_col is incremented by 1 step=0; // steps through the matrix correspond to alignment columns (from 1 to nsteps) // state=MM; // state with maximum score must be MM state // already set at the end of Viterbi() i=i2; j=j2; // last aligned pair is (i2,j2) while (state) // while (state!=STOP) because STOP=0 { step++; states[step] = state; this->i[step] = i; this->j[step] = j; // Exclude cells in direct neighbourhood from all further alignments for (int ii=imax(i-2,1); ii<=imin(i+2,q.L); ii++) cell_off[ii][j]=1; for (int jj=imax(j-2,1); jj<=imin(j+2,t.L); jj++) cell_off[i][jj]=1; switch (state) { case MM: // current state is MM, previous state is bMM[i][j] matched_cols++; state = bMM[i--][j--]; break; case GD: // current state is GD switch (bGD[i][j--]) { case STOP: state = STOP; break; // current state does not have predecessor case MM: state = MM; break; // previous state is Match state } // default: previous state is same state (GD) break; case IM: switch (bIM[i][j--]) { case STOP: state = STOP; break; // current state does not have predecessor case MM: state = MM; break; // previous state is Match state } // default: previous state is same state (IM) break; case DG: switch (bDG[i--][j]) { case STOP: state = STOP; break; // current state does not have predecessor case MM: state = MM; break; // previous state is Match state } // default: previous state is same state (DG) break; case MI: switch (bMI[i--][j]) { case STOP: state = STOP; break; // current state does not have predecessor case MM: state = MM; break; // previous state is Match state } // default: previous state is same state (MI) break; default: fprintf(stderr,"Error: unallowed state value %i occurred during backtracing at step %i, (i,j)=(%i,%i)\n",state,step,i,j); state=0; v=4; break; } //end switch (state) } //end while (state) i1 = this->i[step]; j1 = this->j[step]; states[step] = MM; // first state (STOP state) is set to MM state nsteps=step; // Allocate new space for alignment scores if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query S = new( float[nsteps+1]); S_ss = new( float[nsteps+1]); if (!S_ss) MemoryError("space for HMM-HMM alignments"); // Add contribution from secondary structure score, record score along alignment, // and record template consensus sequence in master-slave-alignment to query sequence score_ss=0.0f; int ssm=ssm1+ssm2; for (step=1; step<=nsteps; step++) { switch(states[step]) { case MM: i = this->i[step]; j = this->j[step]; S[step] = Score(q.p[i],t.p[j]); S_ss[step] = ScoreSS(q,t,i,j,ssm); score_ss += S_ss[step]; if (Xcons) Xcons[i]=t.Xcons[j]; //record database consensus sequence break; case MI: //if gap in template case DG: if (Xcons) Xcons[this->i[step]]=GAP; //(no break hereafter) default: //if gap in T or Q S[step]=S_ss[step]=0.0f; break; } } if (ssm2>=1) score-=score_ss; // subtract SS score added during alignment!!!! if (Xcons) { for (i=0; i=4) { printf("NAME=%7.7s score=%7.3f score_ss=%7.3f\n",name,score,score_ss); printf("step Q T i j state score T Q cf ss-score\n"); for (step=nsteps; step>=1; step--) { switch(states[step]) { case MM: printf("%4i %1c %1c ",step,q.seq[q.nfirst][this->i[step]],seq[nfirst][this->j[step]]); break; case GD: case IM: printf("%4i - %1c ",step,seq[nfirst][this->j[step]]); break; case DG: case MI: printf("%4i %1c - ",step,q.seq[q.nfirst][this->i[step]]); break; } printf("%4i %4i %2i %7.2f ",this->i[step],this->j[step],(int)states[step],S[step]); printf("%c %c %1i %7.2f\n",i2ss(t.ss_dssp[this->j[step]]),i2ss(q.ss_pred[this->i[step]]),q.ss_conf[this->i[step]]-1,S_ss[step]); } } return; } /* this is the end of Hit::Backtrace() */ ///////////////////////////////////////////////////////////////////////////////////// /** * @brief GLOBAL stochastic trace back through the forward matrix of probability ratios */ void Hit::StochasticBacktrace(HMM& q, HMM& t, char maximize) { int step; // counts steps in path through 5-layered dynamic programming matrix int i,j; // query and template match state indices // float pmin=(par.loc? 1.0: 0.0); // used to distinguish between SW and NW algorithms in maximization const float pmin=0; double* scale_cum = new(double[q.L+2]); scale_cum[0]=1; for (i=1; i<=q.L+1; i++) scale_cum[i] = scale_cum[i-1]*scale[i]; // Select start cell for GLOBAL alignment // (Implementing this in a local version would make this method work for local backtracing as well) if (maximize) { double F_max=0; for (i=q.L-1; i>=1; i--) if (F_MM[i][t.L]/scale_cum[i]>F_max) {i2=i; j2=t.L; F_max=F_MM[i][t.L]/scale_cum[i];} for (j=t.L; j>=1; j--) if (F_MM[q.L][j]/scale_cum[q.L]>F_max) {i2=q.L; j2=j; F_max=F_MM[q.L][j]/scale_cum[q.L];} } else { // float sumF[q.L+t.L]; double* sumF=new(double[q.L+t.L]); sumF[0]=0.0; for (j=1; j<=t.L; j++) sumF[j] = sumF[j-1] + F_MM[q.L][j]/scale_cum[q.L];; for (j=t.L+1; ji[step] = i; this->j[step] = j; switch (state) { case MM: // current state is MM, previous state is state // fprintf(stderr,"%4i %1c %1c %4i %4i MM %7.2f\n",step,q.seq[q.nfirst][i],seq[nfirst][j],i,j,Score(q.p[i],t.p[j])); // printf("0:%7.3f MM:%7.3f GD:%7.3f IM:%7.3f DG:%7.3f MI:%7.3f \n", // pmin*scale_cum[i-1], // F_MM[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][M2M], // F_GD[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][D2M], // F_IM[i-1][j-1] * q.tr[i-1][I2M] * t.tr[j-1][M2M], // F_DG[i-1][j-1] * q.tr[i-1][D2M] * t.tr[j-1][M2M], // F_MI[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][I2M]); matched_cols++; if (j>1 && i>1) state = (*pick6)( pmin*scale_cum[i-1], F_MM[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][M2M], F_GD[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][D2M], F_IM[i-1][j-1] * q.tr[i-1][I2M] * t.tr[j-1][M2M], F_DG[i-1][j-1] * q.tr[i-1][D2M] * t.tr[j-1][M2M], F_MI[i-1][j-1] * q.tr[i-1][M2M] * t.tr[j-1][I2M] ); else state=0; i--; j--; break; case GD: // current state is GD // fprintf(stderr,"%4i - %1c %4i %4i GD %7.2f\n",step,q.seq[q.nfirst][j],i,j,Score(q.p[i],t.p[j])); if (j>1) state = (*pick3_GD)( F_MM[i][j-1] * t.tr[j-1][M2D], F_DG[i][j-1] * t.tr[j-1][M2D] * q.tr[i][D2M], // DG -> GD F_GD[i][j-1] * t.tr[j-1][D2D] // gap extension (DD) in template ); else state=0; j--; break; case IM: // fprintf(stderr,"%4i - %1c %4i %4i IM %7.2f\n",step,q.seq[q.nfirst][j],i,j,Score(q.p[i],t.p[j])); if (j>1) state = (*pick3_IM)( F_MM[i][j-1] * q.tr[i][M2I] * t.tr[j-1][M2M_GAPOPEN], F_MI[i][j-1] * q.tr[i][M2I] * t.tr[j-1][I2M], // MI -> IM F_IM[i][j-1] * q.tr[i][I2I] * t.tr[j-1][M2M] // gap extension (II) in query ); else state=0; j--; break; case DG: // fprintf(stderr,"%4i %1c - %4i %4i DG %7.2f\n",step,q.seq[q.nfirst][i],i,j,Score(q.p[i],t.p[j])); if (i>1) state = (*pick2)( F_MM[i-1][j] * q.tr[i-1][M2D] * t.tr[j][GAPOPEN], F_DG[i-1][j] * q.tr[i-1][D2D] * t.tr[j][GAPEXTD], //gap extension (DD) in query DG ); else state=0; i--; break; case MI: // fprintf(stderr,"%4i %1c - %4i %4i MI %7.2f\n",step,q.seq[q.nfirst][i],i,j,Score(q.p[i],t.p[j])); if (i>1) state = (*pick2)( F_MM[i-1][j] * q.tr[i-1][M2M] * t.tr[j][M2I], F_MI[i-1][j] * q.tr[i-1][M2M] * t.tr[j][I2I], //gap extension (II) in template MI ); else state=0; i--; break; } //end switch (state) } //end while (state) i1 = this->i[step]; j1 = this->j[step]; states[step] = MM; // first state (STOP state) is set to MM state nsteps=step; // Allocate new space for alignment scores if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query S = new( float[nsteps+1]); S_ss = new( float[nsteps+1]); if (!S_ss) MemoryError("space for HMM-HMM alignments"); // Add contribution from secondary structure score, record score along alignment, // and record template consensus sequence in master-slave-alignment to query sequence score_ss=0.0f; int ssm=ssm1+ssm2; for (step=1; step<=nsteps; step++) { switch(states[step]) { case MM: i = this->i[step]; j = this->j[step]; S[step] = Score(q.p[i],t.p[j]); S_ss[step] = ScoreSS(q,t,i,j,ssm); score_ss += S_ss[step]; if (Xcons) Xcons[i]=t.Xcons[j]; //record database consensus sequence break; case MI: //if gap in template case DG: if (Xcons) Xcons[this->i[step]]=GAP; //(no break hereafter) default: //if gap in T or Q S[step]=S_ss[step]=0.0f; break; } } if (ssm2>=1) score-=score_ss; // subtract SS score added during alignment!!!! if (Xcons) { for (i=0; ii[step] = i; this->j[step] = j; // Exclude cells in direct neighbourhood from all further alignments for (int ii=imax(i-2,1); ii<=imin(i+2,q.L); ii++) cell_off[ii][j]=1; for (int jj=imax(j-2,1); jj<=imin(j+2,t.L); jj++) cell_off[i][jj]=1; if (state==MM) matched_cols++; switch (state) { case MM: i--; j--; break; case IM: j--; break; case MI: i--; break; case STOP: break; default: fprintf(stderr,"Error: unallowed state value %i occurred during backtracing at step %i, (i,j)=(%i,%i)\n",state,step,i,j); state=0; v=4; break; } //end switch (state) } //end while (state) i1 = this->i[step]; j1 = this->j[step]; states[step] = MM; // first state (STOP state) is set to MM state nsteps=step; // Allocate new space for alignment scores if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query S = new( float[nsteps+1]); S_ss = new( float[nsteps+1]); P_posterior = new( float[nsteps+1]); if (!P_posterior) MemoryError("space for HMM-HMM alignments"); // Add contribution from secondary structure score, record score along alignment, // and record template consensus sequence in master-slave-alignment to query sequence score_ss=0.0f; sum_of_probs=0.0; // number of identical residues in query and template sequence int ssm=ssm1+ssm2; // printf("Hit=%s\n",name); ///////////////////////////////////////////////////////////// for (step=1; step<=nsteps; step++) { switch(states[step]) { case MM: i = this->i[step]; j = this->j[step]; S[step] = Score(q.p[i],t.p[j]); S_ss[step] = ScoreSS(q,t,i,j,ssm); score_ss += S_ss[step]; P_posterior[step] = B_MM[this->i[step]][this->j[step]]; // Add probability to sum of probs if no dssp states given or dssp states exist and state is resolved in 3D structure if (t.nss_dssp<0 || t.ss_dssp[j]>0) sum_of_probs += P_posterior[step]; // printf("j=%-3i dssp=%1i P=%4.2f sum=%6.2f\n",j,t.ss_dssp[j],P_posterior[step],sum_of_probs); ////////////////////////// if (Xcons) Xcons[i]=t.Xcons[j]; //record database consensus sequence break; case MI: //if gap in template case DG: if (Xcons) Xcons[this->i[step]]=GAP; //(no break hereafter) default: //if gap in T or Q S[step] = S_ss[step] = P_posterior[step] = 0.0; break; } } // printf("\n"); ///////////////////////////////////////////////////////////// if (ssm2>=1) score-=score_ss; // subtract SS score added during alignment!!!! if (Xcons) { for (i=0; i=4) { float sum_post=0.0; printf("NAME=%7.7s score=%7.3f score_ss=%7.3f\n",name,score,score_ss); printf("step Q T i j state score T Q cf ss-score P_post Sum_post\n"); for (step=nsteps; step>=1; step--) { switch(states[step]) { case MM: sum_post+=P_posterior[step]; printf("%4i %1c %1c ",step,q.seq[q.nfirst][this->i[step]],seq[nfirst][this->j[step]]); break; case IM: printf("%4i - %1c ",step,seq[nfirst][this->j[step]]); break; case MI: printf("%4i %1c - ",step,q.seq[q.nfirst][this->i[step]]); break; } printf("%4i %4i %2i %7.1f ",this->i[step],this->j[step],(int)states[step],S[step]); printf("%c %c %1i %7.1f ",i2ss(t.ss_dssp[this->j[step]]),i2ss(q.ss_pred[this->i[step]]),q.ss_conf[this->i[step]]-1,S_ss[step]); printf("%7.5f %7.2f\n",P_posterior[step],sum_post); } } return; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Functions that calculate probabilities */ void Hit::InitializeForAlignment(HMM& q, HMM& t) { int i,j; // SS scoring during (ssm2>0) or after (ssm1>0) alignment? Query SS known or Template SS known? switch (par.ssm) { case 0: ssm1=0; ssm2=0; break; case 1: ssm2=0; // SS scoring after alignment if (t.nss_dssp>=0 && q.nss_pred>=0) ssm1=1; else if (q.nss_dssp>=0 && t.nss_pred>=0) ssm1=2; else if (q.nss_pred>=0 && t.nss_pred>=0) ssm1=3; else ssm1=0; break; case 2: ssm1=0; // SS scoring during alignment if (t.nss_dssp>=0 && q.nss_pred>=0) ssm2=1; else if (q.nss_dssp>=0 && t.nss_pred>=0) ssm2=2; else if (q.nss_pred>=0 && t.nss_pred>=0) ssm2=3; else ssm2=0; break; case 3: ssm2=0; // SS scoring after alignment if (q.nss_pred>=0 && t.nss_pred>=0) ssm1=3; else ssm1=0; break; case 4: ssm1=0; // SS scoring during alignment if (q.nss_pred>=0 && t.nss_pred>=0) ssm2=3; else ssm2=0; break; // case 5: // ssm2=0; // SS scoring after alignment // if (q.nss_dssp>=0 && t.nss_dssp>=0) ssm1=4; else ssm1=0; // break; // case 6: // ssm1=0; // SS scoring during alignment // if (q.nss_dssp>=0 && t.nss_dssp>=0) ssm2=4; else ssm2=0; // break; } if (self) { // Cross out cells in lower diagonal for self-comparison? for (i=1; i<=q.L; i++) { int jmax = imin(i+SELFEXCL,t.L); for (j=1; j<=jmax; j++) cell_off[i][j]=1; // cross out cell near diagonal for (j=jmax+1; j<=t.L+1; j++) cell_off[i][j]=0; // no other cells crossed out yet } } else // Compare two different HMMs Q and T { // Activate all cells in dynamic programming matrix for (i=1; i<=q.L; i++) for (j=1; j<=t.L; j++) cell_off[i][j]=0; // no other cells crossed out yet // Cross out cells that are excluded by the minimum-overlap criterion if (par.min_overlap==0) min_overlap = imin(60, (int)(0.333f*imin(q.L,t.L))+1); // automatic minimum overlap else min_overlap = imin(par.min_overlap, (int)(0.8f*imin(q.L,t.L))); for (i=0; i=Ovlap => j<=i-Ovlap+Lt => jmax=min{Lt,i-Ovlap+Lt} cell_off[i][j]=1; for (i=q.L-min_overlap+1; i<=q.L; i++) for (j=1; j=Ovlap => j>=i+Ovlap-Lq => jmin=max{1, i+Ovlap-Lq} cell_off[i][j]=1; } // Cross out rows which are contained in range given by exclstr ("3-57,238-314") if (par.exclstr) { char* ptr=par.exclstr; int i0, i1; while (1) { i0 = abs(strint(ptr)); i1 = abs(strint(ptr)); if (!ptr) break; for (i=i0; i<=imin(i1,q.L); i++) for (j=1; j<=t.L; j++) cell_off[i][j]=1; } } } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Allocate memory for data of new alignment (sequence names, alignment, scores,...) */ void Hit::InitializeBacktrace(HMM& q, HMM& t) { if (irep==1) //if this is the first single repeat repeat hit with this template { //Copy information about template profile to hit and reset template pointers to avoid destruction longname=new(char[strlen(t.longname)+1])(); name =new(char[strlen(t.name)+1])(); file =new(char[strlen(t.file)+1])(); if (!file) { MemoryError("space for alignments with database HMMs. \nNote that all alignments have to be kept in memory"); } strcpy(longname,t.longname); strcpy(name,t.name); strcpy(fam ,t.fam); strcpy(sfam ,t.sfam); strcpy(fold ,t.fold); strcpy(cl ,t.cl); strcpy(file,t.file); sname=new(char*[t.n_display])(); // Call Compare only once with irep=1 seq =new(char*[t.n_display])(); // Call Compare only once with irep=1 if (!sname || !seq) { MemoryError("space for alignments with database HMMs.\nNote that all sequences for display have to be kept in memory"); } for (int k=0; ki = new( int[i2+j2+2])(); this->j = new( int[i2+j2+2])(); states = new( char[i2+j2+2])(); S = S_ss = P_posterior = NULL; // set to NULL to avoid deleting data from irep=1 when hit with irep=2 is removed Xcons = NULL; } /* this is the end of Hit::InitializeBacktrace() */ ///////////////////////////////////////////////////////////////////////////////////// // Some score functions ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Calculate score between columns i and j of two HMMs (query and template) */ inline float Score(float* qi, float* tj) { // if (par.columnscore==9) // return (tj[0] *qi[0] +tj[1] *qi[1] +tj[2] *qi[2] +tj[3] *qi[3] +tj[4]*qi[4] // +tj[5] *qi[5] +tj[6] *qi[6] +tj[7] *qi[7] +tj[8] *qi[8] +tj[9]*qi[9] // +tj[10]*qi[10]+tj[11]*qi[11]+tj[12]*qi[12]+tj[13]*qi[13]+tj[14]*qi[14] // +tj[15]*qi[15]+tj[16]*qi[16]+tj[17]*qi[17]+tj[18]*qi[18]+tj[19]*qi[19]); // else return fast_log2( tj[0] *qi[0] +tj[1] *qi[1] +tj[2] *qi[2] +tj[3] *qi[3] +tj[4] *qi[4] +tj[5] *qi[5] +tj[6] *qi[6] +tj[7] *qi[7] +tj[8] *qi[8] +tj[9] *qi[9] +tj[10]*qi[10]+tj[11]*qi[11]+tj[12]*qi[12]+tj[13]*qi[13]+tj[14]*qi[14] +tj[15]*qi[15]+tj[16]*qi[16]+tj[17]*qi[17]+tj[18]*qi[18]+tj[19]*qi[19] ); } /** * @brief Calculate score between columns i and j of two HMMs (query and template) */ inline float ProbFwd(float* qi, float* tj) { return tj[0] *qi[0] +tj[1] *qi[1] +tj[2] *qi[2] +tj[3] *qi[3] +tj[4] *qi[4] +tj[5] *qi[5] +tj[6] *qi[6] +tj[7] *qi[7] +tj[8] *qi[8] +tj[9] *qi[9] +tj[10]*qi[10]+tj[11]*qi[11]+tj[12]*qi[12]+tj[13]*qi[13]+tj[14]*qi[14] +tj[15]*qi[15]+tj[16]*qi[16]+tj[17]*qi[17]+tj[18]*qi[18]+tj[19]*qi[19]; } /** * @brief Calculate secondary structure score between columns i and j of two HMMs (query and template) */ inline float Hit::ScoreSS(HMM& q, HMM& t, int i, int j, int ssm) { switch (ssm) //SS scoring during alignment { case 0: // no SS scoring during alignment return 0.0; case 1: // t has dssp information, q has psipred information return par.ssw * S73[ (int)t.ss_dssp[j]][ (int)q.ss_pred[i]][ (int)q.ss_conf[i]]; case 2: // q has dssp information, t has psipred information return par.ssw * S73[ (int)q.ss_dssp[i]][ (int)t.ss_pred[j]][ (int)t.ss_conf[j]]; case 3: // q has dssp information, t has psipred information return par.ssw * S33[ (int)q.ss_pred[i]][ (int)q.ss_conf[i]][ (int)t.ss_pred[j]][ (int)t.ss_conf[j]]; // case 4: // q has dssp information, t has dssp information // return par.ssw*S77[ (int)t.ss_dssp[j]][ (int)t.ss_conf[j]]; } return 0.0; } /** * @brief Calculate secondary structure score between columns i and j of two HMMs (query and template) */ inline float Hit::ScoreSS(HMM& q, HMM& t, int i, int j) { return ScoreSS(q,t,i,j,ssm2); } /** * @brief Calculate score between columns i and j of two HMMs (query and template) */ inline float Hit::ScoreTot(HMM& q, HMM& t, int i, int j) { return Score(q.p[i],t.p[j]) + ScoreSS(q,t,i,j) + par.shift; } /* * Calculate score between columns i and j of two HMMs (query and template) */ inline float Hit::ScoreAA(HMM& q, HMM& t, int i, int j) { return Score(q.p[i],t.p[j]); } ///////////////////////////////////////////////////////////////////////////////////// /* * Function for Viterbi() */ inline float max2(const float& xMM, const float& xX, char& b) { if (xMM>xX) { b=MM; return xMM;} else { b=SAME; return xX;} } ///////////////////////////////////////////////////////////////////////////////////// /* * Functions for StochasticBacktrace() */ inline int pickprob2(const double& xMM, const double& xX, const int& state) { if ( (xMM+xX)*frand() < xMM) return MM; else return state; } inline int pickprob3_GD(const double& xMM, const double& xDG, const double& xGD) { double x = (xMM+xDG+xGD)*frand(); if ( x xX) return MM; else return state; } inline int pickmax3_GD(const double& xMM, const double& xDG, const double& xGD) { char state; double x; if ( xMM>xDG) {state=MM; x=xMM;} else {state=DG; x=xDG;} if ( xGD>x) {state=GD; x=xGD;} return state; } inline int pickmax3_IM(const double& xMM, const double& xMI, const double& xIM) { char state; double x; if ( xMM>xMI) {state=MM; x=xMM;} else {state=MI; x=xMI;} if ( xIM>x) {state=IM; x=xIM;} return state; } inline int pickmax6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI) { char state; double x; if ( x0 >xMM) {state=STOP; x=x0;} else {state=MM; x=xMM;} if ( xGD>x) {state=GD; x=xGD;} if ( xIM>x) {state=IM; x=xIM;} if ( xDG>x) {state=DG; x=xDG;} if ( xMI>x) {state=MI; x=xMI;} return state; } ///////////////////////////////////////////////////////////////////////////////////// //// Functions that calculate P-values and probabilities ///////////////////////////////////////////////////////////////////////////////////// //// Evaluate the CUMULATIVE extreme value distribution at point x //// p(s)ds = lamda * exp{ -exp[-lamda*(s-mu)] - lamda*(s-mu) } ds = exp( -exp(-x) - x) dx = p(x) dx //// => P(s>S) = integral_-inf^inf {p(x) dx} = 1 - exp{ -exp[-lamda*(S-mu)] } inline double Pvalue(double x, double a[]) { //a[0]=lamda, a[1]=mu double h = a[0]*(x-a[1]); return (h>10)? exp(-h) : double(1.0)-exp( -exp(-h)); } inline double Pvalue(float x, float lamda, float mu) { double h = lamda*(x-mu); return (h>10)? exp(-h) : (double(1.0)-exp( -exp(-h))); } inline double logPvalue(float x, float lamda, float mu) { double h = lamda*(x-mu); return (h>10)? -h : (h<-2.5)? -exp(-exp(-h)): log( ( double(1.0) - exp(-exp(-h)) ) ); } inline double logPvalue(float x, double a[]) { double h = a[0]*(x-a[1]); return (h>10)? -h : (h<-2.5)? -exp(-exp(-h)): log( ( double(1.0) - exp(-exp(-h)) ) ); } // Calculate probability of true positive : p_TP(score)/( p_TP(score)+p_FP(score) ) // TP: same superfamily OR MAXSUB score >=0.1 inline double Probab(Hit& hit) { double s=-hit.score_aass; double t; if (s>200) return 100.0; if (par.loc) { if (par.ssm && (hit.ssm1 || hit.ssm2) && par.ssw>0) { // local with SS const double a=sqrt(6000.0); const double b=2.0*2.5; const double c=sqrt(0.12); const double d=2.0*32.0; t = a*exp(-s/b) + c*exp(-s/d); } else { // local no SS const double a=sqrt(4000.0); const double b=2.0*2.5; const double c=sqrt(0.15); const double d=2.0*34.0; t = a*exp(-s/b) + c*exp(-s/d); } } else { if ( (par.ssm>0) && (par.ssw>0) ) /* FIXME: was '&', should be '&&' (or not?) */ { // global with SS const double a=sqrt(4000.0); const double b=2.0*3.0; const double c=sqrt(0.13); const double d=2.0*34.0; t = a*exp(-s/b) + c*exp(-s/d); } else { // global no SS const double a=sqrt(6000.0); const double b=2.0*2.5; const double c=sqrt(0.10); const double d=2.0*37.0; t = a*exp(-s/b) + c*exp(-s/d); } } return 100.0/(1.0+t*t); } // #define Weff(Neff) (1.0+par.neffa*(Neff-1.0)+(par.neffb-4.0*par.neffa)/16.0*(Neff-1.0)*(Neff-1.0)) // ///////////////////////////////////////////////////////////////////////////////////// // // Merge HMM with next aligned HMM // ///////////////////////////////////////////////////////////////////////////////////// // void Hit::MergeHMM(HMM& Q, HMM& t, float wk[]) // { // int i,j; // position in query and target // int a; // amino acid // int step; // alignment position (step=1 is end) // float Weff_M, Weff_D, Weff_I; // for (step=nsteps; step>=2; step--) // iterate only to one before last alignment column // { // i = this->i[step]; // j = this->j[step]; // switch(states[step]) // { // case MM: // Weff_M = Weff(t.Neff_M[j]-1.0); // Weff_D = Weff(t.Neff_D[j]-1.0); // Weff_I = Weff(t.Neff_I[j]-1.0); // for (a=0; a<20; a++) Q.f[i][a] += t.f[j][a]*wk[j]*Weff_M; // switch(states[step-1]) // { // case MM: // MM->MM // Q.tr_lin[i][M2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][M2D]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][M2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case MI: // MM->MI // Q.tr_lin[i][M2D]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][M2D]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][M2M]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case DG: // MM->DG // Q.tr_lin[i][M2D]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][M2D]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][M2M]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case IM: // MM->IM // Q.tr_lin[i][M2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][M2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][M2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case GD: // MM->GD // Q.tr_lin[i][M2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][M2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][M2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // } // break; // case MI: // if gap in template // Weff_I = Weff(t.Neff_I[j]-1.0); // switch(states[step-1]) // { // case MI: // MI->MI // Q.tr_lin[i][M2M]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case MM: // MI->MM // Q.tr_lin[i][M2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // break; // } // break; // case DG: // Weff_M = Weff(t.Neff_M[j]-1.0); // Weff_D = Weff(t.Neff_D[j]-1.0); // Weff_I = Weff(t.Neff_I[j]-1.0); // switch(states[step-1]) // { // case DG: // DG->DG // Q.tr_lin[i][D2D]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][M2M]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // Q.tr_lin[i][M2D]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // break; // case MM: // DG->MM // Q.tr_lin[i][D2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][D2D]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // Q.tr_lin[i][M2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // break; // } // break; // case IM: // if gap in query // Weff_M = Weff(t.Neff_M[j]-1.0); // switch(states[step-1]) // { // case IM: // IM->IM // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // break; // case MM: // IM->MM // Weff_D = Weff(t.Neff_D[j]-1.0); // Weff_I = Weff(t.Neff_I[j]-1.0); // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][I2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // } // break; // case GD: // Weff_M = Weff(t.Neff_M[j]-1.0); // switch(states[step-1]) // { // case GD: // GD->GD // Weff_I = Weff(t.Neff_I[j]-1.0); // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // case MM: // GD->MM // Weff_D = Weff(t.Neff_D[j]-1.0); // Weff_I = Weff(t.Neff_I[j]-1.0); // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M; // Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M; // Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M; // Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D; // Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I; // Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I; // break; // } // break; // } // } // i = this->i[step]; // j = this->j[step]; // Weff_M = Weff(t.Neff_M[j]-1.0); // for (a=0; a<20; a++) Q.f[i][a] += t.f[j][a]*wk[j]*Weff_M; // } #ifdef CLUSTALO /* @* Hit::ClobberGlobal (eg, hit) * */ void Hit::ClobberGlobal(void){ if (i){ //delete[] i; i = NULL; } if (j){ //delete[] j; j = NULL; } if (states){ //delete[] states; states = NULL; } if (S){ //delete[] S; S = NULL; } if (S_ss){ //delete[] S_ss; S_ss = NULL; } if (P_posterior){ //delete[] P_posterior; P_posterior = NULL; } if (Xcons){ //delete[] Xcons; Xcons = NULL; } // delete[] l; l = NULL; i = j = NULL; states = NULL; S = S_ss = P_posterior = NULL; Xcons = NULL; if (irep==1) // if irep>1 then longname etc point to the same memory locations as the first repeat. { // but these have already been deleted. // printf("Delete name = %s\n",name);////////////////////////// //delete[] longname; longname = NULL; //delete[] name; name = NULL; //delete[] file; file = NULL; //delete[] dbfile; dbfile = NULL; /*for (int k=0; k // cin, cout, cerr #include // ofstream, ifstream #include // printf using std::cout; using std::cerr; using std::endl; using std::ios; using std::ifstream; using std::ofstream; #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // clock #include // islower, isdigit etc #include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "list.h" // list data structure #include "hash.h" // hash data structure #include "hhdecl-C.h" #include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #endif // #ifndef WNLIB // #define WNLIB // #include "wnconj.h" // Will Naylor's wnlib for optimization in C // #endif ////////////////////////////////////////////////////////////////////////////// //// Class HMM ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Object constructor ////////////////////////////////////////////////////////////////////////////// HMM::HMM(int maxseqdis, int maxres) { sname = new char*[maxseqdis](); // names of stored sequences for (int i = 0; i < maxseqdis; i++){ sname[i] = NULL;} seq = new char*[maxseqdis](); // residues of stored sequences (first at pos 1!) for (int i = 0; i < maxseqdis; i++){ seq[i] = NULL;} Neff_M = new float[maxres](); // Neff_M[i] = diversity of subalignment of seqs that have residue in col i Neff_I = new float[maxres](); // Neff_I[i] = diversity of subalignment of seqs that have insert in col i Neff_D = new float[maxres](); // Neff_D[i] = diversity of subalignment of seqs that have delete in col i longname = new char[DESCLEN](); // Full name of first sequence of original alignment (NAME field) ss_dssp = new char[maxres](); // secondary structure determined by dssp 0:- 1:H 2:E 3:C 4:S 5:T 6:G 7:B sa_dssp = new char[maxres](); // solvent accessibility state determined by dssp 0:- 1:A (absolutely buried) 2:B 3:C 4:D 5:E (exposed) ss_pred = new char[maxres](); // predicted secondary structure 0:- 1:H 2:E 3:C ss_conf = new char[maxres](); // confidence value of prediction 0:- 1:0 ... 10:9 Xcons = NULL; // create only when needed: consensus sequence in internal representation (A=0 R=1 N=2 D=3 ...) l = new int[maxres](); // l[i] = pos. of j'th match state in aligment /* FS introduced sentinel, NULL terminates loop in destructor, FS, r221->222 */ f = new float*[maxres+1](); f[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITHOUT pseudocounts g = new float*[maxres+1](); g[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITH pseudocounts p = new float*[maxres+1](); p[maxres] = NULL; // p[i][a] = prob of finding amino acid a in column i WITH OPTIMUM pseudocounts tr = new float*[maxres+1](); tr[maxres] = NULL; // log2 of transition probabilities M2M M2I M2D I2M I2I D2M D2D M2M_GAPOPEN GAPOPEN GAPEXTD // tr_lin = new float*[maxres]; // linear transition probabilities M2M M2I M2D I2M I2I D2M D2D M2M_GAPOPEN GAPOPEN GAPEXTD for (int i=0; i=4) cout<<"Reading in HMM "< k=n int h; // index for character in input line int l=1; // index of character in sequence seq[k] int i=1; // index of match states in ss_dssp[i] and ss_pred[i] sequence int n_seq=0; // number of sequences to be displayed EXCLUDING ss sequences cur_seq[0]='-'; // overwrite '\0' character at beginning to be able to do strcpy(*,cur_seq) k=-1; while (fgetline(line,LINELEN-1,dbf) && line[0]!='#') { if (v>=4) cout<<"Read from file:"<') //line contains sequence name { if (k>=MAXSEQDIS-1) //maximum number of allowable sequences exceeded {while (fgetline(line,LINELEN-1,dbf) && line[0]!='#'); break;} k++; if (!strncmp(line,">ss_dssp",8)) nss_dssp=k; else if (!strncmp(line,">sa_dssp",8)) nsa_dssp=k; else if (!strncmp(line,">ss_pred",8)) nss_pred=k; else if (!strncmp(line,">ss_conf",8)) nss_conf=k; else if (!strncmp(line,">Cons-",6) || !strncmp(line,">Consensus",10)) ncons=k; else { if (nfirst==-1) nfirst=k; if (n_seq>=par.nseqdis) {while (fgetline(line,LINELEN-1,dbf) && line[0]!='#'); k--; break;} n_seq++; } //If this is not the first sequence then store residues of previous sequence if (k>0) { seq[k-1]=new(char[strlen(cur_seq)+1]); if (!seq[k-1]) MemoryError("array of sequences to display"); strcpy(seq[k-1],cur_seq); } // store sequence name strcut(line+1); //find next white-space character and overwrite it with end-of-string character sname[k] = new (char[strlen(line+1)+1]); //+1 for terminating '\0' if (!sname[k]) MemoryError("array of names for sequences to display"); strcpy(sname[k],line+1); //store sequence name in **name l=1; i=1; } else //line contains sequence residues { if (k==-1) { cerr<'\0' && l=0 && line[h]!='.') { char c=ss2ss(line[h]); cur_seq[l]=c; if (c!='.' && !(c>='a' && c<='z')) ss_dssp[i++]=ss2i(c); l++; } else if (v && ss2i(line[h])==-2) cerr<'\0' && l=0) { char c=line[h]; cur_seq[l]=c; if (c!='.' && !(c>='a' && c<='z')) sa_dssp[i++]=sa2i(c); l++; } else if (v && sa2i(line[h])==-2) cerr<'\0' && l=0 && ss2i(line[h])<=3 && line[h]!='.') { char c=ss2ss(line[h]); cur_seq[l]=c; if (c!='.' && !(c>='a' && c<='z')) ss_pred[i++]=ss2i(c); l++; } else if (v && ss2i(line[h])==-2) cerr<'\0' && l='0' && line[h]<='9')) { cur_seq[l]=line[h]; ss_conf[l]=cf2i(line[h]); l++; } else if (v && cf2i(line[h])==-2) cerr<'\0' && l=0 && line[h]!='.') // ignore '.' and white-space characters ' ', \t and \n (aa2i()==-1) {cur_seq[l]=line[h]; l++;} else if (aa2i(line[h])==-2 && v) cerr<=0) { seq[k]=new(char[strlen(cur_seq)+1]); if (!seq[k]) MemoryError("array of sequences to display"); strcpy(seq[k],cur_seq); } n_display=k+1; // DEBUG if (v>=4) { printf("nss_dssp=%i nsa_dssp=%i nss_pred=%i nss_conf=%i nfirst=%i\n",nss_dssp,nsa_dssp,nss_pred,nss_conf,nfirst); for (k=0; k"< 1.1 to generate hhm files.\n"); exit(1); } else if (!strcmp("AVER",str4)) {} // AVER line scrapped else if (!strcmp("NULL",str4)) { ptr=line+4; for (a=0; a<20 && ptr; ++a) //s2[a]: transform amino acids Sorted by alphabet -> internal numbers for amino acids pb[s2a[a]] = (float) fpow2(float(-strinta(ptr))/HMMSCALE); if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("\nNULL "); for (a=0; a<20; ++a) printf("%5.1f ",100.*pb[s2a[a]]); printf("\n"); } } ///////////////////////////////////////////////////////////////////////////////////// // Read transition probabilities from start state else if (!strcmp("HMM",str3)) { fgetline(line,LINELEN-1,dbf); // Skip line with amino acid labels fgetline(line,LINELEN-1,dbf); // Skip line with transition labels ptr=line; for (a=0; a<=D2D && ptr; ++a) tr[0][a] = float(-strinta(ptr))/HMMSCALE; //store transition probabilites as log2 values // strinta returns next integer in string and puts ptr to first char // after the integer. Returns -99999 if '*' is found. // ptr is set to 0 if no integer is found after ptr. Neff_M[0] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with M->? transition Neff_I[0] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with I->? transition Neff_D[0] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with D->? transition if (!ptr) return Warning(dbf,line,name); ///////////////////////////////////////////////////////////////////////////////////// // Read columns of HMM int next_i=0; // index of next column while (fgetline(line,LINELEN-2,dbf) && !(line[0]=='/' && line[1]=='/') && line[0]!='#') { if (strscn(line)==NULL) continue; // skip lines that contain only white space // Read in AA probabilities ptr=line+1; int prev_i = next_i; next_i = strint(ptr); ++i; if (v && next_i!=prev_i+1) if (++warn<=5) { cerr<L) { cerr<=/*MAXRES*/par.maxResLen-2) { fgetline(line,LINELEN-1,dbf); // Skip line continue; } for (a=0; a<20 && ptr; ++a) // f[i][s2a[a]] = (float)pow(2.,float(-strinta(ptr))/HMMSCALE); f[i][s2a[a]] = fpow2(float(-strinta(ptr))/HMMSCALE); // speed-up ~5 s for 10000 SCOP domains //s2a[a]: transform amino acids Sorted by alphabet -> internal numbers for amino acids l[i]=strint(ptr); if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("%s",line); printf("%6i ",i); for (a=0; a<20; ++a) printf("%5.1f ",100*f[i][s2a[a]]); printf("%5i",l[i]); printf("\n"); } // Read transition probabilities fgetline(line,LINELEN-1,dbf); // Skip line with amino acid labels if (line[0]!=' ' && line[0]!='\t') return Warning(dbf,line,name); ptr=line; for (a=0; a<=D2D && ptr; ++a) tr[i][a] = float(-strinta(ptr))/HMMSCALE; //store transition prob's as log2-values Neff_M[i] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with M->? transition Neff_I[i] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with I->? transition Neff_D[i] = float(strinta(ptr))/HMMSCALE; // Read eff. number of sequences with D->? transition if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf(" "); for (a=0; a<=D2D; ++a) printf("%5.1f ",100*fpow2(tr[i][a])); printf("%5.1f %5.1f %5.1f \n",Neff_M[i],Neff_I[i],Neff_D[i]); } } if (line[0]=='/' && line[1]=='/') break; } else if (v) cerr< stop reading in // Set coefficients of EVD (= 0.0 if not calibrated for these parameters) // lamda = lamda_hash.Show(par.Key()); // mu = mu_hash.Show(par.Key()); if (lamda && v>=3) printf("HMM %s is already calibrated: lamda=%-5.3f, mu=%-5.2f\n",name,lamda,mu); if (v && i!=L) cerr</*MAXRES*/par.maxResLen-2) {i=/*MAXRES*/par.maxResLen-2; cerr<=2) cout<<"Read in HMM "<=4) cout<<"Reading in HMM "<=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SADSS records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nsa_dssp],ptr); } } else if (!strncmp("SSPRD",line,5)) { if (nss_pred<0) { nss_pred=k++; seq[nss_pred] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_pred] = new(char[15]); strcpy(seq[nss_pred]," "); strcpy(sname[nss_pred],"ss_pred"); } ptr=strscn(line+5); if (ptr) { strcut(ptr); if (strlen(seq[nss_pred])+strlen(ptr)>=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SSPRD records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nss_pred],ptr); } } else if (!strncmp("SSCON",line,5)) { if (nss_conf<0) { nss_conf=k++; seq[nss_conf] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_conf] = new(char[15]); strcpy(seq[nss_conf]," "); strcpy(sname[nss_conf],"ss_conf"); } ptr=strscn(line+5); if (ptr) { strcut(ptr); if (strlen(seq[nss_conf])+strlen(ptr)>=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SSPRD records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nss_conf],ptr); } } else if (!strncmp("SSCIT",line,5)) continue; else if (!strcmp("XT ",str4)) continue; else if (!strcmp("NULT",str4)) continue; else if (!strcmp("NULE",str4)) { ptr=line+4; for (a=0; (a < iAlpha) && ptr; ++a){ /* FIXME: FS introduced alphabet size (was '20') and dAlphaInv (was '0.05' = 1/20) */ //s2a[a]: transform amino acids Sorted by alphabet -> internal numbers for amino acids pb[s2a[a]] = (float) dAlphaInv * fpow2(float(strinta(ptr,-99999))/HMMSCALE); /* dAlphaInv */ } for (a = iAlpha; a < 20; a++){ pb[s2a[a]] = 0.0; } if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("\nNULL "); for (a=0; a=2 && ignore_hmmer_cal==0) cerr<=4) { printf(" "); for (a=0; a<=D2D && ptr; ++a) printf("%5.1f ",100*fpow2(tr[i][a])); printf("\n"); } // Prepare to store DSSP states (if there are none, delete afterwards) nss_dssp=k++; seq[nss_dssp] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_dssp] = new(char[15]); strcpy(sname[nss_dssp],"ss_dssp"); ///////////////////////////////////////////////////////////////////////////////////// // Read columns of HMM int next_i=0; // index of next column while (fgetline(line,LINELEN-1,dbf) && !(line[0]=='/' && line[1]=='/') && line[0]!='#') { if (strscn(line)==NULL) continue; // skip lines that contain only white space // Read in AA probabilities ptr=line; int prev_i = next_i; next_i = strint(ptr); ++i; if (v && next_i!=prev_i+1) if (++warn<5) { cerr<L) { cerr<L && v) cerr<=/*MAXRES*/par.maxResLen-2) { fgetline(line,LINELEN-1,dbf); // Skip two lines fgetline(line,LINELEN-1,dbf); continue; } for (a=0; (a internal numbers for amino acids } for (a = iAlpha; a < 20; a++){ f[i][s2a[a]] = 0.0; } if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("%6i ",i); for (a=0; a=4) { printf(" "); for (a=0; a<=D2D; ++a) printf("%5.1f ",100*fpow2(tr[i][a])); printf("\n"); } } if (line[0]=='/' && line[1]=='/') break; } /* strncmp("HMM") */ } //while(getline) if (L==0) return 0; //End of db file -> stop reading in // Set coefficients of EVD (= 0.0 if not calibrated for these parameters) // lamda = lamda_hash.Show(par.Key()); // mu = mu_hash.Show(par.Key()); if (lamda && v>=2) printf("HMM %s is already calibrated: lamda=%-5.3f, mu=%-5.2f\n",name,lamda,mu); if (v && i!=L) cerr<=/*MAXRES*/par.maxResLen-2) {i=/*MAXRES*/par.maxResLen-2; cerr<0) strcat(longname," "); strncat(longname,name,DESCLEN-strlen(longname)-1); // longname = ACC NAME DESC if (strlen(name)>0) strcat(longname," "); strncat(longname,desc,DESCLEN-strlen(longname)-1); longname[DESCLEN-1]='\0'; ScopID(cl,fold,sfam,fam);// get scop classification from basename (e.g. a.1.2.3.4) RemoveExtension(file,filestr); // copy name of dbfile without extension into 'file' // Secondary structure if (!dssp) { // remove dssp sequence // memory that had been allocated in case ss_dssp was given needs to be freed delete[] seq[nss_dssp]; seq[nss_dssp] = NULL; // memory that had been allocated in case ss_dssp was given needs to be freed delete[] sname[nss_dssp]; sname[nss_dssp] = NULL; nss_dssp=-1; k--; } if (nss_pred>=0) { for (i=1; i<=L; ++i) ss_pred[i] = ss2i(seq[nss_pred][i]); if (nss_conf>=0) for (i=1; i<=L; ++i) ss_conf[i] = cf2i(seq[nss_conf][i]); else for (i=1; i<=L; ++i) ss_conf[i] = 5; } // Copy query (first sequence) and consensus residues? if (par.showcons) { sname[k]=new(char[10]); strcpy(sname[k],"Consensus"); sname[k+1]=new(char[strlen(longname)+1]); strcpy(sname[k+1],longname); seq[k]=new(char[L+2]); seq[k][0]=' '; seq[k][L+1]='\0'; seq[k+1]=new(char[L+2]); seq[k+1][0]=' '; seq[k+1][L+1]='\0'; for (i=1; i<=L; ++i) { float pmax=0.0; int amax=0; for (a=0; apmax) {amax=a; pmax=f[i][a];} if (pmax>0.6) seq[k][i]=i2aa(amax); else if (pmax>0.4) seq[k][i]=lwrchr(i2aa(amax)); else seq[k][i]='x'; seq[k+1][i]=i2aa(amax); } ncons=k++; // nfirst is set later! } else { sname[k]=new(char[strlen(longname)+1]); /* FIXME valgrind says bytes get lost here during hmm iteration -- fixed in HMM::ClobberGlobal(), I (FS) think */ strcpy(sname[k],longname); seq[k]=new(char[L+2]); seq[k][0]=' '; seq[k][L+1]='\0'; } if (annot) // read in some annotation characters? { annotchr[0]=' '; annotchr[L+1]='\0'; strcpy(seq[k],annotchr); // overwrite the consensus sequence with the annotation characters } else if (!par.showcons) // we have not yet calculated the consensus, but we need it now as query (first sequence) { /* FIXME: FS set ncons=k don't understand why it is not set but seem to need it */ ncons = k; for (i=1; i<=L; ++i) { float pmax=0.0; int amax=0; for (a=0; apmax) {amax=a; pmax=f[i][a];} seq[k][i]=i2aa(amax); } } // printf("%i query name=%s seq=%s\n",n,sname[n],seq[n]); nfirst=k++; n_display=k; // Calculate overall Neff_HMM Neff_HMM=0; for (i=1; i<=L; ++i) { float S=0.0; for (a=0; a1E-10) S-=f[i][a]*fast_log2(f[i][a]); } Neff_HMM+=(float) fpow2(S); } Neff_HMM/=L; for (i=0; i<=L; ++i) Neff_M[i] = Neff_I[i] = Neff_D[i] = 10.0; // to add only little additional pseudocounts! if (v>=2) cout<<"Read in HMM "<=4) cout<<"Reading in HMM "<=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SADSS records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nsa_dssp],ptr); } } else if (!strncmp("SSPRD",line,5)) { if (nss_pred<0) { nss_pred=k++; seq[nss_pred] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_pred] = new(char[15]); strcpy(seq[nss_pred]," "); strcpy(sname[nss_pred],"ss_pred"); } ptr=strscn(line+5); if (ptr) { strcut(ptr); if (strlen(seq[nss_pred])+strlen(ptr)>=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SSPRD records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nss_pred],ptr); } } else if (!strncmp("SSCON",line,5)) { if (nss_conf<0) { nss_conf=k++; seq[nss_conf] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_conf] = new(char[15]); strcpy(seq[nss_conf]," "); strcpy(sname[nss_conf],"ss_conf"); } ptr=strscn(line+5); if (ptr) { strcut(ptr); if (strlen(seq[nss_conf])+strlen(ptr)>=(unsigned)(/*MAXRES*/par.maxResLen)) printf("\nWARNING: HMM %s has SSPRD records with more than %i residues.\n",name,/*MAXRES*/par.maxResLen); else strcat(seq[nss_conf],ptr); } } else if (!strncmp("SSCIT",line,5)) continue; else if (!strcmp("XT ",str4)) continue; ////////////////////////////////////////////////////////////////////////////////////////////////////// else if (!strncmp("STATS LOCAL",line,11)) continue; else if (!strcmp("EFFN",str4)) { ptr=line+4; float effn = strflt(ptr); // Calculate Neff_HMM by using f(x) = ax^0.1 + bx^0.5 + cx + d (fitted with scop25 dataset) Neff_HMM = -1.403534 * pow(effn, 0.1) + 4.428118 * pow(effn, 0.5) - 0.2885410 * effn - 1.108568; } ///////////////////////////////////////////////////////////////////////////////////// // Read transition probabilities from start state else if (!strncmp("HMM",line,3)) { fgetline(line,LINELEN-1,dbf); // Skip line with amino acid labels fgetline(line,LINELEN-1,dbf); // Skip line with transition labels ptr=strscn(line); if (!strncmp("COMPO",ptr,5)) { ptr=ptr+5; for (a=0; a<20 && ptr; ++a) //s2a[a]: transform amino acids Sorted by alphabet -> internal numbers for amino acids pb[s2a[a]] = (float) exp(-1.0*strflta(ptr,99999)); if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("\nNULL "); for (a=0; a<20; ++a) printf("%6.3g ",100.*pb[s2a[a]]); printf("\n"); } fgetline(line,LINELEN-1,dbf); // Read next line } fgetline(line,LINELEN-1,dbf); // Skip line with 0-states insert probabilities ptr = strscn(line); for (a=0; a<=D2D && ptr; ++a) tr[0][a] = log2((float) exp(-1.0*strflta(ptr,99999))); //store transition probabilites as log2 values // strinta returns next integer in string and puts ptr to first char // after the integer. Returns -99999 if '*' is found. // ptr is set to 0 if no integer is found after ptr. if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf(" "); for (a=0; a<=D2D && ptr; ++a) printf("%6.3g ",100*fpow2(tr[i][a])); printf("\n"); } // Prepare to store DSSP states (if there are none, delete afterwards) nss_dssp=k++; seq[nss_dssp] = new(char[/*MAXRES*/par.maxResLen+2]); sname[nss_dssp] = new(char[15]); strcpy(sname[nss_dssp],"ss_dssp"); ///////////////////////////////////////////////////////////////////////////////////// // Read columns of HMM int next_i=0; // index of next column while (fgetline(line,LINELEN-1,dbf) && !(line[0]=='/' && line[1]=='/') && line[0]!='#') { if (strscn(line)==NULL) continue; // skip lines that contain only white space // Read in AA probabilities ptr=line; int prev_i = next_i; next_i = strint(ptr); ++i; if (v && next_i!=prev_i+1) if (++warn<5) { cerr<L) { cerr<L && v) cerr<=/*MAXRES*/par.maxResLen-2) { fgetline(line,LINELEN-1,dbf); // Skip two lines fgetline(line,LINELEN-1,dbf); continue; } for (a=0; a internal numbers for amino acids } for (a = iAlpha; a < 20; a++){ f[i][s2a[a]] = 0.0; } if (!ptr) return Warning(dbf,line,name); if (v>=4) { printf("%6i ",i); for (a=0; a=4) { printf(" "); for (a=0; a<=D2D; ++a) printf("%6.3g ",100*fpow2(tr[i][a])); printf("\n"); } } if (line[0]=='/' && line[1]=='/') break; } /* strncmp("HMM") */ } //while(getline) if (L==0) return 0; //End of db file -> stop reading in if (v && i!=L) cerr<=/*MAXRES*/par.maxResLen-2) {i=/*MAXRES*/par.maxResLen-2; cerr<0) strcat(longname," "); strncat(longname,name,DESCLEN-strlen(longname)-1); // longname = ACC NAME DESC if (strlen(name)>0) strcat(longname," "); strncat(longname,desc,DESCLEN-strlen(longname)-1); longname[DESCLEN-1]='\0'; ScopID(cl,fold,sfam,fam);// get scop classification from basename (e.g. a.1.2.3.4) RemoveExtension(file,filestr); // copy name of dbfile without extension into 'file' // Secondary structure if (!dssp) { // remove dssp sequence delete[] seq[nss_dssp]; // memory that had been allocated in case ss_dssp was given needs to be freed delete[] sname[nss_dssp]; // memory that had been allocated in case ss_dssp was given needs to be freed nss_dssp=-1; k--; } else { seq[nss_dssp][0]='-'; seq[nss_dssp][L+1]='\0'; } if (nss_pred>=0) { for (i=1; i<=L; ++i) ss_pred[i] = ss2i(seq[nss_pred][i]); if (nss_conf>=0) for (i=1; i<=L; ++i) ss_conf[i] = cf2i(seq[nss_conf][i]); else for (i=1; i<=L; ++i) ss_conf[i] = 5; } // Copy query (first sequence) and consensus residues? if (par.showcons) { sname[k]=new(char[10]); strcpy(sname[k],"Consensus"); sname[k+1]=new(char[strlen(longname)+1]); strcpy(sname[k+1],longname); seq[k]=new(char[L+2]); seq[k][0]=' '; seq[k][L+1]='\0'; seq[k+1]=new(char[L+2]); seq[k+1][0]=' '; seq[k+1][L+1]='\0'; for (i=1; i<=L; ++i) { float pmax=0.0; int amax=0; for (a=0; apmax) {amax=a; pmax=f[i][a];} if (pmax>0.6) seq[k][i]=i2aa(amax); else if (pmax>0.4) seq[k][i]=lwrchr(i2aa(amax)); else seq[k][i]='x'; seq[k+1][i]=i2aa(amax); } ncons=k++; // nfirst is set later! } else { sname[k]=new(char[strlen(longname)+1]); strcpy(sname[k],longname); seq[k]=new(char[L+2]); seq[k][0]=' '; seq[k][L+1]='\0'; } if (annot) // read in some annotation characters? { annotchr[0]=' '; annotchr[L+1]='\0'; strcpy(seq[k],annotchr); // overwrite the consensus sequence with the annotation characters } else if (!par.showcons) // we have not yet calculated the consensus, but we need it now as query (first sequence) { for (i=1; i<=L; ++i) { float pmax=0.0; int amax=0; for (a=0; apmax) {amax=a; pmax=f[i][a];} seq[k][i]=i2aa(amax); } } // printf("%i query name=%s seq=%s\n",n,sname[n],seq[n]); nfirst=k++; n_display=k; n_seqs=k; // If no effektive number of sequences is given, calculate Neff_HMM by given profile if (Neff_HMM == 0) { for (i=1; i<=L; ++i) { float S=0.0; for (a=0; a<20; ++a) if (f[i][a]>1E-10) S-=f[i][a]*fast_log2(f[i][a]); Neff_HMM+=(float) fpow2(S); } Neff_HMM/=L; } for (i=0; i<=L; ++i) Neff_M[i] = Neff_I[i] = Neff_D[i] = 10.0; // to add only little additional pseudocounts! Neff_M[L+1]=1.0f; Neff_I[L+1]=Neff_D[L+1]=0.0f; if (v>=2) cout<<"Read in HMM "< pI2I=0 gape=1 -> pI2I=0.75 gape=inf -> pI2I=1. pI2I=1.0*gape/(gape-1+1.0/0.75); pI2M=1-pI2I; // gape=0 -> pD2D=0 gape=1 -> pD2D=0.75 gape=inf -> pD2D=1. pD2D=1.0*gape/(gape-1+1.0/0.75); pD2M=1-pD2D; for (i=0; i<=L; ++i) //for all columns in HMM { // Transitions from M state p0 = (Neff_M[i]-1)*fpow2(tr[i][M2M]) + gapb*pM2M; p1 = (Neff_M[i]-1)*fpow2(tr[i][M2D]) + gapb*pM2D; p2 = (Neff_M[i]-1)*fpow2(tr[i][M2I]) + gapb*pM2I; if (i==0) p1=p2=0; //from M(0) no transition to D(1) and I(0) possible if (i==L) p1=p2=0; //from M(L) no transition to D(L+1) and I(L+1) possible sum = p0+p1+p2+FLT_MIN; // p0 = p0/sum ; // p1 = pow(p1/sum,gapf); // p2 = pow(p2/sum,gapg); // sum = p0+p1+p2+FLT_MIN; // tr[i][M2M] = fast_log2(p0/sum); // tr[i][M2D] = fast_log2(p1/sum); // tr[i][M2I] = fast_log2(p2/sum); tr[i][M2M] = fast_log2(p0/sum); tr[i][M2D] = fast_log2(p1/sum)*gapf; tr[i][M2I] = fast_log2(p2/sum)*gapg; // Transitions from I state p0 = Neff_I[i]*fpow2(tr[i][I2M]) + gapb*pI2M; p1 = Neff_I[i]*fpow2(tr[i][I2I]) + gapb*pI2I; sum = p0+p1+FLT_MIN; // p0 = pow(p0/sum,gapg); // p1 = pow(p1/sum,gapi); // sum = p0+p1+FLT_MIN; // tr[i][I2M] = fast_log2(p0/sum); // tr[i][I2I] = fast_log2(p1/sum); tr[i][I2M] = fast_log2(p0/sum); tr[i][I2I] = fast_log2(p1/sum)*gapi; // Transitions from D state p0 = Neff_D[i]*fpow2(tr[i][D2M]) + gapb*pD2M; p1 = Neff_D[i]*fpow2(tr[i][D2D]) + gapb*pD2D; if (i==L) p1=0; //from D(L) no transition to D(L+1) possible sum = p0+p1+FLT_MIN; // p0 = pow(p0/sum,gapf); // p1 = pow(p1/sum,gaph); // sum = p0+p1+FLT_MIN; // tr[i][D2M] = fast_log2(p0/sum); // tr[i][D2D] = fast_log2(p1/sum); tr[i][D2M] = fast_log2(p0/sum); tr[i][D2D] = fast_log2(p1/sum)*gaph; // SS-dependent gap penalties tr[i][M2M_GAPOPEN]=tr[i][M2M]; tr[i][GAPOPEN]=0.0; tr[i][GAPEXTD]=0.0; } if (v>=4) { printf("\nPseudocount transition probabilities:\n"); printf("pM2M=%4.1f%%, pM2I=%4.1f%%, pM2D=%4.1f%%, ",100*pM2M,100*pM2I,100*pM2D); printf("pI2M=%4.1f%%, pI2I=%4.1f%%, ",100*pI2M,100*pI2I); printf("pD2M=%4.1f%%, pD2D=%4.1f%% ",100*pD2M,100*pD2D); printf("tau = %4.1f%%\n\n",100.*gapb/(Neff_HMM-1+gapb)); printf("Listing transition probabilities WITH pseudocounts:\n"); printf(" i dssp pred sacc M->M M->I M->D I->M I->I D->M D->D\n"); for (i=1; i<=L; ++i) //for all columns in HMM { printf("%4i %1c %1c %1c %6.3f %6.3f %6.3f ",i,i2ss(ss_dssp[i]),i2ss(ss_pred[i]),i2sa(sa_dssp[i]),fpow2(tr[i][M2M]),fpow2(tr[i][M2I]),fpow2(tr[i][M2D])); printf("%6.3f %6.3f ",fpow2(tr[i][I2M]),fpow2(tr[i][I2I])); printf("%6.3f %6.3f ",fpow2(tr[i][D2M]),fpow2(tr[i][D2D])); printf("%1i %2i %1i\n",ss_pred[i],ss_conf[i],ss_dssp[i]); } printf("\n"); printf("nss_dssp=%i nss_pred=%i\n",nss_dssp,nss_pred); } return; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Use secondary structure-dependent gap penalties * on top of the HMM transition penalties */ void HMM::UseSecStrucDependentGapPenalties() { int i; // column in HMM int ii; //unsigned char iis[MAXRES]; // inside-integer array unsigned char iis[par.maxResLen]; // inside-integer array float d; // Additional penalty for opening gap whithin SS element float e; // Additional penalty for extending gap whithin SS element // Determine inside-integers: // CCSTCCCHHHHHHHHHHHCCCCCEEEEECCSBGGGCCCCEECC // 0000000123444432100000012210000000000001000 ii=0; for (i=0; i<=L; ++i) // forward run { if (ss_dssp[i]==1 || ss_dssp[i]==2) {ii+=(ii=0; i--) // backward run { if (ss_dssp[i]==1 || ss_dssp[i]==2) {ii+=(ii=3) { printf("Col SS II\n"); for (i=0; i<=L; ++i) printf("%3i %c %2i\n",i,i2ss(ss_dssp[i]),iis[i]); } return; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Generate an amino acid frequency matrix g[][] with full pseudocount admixture (tau=1) */ void HMM::PreparePseudocounts() { for (int i=0; i<=L+1; ++i) for (int a=0; a<20; ++a) g[i][a] = // produces fast code R[a][0]*f[i][0] +R[a][1]*f[i][1] +R[a][2]*f[i][2] +R[a][3]*f[i][3] +R[a][4]*f[i][4] +R[a][5]*f[i][5] +R[a][6]*f[i][6] +R[a][7]*f[i][7] +R[a][8]*f[i][8] +R[a][9]*f[i][9] +R[a][10]*f[i][10]+R[a][11]*f[i][11]+R[a][12]*f[i][12]+R[a][13]*f[i][13]+R[a][14]*f[i][14] +R[a][15]*f[i][15]+R[a][16]*f[i][16]+R[a][17]*f[i][17]+R[a][18]*f[i][18]+R[a][19]*f[i][19]; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Add amino acid pseudocounts to HMM and calculate average protein aa probabilities pav[a] * Pseudocounts: t.p[i][a] = (1-tau)*f[i][a] + tau*g[i][a] */ void HMM::AddAminoAcidPseudocounts(char pcm, float pca, float pcb, float pcc) { int i; //position in HMM int a; //amino acid (0..19) float sum; float tau; //tau = pseudocount admixture for (a=0; a<20; ++a) pav[a]=pb[a]*100.0f/Neff_HMM; // initialize vector of average aa freqs with pseudocounts // Calculate amino acid frequencies p[i][a] = (1-tau(i))*f[i][a] + tau(i)*g[i][a] switch (pcm) { case 0: //no pseudocounts whatsoever: tau=0 for (i=1; i<=L; ++i) for (a=0; a<20; ++a) pav[a] += ( p[i][a]=f[i][a] ); break; case 1: //constant pseudocounts (for optimization): tau = pca tau = pca; for (i=1; i<=L; ++i) for (a=0; a<20; ++a) pav[a] += ( p[i][a] = (1.-tau)*f[i][a] + tau * g[i][a] ); break; case 2: //divergence-dependent pseudocounts case 4: //divergence-dependent pseudocounts and rate matrix rescaling if (par.pcc==1.0f) for (i=1; i<=L; ++i) { tau = fmin(1.0, pca/(1. + Neff_M[i]/pcb ) ); for (a=0; a<20; ++a) pav[a] += ( p[i][a] = (1.-tau)*f[i][a] + tau * g[i][a] ); } else for (i=1; i<=L; ++i) { tau = fmin(1.0, pca/(1. + pow((Neff_M[i])/pcb,pcc))); for (a=0; a<20; ++a) pav[a] += ( p[i][a] = (1.-tau)*f[i][a] + tau * g[i][a] ); } break; case 3: // constant-divergence pseudocounts for (i=1; i<=L; ++i) { float x = Neff_M[i]/pcb; pca = 0.793 + 0.048*(pcb-10.0); tau = fmax(0.0, pca*(1-x + pcc*x*(1-x)) ); for (a=0; a<20; ++a) pav[a] += ( p[i][a] = (1.-tau)*f[i][a] + tau * g[i][a] ); } if (v>=2) { printf("Divergence before / after addition of amino acid pseudocounts: %5.2f / %5.2f\n",Neff_HMM, CalcNeff()); } break; } //end switch (pcm) // Normalize vector of average aa frequencies pav[a] NormalizeTo1(pav,NAA); for (a=0; a<20; ++a) p[0][a] = p[L+1][a] = pav[a]; // DEBUGGING output if (v>=3) { switch (pcm) { case 0: cout<<"No pseudocounts added (-pcm 0)\n"; return; case 1: cout<<"Adding constant AA pseudocount admixture of "<=4) { cout<<"\nAmino acid frequencies WITHOUT pseudocounts:\n A R N D C Q E G H I L K M F P S T W Y V\n"; for (i=1; i<=L; ++i) { printf("%3i: ",i); sum=0; for (a=0; a<20; ++a) { sum+=f[i][a]; printf("%4.1f ",100*f[i][a]); } printf(" sum=%5.3f\n",sum); } cout<<"\nAmino acid frequencies WITH pseudocounts:\n A R N D C Q E G H I L K M F P S T W Y V\n"; for (i=1; i<=L; ++i) { printf("%3i: ",i); sum=0; for (a=0; a<20; ++a) { sum+=p[i][a]; printf("%4.1f ",100*p[i][a]); } printf(" sum=%5.3f\n",sum); } } } return; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Factor Null model into HMM t */ void HMM::IncludeNullModelInHMM(HMM& q, HMM& t) { int i,j; //query and template match state indices int a; //amino acid index switch (par.columnscore) { default: case 0: // Null model with background prob. from database for (a=0; a<20; ++a) pnul[a]=pb[a]; break; case 1: // Null model with background prob. equal average from query and template for (a=0; a<20; ++a) pnul[a]=0.5*(q.pav[a]+t.pav[a]); break; case 2: // Null model with background prob. from template protein for (a=0; a<20; ++a) pnul[a]=t.pav[a]; break; case 3: // Null model with background prob. from query protein for (a=0; a<20; ++a) pnul[a]=q.pav[a]; break; case 4: // Null model with background prob. equal average from query and template for (a=0; a<20; ++a) pnul[a]=sqrt(q.pav[a]*t.pav[a]); break; case 10: // Separated column scoring for Stochastic Backtracing (STILL USED??) for (i=0; i<=q.L+1; ++i) { float sum = 0.0; for (a=0; a<20; ++a) sum += pb[a]*q.p[i][a]; sum = 1.0/sqrt(sum); for (a=0; a<20; ++a) q.p[i][a]*=sum; } for (j=0; j<=t.L+1; j++) { float sum = 0.0; for (a=0; a<20; ++a) sum += pb[a]*t.p[j][a]; sum = 1.0/sqrt(sum); for (a=0; a<20; ++a) t.p[j][a]*=sum; } break; case 11: // log co-emission probability (no null model) for (a=0; a<20; ++a) pnul[a]=0.05; break; } // !!!!! ATTENTION!!!!!!! after this t.p is not the same as after adding pseudocounts !!! //Introduce amino acid weights into template (for all but SOP scores) if (par.columnscore!=10) for (a=0; a<20; ++a) for (j=0; j<=t.L+1; j++) t.p[j][a]/=pnul[a]; if (v>=5) { cout<<"\nAverage amino acid frequencies\n"; cout<<" A R N D C Q E G H I L K M F P S T W Y V\n"; cout<<"Q: "; for (a=0; a<20; ++a) printf("%4.1f ",100*q.pav[a]); cout<<"\nT: "; for (a=0; a<20; ++a) printf("%4.1f ",100*t.pav[a]); cout<<"\nNull: "; for (a=0; a<20; ++a) printf("%4.1f ",100*pnul[a]); cout<<"\npb: "; for (a=0; a<20; ++a) printf("%4.1f ",100*pb[a]); } return; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Write HMM to output file */ void HMM::WriteToFile(char* outfile) { const int SEQLEN=100; // number of residues per line for sequences to be displayed int i,a; if (trans_lin) {fprintf(stderr,"Error: Writing transition pseudocounts in linear representation not allowed. Please report this error to the HHsearch developers.\n"); exit(6);} FILE *outf=NULL; if (strcmp(outfile,"stdout")) { if (par.append) outf=fopen(outfile,"a"); else outf=fopen(outfile,"w"); if (!outf) OpenFileError(outfile); } else outf = stdout; if (v>=2) cout<<"Writing HMM to "< ",(int)strlen(par.argv[i])); fprintf(outf,"\n"); // print out date stamp time_t* tp=new(time_t); *tp=time(NULL); fprintf(outf,"DATE %s",ctime(tp)); delete tp; tp = NULL; /* really? FS */ // Print out some statistics of alignment fprintf(outf,"LENG %i match states, %i columns in multiple alignment\n",L,l[L]); fprintf(outf,"FILT %i out of %i sequences passed filter (-id %i -cov %i -qid %i -qsc %.2f -diff %i)\n",N_filtered,N_in,par.max_seqid,par.coverage,par.qid,par.qsc,par.Ndiff); fprintf(outf,"NEFF %-4.1f\n",Neff_HMM); // Print selected sequences from alignment (including secondary structure and confidence values, if known) fprintf(outf,"SEQ\n"); for (int n=0; n%s\n",sname[n]); //first sequence character starts at 1; 0 not used. for(unsigned int j=0; jM\tM->I\tM->D\tI->M\tI->I\tD->M\tD->D\tNeff\tNeff_I\tNeff_D\n"); // print out transition probabilities from begin state (virtual match state) fprintf(outf," "); for (a=0; a<=D2D; ++a) fout(outf,-iround(tr[0][a]*HMMSCALE)); fout(outf,iround(Neff_M[0]*HMMSCALE)); fout(outf,iround(Neff_I[0]*HMMSCALE)); fout(outf,iround(Neff_D[0]*HMMSCALE)); fprintf(outf,"\n"); // Start loop for printing HMM columns int h=1; for (i=1; i<=L; ++i) { while(islower(seq[nfirst][h]) && seq[nfirst][h]) h++; fprintf(outf,"%1c %-4i ",seq[nfirst][h++],i); // Print emission probabilities for match state for (a=0; a<20; ++a) fout(outf,-iround(fast_log2(p[i][s2a[a]])*HMMSCALE )); fprintf(outf,"%-i",l[i]); fprintf(outf,"\n"); // Print transition probabilities fprintf(outf," "); for (a=0; a<=D2D; ++a) fout(outf,-iround(tr[i][a]*HMMSCALE)); fout(outf,iround(Neff_M[i]*HMMSCALE)); fout(outf,iround(Neff_I[i]*HMMSCALE)); fout(outf,iround(Neff_D[i]*HMMSCALE)); fprintf(outf,"\n\n"); } // end for(i)-loop for printing HMM columns fprintf(outf,"//\n"); fclose(outf); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Write HMM to output file */ void HMM::InsertCalibration(char* infile) { char* line = new(char[LINELEN]); // input line char** lines = new(char*[3*L+100000]); int nline=0; int l; char done=0; // inserted new 'EVD mu sigma' line? // Read from infile all lines and insert the EVD line with lamda and mu coefficients ifstream inf; inf.open(infile, ios::in); if (!inf) OpenFileError(infile); if (v>=2) cout<<"Recording calibration coefficients in "< remove while (!done && !strncmp(line,"EVD ",3) && !(line[0]=='/' && line[1]=='/') && nline<2*/*MAXRES*/par.maxResLen) inf.getline(line,LINELEN); if ((line[0]=='/' && line[1]=='/') || nline>=2*/*MAXRES*/par.maxResLen) {fprintf(stderr,"Error: wrong format in %s. Expecting hhm format\n",infile); exit(1);} // Found the SEQ line? -> insert calibration before this line if (!done && (!strncmp("SEQ",line,3) || !strncmp("HMM",line,3)) && (isspace(line[3]) || line[3]=='\0')) { done=1; lines[nline]=new(char[128]); if (!lines[nline]) MemoryError("space to read in HHM file for calibration"); sprintf(lines[nline],"EVD %-7.4f %-7.4f",lamda,mu); nline++; } lines[nline]=new(char[strlen(line)+1]); if (!lines[nline]) MemoryError("space to read in HHM file for calibration"); strcpy (lines[nline],line); nline++; } inf.close(); // Write to infile all lines FILE* infout=fopen(infile,"w"); if (!infout) { cerr<=2) cout<<"Writing HMM to "<=0) fprintf(outf,"SSDSS %s\n",seq[nss_dssp]); if (nsa_dssp>=0) fprintf(outf,"SADSS %s\n",seq[nsa_dssp]); if (nss_pred>=0) fprintf(outf,"SSPRD %s\n",seq[nss_pred]); if (nss_conf>=0) fprintf(outf,"SSCNF %s\n",seq[nss_conf]); // Special Plan7 transitions that control repeated detection of profile HMM within sequence fprintf(outf,"XT %6i %6i %6i %6i %6i %6i %6i %6i\n",LOG2pJB,LOG2pJJ,LOG2pEC,LOG2pEJ,LOG2pJB,LOG2pJJ,LOG2pJB,LOG2pJJ); fprintf(outf,"NULT -4 -8455\n"); // Null model background probabilities from substitution matrix fprintf(outf,"NULE "); for (a=0; a<20; ++a) { float lg2=fast_log2(pb[s2a[a]]*20.0); if (lg2<-99.999) fprintf(outf," *"); else fprintf(outf," %6i",iround(lg2*INTSCALE)); } fprintf(outf,"\n"); // Table header line with amino acids fprintf(outf,"HMM "); for (a=0; a<20; ++a) fprintf(outf," %1c ",i2aa(s2a[a])); fprintf(outf,"\n"); // Table header line with state transitions fprintf(outf," m->m m->i m->d i->m i->i d->m d->d b->m m->e\n"); // Transition probabilities from begin state fprintf(outf," %6i * %6i\n",LOG2pBM,LOG2pBD); // Start loop for printing HMM columns int h=1, hss=1; for (i=1; i<=L; ++i) { // Emission probabilities for match state fprintf(outf," %5i",i); for (a=0; a<20; ++a) fprintf(outf," %6i",imax(-9999,iround(fast_log2(p[i][s2a[a]]/pb[s2a[a]])*INTSCALE))); fprintf(outf," %5i",l[i]); fprintf(outf,"\n"); // Emission probabilities (relative to null model) for insert state while(islower(seq[nfirst][h]) && seq[nfirst][h]) h++; if (i==L) fprintf(outf," %1c * * * * * * * * * * * * * * * * * * * *\n",seq[nfirst][h++]); else fprintf(outf," %1c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",seq[nfirst][h++]); // Transition probabilities if (nss_dssp>=0) { while(islower(seq[nss_dssp][hss]) && seq[nss_dssp][hss]) hss++; c=seq[nss_dssp][hss++]; } else c=' '; fprintf(outf," %1c",c); if (i==1) { for (a=0; a<=D2D; ++a) fprintf(outf," %6i",imax(-9999,iround(tr[i][a]*INTSCALE))); fprintf(outf," %6i *\n",LOG2pBM); } else if (i==L) { for (a=0; a<=D2D; ++a) fprintf(outf," *"); fprintf(outf," * 0\n"); } else { for (a=0; a<=D2D; ++a) fprintf(outf," %6i",imax(-9999,iround(tr[i][a]*INTSCALE))); fprintf(outf," * *\n"); } } fprintf(outf,"//\n"); fclose(outf); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Transform log to lin transition probs */ void HMM::Log2LinTransitionProbs(float beta) { if (trans_lin==1) return; trans_lin=1; for (int i=0; i<=L; ++i) { for (int a=0; a=2) printf("Neutralized His-tag at position %i\n",i0); for (i=imax(i0-5,1); i=3) printf("start:%i end:%i\n",imax(i0-5,1),i-1); } // Neutralize C-myc tag if ( (pt=strstr(qseq,"EQKLISEEDL")) ) { if (v>=2) printf("Neutralized C-myc-tag at position %i\n",int(pt-qseq)+1); for (i=pt-qseq+1; i<=pt-qseq+10; ++i) for (a=0; a=2) printf("Neutralized FLAG-tag at position %i\n",int(pt-qseq)+1); for (i=pt-qseq+1; i<=pt-qseq+8; ++i) for (a=0; a1E-10) Neff-=p[i][a]*fast_log2(p[i][a]); return fpow2(Neff/L); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Calculate consensus of HMM (needed to merge HMMs later) */ void HMM::CalculateConsensus() { int i; // position in query int a; // amino acid if (!Xcons) Xcons = new char[/*MAXRES*/par.maxResLen+2]; for (i=1; i<=L; ++i) { float max=f[i][0]-pb[0]; for (a=1; a<20; ++a) if (f[i][a]-pb[a]>max) Xcons[i]=a; } Xcons[0]=Xcons[L+1]=ENDGAP; } // ///////////////////////////////////////////////////////////////////////////////////// // // Store linear transition probabilities // ///////////////////////////////////////////////////////////////////////////////////// // void HMM::StoreLinearTransitionProbs() // { // int i; // position in query // for (i=0; i<=L+1; ++i) if (!tr_lin[i]) tr_lin[i] = new(float[NTRANS]); // for (i=0; i<=L+1; ++i) // { // tr_lin[i][M2M] = fpow2(tr[i][M2M]); // tr_lin[i][M2I] = fpow2(tr[i][M2I]); // tr_lin[i][M2D] = fpow2(tr[i][M2D]); // tr_lin[i][D2M] = fpow2(tr[i][M2D]); // tr_lin[i][D2D] = fpow2(tr[i][D2D]); // tr_lin[i][I2M] = fpow2(tr[i][I2M]); // tr_lin[i][I2I] = fpow2(tr[i][I2I]); // } // } // #define Weff(Neff) (1.0+par.neffa*(Neff-1.0)+(par.neffb-4.0*par.neffa)/16.0*(Neff-1.0)*(Neff-1.0)) // ///////////////////////////////////////////////////////////////////////////////////// // // Initialize f[i][a] with query HMM // ///////////////////////////////////////////////////////////////////////////////////// // void HMM::MergeQueryHMM(HMM& q, float wk[]) // { // int i; // position in query // int a; // amino acid // float Weff_M, Weff_D, Weff_I; // for (i=1; i<=L; i++) // { // Weff_M = Weff(q.Neff_M[i]-1.0); // Weff_D = Weff(q.Neff_D[i]-1.0); // Weff_I = Weff(q.Neff_I[i]-1.0); // for (a=0; a<20; a++) f[i][a] = q.f[i][a]*wk[i]*Weff_M; // tr_lin[i][M2M] = q.tr_lin[i][M2M]*wk[i]*Weff_M; // tr_lin[i][M2I] = q.tr_lin[i][M2I]*wk[i]*Weff_M; // tr_lin[i][M2D] = q.tr_lin[i][M2D]*wk[i]*Weff_M; // tr_lin[i][D2M] = q.tr_lin[i][D2M]*wk[i]*Weff_D; // tr_lin[i][D2D] = q.tr_lin[i][D2D]*wk[i]*Weff_D; // tr_lin[i][I2M] = q.tr_lin[i][I2M]*wk[i]*Weff_I; // tr_lin[i][I2I] = q.tr_lin[i][I2I]*wk[i]*Weff_I; // } // } // ///////////////////////////////////////////////////////////////////////////////////// // // Normalize probabilities in total merged super-HMM // ///////////////////////////////////////////////////////////////////////////////////// // void HMM::NormalizeHMMandTransitionsLin2Log() // { // int i; // position in query // int a; // amino acid // for (i=0; i<=L+1; i++) // { // float sum=0.0; // for (a=0; a<20; a++) sum += f[i][a]; // for (a=0; a<20; a++) f[i][a]/=sum; // sum = tr_lin[i][M2M] + tr_lin[i][M2I] + tr_lin[i][M2D]; // tr_lin[i][M2M] /= sum; // tr_lin[i][M2I] /= sum; // tr_lin[i][M2D] /= sum; // tr[i][M2M] = fast_log2(tr_lin[i][M2M]); // tr[i][M2I] = fast_log2(tr_lin[i][M2I]); // tr[i][M2D] = fast_log2(tr_lin[i][M2D]); // sum = tr_lin[i][D2M] + tr_lin[i][D2D]; // tr_lin[i][D2M] /= sum; // tr_lin[i][D2D] /= sum; // tr[i][D2M] = fast_log2(tr_lin[i][D2M]); // tr[i][D2D] = fast_log2(tr_lin[i][D2D]); // sum = tr_lin[i][I2M] + tr_lin[i][I2I]; // tr_lin[i][I2M] /= sum; // tr_lin[i][I2I] /= sum; // tr[i][I2M] = fast_log2(tr_lin[i][I2M]); // tr[i][I2I] = fast_log2(tr_lin[i][I2I]); // } // } // UNCOMMENT TO ACTIVATE COMPOSITIONALLY BIASED PSEUDOCOUNTS BY RESCALING THE RATE MATRIX // ///////////////////////////////////////////////////////////////////////////////////// // //// Function to minimize // ///////////////////////////////////////////////////////////////////////////////////// // double RescaleMatrixFunc(double x[]) // { // double sum=0.0; // for (int a=0; a<20; ++a) // { // double za=0.0; // for (int b=0; b<20; ++b) za+=P[a][b]*x[b]; // sum += (x[a]*za-qav[a])*(x[a]*za-qav[a]); // } // return sum; // } // ///////////////////////////////////////////////////////////////////////////////////// // //// Gradient of function to minimize // ///////////////////////////////////////////////////////////////////////////////////// // void RescaleMatrixFuncGrad(double grad[], double x[]) // { // double z[20] = {0.0}; // double w[20]; // double tmp; // for (int a=0; a<20; ++a) // for (int b=0; b<20; ++b) z[a] += P[a][b]*x[b]; // for (int a=0; a<20; ++a) w[a] = x[a]*z[a]-qav[a]; // for (int a=0; a<20; ++a) // { // tmp = w[a]*z[a]; // for (int b=0; b<20; ++b) tmp += P[a][b]*x[b]*w[b]; // grad[a] = 2.0*tmp; // } // return; // } // ///////////////////////////////////////////////////////////////////////////////////// // //// Rescale a substitution matrix to biased aa frequencies in global vector qav[a] // ///////////////////////////////////////////////////////////////////////////////////// // void HMM::RescaleMatrix() // { // int a,b; // int code; // double x[21]; // scaling factor // double val_min; // const int len=20; // const int max_iterations=50; // if (v>=2) printf("Adjusting rate matrix to query amino acid composition ...\n"); // // Put amino acid frequencies into global array (needed to call WNLIB's conjugate gradient method) // for (a=0; a<20; ++a) qav[a] = pav[a]; // // Initialize scaling factors x[a] // for (a=0; a<20; ++a) x[a]=pow(qav[a]/pb[a],0.73); // Initialize // // Call conjugate gradient minimization method from WNLIB // wn_conj_gradient_method(&code,&val_min,x,len,&RescaleMatrixFunc,&RescaleMatrixFuncGrad,max_iterations); // // Calculate z[a] = sum_b Pab*xb // float sum_err=0.0f; // float sum = 0.0f; // for (a=0; a<20; ++a) // { // float za=0.0f; // za = sum_b Pab*xb // for (b=0; b<20; ++b) za+=P[a][b]*x[b]; // sum_err += (x[a]*za/qav[a]-1)*(x[a]*za/qav[a]-1); // sum += x[a]*za; // } // if (sum_err>1e-3 & v>=1) fprintf(stderr,"WARNING: adjusting rate matrix by CG resulted in residual error of %5.3f.\n",sum_err); // // Rescale rate matrix // for (a=0; a<20; ++a) // for (b=0; b<20; ++b) // { // P[a][b] *= x[a]*x[b]/sum; // R[a][b] = P[a][b]/qav[b]; // } // // How well approximated? // if (v>=3) // { // // Calculate z[a] = sum_b Pab*xb // float z[21]; // for (a=0; a<20; ++a) // for (z[a]=0.0, b=0; b<20; ++b) z[a]+=P[a][b]; // printf("Adjust A R N D C Q E G H I L K M F P S T W Y V\nErr? "); // for (a=0; a<20; ++a) printf("%4.0f ",1000*z[a]/qav[a]); // cout<=3) // { // float id=0.0f; // float entropy=0.0f; // float entropy_qav=0.0f; // float mut_info=0.0f; // for (a=0; a<20; ++a) id += P[a][a]; // for (a=0; a<20; ++a) entropy_qav-=qav[a]*fast_log2(qav[a]); // for (a=0; a<20; ++a) // for (b=0; b<20; ++b) // { // entropy-=P[a][b]*fast_log2(R[a][b]); // mut_info += P[a][b]*fast_log2(P[a][b]/qav[a]/qav[b]); // } // fprintf(stdout,"Rescaling rate matrix: sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\n",100*id,entropy,entropy_qav,mut_info); // } // return; // } /* @* HMM::ClobberGlobal (eg, q,t) */ void HMM::ClobberGlobal(void){ for (int i = 0; i < n_display; i++){ if (sname[i]){ delete[] sname[i]; sname[i] = NULL; } if (seq[i]){ delete[] seq[i]; seq[i] = NULL; } } Neff_M[0] = Neff_I[0] = Neff_D[0] = 0.0; longname[0] = '\0'; file[0] = '\0'; ss_dssp[0] = sa_dssp[0] = ss_pred[0] = ss_conf[0] = '\0'; Xcons = NULL; l[0] = 0; L = 0; Neff_HMM = 0; n_display = N_in = N_filtered = 0; nss_dssp = nsa_dssp = nss_pred = nss_conf = nfirst = ncons = -1; lamda = 0.0; mu = 0.0; name[0] = longname[0] = fam[0] = '\0'; for (int i = 0; i < NAA; i++){ pav[i] = 0; } /* @= */ return; } /* this is the end of ClobberGlobal() */ /* * EOF hhhmm-C.h */ clustal-omega-1.2.1/src/hhalign/general.h0000644000175100017510000000562112217063464015173 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: general.h 290 2013-09-20 15:18:12Z fabian $ */ #ifndef GENERAL_H #define GENERAL_H #include "../clustal/log.h" #include /* ***** Omega definitions************************************ FS, 2010-02-19 */ enum {NO = 0, YES}; enum {BASE10 = 10}; enum {AMINOACIDS = 20, STATE_TRANSITIONS = 7}; enum {MAXWORD = 100, MAXLEN = 10000}; enum {OVER_ALLOCATE = 2}; enum {FAILURE = -1, OK}; enum {RETURN_OK = 0, RETURN_FROM_MAC, RETURN_FROM_VITERBI, RETURN_FROM_PRINT_ALI, RETURN_FROM_RNP, RETURN_UNKNOWN}; enum {REALLY_BIG_MEMORY_MB = 64000}; enum {F_OFFSET = 1}; enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM, INTERN_HMM_2_HMM}; #define UNITY 1.00 enum {CALL_FROM_DONT_KNOW = -1, CALL_FROM_ALN_HMM, CALL_FROM_REGULAR}; /*#define MIN(a,b) ((a)<(b)?(a):(b))*/ /* parameters passed from Clustal-Omega to hhalign; FS, r240 -> */ typedef struct { int iMacRamMB; /* dedicated amount of RAM for Maximum Accuracy (in MB) */ bool bIsDna; /* indicates we're in nucleotide mode */ bool bIsRna; /* indicates we're in nucleotide mode */ double pca; double pcb; double pcc; double pcw; double gapb; double gapd; double gape; double gapf; double gapg; double gaph; double gapi; double pcaV; double pcbV; double pccV; double pcwV; double gapbV; double gapdV; double gapeV; double gapfV; double gapgV; double gaphV; double gapiV; } hhalign_para; /* 'scores' passed out from hhalign */ typedef struct{ double forwardProb; double backwardProb; double hhScore; double sumPP; double *PP; int L; } hhalign_scores; typedef struct { /***public***/ int n_display; char **sname; char **seq; int ncons; int nfirst; int nss_dssp; int nsa_dssp; int nss_pred; int nss_conf; int L; int N_in; int N_filtered; float *Neff_M; float *Neff_I; float *Neff_D; float Neff_HMM; char *longname; char name[511]; char file[511]; char fam[511]; char sfam[511]; char fold[511]; char cl[511]; float lamda; float mu; /***private***/ float **f; float **g; float **p; float **tr; float **linTr; char trans_lin; char *ss_dssp; char *sa_dssp; char *ss_pred; char *ss_conf; char *Xcons; float pav[20]; float pnul[20]; int *l; } hmm_light; #endif clustal-omega-1.2.1/src/hhalign/list.h0000644000175100017510000001626711457540746014551 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: list.h 143 2010-10-14 13:11:14Z andreas $ */ // list.h ////////////////////////////////////////////////////////////////////////////// // Double-linked list implementation with head and tail dummy elements // We set head->prev=head and tail->next=tail. // This makes sure that repeated current=current->next; ends up in tail // and repeated current=current->prev; ends up in head. // head and tail optionally contain a NULL element of Typ defined by method Null(Typ) ////////////////////////////////////////////////////////////////////////////// template class List { protected: template class ListEl //elements of List; essentially a data structure { public: Typ1 data; //Typ is type of data to be stored in list ListEl* prev; //points to previous list element ListEl* next; //points to next list element ListEl() : prev(0), next(0) {} ListEl(Typ1 d) : data(d), prev(0), next(0) {} ListEl(ListEl* p, ListEl* n) : prev(p), next(n) {} ListEl(Typ1 d, ListEl* p, ListEl* n) : data(d), prev(p), next(n) {} }; ListEl* head; //points to dummy element at beginning of list ListEl* tail; //points to dummy element at end of list ListEl* current; //current element position within list int size; //Number of elements in list // Use QUICKSORT to sort list in asscending order between two list elements void SortList(ListEl*, ListEl*, int); // Use QUICKSORT to sort list of pointers by comparing elements they point to void SortPointerList(ListEl*, ListEl*); // Swap two list elements by making a flat copy (don't need two copies of data) // Warning: Gets slow if Typ is composite type with many variables (>=5) void SwapContent(ListEl* e1, ListEl* e2) { Typ d; if (e1!=e2) {d=e1->data; e1->data=e2->data; e2->data=d;} } public: ////////////////////////////////////////////////////////////////////////////// // General methods List(); List(Typ d); ~List(); List& operator=(List&); // Set Null element that will be returned when trying to read from an empty list void Null(Typ null) {head->data = tail->data = null;} ////////////////////////////////////////////////////////////////////////////// // Methods that act at the end of the list // Insert Element after LAST element of list (and return address of data element) Typ* Push(Typ); // Remove and return LAST element of list. Returns head->data if list empty Typ Pop(); // return LAST element of list. Returns null element in head->data if list empty Typ ReadLast() {return tail->prev->data;} ////////////////////////////////////////////////////////////////////////////// // Methods that act at the beginning of the list // Insert element as FIRST element of list (and return address of data element) Typ* Enqueue(Typ); // Remove and return element at BEGINNING of list. Returns head->data if list empty Typ Dequeue(); // return FIRST element of list. Returns null element in head->data if list empty Typ ReadFirst() {if (size) return head->next->data; else return head->data;} ////////////////////////////////////////////////////////////////////////////// // Methods that work with 'current' position in the list // Advances current position by 1 and reads next element; returns head->data if at end of list. Typ ReadNext(); // Reads current element again Typ ReadCurrent(); // Moves current position back by 1 and reads previous element; returns head->data if at beginning of list. Typ ReadPrevious(); // Advances current position by 1 and reads address of next element; returns NULL if at end of list. Typ* ReadNextAddress(); // Reads address of current element again, returns NULL if at end of list Typ* ReadCurrentAddress(); // Sets current position to k and reads k'th element (first=1). Returns head->data if current points to no data element Typ Read(int); // Inserts element AFTER CURRENT element; current element will be set to inserted element void Insert(Typ); // Removes and returns element at CURRENT position. New position is one BEFORE current position. // Returns head->data if current points to no data element. After Reset() delete first element (not 0'th) Typ Delete(); // Overwrites data at current position with new data void Overwrite(Typ d) {current->data=d;} // Reset current position to 0 (one BEFORE the first) int Reset() {current = head; return size;} // Reset current position to End (one AFTER the last) int SetToEnd() {current = tail; return size;} ////////////////////////////////////////////////////////////////////////////// // Methods that return information about the list // Return number of list elements (size>=0) int Size() {return size;} // return true if end of list, i.e. ReadNext would give tail->data (i.e. current position >= Size) char End() {return (current==tail || current==tail->prev);} char End(void* curr) {return ( curr == tail || curr == tail->prev);} // return true if start of list, i.e. ReadPrevious would give head->data (i.e. current position <=1) char Start() {return (current==head || current==head->next);} // Get current position within list (0 <= pos <= Size+1) int GetPos(); //print out list (elements assumed int) void PrintList(); // Get largest data element (Null element for empty list) Typ Largest(); // Get smallest data element (Null element for empty list) Typ Smallest(); ////////////////////////////////////////////////////////////////////////////// // Methods that manipulate the list as a whole // Reverse list void Reverse(); // Copies list into list object void Copy(List* list); // Appends a copy of list to class object void AppendCopy(List* list); // Appends list to class object list void Append(List* list); // Use QUICKSORT to sort list in ascending order. Use only for UNSORTED lists, otherwise time O(N^2) instead of O(N*log(N)) /* void SortList() {if (size>1) SortList(head->next, tail->prev);} */ void SortList() {if (size>1) SortList(head->next, tail->prev, size);} void QuickSort() {if (size>1) SortList(head->next, tail->prev, size);} // Use QUICKSORT to sort list of pointers in ascending order. Use only for UNSORTED lists, otherwwise time O(N^2)! void SortPointerList() {if (size>1) SortPointerList(head->next, tail->prev);} void QuickSortPointer() {if (size>1) SortPointerList(head->next, tail->prev);} // Use INSERTSORT to sort list in asscending order. Use only for PRESORTED lists, otherwise time O(N^2)! void ResortList(); }; clustal-omega-1.2.1/src/hhalign/hash.h0000644000175100017510000001711711457540746014514 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hash.h 143 2010-10-14 13:11:14Z andreas $ */ // Class for Hash data structure // * works in the same way as a hash in Perl // * keys are strings of type char* // * data elements are of type Typ // * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2) // * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots // // Applications // * fast storage and retrieval of data by a key // * fast check if a string occurs in a list of strings (data field not used) // // Time complexity: (L is the length of the key string) // * Show(key), Add(key), Remove(key): O(L) for calculating hash value & compare keys in slot list // * ReadNext, ReadCurrent, RemoveCurrent: O(L) for copying key into returned string // * Contains: O(L) for calculating hash value // * Size, MaxLen, Reset: O(1) // * RemoveAll(), Hash() and ~Hash(): O(num_slots) // // Memory complexity: ~3*num_keys*(datasize+12bytes) + num_slots*4bytes + total added length of keys (including \0) // // Implementation: // Hash is an array of pointers to lists of size num_slots. The lists, called slots, contain key/data pairs. // When a key/data pair is added (e.g. with Add()) the array index i for the key (0<=i class Pair { public: char* key; //hash key Typ data; //data for key Pair() {} Pair(char* k, Typ& d) {key = new char[strlen(k)+1]; strcpy(key,k); data=d;} Pair(int& l, char* k, Typ& d) {key = new char[l+1]; strcpy(key,k); data=d;} }; //////////////////////////////////////////////////////////////////////////////////////////// // Declaration of Slot, a list of key/data pairs //////////////////////////////////////////////////////////////////////////////////////////// template class Slot : public List< Pair > { public: //Destructor of Slot deletes whole list TOGETHER WITH THE KEY STRINGS ~Slot() {this->Reset(); while (!this->End()) delete[] this->Pop().key; } // Push key/data pair onto slot list and return address of data element // Attention: l must be at least length of key inline Typ* Push(int& l, char* key, Typ& data) { Pair pair(l,key,data); //create a pair with key/data return &(List >::Push(pair)->data); } }; //////////////////////////////////////////////////////////////////////////////////////////// // Declaration of Hash, an array of slots, i.e. pointers to lists of key/data //////////////////////////////////////////////////////////////////////////////////////////// template class Hash { private: int num_slots; //number of slots in slot[]. num_slots is set with the constructor int curr; //index of current slot int prev; //index of slot from previous ReadNext() int num_keys; //total number of keys in hash int max_len; //length of longest key in hash int key_len; //length of key in argument Typ fail; Slot** slot; //each slot[i] (i(0)); // Update maximum key length and caculate key_len; inline void KeyLen() {if(key_len>max_len) max_len=key_len; return;} //////////////////////////////////////////////////////////////////////////////////////////// // Methods that work with a key supplied as an argument // Return data element for key. Returns 'fail' if key does not exist Typ Show(char* key); inline Typ operator[](char* key) {return Show(key);} // Add/replace key/data pair to hash and return address of data element for key Typ* Add(char* key, Typ data); // Add key to hash and return address of data element. If key exists leave data element unchanged, else set it to 'fail'. Typ* Add(char* key); inline Typ* operator()(char* key) {return Add(key);} // Remove key from hash and return data element for key ('fail' if key does not exist) Typ Remove(char* key); // Remove all keys from hash void RemoveAll(); /////////////////////////////////////////////////////////////////////////////////////////// // Methods that work with an internal "current key": // It is set to the first key by Reset() and moves to the next key with ReadNext or RemoveCurrent // Note:the methods above (e.g. Store, Show, [], Add, (), etc. DO NOT CHANGE the current key // Return data of next key. Return 'fail' data and empty key if at end Typ ReadNext(); // Write next key into variable key and return data. Return 'fail' data and empty key if at end // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! Typ ReadNext(char* key); // Return data of current key Typ ReadCurrent(); // Write key last read into variable key and return data // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! Typ ReadCurrent(char* key); // Remove current key, return data and advance to next key Typ RemoveCurrent(); // Remove current key, return data, copy current key into key, and advance to next key // (After Reset() remove first element) // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! Typ RemoveCurrent(char* key); // Reset readout of keys to beginning of hash void Reset(); // Returns 1 if the current key has arrived at the end, 0 otherwise int End() {return (curr>=num_slots);} /////////////////////////////////////////////////////////////////////////////////////////// // Methods that return usefull information about the data stored in Hash: // Returns 1 if the hash contains key, 0 otherwise int Contains(char* key); // Return number of slots int Size() {return num_keys;} // Return length of longest key INCLUDING DELETED KEYS (excluding \0) int MaxLen() {return max_len;} //print out list of keys and data void Print(); //Print out hash with internal representation as array void DebugPrint(); }; clustal-omega-1.2.1/src/hhalign/Makefile.in0000644000175100017510000003775212304116377015463 00000000000000# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Some useful automake documentation: # http://www.openismus.com/documents/linux/automake/automake.shtml # http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html #SUBDIRS = #EXTRA_DIST = # LDADD = foofiles/libfoo.a VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/hhalign DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libhhalign_la_LIBADD = am_libhhalign_la_OBJECTS = hhalign.lo libhhalign_la_OBJECTS = $(am_libhhalign_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libhhalign_la_SOURCES) DIST_SOURCES = $(libhhalign_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(library_includedir)" library_includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(library_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CXXFLAGS = -fno-strict-aliasing -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 @OPENMP_CXXFLAGS@ @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENMP_CFLAGS = @OPENMP_CFLAGS@ OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CODENAME = @PACKAGE_CODENAME@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libhhalign.la libhhalign_la_SOURCES = hhalign.cpp hhalign.h \ hash-C.h hash.h hhdecl-C.h hhfunc-C.h hhfunc.h \ hhmatrices-C.h hhutil-C.h \ hhalignment-C.h hhalignment.h \ hhfullalignment-C.h hhfullalignment.h \ hhhalfalignment-C.h hhhalfalignment.h \ hhhit-C.h hhhit.h hhhitlist-C.h hhhitlist.h \ hhhmm-C.h hhhmm.h \ util-C.h list-C.h list.h \ general.h library_includedir = $(includedir)/clustalo/hhalign library_include_HEADERS = general.h hhfunc.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/hhalign/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/hhalign/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhhalign.la: $(libhhalign_la_OBJECTS) $(libhhalign_la_DEPENDENCIES) $(CXXLINK) $(libhhalign_la_OBJECTS) $(libhhalign_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hhalign.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(library_includedir)" || $(MKDIR_P) "$(DESTDIR)$(library_includedir)" @list='$(library_include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(library_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(library_includedir)/$$f'"; \ $(library_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(library_includedir)/$$f"; \ done uninstall-library_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(library_include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(library_includedir)/$$f'"; \ rm -f "$(DESTDIR)$(library_includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(library_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-library_includeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-library_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-library_includeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-library_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clustal-omega-1.2.1/src/hhalign/list-C.h0000644000175100017510000004303311457540746014720 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: list-C.h 143 2010-10-14 13:11:14Z andreas $ */ // list.C // Class for double-linked list #ifndef JLIST #define JLIST #ifndef MAIN #include // cin, cout #include // #include // using std::cout; using std::cerr; #endif #include "list.h" //////////////////////////////////////////////////////////////////////////// // Double-linked list implementation with head and tail dummy elements // We set head->prev=head and tail->next=tail. // This makes sure that repeated current=current->next; ends up in tail // and repeated current=current->prev; ends up in head. // head and tail optionally contain a NULL element of Typ defined by method Null(Typ) //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Constructors and destructor //////////////////////////////////////////////////////////////////////////// // Creates empty List with two dummy elements //////////////////////////////////////////////////////////////////////////// template List::List() { head=new ListEl(); if (!head) { cerr<<"Could not create new element\n"; return; } tail=new ListEl(head,NULL); if (!tail) { cerr<<"Could not create new element\n"; return; } tail->next = tail; head->prev = head; head->next = tail; current = head; size=0; } //////////////////////////////////////////////////////////////////////////// // Creates List with one element //////////////////////////////////////////////////////////////////////////// template List::List(Typ d) { head=new ListEl(); if (!head) { cerr<<"Could not create new element\n"; return; } tail=new ListEl(); if (!tail) { cerr<<"Could not create new element\n"; return; } ListEl* el = new ListEl(d,head,tail); if (!el) { cerr<<"Could not create new element\n"; return; } head->prev = head; head->next = el; tail->prev = el; tail->next = tail; current = head; size=1; } //////////////////////////////////////////////////////////////////////////// // Destructor deletes List object //////////////////////////////////////////////////////////////////////////// template List::~List() { ListEl* n=head->next; while(head!=n) { delete(head); head = NULL; head=n; n=head->next; } delete(head); head = NULL; } //////////////////////////////////////////////////////////////////////////// // Flat copy //////////////////////////////////////////////////////////////////////////// template List& List::operator=(List& l) { head = l.head; tail = l.tail; current = l.current; size = l.size; } //////////////////////////////////////////////////////////////////////////// // Reverse order of list //////////////////////////////////////////////////////////////////////////// template void List::Reverse() { ListEl *n; // next list element; also for swapping ListEl *c; // current element to be sorted in. Everything to the left is already sorted if (Size()<=1) return; for (c=head; c!=tail; c=n) { // Swap prev and next pointers of all list elements n = c->next; c->next = c->prev; c->prev = n; } // Swap prev and next pointers of tail tail->next = tail->prev; tail->prev = tail; // Swap head an tail n = head; head = tail; tail = n; } //////////////////////////////////////////////////////////////////////////// // Methods that act at the end of the list //////////////////////////////////////////////////////////////////////////// // Insert Element after LAST of list (and return address of data element) //////////////////////////////////////////////////////////////////////////// template Typ* List::Push(Typ d) { ListEl* t=new ListEl(d,tail->prev,tail); if (!t) { cerr<<"Could not create new element\n"; return 0; } tail->prev->next=t; tail->prev = t; size++; return &(t->data); } //////////////////////////////////////////////////////////////////////////// // Remove and return LAST element of list. Returns head->data if empty //////////////////////////////////////////////////////////////////////////// template Typ List::Pop() { if (!size) return head->data; ListEl* t=tail->prev; if (current==t) current=tail; Typ d=t->data; t->prev->next=tail; tail->prev=t->prev; delete t; t = NULL; size--; return d; } //////////////////////////////////////////////////////////////////////////// // Methods that act at the beginning of the list //////////////////////////////////////////////////////////////////////////// // Insert element as FIRST element of list (and return address of data element) //////////////////////////////////////////////////////////////////////////// template Typ* List::Enqueue(Typ d) { ListEl* h = new ListEl(d,head,head->next); if (!h) { cerr<<"Could not create new element\n"; return 0; } h->next->prev = h; head->next=h; size++; return &(h->data); } //////////////////////////////////////////////////////////////////////////// // Remove element at BEGINNING of list //////////////////////////////////////////////////////////////////////////// template Typ List::Dequeue() { if (!size) return head->data; ListEl* h=head->next; if (current==h) current=head; Typ d=h->data; h->next->prev=head; head->next=h->next; delete h; h = NULL; size--; return d; } //////////////////////////////////////////////////////////////////////////// // Methods that work with 'current' position in the list //////////////////////////////////////////////////////////////////////////// // Reads next element; advances current position by 1 //////////////////////////////////////////////////////////////////////////// template inline Typ List::ReadNext() { current = current->next; return current->data; } //////////////////////////////////////////////////////////////////////////// // Reads current element again (NULL if nothing read yet) //////////////////////////////////////////////////////////////////////////// template inline Typ List::ReadCurrent() { return current->data; } //////////////////////////////////////////////////////////////////////////// // Reads previous element; moves current position back by 1 //////////////////////////////////////////////////////////////////////////// template inline Typ List::ReadPrevious() { current = current->prev; return current->data; } //////////////////////////////////////////////////////////////////////////// // Reads next element; advances current position by 1 //////////////////////////////////////////////////////////////////////////// template inline Typ* List::ReadNextAddress() { current = current->next; if (current==tail) return NULL; return &(current->data); } //////////////////////////////////////////////////////////////////////////// // Reads address of current element again, returns NULL if at end of list //////////////////////////////////////////////////////////////////////////// template inline Typ* List::ReadCurrentAddress() { if (current==tail) return NULL; return &(current->data); } //////////////////////////////////////////////////////////////////////////// // Sets current position to k and reads k'th element (first=1) //////////////////////////////////////////////////////////////////////////// template Typ List::Read(int pos) { if (pos>size) {current = tail; return tail->data;} if (pos<=0) {current = head; return head->data;} current = head->next; for (; pos>1; pos--) current = current->next; //If pos==2 do 1 iteration return current->data; } //////////////////////////////////////////////////////////////////////////// // Inserts element d AFTER current element and sets current element to inserted //////////////////////////////////////////////////////////////////////////// template void List::Insert(Typ d) { ListEl* el = new ListEl(d,current,current->next); if (!el) { cerr<<"Could not create new element\n"; return; } (current->next)->prev = el; current->next = el; current=el; size++; } //////////////////////////////////////////////////////////////////////////// // Deletes current element and returns content of deleted element. Current element // will be previous one after Delete(). After Reset() delete first element (not 0'th) //////////////////////////////////////////////////////////////////////////// template Typ List::Delete() { Typ d; ListEl* p; if (!size || current==tail) return tail->data; if (current==head) current = head->next; // After Reset() delete first element (not 0'th) (current->prev)->next = current->next; (current->next)->prev = current->prev; d = current->data; p = current->prev; delete current; current = NULL; current = p; size--; return d; } //////////////////////////////////////////////////////////////////////////// // Methods that return useful information about the list //////////////////////////////////////////////////////////////////////////// // Get current position within list (0 <= pos <= Size+1) //////////////////////////////////////////////////////////////////////////// template int List::GetPos() { int pos=0; ListEl* el; for (el = head; el!=current; el=el->next) pos++; return pos; } //////////////////////////////////////////////////////////////////////////// //print out list //////////////////////////////////////////////////////////////////////////// template void List::PrintList() { int j=0; ListEl* c=current; Reset(); printf("List: "); while (!End()) { j++; cout< Typ List::Largest() { Typ* result= &((tail->prev)->data); Reset(); while (!End()) { if (*result Typ List::Smallest() { Typ* result= &((tail->prev)->data); Reset(); while (!End()) { if (ReadNext()<*result) result=ReadCurrentAddress(); } return *result; } ///////////////////////////////////////////////////////////////////////////// // Methods that manipulate the list as a whole //////////////////////////////////////////////////////////////////////////// // Copies list 0 into list object //////////////////////////////////////////////////////////////////////////// template void List::Copy(List* list) { if (list==this) return; while (!End()) Pop(); //empty list list->Reset(); while (!list->End()) Push(list->ReadNext()); } //////////////////////////////////////////////////////////////////////////// // Appends a copy of list2 to class object //////////////////////////////////////////////////////////////////////////// template void List::AppendCopy(List* list2) { List* cpy=new List; cpy->Copy(list2); Append(cpy); delete cpy; cpy = NULL; } //////////////////////////////////////////////////////////////////////////// // Appends list2 to class object //////////////////////////////////////////////////////////////////////////// template void List::Append(List* list) { if (this==list) { AppendCopy(list); return;} (tail->prev)->next = list->head->next; (list->head->next)->prev = tail->prev; if (current==tail) current=tail->prev; ListEl* t=tail; tail = list->tail; size += list->size; // Reuse old tail as new tail t for list2 and initialize pointers for empty list list->tail=t; list->head->next=t; t->prev=list->head; t->next=t; list->head->prev=list->head; t->data=list->head->data; list->current=list->head; list->size = 0; } //////////////////////////////////////////////////////////////////////////// // Use QUICKSORT to sort list in ascending order between two list elements //////////////////////////////////////////////////////////////////////////// template void List::SortList(ListEl* left, ListEl* right, int sz) { if (sz<=1) return; // when SortList() is called, left=head->next, right=tail->prev ListEl *l=left->prev, *r=right->next; // Choose *random* pivot element!! // (Otherwise, complexity for an already sorted list is N^2 => recursive calls may lead to stack overflow) ListEl *c=left; for (int i=1; i<(int)(float(rand())*sz/(RAND_MAX+0.999)); i++) c = c->next; SwapContent(left,c); Typ pivot = left->data; // Typ* pivot= &(left->data); int sz0=sz+1; // cout<<"Sorting between "<data<<" and "<data<<". Pivot="<prev; sz0--;} while (pivot < r->data); do l=l->next; while (l->data < pivot); if (l==r || l->prev==r) break; SwapContent(l,r); } SortList(left,r,sz0); SortList(r->next,right,sz-sz0); pivot = tail->data; // to avoid calling the destructor of Typ on some real data element } //////////////////////////////////////////////////////////////////////////// // Use QUICKSORT to sort list of POINTERS by comparing the objects the pointers point to //////////////////////////////////////////////////////////////////////////// template void List::SortPointerList(ListEl* left, ListEl* right) { if (right==left || right->next==left) return; ListEl *l=left->prev, *r=right->next; Typ pivot=left->data; // cout<<"Sorting between "<data<<" and "<data<<". Pivot="<prev; // cout<<"r=r->prev. r->data="<data<data)); do { l=l->next; // cout<<"l=l->next l->data="<data<data) < *pivot); if (l==r || l->prev==r) break; SwapContent(l,r); } SortPointerList(left,r); SortPointerList(r->next,right); } // Use INSERTSORT to sort list in asscending order between two list elements. Use only for presorted lists, otherwise time O(N^2)! template void List::ResortList() { ListEl *c; // current element to be sorted in. Everything to the left is already sorted ListEl *n; // next element to be sorted in ListEl *p; // pointer for looping through sorted part of list ListEl *pnext; // for swapping if (Size()<=1) return; c=head->next->next; while (c!=tail) { p=c->prev; n=c->next; if (c->data < p->data) { do {p=p->prev;} while (p!=head && c->data < p->data); // Connect c->prev to c->next ... c->next->prev=c->prev; c->prev->next=c->next; // ... and insert c between p and p->next ... pnext=p->next; p->next=c; c->next=pnext; pnext->prev=c; c->prev=p; } c=n; } } #endif /* JLIST */ // //Main program: test class List // int main() // { // int p; // List* plist=new List(11); // List list(22); // plist->Push(24); // plist->Push(18); // plist->Push(3); // plist->Enqueue(17); // plist->Enqueue(29); // printf("List 1 with pushed and enqueued elements:\n"); // plist->PrintList(); // list.Push(222); // printf("List 1 with list 2 appended:\n"); // plist->Append(&list); // plist->PrintList(); // printf("Pushing one element three times into list 2:\n"); // list.Push(333); // list.Push(444); // list.Push(555); // printf("Printing plist and list with three elements:\n"); // list.PrintList(); // plist->PrintList(); // printf("list.Copy(plist). Printing list 1 and 2:\n"); // list.Copy(plist); // plist->PrintList(); // list.PrintList(); // printf("Appending list 1 to itself:\n"); // plist->Append(plist); // plist->PrintList(); // cout<<"Popping "<Pop()<<"\n"; // cout<<"Popping "<Pop()<<"\n"; // plist->PrintList(); // cout<<"Dequeing "<Dequeue()<<"\n"; // cout<<"Dequeing "<Dequeue()<<"\n"; // plist->PrintList(); // cout<<"Reversing list\n"; // plist->Reverse(); // plist->PrintList(); // cout<<"Reversing to original list\n"; // plist->Reverse(); // plist->PrintList(); // for (p=plist->Reset(); p>=5;p--) // {cout<GetPos()<<": "<Read(p)<<"\n";} // cout<<"Deleting "<Delete()<<"\n"; // cout<<"Deleting "<Delete()<<"\n"; // plist->PrintList(); // plist->Append(plist); // plist->PrintList(); // cout<<"List 1 sorted:\n"; // plist->SortList(); // plist->PrintList(); // } clustal-omega-1.2.1/src/hhalign/hhalign.h0000644000175100017510000000212412156044404015156 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhalign.h 284 2013-06-12 10:10:11Z fabian $ */ extern int hhalign(char **ppcFirstProf, int iFirstCnt, double *pdWeightsL, char **ppcSecndProf, int iSecndCnt, double *pdWeightsR, double *dScore_p, hmm_light *prHMM, char *pcPrealigned1, char *pcRepresent1, char *pcPrealigned2, char *pcRepresent2, hhalign_para rHhalignPara, hhalign_scores *rHHscores, int iFlag, int iVerbosity, char zcAux[], char zcError[]); clustal-omega-1.2.1/src/hhalign/hhfullalignment.h0000644000175100017510000000376512156044404016741 00000000000000/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /********************************************************************* * Clustal Omega - Multiple sequence alignment * * Copyright (C) 2010 University College Dublin * * Clustal-Omega is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This file is part of Clustal-Omega. * ********************************************************************/ /* * RCS $Id: hhfullalignment.h 284 2013-06-12 10:10:11Z fabian $ */ ////////////////////////////////////////////////////////////////////////////// // Class for output alignment of query against template sequences ////////////////////////////////////////////////////////////////////////////// class FullAlignment { public: FullAlignment(int maxseqdis=MAXSEQDIS); ~FullAlignment(); void FreeMemory(); int Build(HMM& q, Hit& hit, char zcError[]); void PrintHeader(FILE* outf, HMM& q, Hit& hit); void PrintHHR(FILE* outf, Hit& hit); void PrintA2M(FILE* outf, Hit& hit); void PrintFASTA(FILE* outf, Hit& hit); void PrintA3M(FILE* outf, Hit& hit); void OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf); int identities; // number of identical residues in query and template sequence float score_sim; // substitution matrix similarity score between query and template private: HalfAlignment* qa; //query and template parts of the alignment HalfAlignment* ta; //query and template parts of the alignment char symbol[LINELEN]; //symbol[h] = symbol (= - . + |) indicating match score for col h of alignment void ClearSymbols() {for (int h=0; h */ ////////////////////////////////////////////////////////////////////////////// class Hit { public: char* longname; // Name of HMM char* name; // One-word name of HMM char* file; // Basename (with path, without extension) of alignment file that was used to construct the HMM // (path from db-file is prepended to FILE record in HMM file!) char fam[IDLEN]; // family ID (derived from name) (FAM field) char sfam[IDLEN]; // superfamily ID (derived from name) char fold[IDLEN]; // fold ID (derived from name) char cl[IDLEN]; // class ID (derived from name) int index; // index of HMM in order of reading in (first=0) char* dbfile; // full database file name from which HMM was read long ftellpos; // start position of HMM in database file float score; // Score of alignment (i.e. of Viterbi path) float score_sort; // score to sort hits in output list (negative means first/best!) float score_aass; // first: just hit.score, then hit.logPval-SSSCORE2NATLOG*hit.score_ss;(negative means best!) float score_ss; // Part of score due to secondary structure float Pval; // P-value for whole protein based on score distribution of query float Pvalt; // P-value for whole protein based on score distribution of template float logPval; // natural logarithm of Pval float logPvalt; // natural logarithm of Pvalt float Eval; // E-value for whole protein float Probab; // probability in % for a positive (depends only on score) float weight; // weight of hit for P-value calculation (= 1/#HMMs-in-family/#families-in-superfamily) double Pforward; // scaled total forward probability : Pforward * Product_{i=1}^{Lq+1}(scale[i]) /* float score_comp; // compositional similarity score */ /* float logPcomp; // natural logarithm of Pvalue for compositional similarity score */ /* float Prep; // P-value for single-repeat hit */ /* float Erep; // E-value for single-repeat hit */ /* float logPrep; // natural logarithm of P-value for single-repeat hit */ float E1val; // E-value for whole protein from transitive scoring float logP1val; // natural logarithm of P1val, the transitive P-value int L; // Number of match states in template int irep; // Index of single-repeat hit (1: highest scoring repeat hit) int nrep; // Number of single-repeat hits with one template int n_display; // number of sequences stored for display of alignment char** sname; // names of stored sequences char** seq; // residues of stored sequences (first at pos 1) int nss_dssp; // index of dssp secondary structure sequence in seq[] int nsa_dssp; // index of of dssp solvent accessibility in seq[] int nss_pred; // index of dssp secondary structure sequence in seq[] int nss_conf; // index of dssp secondary structure sequence in seq[] int nfirst; // index of query sequence in seq[] int ncons; // index of consensus sequence int nsteps; // index for last step in Viterbi path; (first=1) int* i; // i[step] = query match state at step of Viterbi path int* j; // j[step] = template match state at step of Viterbi path char* states; // state at step of Viterbi path 0: Start 1: M(MM) 2: A(-D) 3: B(IM) 4: C(D-) 5 D(MI) float* S; // S[step] = match-match score contribution at alignment step float* S_ss; // S_ss[step] = secondary structure score contribution float* P_posterior; // P_posterior[step] = posterior prob for MM states (otherwise zero) char* Xcons; // consensus sequence for aligned states in internal representation (A=0 R=1 N=2 D=3 ...) int i1; // First aligned residue in query int i2; // Last aligned residue in query int j1; // First aligned residue in template int j2; // Last aligned residue in template int matched_cols; // number of matched columns in alignment against query int ssm1; // SS scoring AFTER alignment? 0:no 1:yes; t->dssp q->psipred 2:yes; q->dssp t->psipred int ssm2; // SS scoring DURING alignment? 0:no 1:yes; t->dssp q->psipred 2:yes; q->dssp t->psipred char self; // 0: align two different HMMs 1: align HMM with itself int min_overlap; // Minimum overlap between query and template float sum_of_probs; // sum of probabilities for Maximum ACcuracy alignment (if dssp states defined, only aligned pairs with defined dssp state contribute to sum) float Neff_HMM; // Diversity of underlying alignment // Constructor (only set pointers to NULL) Hit(); ~Hit(){}; // Free all allocated memory (to delete list of hits) void Delete(); // Allocate/delete memory for dynamic programming matrix void AllocateBacktraceMatrix(int Nq, int Nt); void DeleteBacktraceMatrix(int Nq); void AllocateForwardMatrix(int Nq, int Nt); void DeleteForwardMatrix(int Nq); void AllocateBackwardMatrix(int Nq, int Nt); void DeleteBackwardMatrix(int Nq); // Compare an HMM with overlapping subalignments void Viterbi(HMM& q, HMM& t, float** Sstruc=NULL); // Compare two HMMs with each other in lin space int Forward(HMM& q, HMM& t, float** Pstruc=NULL); // Compare two HMMs with each other in lin space int Backward(HMM& q, HMM& t); // Find maximum accuracy alignment (after running Forward and Backward algorithms) void MACAlignment(HMM& q, HMM& t); // Trace back alignment of two profiles based on matrices bXX[][] void Backtrace(HMM& q, HMM& t); // Trace back alignment of two profiles based on matrices bXX[][] void StochasticBacktrace(HMM& q, HMM& t, char maximize=0); // Trace back MAC alignment of two profiles based on matrix bMM[][] void BacktraceMAC(HMM& q, HMM& t); // Calculate secondary structure score between columns i and j of two HMMs (query and template) inline float ScoreSS(HMM& q, HMM& t, int i, int j, int ssm); // Calculate secondary structure score between columns i and j of two HMMs (query and template) inline float ScoreSS(HMM& q, HMM& t, int i, int j); // Calculate total score (including secondary structure score and compositional bias correction inline float ScoreTot(HMM& q, HMM& t, int i, int j); // Calculate score (excluding secondary structure score and compositional bias correction inline float ScoreAA(HMM& q, HMM& t, int i, int j); // Comparison (used to sort list of hits) int operator<(const Hit& hit2) {return score_sort=3) printf("Using the BLOSUM%2i matrix\n",par.matrix); for (a=0; a<20; ++a) for (pb[a]=0.0f, b=0; b<=a; ++b,++n) P[a][b] = BlosumXX[n]; for (a=0; a<19; a++) for (b=a+1; b<20; ++b) P[a][b] = P[b][a]; for (a=0; a<20; ++a) P[a][20]=P[20][a]=1.0f; return; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Set (global variable) substitution matrix with derived matrices and background frequencies */ void SetSubstitutionMatrix() { int a,b; switch (par.matrix) { default: case 0: //Gonnet matrix if (v>=3) cout<<"Using the Gonnet matrix "; for (a=0; a<20; ++a) for (pb[a]=0.0f, b=0; b<20; ++b) P[a][b] = 0.000001f*Gonnet[a*20+b]; for (a=0; a<20; ++a) P[a][20]=P[20][a]=1.0f; break; case 30: //BLOSUM30 SetBlosumMatrix(Blosum30); break; case 40: //BLOSUM40 SetBlosumMatrix(Blosum40); break; case 50: //BLOSUM50 SetBlosumMatrix(Blosum50); break; case 65: //BLOSUM65 SetBlosumMatrix(Blosum65); break; case 80: //BLOSUM80 SetBlosumMatrix(Blosum80); break; } // Check transition probability matrix, renormalize P and calculate pb[a] float sumab=0.0f; for (a=0; a<20; a++) for (b=0; b<20; ++b) sumab+=P[a][b]; for (a=0; a<20; a++) for (b=0; b<20; ++b) P[a][b]/=sumab; for (a=0; a<20; a++) for (pb[a]=0.0f, b=0; b<20; ++b) pb[a]+=P[a][b]; //Compute similarity matrix for amino acid pairs (for calculating consensus sequence) for (a=0; a<20; ++a) for (b=0; b<20; ++b) Sim[a][b] = P[a][b]*P[a][b]/P[a][a]/P[b][b]; //Precompute matrix R for amino acid pseudocounts: for (a=0; a<20; ++a) for (b=0; b<20; ++b) R[a][b] = P[a][b]/pb[b]; //R[a][b]=P(a|b) //Precompute matrix R for amino acid pseudocounts: for (a=0; a<20; ++a) for (b=0; b<20; ++b) S[a][b] = log2(R[a][b]/pb[a]); // S[a][b] = log2(P(a,b)/P(a)/P(b)) // Evaluate sequence identity underlying substitution matrix if (v>=3) { float id=0.0f; float entropy=0.0f; float entropy_pb=0.0f; float mut_info=0.0f; for (a=0; a<20; ++a) id+=P[a][a]; for (a=0; a<20; ++a) entropy_pb-=pb[a]*log2(pb[a]); for (a=0; a<20; ++a) for (b=0; b<20; ++b) { entropy-=P[a][b]*log2(R[a][b]); mut_info += P[a][b]*S[a][b]; } printf(": sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\n",100*id,entropy,entropy_pb,mut_info); } if (v>=4) //Debugging: probability matrix and dissimilarity matrix { cout<<"Check matrix: before renormalization sum P(a,b)= "<=3) { float id=0.0f; float entropy=0.0f; float entropy_pb=0.0f; float mut_info=0.0f; for (a=0; a<20; ++a) id+=P[a][a]; for (a=0; a<20; ++a) entropy_pb-=pb[a]*log2(pb[a]); for (a=0; a<20; ++a) for (b=0; b<20; ++b) { entropy-=P[a][b]*log2(R[a][b]); mut_info += P[a][b]*S[a][b]; } printf(": sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\n",100*id,entropy,entropy_pb,mut_info); } if (v>=4) //Debugging: probability matrix and dissimilarity matrix { cout<<"Check matrix: before renormalization sum P(a,b)= "<=3) { float id=0.0f; float entropy=0.0f; float entropy_pb=0.0f; float mut_info=0.0f; for (a=0; a<20; ++a) id+=P[a][a]; for (a=0; a<20; ++a) entropy_pb-=pb[a]*log2(pb[a]); for (a=0; a<20; ++a) for (b=0; b<20; ++b) { entropy-=P[a][b]*log2(R[a][b]); mut_info += P[a][b]*S[a][b]; } printf(": sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\n",100*id,entropy,entropy_pb,mut_info); } if (v>=4) //Debugging: probability matrix and dissimilarity matrix { cout<<"Check matrix: before renormalization sum P(a,b)= "< // cin, cout, cerr #include // ofstream, ifstream #include // printf #include // exit #include // strcmp, strstr #include // sqrt, pow #include // INT_MIN #include // FLT_MIN #include // clock #include // islower, isdigit etc using std::ios; using std::ifstream; using std::ofstream; using std::cout; using std::cerr; using std::endl; #include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "list.h" // list data structure #include "hash.h" // hash data structure #include "hhdecl-C.h" // constants, class #include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc. #include "hhhmm.h" // class HMM #include "hhalignment.h" // class Alignment #include "hhhit.h" #include "hhhalfalignment.h" #include "hhfullalignment.h" #endif ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //// Methods of class HitList ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// /** * @brief Print summary listing of hits */ void HitList::PrintHitList(HMM& q, char* outfile) { Hit hit; int nhits=0; char str[NAMELEN]=""; FILE* outf=NULL; if (strcmp(outfile,"stdout")) { outf=fopen(outfile,"w"); if (!outf) OpenFileError(outfile); } else outf = stdout; fprintf(outf,"Query %s\n",q.longname); // fprintf(outf,"Family %s\n",q.fam); fprintf(outf,"Match_columns %i\n",q.L); fprintf(outf,"No_of_seqs %i out of %i\n",q.N_filtered,q.N_in); fprintf(outf,"Neff %-4.1f\n",q.Neff_HMM); fprintf(outf,"Searched_HMMs %i\n",N_searched); // Print date stamp time_t* tp=new(time_t); *tp=time(NULL); fprintf(outf,"Date %s",ctime(tp)); delete (tp); (tp) = NULL; // Print command line fprintf(outf,"Command "); for (int i=0; i ",(int)strlen(par.argv[i])); fprintf(outf,"\n\n"); #ifdef WINDOWS if (par.trans) fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\n"); else fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\n"); #else if (par.trans) fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\n"); else fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\n"); #endif Reset(); while (!End()) // print hit list { hit = ReadNext(); if (nhits>=par.Z) break; //max number of lines reached? if (nhits>=par.z && hit.Probab < par.p) break; if (nhits>=par.z && hit.Eval > par.E) continue; // if (hit.matched_cols <=1) continue; // adding this might get to intransparent... analogous statement in PrintAlignments nhits++; sprintf(str,"%3i %-30.30s ",nhits,hit.longname); #ifdef WINDOWS if (par.trans) // Transitive scoring fprintf(outf,"%-34.34s %5.1f %8.2G %8.2G %6.1f %5.1f %4i ",str,hit.Probab,hit.E1val,hit.Eval,hit.score,hit.score_ss,hit.matched_cols); else // Normal scoring fprintf(outf,"%-34.34s %5.1f %8.2G %8.2G %6.1f %5.1f %4i ",str,hit.Probab,hit.Eval,hit.Pval,hit.score,hit.score_ss,hit.matched_cols); #else if (par.trans) // Transitive scoring fprintf(outf,"%-34.34s %5.1f %7.2G %7.2G %6.1f %5.1f %4i ",str,hit.Probab,hit.E1val,hit.Eval,hit.score,hit.score_ss,hit.matched_cols); else // Normal scoring fprintf(outf,"%-34.34s %5.1f %7.2G %7.2G %6.1f %5.1f %4i ",str,hit.Probab,hit.Eval,hit.Pval,hit.score,hit.score_ss,hit.matched_cols); #endif sprintf(str,"%4i-%-4i ",hit.i1,hit.i2); fprintf(outf,"%-10.10s",str); sprintf(str,"%4i-%-4i",hit.j1,hit.j2); fprintf(outf,"%-9.9s(%i)\n",str,hit.L); } //end print hit list fprintf(outf,"\n"); if (strcmp(outfile,"stdout")) fclose(outf); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Print alignments of query sequences against hit sequences */ int HitList::PrintAlignments( #ifdef CLUSTALO char **ppcFirstProf, char **ppcSecndProf, char zcAux[], char zcError[], #endif HMM& q, char* outfile, char outformat) { Hit hit; FullAlignment qt_ali(par.nseqdis+10); // maximum 10 annotation (pseudo) sequences (ss_dssp, sa_dssp, ss_pred, ss_conf, consens,...) int nhits=0; #ifndef CLUSTALO_NOFILE FILE* outf=NULL; if (strcmp(outfile,"stdout")) { if (outformat==0) outf=fopen(outfile,"a"); //append to summary hitlist else outf=fopen(outfile,"w"); //open for writing if (!outf) OpenFileError(outfile); } else outf = stdout; #endif Reset(); while (!End()) // print hit list { if (nhits>=par.B) break; //max number of lines reached? hit = ReadNext(); if (nhits>=par.b && hit.Probab < par.p) break; if (nhits>=par.b && hit.Eval > par.E) continue; // // adding this might get to intransparent... // // analogous statement in PrintHitlist and hhalign.C // if (hit.matched_cols <=1) continue; nhits++; // Build double alignment of query against template sequences int iBuildRet = qt_ali.Build(q,hit, zcError); if (iBuildRet != OK){ /* FS, r241 -> r243 */ sprintf(zcAux, "%s:%s:%d: qt_ali.Build failed\n", __FUNCTION__, __FILE__, __LINE__); strcat(zcError, zcAux); return FAILURE; } #ifndef CLUSTALO // Print out alignment if (outformat==0) // HHR format { fprintf(outf,"No %-3i\n",nhits); qt_ali.PrintHeader(outf,q,hit); qt_ali.PrintHHR(outf,hit); } else if (outformat==1) // FASTA format { fprintf(outf,"# No %-3i\n",nhits); qt_ali.PrintFASTA(outf,hit); } else if(outformat==2) // A2M format { fprintf(outf,"# No %-3i\n",nhits); qt_ali.PrintA2M(outf,hit); } else // A3m format { fprintf(outf,"# No %-3i\n",nhits); qt_ali.PrintA3M(outf,hit); } #else qt_ali.OverWriteSeqs(ppcFirstProf, ppcSecndProf); #endif qt_ali.FreeMemory(); } #ifndef CLUSTALO_NOFILE if (strcmp(outfile,"stdout")) fclose(outf); #endif return OK; } /* this is the end of HitList::PrintAlignments() */ //////////////////////////////////////////////////////////////////////////// /** * @brief Return the ROC_5 score for optimization * (changed 28.3.08 by Michael & Johannes) */ void HitList::Optimize(HMM& q, char* buffer) { const int NFAM =5; // calculate ROC_5 score const int NSFAM=5; // calculate ROC_5 score int roc=0; // ROC score int fam=0; // number of hits from same family (at current threshold) int not_fam=0; // number of hits not from same family int sfam=0; // number of hits from same suporfamily (at current threshold) int not_sfam=0; // number of hits not from same superfamily Hit hit; SortList(); Reset(); while (!End()) { hit = ReadNext(); if (!strcmp(hit.fam,q.fam)) fam++; // query and template from same superfamily? => positive else if (not_fam negative { not_fam++; roc += fam; } if (!strcmp(hit.sfam,q.sfam)) sfam++; // query and template from same superfamily? => positive else if (not_sfam negative { not_sfam++; roc += sfam; } // printf("qfam=%s tfam=%s qsfam=%s tsfam=%s fam=%-2i not_fam=%3i sfam=%-3i not_sfam=%-5i roc=%-3i\n",q.fam,hit.fam,q.sfam,hit.sfam,fam,not_fam,sfam,not_sfam,roc); } // Write ROC score to file or stdout FILE* buf=NULL; if (strcmp(par.buffer,"stdout")) { buf=fopen(buffer,"w"); if (!buf) OpenFileError(par.buffer); } else buf = stdout; fprintf(buf,"%f\n",float(roc)/float(fam*NFAM+sfam*NSFAM)); // must be between 0 and 1 if (v>=2) printf("ROC=%f\n",float(roc)/float(fam*NFAM+sfam*NSFAM)); fclose(buf); } ////////////////////////////////////////////////////////////////////////////// /** * @brief Print score distribution into file score_dist */ void HitList::PrintScoreFile(HMM& q) { int i=0, n; FILE* scoref=NULL; Hit hit; Hash twice(10000); // make sure only one hit per HMM is listed twice.Null(-1); if (strcmp(par.scorefile,"stdout")) { scoref=fopen(par.scorefile,"w"); if (!scoref) {cerr<0.99999) corr=0.99999; } else { if (corr<0.0) corr=0.0; else if (corr>1.0) corr=1.0; } return -s*(1.0-0.5*corr) - corr*log(1.0+s) + log(s*(1.0-0.5*corr)+0.5*corr); // return -s*(1.0-0.5*corr) + log( s*(1.0-corr)*(1.0-0.5*corr)+0.5*corr ); // return -s*(1.0-0.5*corr) + log((s*(1.0-corr)*(1.0-0.5*corr)+corr)*(1.0-0.5*corr)); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Evaluate the *negative* log likelihood for the order statistic of the uniform distribution * for the best 10% of hits (vertex v = (corr,offset) ) * The k'th order statistic for X~Uniform is p:=X^(k)~Beta(k,n-k+1) = const*p^(k-1)*(1-p)^(n-k) * Needed to fit the correlation and score offset in HHblast */ double HitList::RankOrderFitCorr(double* v) { double sum=0.0; // printf("%8.2G %8.2G %i\n",v[0],v[1],Nprof); int i1 = imin(Nprof,imax(50,int(0.05*Nprof))); for (int i=0; iRankOrderFitCorr(v); // call member function } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Evaluate the *negative* log likelihood of the data at the vertex v = (corr,offset) * Needed to fit the correlation and score offset in HHblast */ double HitList::LogLikelihoodCorr(double* v) { double sum=0.0; // printf("%8.2G %8.2G %i\n",v[0],v[1],Nprof); for (int i=0; iLogLikelihoodCorr(v); // call member function } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Evaluate the *negative* log likelihood of the data at the vertex v = (lamda,mu) * p(s) = lamda * exp{ -exp[-lamda*(s-mu)] - lamda*(s-mu) } = lamda * exp( -exp(-x) - x) */ double HitList::LogLikelihoodEVD(double* v) { double sum=0.0, sumw=0.0; for (int i=0; iLogLikelihoodEVD(v); // call member function } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Subroutine to FindMin: try new point given by highest point ihigh and fac and replace ihigh if it is lower */ double HitList::TryPoint(const int ndim, double* p, double* y, double* psum, int ihigh, double fac, double (*Func)(void* pt2hitlist, double* v)) { // New point p_try = p_c + fac*(p_high-p_c), // where p_c = ( sum_i (p_i) - p_high)/ndim is the center of ndim other points // => p_try = fac1*sum_i(p_i) + fac2*p_high double fac1=(1.-fac)/ndim; double fac2=fac-fac1; double ptry[ndim]; //new point to try out double ytry; //function value of new point int j; //index for the ndim parameters for (j=0; j=4) printf("Trying: %-7.3f %-7.3f %-7.3f -> accept\n",ptry[0],ptry[1],ytry); y[ihigh]=ytry; for (j=0; j=4) printf("Trying: %-7.3f %-7.3f %-7.3f -> reject\n",ptry[0],ptry[1],ytry); return ytry; } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Find minimum with simplex method of Nelder and Mead (1965) */ float HitList::FindMin(const int ndim, double* p, double* y, double tol, int& nfunc, double (*Func)(void* pt2hitlist, double* v)) { const int MAXNFUNC=99; //maximum allowed number of function evaluations int ihigh; //index of highest point on simplex int inext; //index of second highest point on simplex int ilow; //index of lowest point on simplex int i; //index for the ndim+1 points int j; //index for the ndim parameters double rtol; //tolerance: difference of function value between highest and lowest point of simplex double temp; //dummy double ytry; //function value of trial point double psum[ndim]; //psum[j] = j'th coordinate of sum vector (sum over all vertex vectors) nfunc=0; //number of function evaluations =0 //Calculate sum vector psum[j] for (j=0; jy[1]) {inext=1; ihigh=0;} else {inext=0; ihigh=1;} for (i=0; iy[ihigh]) {inext=ihigh; ihigh=i;} else if (y[i]>y[inext] && i!= ihigh) inext=i; } // If tolerance in y is smaller than tol swap lowest point to index 0 and break -> return rtol = 2.*fabs(y[ihigh]-y[ilow]) / (fabs(y[ihigh])+fabs(y[ilow])+1E-10); if (rtol=MAXNFUNC ) { if (v) fprintf(stderr,"\nWARNING: maximum likelihood fit of score distribution did not converge.\n"); return 1; } nfunc+=2; // Point-reflect highest point on the center of gravity p_c of the other ndim points of the simplex if (v>=3) printf("%3i %-7.3f %-7.3f %-12.8f %-9.3E\n",nfunc,p[ilow*ndim],p[ilow*ndim+1],y[ilow],rtol); // if (v>=2) printf(" %3i %-9.3E %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f\n",nfunc,rtol,p[ilow*ndim],p[ilow*ndim+1],y[ilow],p[inext*ndim],p[inext*ndim+1],y[inext],p[ihigh*ndim],p[ihigh*ndim+1],y[ihigh]); ytry = TryPoint(ndim,p,y,psum,ihigh,-1.0,Func); //reflect highest point on p_c if (ytry<=y[ilow]) { ytry = TryPoint(ndim,p,y,psum,ihigh,2.0,Func); //expand: try new point 2x further away from p_c // if (v>=2) printf("Expanded: %3i %-9.3E %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f\n",nfunc,rtol,p[ilow*ndim],p[ilow*ndim+1],y[ilow],p[inext*ndim],p[inext*ndim+1],y[inext],p[ihigh*ndim],p[ihigh*ndim+1],y[ihigh]); } else if (ytry>=y[inext]) { // The new point is worse than the second worst point temp=y[ihigh]; ytry=TryPoint(ndim,p,y,psum,ihigh,0.5,Func); //contract simplex by 0.5 along (p_high-p_c // if (v>=2) printf("Compressed:%3i %-9.3E %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f\n",nfunc,rtol,p[ilow*ndim],p[ilow*ndim+1],y[ilow],p[inext*ndim],p[inext*ndim+1],y[inext],p[ihigh*ndim],p[ihigh*ndim+1],y[ihigh]); if (ytry>=temp) { // Trial point is larger than worst point => contract simplex by 0.5 towards lowest point for (i=0; i=2) printf("Contracted:%3i %-9.3E %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f %-7.3f\n",nfunc,rtol,p[ilow*ndim],p[ilow*ndim+1],y[ilow],p[inext*ndim],p[inext*ndim+1],y[inext],p[ihigh*ndim],p[ihigh*ndim+1],y[ihigh]); //Calculate psum[j] for (j=0; j size_fam(MAXPROF/10); // Hash counts number of HMMs in family static Hash size_sfam(MAXPROF/10); // Hash counts number of families in superfamily Hash excluded(50); // Hash containing names of superfamilies to be excluded from fit size_fam.Null(0); // Set int value to return when no data can be retrieved size_sfam.Null(0); // Set int value to return when no data can be retrieved excluded.Null(0); // Set int value to return when no data can be retrieved Hit hit; double mu; // EVD[mu,lam](x) = exp(-exp(-(x-mu)/lam)) = P(score<=x) double vertex[2*3]; // three vertices of the simplex in lamda-mu plane double yvertex[3]; // log likelihood values at the three vertices of the simplex int nfunc=0; // number of function calls double sum_weights=0.0; float sum_scores=0.0; float rtol; if (first_call==1) { first_call=0; // Count how many HMMs are in each family; set number of multiple hits per template nrep if (v>=4) printf(" count number of profiles in each family and families in each superfamily ...\n"); Reset(); while (!End()) { hit = ReadNext(); if (!size_fam.Contains(hit.fam)) (*size_sfam(hit.sfam))++; //Add one to hash element for superfamily (*size_fam(hit.fam))++; //Add one to hash element for family // printf("size(%s)=%i name=%s\n",hit.fam,*size_fam(hit.fam),hit.name) } fams=size_fam.Size(); sfams=size_sfam.Size(); if (v>=3) printf("%-3i HMMs from %i families and %i superfamilies searched. Found %i hits\n",N_searched,fams,sfams,Size()); } // Query has SCOP family identifier? if (q.fam && q.fam[0]>='a' && q.fam[0]<='k' && q.fam[1]=='.') { char sfamid[NAMELEN]; char* ptr_in_fam=q.fam; while ((ptr_in_fam=strwrd(sfamid,ptr_in_fam,'-'))) { char* ptr=strrchr(sfamid,'.'); if (ptr) *ptr='\0'; excluded.Add(sfamid); // fprintf(stderr,"Exclude SCOP superfamily %s ptr_in_fam='%s'\n",sfamid,ptr_in_fam); } } // Exclude best superfamilies from fit else if (nbest>0) { if (sfams<97+nbest) return; // Find the nbest best-scoring superfamilies for exclusion from first ML fit if (v>=4) printf(" find %i best-scoring superfamilies to exclude from first fit ...\n",nbest); hit = Smallest(); excluded.Add(hit.sfam); // printf("Exclude in first round: %s %8.2f %s\n",hit.name,hit.score_aass,hit.sfam); while (excluded.Size()=4) printf(" find best-scoring superfamilies to exclude from second fit ...\n"); Reset(); while (!End()) { hit = ReadNext(); if (hit.Eval < 0.05) excluded.Add(hit.sfam); // changed from 0.5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } tol = 0.001/size_sfam.Size(); // tol=1/N would lead to delta(log-likelihood)~1 (where N ~ number of superfamilies) since (1+1/N)^N = e } // Put scores into score[] and weights into weight[] if (v>=3) printf(" generate scores and weights array for ML fitting ...\n"); Nprof=0; Reset(); while (!End()) { hit = ReadNext(); if (hit.irep > 1) continue; //Use only best hit per template if (Nprof>=MAXPROF) break; char sfamid[NAMELEN]; char* ptr_in_fam=hit.fam; while ((ptr_in_fam=strwrd(sfamid,ptr_in_fam,'-'))) { char* ptr=strrchr(sfamid,'.'); if (ptr) *ptr='\0'; if (excluded.Contains(sfamid)) break; //HMM is among superfamilies to be excluded } if (excluded.Contains(sfamid)) { if (v>=3) fprintf(stderr,"Exclude hit %s (family %s contains %s)\n",hit.name,hit.fam,sfamid); continue; } // ScopID(hit.cl,hit.fold,hit.sfam,hit.fam); //Get scop superfamily code for template // if (*hit.sfam=='\0' || excluded.Contains(hit.sfam)) continue; // skip HMM score[Nprof] = hit.score; weight[Nprof]=1./size_fam[hit.fam]/size_sfam[hit.sfam]; sum_scores +=hit.score*weight[Nprof]; sum_weights+=weight[Nprof]; //DEBUG // if (v>=4) printf("%-10.10s %-12.12s %-3i %-12.12s %-3i %6.4f %6.4f %7.1f\n",hit.name,hit.fam,size_fam[hit.fam],hit.sfam,size_sfam[hit.sfam],1./size_fam[hit.fam]/size_sfam[hit.sfam],sum,hit.score); Nprof++; } //DEBUG if (v>=3) printf("%i hits used for score distribution\n",Nprof); // for (int i=0; i0) {vertex[0]=LAMDA; vertex[1]=mu;} /////////////////////////////////////////// DEBUG else {vertex[0]=q.lamda; vertex[1]=mu;} vertex[2]=vertex[0]+0.1; vertex[3]=vertex[1]; vertex[4]=vertex[0]; vertex[5]=vertex[1]+0.2; yvertex[0]=Func(this,vertex ); yvertex[1]=Func(this,vertex+2); yvertex[2]=Func(this,vertex+4); // Find lam and mu that minimize negative log likelihood of data if (v>=3) printf("Fitting to EVD by maximum likelihood...\niter lamda mu -log(P)/N tol\n"); rtol = FindMin(2,vertex,yvertex,tol,nfunc,Func); if (v>=3) printf("%3i %-7.3f %-7.2f %-7.3f %-7.1E\n\n",nfunc,vertex[0],vertex[1],yvertex[0]-(1.5772-log(vertex[0])),rtol); // printf("HHsearch lamda=%-6.3f mu=%-6.3f\n",vertex[0],vertex[1]); } else { vertex[0]=LAMDA_GLOB; vertex[1]=mu; } // Set lamda and mu of profile q.lamda = vertex[0]; q.mu = vertex[1]; // Set P-values and E-values // CHECK UPDATE FROM score=-logpval to score=-logpval+SSSCORE2NATLOG*score_ss !!!! Reset(); while (!End()) { hit = ReadNext(); // Calculate total score in raw score units: P-value = 1- exp(-exp(-lamda*(Saa-mu))) hit.weight=1./size_fam[hit.fam]/size_sfam[hit.sfam]; // needed for transitive scoring hit.logPval = logPvalue(hit.score,vertex); hit.Pval=Pvalue(hit.score,vertex); hit.Eval=exp(hit.logPval+log(N_searched)); // hit.score_aass = hit.logPval/0.45-3.0 - hit.score_ss; // median(lamda)~0.45, median(mu)~4.0 in EVDs for scop20.1.63 HMMs hit.score_aass = -q.lamda*(hit.score-q.mu)/0.45-3.0 - fmin(hit.score_ss,fmax(0.0,0.5*hit.score-5.0)); // median(lamda)~0.45, median(mu)~3.0 in EVDs for scop20.1.63 HMMs hit.Probab = Probab(hit); if (nbest>0 && par.loc) // correct length correction (not needed for second round of fitting, since lamda very similar) if (par.idummy==0) //////////////////////////////////////////// hit.score += log(q.L*hit.L)*(1/LAMDA-1/vertex[0]); hit.score_sort = hit.score_aass; Overwrite(hit); // copy hit object into current position of hitlist if (nbest==0 && par.trans==1) // if in transitive scoring mode (weights file given) TransitiveScoring(); else if (nbest==0 && par.trans==2) // if in transitive scoring mode (weights file given) TransitiveScoring2(); else if (nbest==0 && par.trans==3) // if in transitive scoring mode (weights file given) TransitiveScoring3(); else if (nbest==0 && par.trans==4) // if in transitive scoring mode (weights file given) TransitiveScoring4(); } } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Calculate correlation and score offset for HHblast composite E-values */ void HitList::CalculateHHblastCorrelation(HMM& q) { int nfunc=0; // number of function calls double tol; // Maximum relative tolerance when minimizing -log(P)/N (~likelihood) double vertex[2*3]; // three vertices of the simplex in lamda-mu plane double yvertex[3]; // log likelihood values at the three vertices of the simplex Hit hit; Hash excluded(50); // Hash containing names of superfamilies to be excluded from fit excluded.Null(0); // Set int value to return when no data can be retrieved // Set sum of HHsearch and PSI-BLAST score for calculating correlation Reset(); while (!End()) { hit = ReadNext(); hit.score_sort = hit.logPval + blast_logPvals->Show(hit.name); // if template not in hash, return log Pval = 0, i.e. Pvalue = 1! Overwrite(hit); // copy hit object into current position of hitlist } // Query has SCOP family identifier? if (q.fam && q.fam[0]>='a' && q.fam[0]<='k' && q.fam[1]=='.') { char sfamid[NAMELEN]; char* ptr_in_fam=q.fam; while ((ptr_in_fam=strwrd(sfamid,ptr_in_fam,'-'))) { char* ptr=strrchr(sfamid,'.'); if (ptr) *ptr='\0'; excluded.Add(sfamid); fprintf(stderr,"Exclude SCOP superfamily %s ptr_in_fam='%s'\n",sfamid,ptr_in_fam); } } // Resort list by sum of log P-values ResortList(); // use InsertSort to resort list according to sum of minus-log-Pvalues Nprof=0; Reset(); ReadNext(); // skip best hit while (!End()) { hit = ReadNext(); if (hit.irep>=2) continue; // use only best alignments // if (hit.Eval<0.005) {if (v>=3) printf("Fitting HHblast correlation coefficient: skipping %s with Evalue=%9.1g\n",hit.name,hit.Eval); continue;} if (Nprof>=MAXPROF) break; char sfamid[NAMELEN]; char* ptr_in_fam=hit.fam; while ((ptr_in_fam=strwrd(sfamid,ptr_in_fam,'-'))) { char* ptr=strrchr(sfamid,'.'); if (ptr) *ptr='\0'; if (excluded.Contains(sfamid)) break; //HMM is among superfamilies to be excluded } if (excluded.Contains(sfamid)) { if (v>=1) fprintf(stderr,"Exclude hit %s (family %s contains %s)\n",hit.name,hit.fam,sfamid); continue; } score[Nprof] = -hit.score_sort; weight[Nprof] = 1.0; // = hit.weight; // printf("%3i %-12.12s %7.3f + %7.3f = %7.3f \n",Nprof,hit.name,hit.logPval,blast_logPvals->Show(hit.name),-hit.score_sort); ////////////////////// printf("%3i %7.3f %7.3f\n",Nprof,hit.Pval,exp(blast_logPvals->Show(hit.name))); ////////////////////// Nprof++; } // Fit correlation vertex[0]=0.5; vertex[1]=0.2; vertex[2]=vertex[0]+0.2; vertex[3]=vertex[1]; vertex[4]=vertex[0]; vertex[5]=vertex[1]+0.2; yvertex[0]=RankOrderFitCorr(vertex ); yvertex[1]=RankOrderFitCorr(vertex+2); yvertex[2]=RankOrderFitCorr(vertex+4); // yvertex[0]=LogLikelihoodCorr(vertex ); // yvertex[1]=LogLikelihoodCorr(vertex+2); // yvertex[2]=LogLikelihoodCorr(vertex+4); tol = 1e-6; v=3;////////////////////////////////// // Find correlation and offset that minimize mean square deviation of reported composite Pvalues from actual if (v>=2) printf("Fitting correlation coefficient for HHblast...\niter corr offset logLikelihood tol\n"); float rtol = FindMin(2,vertex,yvertex,tol,nfunc, HitList::RankOrderFitCorr_static); if (v>=2) printf("%3i %-7.3f %-7.2f %-7.3f %-7.1E\n\n",nfunc,vertex[0],vertex[1],yvertex[0],rtol); if (vertex[0]<0) vertex[0]=0.0; // Print correlation and offset for profile printf("HHblast correlation=%-6.3f score offset=%-6.3f\n",vertex[0],vertex[1]); v=2;////////////////////////////////// } /** * @brief Calculate HHblast composite E-values */ inline double corr_HHblast(float Nq, float Nt) { return 0.5; } /** * @brief Calculate HHblast composite E-values */ inline double offset_HHblast(float Nq, float Nt) { return 0.0; } ////////////////////////////////////////////////////////////////////////////// /** * @brief Calculate HHblast composite E-values */ void HitList::CalculateHHblastEvalues(HMM& q) { Hit hit; float corr, offset; // correlation coefficient and offset for calculating composite HHblast P-values Reset(); while (!End()) { hit = ReadNext(); corr = corr_HHblast(q.Neff_HMM,hit.Neff_HMM); offset = offset_HHblast(q.Neff_HMM,hit.Neff_HMM); hit.score_sort = hit.logPval + blast_logPvals->Show(hit.name); hit.logPval = logPvalue_HHblast(-hit.score_sort+offset,corr); // overwrite logPval from HHsearch with composite logPval from HHblast hit.Pval = Pvalue_HHblast(-hit.score_sort+offset,corr); // overwrite P-value from HHsearch with composite P-value from HHblast hit.Eval = exp(hit.logPval+log(N_searched)); // overwrite E-value from HHsearch with composite E-value from HHblast hit.Probab = Probab(hit); Overwrite(hit); // copy hit object into current position of hitlist } ResortList(); // use InsertSort to resort list according to sum of minus-log-Pvalues } ////////////////////////////////////////////////////////////////////////////// /** * @brief Read file generated by blastpgp (default output) and store P-values in hash */ void HitList::ReadBlastFile(HMM& q) { char line[LINELEN]=""; // input line int Ndb; // number of sequences in database int Ldb=0; // size of database in number of amino acids char* templ; int i; if (!blast_logPvals) { blast_logPvals = new(Hash); blast_logPvals->New(16381,0); } FILE* blaf = NULL; if (!strcmp(par.blafile,"stdin")) blaf=stdin; else { blaf = fopen(par.blafile,"rb"); if (!blaf) OpenFileError(par.blafile); } // Read number of sequences and size of database while (fgetline(line,LINELEN-1,blaf) && !strstr(line,"sequences;")); if (!strstr(line,"sequences;")) FormatError(par.blafile,"No 'Database:' string found."); char* ptr=line; Ndb = strint(ptr); if (Ndb==INT_MIN) FormatError(par.blafile,"No integer for number of sequences in database found."); while ((i=strint(ptr))>INT_MIN) Ldb = 1000*Ldb + i; if (Ldb==0) FormatError(par.blafile,"No integer for size of database found."); printf("\nNumber of sequences in database = %i Size of database = %i\n",Ndb,Ldb); // Read all E-values and sequence lengths while (fgetline(line,LINELEN-1,blaf)) { if (line[0]=='>') { // Read template name templ = new(char[255]); ptr = line+1; strwrd(templ,ptr); if (!blast_logPvals->Contains(templ)) // store logPval only for best HSP with template { // Read length while (fgetline(line,LINELEN-1,blaf) && !strstr(line,"Length =")); ptr = line+18; int length = strint(ptr); // Read E-value fgetline(line,LINELEN-1,blaf); fgetline(line,LINELEN-1,blaf); float EvalDB; // E-value[seq-db] = Evalue for comparison Query vs. database, from PSI-BLAST float EvalQT; // E-value[seq-seq] = Evalue for comparison Query vs. template (seq-seq) double logPval; ptr = strstr(line+20,"Expect ="); if (!ptr) FormatError(par.blafile,"No 'Expect =' string found."); if (sscanf(ptr+8,"%g",&EvalDB)<1) { ptr[7]='1'; if (sscanf(ptr+7,"%g",&EvalDB)<1) FormatError(par.blafile,"No Evalue found after 'Expect ='."); } // Calculate P-value[seq-seq] = 1 - exp(-E-value[seq-seq]) = 1 - exp(-Lt/Ldb*E-value[seq-db]) EvalQT = length/double(Ldb)*double(EvalDB); if (EvalQT>1E-3) logPval = log(1.0-exp(-EvalQT)); else logPval=log(double(EvalQT)+1.0E-99); blast_logPvals->Add(templ,logPval); printf("template=%-10.10s length=%-3i EvalDB=%8.2g EvalQT=%8.2g P-value=%8.2g log Pval=%8.2g\n",templ,length,EvalDB,EvalQT,exp(logPval),logPval); } else { delete[] templ; templ = NULL; } } } fclose(blaf); } ///////////////////////////////////////////////////////////////////////////////////// /** * @brief Calculate output of hidden neural network units */ inline float calc_hidden_output(const float* weights, const float* bias, float Lqnorm, float Ltnorm, float Nqnorm, float Ntnorm) { float res; // Calculate activation of hidden unit = sum of all inputs * weights + bias res = Lqnorm*weights[0] + Ltnorm*weights[1] + Nqnorm*weights[2] + Ntnorm*weights[3] + *bias; res = 1.0 / (1.0 + exp(-(res ))); // logistic function return res; } //////////////////////////////////////////////////////////////////////////////////// /** * @brief Neural network regressions of lamda for EVD */ inline float lamda_NN(float Lqnorm, float Ltnorm, float Nqnorm, float Ntnorm) { const int inputs = 4; const int hidden = 4; const float biases[] = {-0.73195, -1.43792, -1.18839, -3.01141}; // bias for all hidden units const float weights[] = { // Weights for the neural networks (column = start unit, row = end unit) -0.52356, -3.37650, 1.12984, -0.46796, -4.71361, 0.14166, 1.66807, 0.16383, -0.94895, -1.24358, -1.20293, 0.95434, -0.00318, 0.53022, -0.04914, -0.77046, 2.45630, 3.02905, 2.53803, 2.64379 }; float lamda=0.0; for (int h = 0; h