From d0e2ac9ed2432e877e1a55f46752b614d29fafb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20R=C3=A9mond?= Date: Sun, 3 Sep 2006 15:15:46 +0000 Subject: [PATCH] * src/odbc/odbc_queries.erl: Support for Microsoft SQL Server as a database backend (via ODBC). * src/odbc/ejabberd_odbc.erl: Likewise. * src/odbc/mssql.sql: Likewise. * src/odbc/Makefile.in: Likewise. * src/ejabberd_auth_odbc.erl: Likewise. * src/mod_offline_odbc.erl: Likewise. * src/mod_roster_odbc.erl: Likewise. * src/mod_last_odbc.erl: Likewise. * src/configure.ac: Likewise * doc/guide.tex: Likewise. * doc/introduction.tex: Likewise. * src/odbc/pg.sql: Minor fix. SVN Revision: 598 --- ChangeLog | 16 + doc/dev.html | 1 + doc/guide.html | 214 +- doc/guide.tex | 20 + doc/introduction.tex | 4 +- src/configure | 3963 +++++++++++++++++++++--------------- src/configure.ac | 11 +- src/configure.erl | 2 + src/ejabberd_auth_odbc.erl | 61 +- src/mod_last_odbc.erl | 16 +- src/mod_offline_odbc.erl | 23 +- src/mod_roster_odbc.erl | 191 +- src/odbc/Makefile.in | 5 +- src/odbc/Makefile.win32 | 7 +- src/odbc/ejabberd_odbc.erl | 13 +- src/odbc/mssql.sql | 901 ++++++++ src/odbc/odbc_queries.erl | 434 ++++ src/odbc/pg.sql | 2 +- 18 files changed, 3892 insertions(+), 1992 deletions(-) create mode 100644 src/odbc/mssql.sql create mode 100644 src/odbc/odbc_queries.erl diff --git a/ChangeLog b/ChangeLog index 18af92535..212f96e31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2006-09-03 Mickael Remond + + * src/odbc/odbc_queries.erl: Support for Microsoft SQL Server as a + database backend (via ODBC). + * src/odbc/ejabberd_odbc.erl: Likewise. + * src/odbc/mssql.sql: Likewise. + * src/odbc/Makefile.in: Likewise. + * src/ejabberd_auth_odbc.erl: Likewise. + * src/mod_offline_odbc.erl: Likewise. + * src/mod_roster_odbc.erl: Likewise. + * src/mod_last_odbc.erl: Likewise. + * src/configure.ac: Likewise + * doc/guide.tex: Likewise. + * doc/introduction.tex: Likewise. + * src/odbc/pg.sql: Minor fix. + 2006-08-28 Mickael Remond * Makefile.in: Fix for MacOSX compilation. diff --git a/doc/dev.html b/doc/dev.html index 0daaf175b..8681b1521 100644 --- a/doc/dev.html +++ b/doc/dev.html @@ -153,6 +153,7 @@ Native MySQL support.
  • Native PostgreSQL support.
  • Mnesia.
  • ODBC data storage support. +
  • Microsoft SQL Server support (via ODBC).
  • Authentication
    • diff --git a/doc/guide.html b/doc/guide.html index 7dc2ddc22..554201a54 100644 --- a/doc/guide.html +++ b/doc/guide.html @@ -92,68 +92,69 @@ BLOCKQUOTE{margin-left:4ex;margin-right:4ex;text-align:left;}
  • 3.2  Relational Database Support -
  • 3.3  Creating an Initial Administrator -
  • 3.4  Online Configuration and Monitoring +
  • 3.3  Creating an Initial Administrator +
  • 3.4  Online Configuration and Monitoring -
  • 4  Firewall Settings -
  • 5  SRV Records -
  • 6  Clustering +
  • 4  Firewall Settings +
  • 5  SRV Records +
  • 6  Clustering -
  • A  Built-in Modules +
  • A  Built-in Modules -
  • B  Internationalization and Localization -
  • C  Release Notes +
  • B  Internationalization and Localization +
  • C  Release Notes -
  • D  Acknowledgements +
  • D  Acknowledgements @@ -230,6 +231,7 @@ Native MySQL support.
  • Native PostgreSQL support.
  • Mnesia.
  • ODBC data storage support. +
  • Microsoft SQL Server support (via ODBC).
  • Authentication
    • @@ -973,9 +975,29 @@ available from:

      3.2  Relational Database Support

      + + +

      3.2.1  Preliminary steps

      + + +If you have installed ejabberd using a binary version, the compilation steps +are not needed as they have already been done correctly.
      +
      +Otherwise, to be able to use ejabberd with a relational database you need to +enable ODBC modules during compilation, even if you want to use ejabberd with +MySQL or PostgreSQL in native mode. The following configure command can +be used to enable the relational modules: +
      +./configure --enable-odbc
      +
      +If you are planning to use Microsoft SQL Server with ODBC, you need to specify +it from the configure command before compilation: +
      +./configure --enable-odbc --enable-mssql
      +
      -

      3.2.1  Authentication against a relational database

      +

      3.2.2  Authentication against a relational database

      ejabberd use its internal Mnesia database as a default. It is however possible @@ -1030,7 +1052,7 @@ available from: 3.2.2  Relational database for other modules +

      3.2.3  Relational database for other modules

      It is possible to use a relational database to store pieces of @@ -1047,7 +1069,7 @@ Last connection date and time: Use mod_last_odbc instead of
    -

    3.3  Creating an Initial Administrator

    +

    3.3  Creating an Initial Administrator

    Before the web interface can be entered to perform administration tasks, an @@ -1079,12 +1101,12 @@ Register an account on your ejabberd deployment. An account can be -

    3.4  Online Configuration and Monitoring

    +

    3.4  Online Configuration and Monitoring

    -

    3.4.1  Web Interface

    +

    3.4.1  Web Interface

    @@ -1158,7 +1180,7 @@ You can serve the web interface on the same port as the -

    3.4.2  ejabberdctl

    +

    3.4.2  ejabberdctl

    It is possible to do some administration operations using the command @@ -1204,7 +1226,7 @@ Additional information: -

    4  Firewall Settings

    +

    4  Firewall Settings

    @@ -1233,7 +1255,7 @@ You need to take the following TCP ports in mind when configuring your firewall:

    -

    5  SRV Records

    +

    5  SRV Records

    @@ -1245,13 +1267,13 @@ General information: -

    6  Clustering

    +

    6  Clustering

    -

    6.1  How it Works

    +

    6.1  How it Works

    @@ -1272,7 +1294,7 @@ router, -

    6.1.1  Router

    +

    6.1.1  Router

    This module is the main router of Jabber packets on each node. It @@ -1283,7 +1305,7 @@ appropriate process. If not, it is sent to the s2s manager.

    -

    6.1.2  Local Router

    +

    6.1.2  Local Router

    This module routes packets which have a destination domain equal to @@ -1293,7 +1315,7 @@ on its content.

    -

    6.1.3  Session Manager

    +

    6.1.3  Session Manager

    This module routes packets to local users. It looks up to which user @@ -1303,7 +1325,7 @@ storage, or bounced back.

    -

    6.1.4  s2s Manager

    +

    6.1.4  s2s Manager

    This module routes packets to other Jabber servers. First, it @@ -1314,7 +1336,7 @@ serving this connection, otherwise a new connection is opened.

    -

    6.2  Clustering Setup

    +

    6.2  Clustering Setup

    @@ -1387,13 +1409,13 @@ domain.
    -

    A  Built-in Modules

    +

    A  Built-in Modules

    -

    A.1  Overview

    +

    A.1  Overview

    @@ -1605,7 +1627,7 @@ XMPP compliancy.

    -

    A.2  Common Options

    +

    A.2  Common Options

    The following options are used by many modules. Therefore, they are described in @@ -1613,7 +1635,7 @@ this separate section.

    -

    A.2.1  iqdisc

    +

    A.2.1  iqdisc

    @@ -1647,7 +1669,7 @@ Example: -

    A.2.2  hosts

    +

    A.2.2  hosts

    @@ -1686,7 +1708,7 @@ Serving the echo module on one domain: -

    A.3  mod_announce

    +

    A.3  mod_announce

    @@ -1752,7 +1774,7 @@ Only administrators can send announcements: -

    A.4  mod_disco

    +

    A.4  mod_disco

    @@ -1804,7 +1826,7 @@ To serve a link to the Jabber User Directory on jabber.org: -

    A.5  mod_echo

    +

    A.5  mod_echo

    @@ -1837,7 +1859,7 @@ Mirror, mirror, on the wall, who is the most beautiful -

    A.6  mod_irc

    +

    A.6  mod_irc

    @@ -1907,7 +1929,7 @@ In the first example, the IRC transport is available on (all) your -

    A.7  mod_last

    +

    A.7  mod_last

    @@ -1924,7 +1946,7 @@ the processing discipline for Last activity (jabber:iq:last) IQ queries -

    A.8  mod_muc

    +

    A.8  mod_muc

    @@ -2014,7 +2036,7 @@ In the first example everyone is allowed to use the Multi-User Chat -

    A.9  mod_muc_log

    +

    A.9  mod_muc_log

    @@ -2086,7 +2108,7 @@ Example configuration: -

    A.10  mod_offline

    +

    A.10  mod_offline

    @@ -2098,7 +2120,7 @@ online again. Thus it is very similar to how email works. Note that
    -

    A.11  mod_privacy

    +

    A.11  mod_privacy

    @@ -2133,7 +2155,7 @@ the processing discipline for Blocking Communication (jabber:iq:privacy -

    A.12  mod_private

    +

    A.12  mod_private

    @@ -2152,7 +2174,7 @@ the processing discipline for Private XML Storage (jabber:iq:private) I -

    A.13  mod_pubsub

    +

    A.13  mod_pubsub

    @@ -2205,7 +2227,7 @@ Example: -

    A.14  mod_register

    +

    A.14  mod_register

    @@ -2262,7 +2284,7 @@ Next example prohibits the registration of too short account names and of -

    A.15  mod_roster

    +

    A.15  mod_roster

    @@ -2276,7 +2298,7 @@ the processing discipline for Roster Management (jabber:iq:roster) IQ q -

    A.16  mod_service_log

    +

    A.16  mod_service_log

    @@ -2316,7 +2338,7 @@ To log all end user packets to the Bandersnatch service running on -

    A.17  mod_shared_roster

    +

    A.17  mod_shared_roster

    @@ -2443,7 +2465,7 @@ Take the case of a computer club that wants all its members seeing each -

    A.18  mod_stats

    +

    A.18  mod_stats

    @@ -2485,7 +2507,7 @@ You can request the number of online users on the current virtual host -

    A.19  mod_time

    +

    A.19  mod_time

    @@ -2500,7 +2522,7 @@ the processing discipline for Entity Time (jabber:iq:time) IQ queries -

    A.20  mod_vcard

    +

    A.20  mod_vcard

    @@ -2566,7 +2588,7 @@ In this first situation, search results are limited to twenty items, -

    A.21  mod_version

    +

    A.21  mod_version

    @@ -2581,7 +2603,7 @@ the processing discipline for Software Version (jabber:iq:version) IQ q -

    B  Internationalization and Localization

    +

    B  Internationalization and Localization

    @@ -2624,13 +2646,13 @@ figure 3 with figure 
    -

    C  Release Notes

    +

    C  Release Notes

    -

    C.1  ejabberd 0.9

    +

    C.1  ejabberd 0.9

            Release notes
    @@ -2724,7 +2746,7 @@ Bugfixes
     
    -

    C.2  ejabberd 0.9.1

    +

    C.2  ejabberd 0.9.1

            Release notes
    @@ -2792,7 +2814,7 @@ Bugfixes
     
    -

    C.3  ejabberd 0.9.8

    +

    C.3  ejabberd 0.9.8

            Release notes
    @@ -2897,7 +2919,7 @@ END
     
    -

    C.4  ejabberd 1.0.0

    +

    C.4  ejabberd 1.0.0

            Release Notes
    @@ -3023,7 +3045,7 @@ END
     
    -

    C.5  ejabberd 1.1.0

    +

    C.5  ejabberd 1.1.0

         Release Notes
    @@ -3144,7 +3166,7 @@ END
     
    -

    C.6  ejabberd 1.1.1

    +

    C.6  ejabberd 1.1.1

         Release Notes
    @@ -3269,7 +3291,7 @@ END
     
    -

    D  Acknowledgements

    +

    D  Acknowledgements

    diff --git a/doc/guide.tex b/doc/guide.tex index 99e2df91a..0a757ca58 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -860,6 +860,26 @@ available from: \subsection{Relational Database Support} \label{sec:relationaldatabase} +\subsubsection{Preliminary steps} +\label{sec:relationaldatabasecompilation} + +If you have installed ejabberd using a binary version, the compilation steps +are not needed as they have already been done correctly. + +Otherwise, to be able to use ejabberd with a relational database you need to +enable ODBC modules during compilation, even if you want to use ejabberd with +MySQL or PostgreSQL in native mode. The following \term{configure} command can +be used to enable the relational modules: +\begin{verbatim} +./configure --enable-odbc +\end{verbatim} + +If you are planning to use Microsoft SQL Server with ODBC, you need to specify +it from the \term{configure} command before compilation: +\begin{verbatim} +./configure --enable-odbc --enable-mssql +\end{verbatim} + \subsubsection{Authentication against a relational database} \label{sec:relationaldatabaseauth} diff --git a/doc/introduction.tex b/doc/introduction.tex index 7bf10db62..4ad14bc50 100644 --- a/doc/introduction.tex +++ b/doc/introduction.tex @@ -100,7 +100,9 @@ Besides common \Jabber{} server features, \ejabberd{} comes with a wide range of \item Native MySQL support.\new{} \item Native PostgreSQL support. \item Mnesia. -\item ODBC data storage support. \moreinfo{ --- ODBC requests can be load balanced between several connections.} +\item ODBC data storage support. \moreinfo{ --- ODBC requests can be load + balanced between several connections.} +\item Microsoft SQL Server support (via ODBC).\new{} \end{itemize} \item Authentication \begin{itemize} diff --git a/src/configure b/src/configure index 924014753..3172e8e36 100755 --- a/src/configure +++ b/src/configure @@ -1,10 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for FULL-PACKAGE-NAME VERSION. +# Generated by GNU Autoconf 2.59d for FULL-PACKAGE-NAME VERSION. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,66 +19,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -98,124 +48,464 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# 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.) +as_nl=' +' +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 + ;; +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 + 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. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +done + +# 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 || +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 +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + 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 which exist, to save several forks. + if test -f "$as_shell" && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs 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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs 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 +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(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 - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + 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 autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + 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 before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # 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 - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # 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 - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { 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 sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (dirname -- /) >/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; then +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 +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + 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' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +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=: @@ -224,7 +514,19 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # 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'" @@ -233,39 +535,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +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` -exec 6>&1 - # # 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} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='FULL-PACKAGE-NAME' PACKAGE_TARNAME='full-package-name' @@ -301,18 +591,104 @@ ac_includes_default="\ #endif #if HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif +#endif +#if HAVE_STDINT_H +# include #endif #if HAVE_UNISTD_H # include #endif" ac_default_prefix= -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE ERLC ac_pt_ERLC ERL ac_pt_ERL ERLANG_CFLAGS ERLANG_LIBS LIBICONV CPP EGREP EXPAT_CFLAGS EXPAT_LIBS ZLIB_CFLAGS ZLIB_LIBS LIBOBJS mod_pubsub make_mod_pubsub mod_irc make_mod_irc mod_muc make_mod_muc eldap make_eldap web make_web tls make_tls odbc make_odbc ejabberd_zlib make_ejabberd_zlib roster_gateway_workaround SSL_LIBS SSL_CFLAGS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +SET_MAKE +ERLC +ERL +ERLANG_CFLAGS +ERLANG_LIBS +LIBICONV +CPP +GREP +EGREP +EXPAT_CFLAGS +EXPAT_LIBS +ZLIB_CFLAGS +ZLIB_LIBS +LIBOBJS +mod_pubsub +make_mod_pubsub +mod_irc +make_mod_irc +mod_muc +make_mod_muc +eldap +make_eldap +web +make_web +tls +make_tls +odbc +make_odbc +ejabberd_zlib +make_ejabberd_zlib +roster_gateway_workaround +db_type +SSL_LIBS +SSL_CFLAGS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -339,34 +715,48 @@ x_libraries=NONE # 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' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +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" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + 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_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,12 +778,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -401,7 +797,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -410,11 +816,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +843,12 @@ do -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 ;; @@ -465,13 +873,16 @@ do | --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 | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,6 +947,16 @@ do | --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 ;; @@ -592,11 +1013,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -605,7 +1022,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -636,8 +1053,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -657,27 +1073,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +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=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { 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' @@ -704,74 +1112,76 @@ 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 .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { 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 its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + 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 + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + 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. @@ -800,9 +1210,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -820,15 +1227,22 @@ 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] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --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/full-package-name] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -852,7 +1266,8 @@ Optional Features: --enable-tls enable tls (default: yes) --enable-odbc enable odbc (default: no) --enable-ejabberd_zlib enable ejabberd_zlib (default: yes) - --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions + --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions (default: no) + --enable-mssql Use Microsoft SQL Server database (default: no, requires --enable-odbc) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -868,8 +1283,8 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -877,120 +1292,86 @@ 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. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`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 - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + 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 ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + 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 -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style 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 - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + 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 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF FULL-PACKAGE-NAME configure VERSION -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.59d -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 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 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +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 FULL-PACKAGE-NAME $as_me VERSION, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.59d. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1009,7 +1390,7 @@ uname -v = `(uname -v) 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` -hostinfo = `(hostinfo) 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` @@ -1023,6 +1404,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1055,7 +1437,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1090,8 +1472,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # 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: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# 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. { @@ -1104,20 +1486,34 @@ trap 'exit_status=$? _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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + 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" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1128,22 +1524,22 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1155,26 +1551,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 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 -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1205,14 +1599,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1228,8 +1625,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1241,12 +1638,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +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" + 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1271,8 +1667,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1289,6 +1684,30 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1297,31 +1716,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1331,8 +1725,8 @@ 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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1345,32 +1739,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" 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 - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1383,36 +1779,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" 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 - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&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. + 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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1425,74 +1836,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" 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 - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1506,7 +1877,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$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 @@ -1517,6 +1888,7 @@ do 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. @@ -1534,22 +1906,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + 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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1562,36 +1935,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" 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 - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + 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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1604,29 +1979,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" 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 - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1639,25 +2030,38 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version >&5\"") >&5 + (eval $ac_compiler --version >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v >&5\"") >&5 + (eval $ac_compiler -v >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V >&5\"") >&5 + (eval $ac_compiler -V >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } + +# List of possible output files. We want to start from the most likely, +# but we have to check foo.exe before foo, because Cygwin `test -f' looks +# also for foo.exe. b.out is created by i960 compilers. +# As a last resort, we also try wildcards: `conftest.*' and `a.*'. +# But we are not allowed to rm a.*, and we do not want always remove +# conftest.*, so we will list them literally, when appropriate. +ac_outfiles="a_out.exe a.out conftest.exe conftest a.exe b.out" + +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +rm -f $ac_outfiles conftest.* + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -1673,51 +2077,40 @@ main () return 0; } _ACEOF + ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files $ac_outfiles" + +# The following tests should remove their output except files matching conftest.*. # 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. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + for ac_file in $ac_outfiles a.* conftest.* NO do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) break;; esac done +if test "$ac_file" = NO; then + { { echo "$as_me:$LINENO: error: no output file found +See \`config.log' for more details." >&5 +echo "$as_me: error: no output file found +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1729,14 +2122,12 @@ See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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 @@ -1761,83 +2152,84 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 +# Clean up; list also $ac_file, in case it matched a wildcard entry. +rm -f $ac_outfiles $ac_file -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if test "${ac_cv_exeext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done + # 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.* NO; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac + done + if test "$ac_file" = NO; then + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: no output file found +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: no output file found +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + + # Clean up; list also $ac_file, in case it matched conftest.*. + rm -f $ac_outfiles $ac_file + else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 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 -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 -rm -f conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 + + +ac_clean_files=$ac_clean_files_save + +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 + rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + 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 ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1853,14 +2245,16 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 + + +rm -f conftest.* +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1909,24 +2303,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + 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 @@ -1968,12 +2366,107 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 @@ -1989,12 +2482,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2028,10 +2521,10 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* 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 -std1 is added to get + 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 -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); @@ -2048,14 +2541,8 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +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 @@ -2080,192 +2567,56 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi + rm -f conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext 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 -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo 'ac_maketemp=X"$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then +if test "$ac_maketemp" != X ; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no @@ -2273,30 +2624,30 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #locating erlang -# Check whether --with-erlang or --without-erlang was given. +# Check whether --with-erlang was given. if test "${with_erlang+set}" = set; then - withval="$with_erlang" + withval=$with_erlang; +fi -fi; if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}erlc", so it can be a program name with args. set dummy ${ac_tool_prefix}erlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ERLC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2312,34 +2663,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ERLC="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ERLC=$ac_cv_path_ERLC - if test -n "$ERLC"; then - echo "$as_me:$LINENO: result: $ERLC" >&5 -echo "${ECHO_T}$ERLC" >&6 + { echo "$as_me:$LINENO: result: $ERLC" >&5 +echo "${ECHO_T}$ERLC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_path_ERLC"; then ac_pt_ERLC=$ERLC # Extract the first word of "erlc", so it can be a program name with args. set dummy erlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_ERLC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2355,28 +2707,42 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_ERLC="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ac_pt_ERLC=$ac_cv_path_ac_pt_ERLC - if test -n "$ac_pt_ERLC"; then - echo "$as_me:$LINENO: result: $ac_pt_ERLC" >&5 -echo "${ECHO_T}$ac_pt_ERLC" >&6 + { echo "$as_me:$LINENO: result: $ac_pt_ERLC" >&5 +echo "${ECHO_T}$ac_pt_ERLC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - ERLC=$ac_pt_ERLC + if test "x$ac_pt_ERLC" = x; then + ERLC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + ERLC=$ac_pt_ERLC + fi else ERLC="$ac_cv_path_ERLC" fi @@ -2384,8 +2750,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}erl", so it can be a program name with args. set dummy ${ac_tool_prefix}erl; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2401,34 +2767,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ERL=$ac_cv_path_ERL - if test -n "$ERL"; then - echo "$as_me:$LINENO: result: $ERL" >&5 -echo "${ECHO_T}$ERL" >&6 + { echo "$as_me:$LINENO: result: $ERL" >&5 +echo "${ECHO_T}$ERL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_path_ERL"; then ac_pt_ERL=$ERL # Extract the first word of "erl", so it can be a program name with args. set dummy erl; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_ERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2444,28 +2811,42 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_ERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ac_pt_ERL=$ac_cv_path_ac_pt_ERL - if test -n "$ac_pt_ERL"; then - echo "$as_me:$LINENO: result: $ac_pt_ERL" >&5 -echo "${ECHO_T}$ac_pt_ERL" >&6 + { echo "$as_me:$LINENO: result: $ac_pt_ERL" >&5 +echo "${ECHO_T}$ac_pt_ERL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - ERL=$ac_pt_ERL + if test "x$ac_pt_ERL" = x; then + ERL="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + ERL=$ac_pt_ERL + fi else ERL="$ac_cv_path_ERL" fi @@ -2560,20 +2941,20 @@ echo "$as_me: error: erlang program was not properly executed, (conftest.out was -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +# Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - + withval=$with_libiconv_prefix; for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/include; then CFLAGS="$CFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done -fi; +fi - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 + + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2625,7 +3006,9 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then @@ -2677,7 +3060,9 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" @@ -2736,9 +3121,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -LDFLAGS="$am_save_LDFLAGS" + LDFLAGS="$am_save_LDFLAGS" CFLAGS="$am_save_CFLAGS" fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" @@ -2746,16 +3132,16 @@ rm -f conftest.err conftest.$ac_objext \ fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2814,17 +3200,18 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_proto_iconv_arg1="const" + am_cv_proto_iconv_arg1="const" fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- + { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 + }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 @@ -2843,8 +3230,8 @@ 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 -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2904,9 +3291,10 @@ 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 non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2944,6 +3332,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2961,8 +3350,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3011,9 +3400,10 @@ 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 non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3051,6 +3441,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3073,23 +3464,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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_executable_p "$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 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + 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 + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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_executable_p "$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 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + 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 + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name 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 +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3139,8 +3677,9 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then @@ -3197,6 +3736,7 @@ 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)) @@ -3216,8 +3756,8 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext @@ -3240,12 +3780,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + fi fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3268,9 +3810,9 @@ 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3310,12 +3852,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3327,11 +3871,11 @@ done -# Check whether --with-expat or --without-expat was given. +# Check whether --with-expat was given. if test "${with_expat+set}" = set; then - withval="$with_expat" + withval=$with_expat; +fi -fi; EXPAT_CFLAGS= EXPAT_LIBS= @@ -3340,8 +3884,8 @@ fi; EXPAT_LIBS="-L$with_expat/lib" fi - echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 -echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 +echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3354,17 +3898,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* 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 -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XML_ParserCreate (); int main () { -XML_ParserCreate (); +return XML_ParserCreate (); ; return 0; } @@ -3396,14 +3940,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_expat_XML_ParserCreate=no + ac_cv_lib_expat_XML_ParserCreate=no fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 +echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test $ac_cv_lib_expat_XML_ParserCreate = yes; then EXPAT_LIBS="$EXPAT_LIBS -lexpat" expat_found=yes @@ -3422,18 +3967,19 @@ echo "$as_me: error: Could not find the Expat library" >&2;} for ac_header in expat.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3470,15 +4016,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3512,9 +4059,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3538,25 +4086,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3582,11 +4129,11 @@ echo "$as_me: error: Could not find expat.h" >&2;} #locating zlib -# Check whether --with-zlib or --without-zlib was given. +# Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then - withval="$with_zlib" + withval=$with_zlib; +fi -fi; ZLIB_CFLAGS= ZLIB_LIBS= @@ -3595,8 +4142,8 @@ fi; ZLIB_LIBS="-L$with_zlib/lib" fi - echo "$as_me:$LINENO: checking for gzgets in -lz" >&5 -echo $ECHO_N "checking for gzgets in -lz... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gzgets in -lz" >&5 +echo $ECHO_N "checking for gzgets in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_gzgets+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3609,17 +4156,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* 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 -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gzgets (); int main () { -gzgets (); +return gzgets (); ; return 0; } @@ -3651,14 +4198,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_z_gzgets=no + ac_cv_lib_z_gzgets=no fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzgets" >&5 -echo "${ECHO_T}$ac_cv_lib_z_gzgets" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzgets" >&5 +echo "${ECHO_T}$ac_cv_lib_z_gzgets" >&6; } if test $ac_cv_lib_z_gzgets = yes; then ZLIB_LIBS="$ZLIB_LIBS -lz" zlib_found=yes @@ -3677,18 +4225,19 @@ echo "$as_me: error: Could not find the zlib library" >&2;} for ac_header in zlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3725,15 +4274,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3767,9 +4317,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3793,25 +4344,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3837,8 +4387,8 @@ echo "$as_me: error: Could not find zlib.h" >&2;} # Checks for typedefs, structures, and compiler characteristics. -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3878,6 +4428,7 @@ main () 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}; @@ -3896,7 +4447,9 @@ main () } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !x[0] && !zero.x; #endif ; @@ -3930,12 +4483,13 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -3953,18 +4507,19 @@ fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4001,15 +4556,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4043,9 +4599,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4069,25 +4626,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4099,8 +4655,8 @@ fi done -echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4122,7 +4678,7 @@ char *malloc (); int main () { -exit (malloc (0) ? 0 : 1); +return ! malloc (0); ; return 0; } @@ -4147,11 +4703,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF @@ -4163,12 +4721,10 @@ else #define HAVE_MALLOC 0 _ACEOF - case $LIBOBJS in - "malloc.$ac_objext" | \ - *" malloc.$ac_objext" | \ - "malloc.$ac_objext "* | \ + case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; esac @@ -4180,8 +4736,8 @@ fi -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4231,8 +4787,9 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then @@ -4289,6 +4846,7 @@ 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)) @@ -4308,8 +4866,8 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext @@ -4332,12 +4890,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + fi fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4350,21 +4910,21 @@ fi mod_pubsub= make_mod_pubsub= -echo "$as_me:$LINENO: checking whether build mod_pubsub" >&5 -echo $ECHO_N "checking whether build mod_pubsub... $ECHO_C" >&6 -# Check whether --enable-mod_pubsub or --disable-mod_pubsub was given. +{ echo "$as_me:$LINENO: checking whether build mod_pubsub" >&5 +echo $ECHO_N "checking whether build mod_pubsub... $ECHO_C" >&6; } +# Check whether --enable-mod_pubsub was given. if test "${enable_mod_pubsub+set}" = set; then - enableval="$enable_mod_pubsub" - mr_enable_mod_pubsub="$enableval" + enableval=$enable_mod_pubsub; mr_enable_mod_pubsub="$enableval" else mr_enable_mod_pubsub=yes -fi; +fi + if test "$mr_enable_mod_pubsub" = "yes"; then mod_pubsub=mod_pubsub make_mod_pubsub=mod_pubsub/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_mod_pubsub" >&5 -echo "${ECHO_T}$mr_enable_mod_pubsub" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_mod_pubsub" >&5 +echo "${ECHO_T}$mr_enable_mod_pubsub" >&6; } @@ -4372,21 +4932,21 @@ echo "${ECHO_T}$mr_enable_mod_pubsub" >&6 mod_irc= make_mod_irc= -echo "$as_me:$LINENO: checking whether build mod_irc" >&5 -echo $ECHO_N "checking whether build mod_irc... $ECHO_C" >&6 -# Check whether --enable-mod_irc or --disable-mod_irc was given. +{ echo "$as_me:$LINENO: checking whether build mod_irc" >&5 +echo $ECHO_N "checking whether build mod_irc... $ECHO_C" >&6; } +# Check whether --enable-mod_irc was given. if test "${enable_mod_irc+set}" = set; then - enableval="$enable_mod_irc" - mr_enable_mod_irc="$enableval" + enableval=$enable_mod_irc; mr_enable_mod_irc="$enableval" else mr_enable_mod_irc=yes -fi; +fi + if test "$mr_enable_mod_irc" = "yes"; then mod_irc=mod_irc make_mod_irc=mod_irc/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_mod_irc" >&5 -echo "${ECHO_T}$mr_enable_mod_irc" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_mod_irc" >&5 +echo "${ECHO_T}$mr_enable_mod_irc" >&6; } @@ -4394,21 +4954,21 @@ echo "${ECHO_T}$mr_enable_mod_irc" >&6 mod_muc= make_mod_muc= -echo "$as_me:$LINENO: checking whether build mod_muc" >&5 -echo $ECHO_N "checking whether build mod_muc... $ECHO_C" >&6 -# Check whether --enable-mod_muc or --disable-mod_muc was given. +{ echo "$as_me:$LINENO: checking whether build mod_muc" >&5 +echo $ECHO_N "checking whether build mod_muc... $ECHO_C" >&6; } +# Check whether --enable-mod_muc was given. if test "${enable_mod_muc+set}" = set; then - enableval="$enable_mod_muc" - mr_enable_mod_muc="$enableval" + enableval=$enable_mod_muc; mr_enable_mod_muc="$enableval" else mr_enable_mod_muc=yes -fi; +fi + if test "$mr_enable_mod_muc" = "yes"; then mod_muc=mod_muc make_mod_muc=mod_muc/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_mod_muc" >&5 -echo "${ECHO_T}$mr_enable_mod_muc" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_mod_muc" >&5 +echo "${ECHO_T}$mr_enable_mod_muc" >&6; } @@ -4416,21 +4976,21 @@ echo "${ECHO_T}$mr_enable_mod_muc" >&6 eldap= make_eldap= -echo "$as_me:$LINENO: checking whether build eldap" >&5 -echo $ECHO_N "checking whether build eldap... $ECHO_C" >&6 -# Check whether --enable-eldap or --disable-eldap was given. +{ echo "$as_me:$LINENO: checking whether build eldap" >&5 +echo $ECHO_N "checking whether build eldap... $ECHO_C" >&6; } +# Check whether --enable-eldap was given. if test "${enable_eldap+set}" = set; then - enableval="$enable_eldap" - mr_enable_eldap="$enableval" + enableval=$enable_eldap; mr_enable_eldap="$enableval" else mr_enable_eldap=yes -fi; +fi + if test "$mr_enable_eldap" = "yes"; then eldap=eldap make_eldap=eldap/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_eldap" >&5 -echo "${ECHO_T}$mr_enable_eldap" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_eldap" >&5 +echo "${ECHO_T}$mr_enable_eldap" >&6; } @@ -4438,21 +4998,21 @@ echo "${ECHO_T}$mr_enable_eldap" >&6 web= make_web= -echo "$as_me:$LINENO: checking whether build web" >&5 -echo $ECHO_N "checking whether build web... $ECHO_C" >&6 -# Check whether --enable-web or --disable-web was given. +{ echo "$as_me:$LINENO: checking whether build web" >&5 +echo $ECHO_N "checking whether build web... $ECHO_C" >&6; } +# Check whether --enable-web was given. if test "${enable_web+set}" = set; then - enableval="$enable_web" - mr_enable_web="$enableval" + enableval=$enable_web; mr_enable_web="$enableval" else mr_enable_web=yes -fi; +fi + if test "$mr_enable_web" = "yes"; then web=web make_web=web/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_web" >&5 -echo "${ECHO_T}$mr_enable_web" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_web" >&5 +echo "${ECHO_T}$mr_enable_web" >&6; } @@ -4460,21 +5020,21 @@ echo "${ECHO_T}$mr_enable_web" >&6 tls= make_tls= -echo "$as_me:$LINENO: checking whether build tls" >&5 -echo $ECHO_N "checking whether build tls... $ECHO_C" >&6 -# Check whether --enable-tls or --disable-tls was given. +{ echo "$as_me:$LINENO: checking whether build tls" >&5 +echo $ECHO_N "checking whether build tls... $ECHO_C" >&6; } +# Check whether --enable-tls was given. if test "${enable_tls+set}" = set; then - enableval="$enable_tls" - mr_enable_tls="$enableval" + enableval=$enable_tls; mr_enable_tls="$enableval" else mr_enable_tls=yes -fi; +fi + if test "$mr_enable_tls" = "yes"; then tls=tls make_tls=tls/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_tls" >&5 -echo "${ECHO_T}$mr_enable_tls" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_tls" >&5 +echo "${ECHO_T}$mr_enable_tls" >&6; } @@ -4482,21 +5042,21 @@ echo "${ECHO_T}$mr_enable_tls" >&6 odbc= make_odbc= -echo "$as_me:$LINENO: checking whether build odbc" >&5 -echo $ECHO_N "checking whether build odbc... $ECHO_C" >&6 -# Check whether --enable-odbc or --disable-odbc was given. +{ echo "$as_me:$LINENO: checking whether build odbc" >&5 +echo $ECHO_N "checking whether build odbc... $ECHO_C" >&6; } +# Check whether --enable-odbc was given. if test "${enable_odbc+set}" = set; then - enableval="$enable_odbc" - mr_enable_odbc="$enableval" + enableval=$enable_odbc; mr_enable_odbc="$enableval" else mr_enable_odbc=no -fi; +fi + if test "$mr_enable_odbc" = "yes"; then odbc=odbc make_odbc=odbc/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_odbc" >&5 -echo "${ECHO_T}$mr_enable_odbc" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_odbc" >&5 +echo "${ECHO_T}$mr_enable_odbc" >&6; } @@ -4504,30 +5064,29 @@ echo "${ECHO_T}$mr_enable_odbc" >&6 ejabberd_zlib= make_ejabberd_zlib= -echo "$as_me:$LINENO: checking whether build ejabberd_zlib" >&5 -echo $ECHO_N "checking whether build ejabberd_zlib... $ECHO_C" >&6 -# Check whether --enable-ejabberd_zlib or --disable-ejabberd_zlib was given. +{ echo "$as_me:$LINENO: checking whether build ejabberd_zlib" >&5 +echo $ECHO_N "checking whether build ejabberd_zlib... $ECHO_C" >&6; } +# Check whether --enable-ejabberd_zlib was given. if test "${enable_ejabberd_zlib+set}" = set; then - enableval="$enable_ejabberd_zlib" - mr_enable_ejabberd_zlib="$enableval" + enableval=$enable_ejabberd_zlib; mr_enable_ejabberd_zlib="$enableval" else mr_enable_ejabberd_zlib=yes -fi; +fi + if test "$mr_enable_ejabberd_zlib" = "yes"; then ejabberd_zlib=ejabberd_zlib make_ejabberd_zlib=ejabberd_zlib/Makefile fi -echo "$as_me:$LINENO: result: $mr_enable_ejabberd_zlib" >&5 -echo "${ECHO_T}$mr_enable_ejabberd_zlib" >&6 +{ echo "$as_me:$LINENO: result: $mr_enable_ejabberd_zlib" >&5 +echo "${ECHO_T}$mr_enable_ejabberd_zlib" >&6; } -# Check whether --enable-roster_gateway_workaround or --disable-roster_gateway_workaround was given. +# Check whether --enable-roster_gateway_workaround was given. if test "${enable_roster_gateway_workaround+set}" = set; then - enableval="$enable_roster_gateway_workaround" - case "${enableval}" in + enableval=$enable_roster_gateway_workaround; case "${enableval}" in yes) roster_gateway_workaround=true ;; no) roster_gateway_workaround=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-roster-gateway-workaround" >&5 @@ -4536,18 +5095,34 @@ echo "$as_me: error: bad value ${enableval} for --enable-roster-gateway-workarou esac else roster_gateway_workaround=false -fi; +fi - ac_config_files="$ac_config_files Makefile $make_mod_irc $make_mod_muc $make_mod_pubsub $make_eldap $make_web stringprep/Makefile $make_tls $make_odbc $make_ejabberd_zlib" + +# Check whether --enable-mssql was given. +if test "${enable_mssql+set}" = set; then + enableval=$enable_mssql; case "${enableval}" in + yes) db_type=mssql ;; + no) db_type=generic ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-mssql" >&5 +echo "$as_me: error: bad value ${enableval} for --enable-mssql" >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + db_type=generic +fi + + + +ac_config_files="$ac_config_files Makefile $make_mod_irc $make_mod_muc $make_mod_pubsub $make_eldap $make_web stringprep/Makefile $make_tls $make_odbc $make_ejabberd_zlib" #openssl -# Check whether --with-openssl or --without-openssl was given. +# Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then - withval="$with_openssl" + withval=$with_openssl; +fi -fi; unset SSL_LIBS; unset SSL_CFLAGS; have_openssl=no @@ -4556,8 +5131,8 @@ if test x"$tls" != x; then printf "looking for openssl in $ssl_prefix...\n" SSL_CFLAGS="-I$ssl_prefix/include/openssl" SSL_LIBS="-L$ssl_prefix/lib -lcrypto" - echo "$as_me:$LINENO: checking for SSL_new in -lssl" >&5 -echo $ECHO_N "checking for SSL_new in -lssl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for SSL_new in -lssl" >&5 +echo $ECHO_N "checking for SSL_new in -lssl... $ECHO_C" >&6; } if test "${ac_cv_lib_ssl_SSL_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4570,17 +5145,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* 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 -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char SSL_new (); int main () { -SSL_new (); +return SSL_new (); ; return 0; } @@ -4612,14 +5187,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ssl_SSL_new=no + ac_cv_lib_ssl_SSL_new=no fi + rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_new" >&5 -echo "${ECHO_T}$ac_cv_lib_ssl_SSL_new" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_new" >&5 +echo "${ECHO_T}$ac_cv_lib_ssl_SSL_new" >&6; } if test $ac_cv_lib_ssl_SSL_new = yes; then have_openssl=yes else @@ -4633,18 +5209,19 @@ fi for ac_header in openssl/ssl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4681,15 +5258,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4723,9 +5301,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4749,25 +5328,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4814,17 +5392,17 @@ else done fi if test "${ac_cv_header_krb5_h+set}" = set; then - echo "$as_me:$LINENO: checking for krb5.h" >&5 -echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for krb5.h" >&5 +echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6; } if test "${ac_cv_header_krb5_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5 -echo "${ECHO_T}$ac_cv_header_krb5_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5 +echo "${ECHO_T}$ac_cv_header_krb5_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking krb5.h usability" >&5 -echo $ECHO_N "checking krb5.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking krb5.h usability" >&5 +echo $ECHO_N "checking krb5.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4861,15 +5439,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi + rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking krb5.h presence" >&5 -echo $ECHO_N "checking krb5.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking krb5.h presence" >&5 +echo $ECHO_N "checking krb5.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4903,9 +5482,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4929,25 +5509,23 @@ echo "$as_me: WARNING: krb5.h: section \"Present But Cannot Be Compiled\"" > echo "$as_me: WARNING: krb5.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: krb5.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: krb5.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## --------------------------------- ## ## Report this to BUG-REPORT-ADDRESS ## ## --------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for krb5.h" >&5 -echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for krb5.h" >&5 +echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6; } if test "${ac_cv_header_krb5_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_krb5_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5 -echo "${ECHO_T}$ac_cv_header_krb5_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5 +echo "${ECHO_T}$ac_cv_header_krb5_h" >&6; } fi @@ -4971,39 +5549,58 @@ _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, don't put newlines in cache variables' values. +# 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + 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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!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" && echo "updating cache $cache_file" + 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" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -5012,21 +5609,6 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# 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 - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. @@ -5036,17 +5618,17 @@ fi # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g +:quote +s/[ `~#$^&*(){}\\|;'"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. @@ -5064,11 +5646,12 @@ 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_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`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 @@ -5106,66 +5689,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -5186,126 +5718,198 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# 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.) +as_nl=' +' +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 - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + ;; +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 + 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. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# 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 || +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 - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + 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 before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # 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 - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # 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 - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { 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 sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (dirname -- /) >/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; then +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 +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + 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' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +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=: @@ -5314,7 +5918,19 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # 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'" @@ -5323,31 +5939,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# 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. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by FULL-PACKAGE-NAME $as_me VERSION, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.59d. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5355,30 +5954,18 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -5397,18 +5984,20 @@ Configuration files: $config_files Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ FULL-PACKAGE-NAME config.status VERSION -configured by $0, generated by GNU Autoconf 2.59, +configured by $0, generated by GNU Autoconf 2.59d, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5419,60 +6008,42 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + 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. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { 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_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -5488,37 +6059,51 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0" $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "$make_mod_irc" ) CONFIG_FILES="$CONFIG_FILES $make_mod_irc" ;; - "$make_mod_muc" ) CONFIG_FILES="$CONFIG_FILES $make_mod_muc" ;; - "$make_mod_pubsub" ) CONFIG_FILES="$CONFIG_FILES $make_mod_pubsub" ;; - "$make_eldap" ) CONFIG_FILES="$CONFIG_FILES $make_eldap" ;; - "$make_web" ) CONFIG_FILES="$CONFIG_FILES $make_web" ;; - "stringprep/Makefile" ) CONFIG_FILES="$CONFIG_FILES stringprep/Makefile" ;; - "$make_tls" ) CONFIG_FILES="$CONFIG_FILES $make_tls" ;; - "$make_odbc" ) CONFIG_FILES="$CONFIG_FILES $make_odbc" ;; - "$make_ejabberd_zlib" ) CONFIG_FILES="$CONFIG_FILES $make_ejabberd_zlib" ;; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "$make_mod_irc") CONFIG_FILES="$CONFIG_FILES $make_mod_irc" ;; + "$make_mod_muc") CONFIG_FILES="$CONFIG_FILES $make_mod_muc" ;; + "$make_mod_pubsub") CONFIG_FILES="$CONFIG_FILES $make_mod_pubsub" ;; + "$make_eldap") CONFIG_FILES="$CONFIG_FILES $make_eldap" ;; + "$make_web") CONFIG_FILES="$CONFIG_FILES $make_web" ;; + "stringprep/Makefile") CONFIG_FILES="$CONFIG_FILES stringprep/Makefile" ;; + "$make_tls") CONFIG_FILES="$CONFIG_FILES $make_tls" ;; + "$make_odbc") CONFIG_FILES="$CONFIG_FILES $make_odbc" ;; + "$make_ejabberd_zlib") CONFIG_FILES="$CONFIG_FILES $make_ejabberd_zlib" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 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 @@ -5528,322 +6113,389 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# 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 || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + 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 -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@ERLC@,$ERLC,;t t -s,@ac_pt_ERLC@,$ac_pt_ERLC,;t t -s,@ERL@,$ERL,;t t -s,@ac_pt_ERL@,$ac_pt_ERL,;t t -s,@ERLANG_CFLAGS@,$ERLANG_CFLAGS,;t t -s,@ERLANG_LIBS@,$ERLANG_LIBS,;t t -s,@LIBICONV@,$LIBICONV,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@EXPAT_CFLAGS@,$EXPAT_CFLAGS,;t t -s,@EXPAT_LIBS@,$EXPAT_LIBS,;t t -s,@ZLIB_CFLAGS@,$ZLIB_CFLAGS,;t t -s,@ZLIB_LIBS@,$ZLIB_LIBS,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@mod_pubsub@,$mod_pubsub,;t t -s,@make_mod_pubsub@,$make_mod_pubsub,;t t -s,@mod_irc@,$mod_irc,;t t -s,@make_mod_irc@,$make_mod_irc,;t t -s,@mod_muc@,$mod_muc,;t t -s,@make_mod_muc@,$make_mod_muc,;t t -s,@eldap@,$eldap,;t t -s,@make_eldap@,$make_eldap,;t t -s,@web@,$web,;t t -s,@make_web@,$make_web,;t t -s,@tls@,$tls,;t t -s,@make_tls@,$make_tls,;t t -s,@odbc@,$odbc,;t t -s,@make_odbc@,$make_odbc,;t t -s,@ejabberd_zlib@,$ejabberd_zlib,;t t -s,@make_ejabberd_zlib@,$make_ejabberd_zlib,;t t -s,@roster_gateway_workaround@,$roster_gateway_workaround,;t t -s,@SSL_LIBS@,$SSL_LIBS,;t t -s,@SSL_CFLAGS@,$SSL_CFLAGS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +ERLC!$ERLC$ac_delim +ERL!$ERL$ac_delim +ERLANG_CFLAGS!$ERLANG_CFLAGS$ac_delim +ERLANG_LIBS!$ERLANG_LIBS$ac_delim +LIBICONV!$LIBICONV$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +EXPAT_CFLAGS!$EXPAT_CFLAGS$ac_delim +EXPAT_LIBS!$EXPAT_LIBS$ac_delim +ZLIB_CFLAGS!$ZLIB_CFLAGS$ac_delim +ZLIB_LIBS!$ZLIB_LIBS$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +mod_pubsub!$mod_pubsub$ac_delim +make_mod_pubsub!$make_mod_pubsub$ac_delim +mod_irc!$mod_irc$ac_delim +make_mod_irc!$make_mod_irc$ac_delim +mod_muc!$mod_muc$ac_delim +make_mod_muc!$make_mod_muc$ac_delim +eldap!$eldap$ac_delim +make_eldap!$make_eldap$ac_delim +web!$web$ac_delim +make_web!$make_web$ac_delim +tls!$tls$ac_delim +make_tls!$make_tls$ac_delim +odbc!$odbc$ac_delim +make_odbc!$make_odbc$ac_delim +ejabberd_zlib!$ejabberd_zlib$ac_delim +make_ejabberd_zlib!$make_ejabberd_zlib$ac_delim +roster_gateway_workaround!$roster_gateway_workaround$ac_delim +db_type!$db_type$ac_delim +SSL_LIBS!$SSL_LIBS$ac_delim +SSL_CFLAGS!$SSL_CFLAGS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `grep -c "$ac_delim\$" conf$$subs.sed` = 79; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +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 + +ac_eof= +if grep '^CEOF$' conf$$subs.sed >/dev/null; then + ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF//p' conf$$subs.sed | sort -nru | sed 1q` + ac_eof=`expr 0$ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_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 fi # test -n "$CONFIG_FILES" -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +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 || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + 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 "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + 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 || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + 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 test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`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 || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + 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 ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`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 - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + 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 ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + 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 + # - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # 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. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } _ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# 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= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + 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 sed "$ac_vpsub $extrasub @@ -5851,28 +6503,31 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;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 +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out -done -_ACEOF + 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 + ;; + + + + esac + +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/src/configure.ac b/src/configure.ac index cabfa55e1..c77f79f08 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -37,7 +37,7 @@ AC_MOD_ENABLE(odbc, no) AC_MOD_ENABLE(ejabberd_zlib, yes) AC_ARG_ENABLE(roster_gateway_workaround, -[ --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions], +[ --enable-roster-gateway-workaround Turn on workaround for processing gateway subscriptions (default: no)], [case "${enableval}" in yes) roster_gateway_workaround=true ;; no) roster_gateway_workaround=false ;; @@ -45,6 +45,15 @@ AC_ARG_ENABLE(roster_gateway_workaround, esac],[roster_gateway_workaround=false]) AC_SUBST(roster_gateway_workaround) +AC_ARG_ENABLE(mssql, +[ --enable-mssql Use Microsoft SQL Server database (default: no, requires --enable-odbc)], +[case "${enableval}" in + yes) db_type=mssql ;; + no) db_type=generic ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-mssql) ;; +esac],[db_type=generic]) +AC_SUBST(db_type) + AC_CONFIG_FILES([Makefile $make_mod_irc $make_mod_muc diff --git a/src/configure.erl b/src/configure.erl index 79424ba79..688f94fe5 100644 --- a/src/configure.erl +++ b/src/configure.erl @@ -46,6 +46,7 @@ start() -> Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n", ExpatDir = "EXPAT_DIR = c:\\progra~1\\expat-1.95.7\n", OpenSSLDir = "OPENSSL_DIR = c:\\progra~1\\OpenSSL\n", + DBType = "DBTYPE = generic\n", %% 'generic' or 'mssql' SSLDir = "SSLDIR = " ++ code:lib_dir("ssl") ++ "\n", StdLibDir = "STDLIBDIR = " ++ code:lib_dir("stdlib") ++ "\n", @@ -58,6 +59,7 @@ start() -> SSLDir ++ StdLibDir ++ OpenSSLDir ++ + DBType ++ ExpatDir ++ ExpatLib ++ ExpatFlag ++ diff --git a/src/ejabberd_auth_odbc.erl b/src/ejabberd_auth_odbc.erl index cf5a96131..d946bfd48 100644 --- a/src/ejabberd_auth_odbc.erl +++ b/src/ejabberd_auth_odbc.erl @@ -57,10 +57,8 @@ check_password(User, Server, Password) -> false; LUser -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["select password from users " - "where username='", Username, "';"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:get_password(LServer, Username) of {selected, ["password"], [{Password}]} -> true; _ -> @@ -74,10 +72,8 @@ check_password(User, Server, Password, StreamID, Digest) -> false; LUser -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["select password from users " - "where username='", Username, "';"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:get_password(LServer, Username) of {selected, ["password"], [{Passwd}]} -> DigRes = if Digest /= "" -> @@ -103,11 +99,7 @@ set_password(User, Server, Password) -> Username = ejabberd_odbc:escape(LUser), Pass = ejabberd_odbc:escape(Password), LServer = jlib:nameprep(Server), - catch ejabberd_odbc:sql_transaction( - LServer, - [["delete from users where username='", Username ,"';"], - ["insert into users(username, password) " - "values ('", Username, "', '", Pass, "');"]]) + catch odbc_queries:set_password_t(LServer, Username, Pass) end. @@ -118,10 +110,8 @@ try_register(User, Server, Password) -> LUser -> Username = ejabberd_odbc:escape(LUser), Pass = ejabberd_odbc:escape(Password), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["insert into users(username, password) " - "values ('", Username, "', '", Pass, "');"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:add_user(LServer, Username, Pass) of {updated, 1} -> {atomic, ok}; _ -> @@ -134,9 +124,7 @@ dirty_get_registered_users() -> get_vh_registered_users(Server) -> LServer = jlib:nameprep(Server), - case catch ejabberd_odbc:sql_query( - LServer, - "select username from users") of + case catch odbc_queries:list_users(LServer) of {selected, ["username"], Res} -> [{U, LServer} || {U} <- Res]; _ -> @@ -149,10 +137,8 @@ get_password(User, Server) -> false; LUser -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["select password from users " - "where username='", Username, "';"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:get_password(LServer, Username) of {selected, ["password"], [{Password}]} -> Password; _ -> @@ -166,10 +152,8 @@ get_password_s(User, Server) -> ""; LUser -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["select password from users " - "where username='", Username, "';"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:get_password(LServer, Username) of {selected, ["password"], [{Password}]} -> Password; _ -> @@ -183,10 +167,8 @@ is_user_exists(User, Server) -> false; LUser -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["select password from users " - "where username='", Username, "';"]) of + LServer = jlib:nameprep(Server), + case catch odbc_queries:get_password(LServer, Username) of {selected, ["password"], [{_Password}]} -> true; _ -> @@ -200,9 +182,8 @@ remove_user(User, Server) -> error; LUser -> Username = ejabberd_odbc:escape(LUser), - catch ejabberd_odbc:sql_query( - jlib:nameprep(Server), - ["delete from users where username='", Username ,"';"]), + LServer = jlib:nameprep(Server), + catch odbc_queries:del_user(LServer, Username), ejabberd_hooks:run(remove_user, jlib:nameprep(Server), [User, Server]) end. @@ -216,12 +197,8 @@ remove_user(User, Server, Password) -> Pass = ejabberd_odbc:escape(Password), LServer = jlib:nameprep(Server), F = fun() -> - Result = ejabberd_odbc:sql_query_t( - ["select password from users where username='", - Username, "';"]), - ejabberd_odbc:sql_query_t(["delete from users " - "where username='", Username, - "' and password='", Pass, "';"]), + Result = odbc_queries:del_user_return_password( + LServer, Username, Pass), case Result of {selected, ["password"], [{Password}]} -> ejabberd_hooks:run(remove_user, jlib:nameprep(Server), @@ -233,6 +210,6 @@ remove_user(User, Server, Password) -> not_allowed end end, - {atomic, Result } = ejabberd_odbc:transaction(LServer, F), + {atomic, Result} = odbc_queries:transaction(LServer, F), Result end. diff --git a/src/mod_last_odbc.erl b/src/mod_last_odbc.erl index 1b9115238..8ec76823d 100644 --- a/src/mod_last_odbc.erl +++ b/src/mod_last_odbc.erl @@ -95,10 +95,7 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) -> get_last(IQ, SubEl, LUser, LServer) -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - LServer, - ["select seconds, state from last " - "where username='", Username, "';"]) of + case catch odbc_queries:get_last(LServer, Username) of {'EXIT', _Reason} -> IQ#iq{type = error, sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}; {selected, ["seconds","state"], []} -> @@ -131,16 +128,11 @@ store_last_info(User, Server, TimeStamp, Status) -> Username = ejabberd_odbc:escape(LUser), Seconds = ejabberd_odbc:escape(integer_to_list(TimeStamp)), State = ejabberd_odbc:escape(Status), - %% MREMOND: I think this should be turn into a non transactional behaviour - ejabberd_odbc:sql_transaction( - LServer, - [["delete from last where username='", Username, "';"], - ["insert into last(username, seconds, state) " - "values ('", Username, "', '", Seconds, "', '", State, "');"]]). + odbc_queries:set_last_t(LServer, Username, Seconds, State). + remove_user(User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), Username = ejabberd_odbc:escape(LUser), - ejabberd_odbc:sql_query(LServer, - ["delete from last where username='", Username, "';"]). + odbc_queries:del_last(LServer, Username). diff --git a/src/mod_offline_odbc.erl b/src/mod_offline_odbc.erl index 50a0e53c9..e3ac67104 100644 --- a/src/mod_offline_odbc.erl +++ b/src/mod_offline_odbc.erl @@ -65,14 +65,9 @@ loop(Host) -> ejabberd_odbc:escape( lists:flatten( xml:element_to_string(Packet))), - ["insert into spool(username, xml) " - "values ('", Username, "', '", - XML, - "');"] + odbc_queries:add_spool_sql(Username, XML) end, Msgs), - case catch ejabberd_odbc:sql_transaction( - Host, - Query) of + case catch odbc_queries:add_spool(Host, Query) of {'EXIT', Reason} -> ?ERROR_MSG("~p~n", [Reason]); _ -> @@ -207,15 +202,7 @@ pop_offline_messages(Ls, User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), EUser = ejabberd_odbc:escape(LUser), - F = fun() -> - Result = ejabberd_odbc:sql_query_t( - ["select username, xml from spool where username='", EUser, "'" - " order by seq;"]), - ejabberd_odbc:sql_query_t( - ["delete from spool where username='", EUser, "';"]), - Result - end, - case ejabberd_odbc:sql_transaction(LServer,F) of + case odbc_queries:get_and_del_spool_msg_t(LServer, EUser) of {atomic, {selected, ["username","xml"], Rs}} -> Ls ++ lists:flatmap( fun({_, XML}) -> @@ -245,7 +232,5 @@ remove_user(User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), Username = ejabberd_odbc:escape(LUser), - ejabberd_odbc:sql_query( - LServer, - ["delete from spool where username='", Username, "';"]). + odbc_queries:del_spool_msg(LServer, Username). diff --git a/src/mod_roster_odbc.erl b/src/mod_roster_odbc.erl index 1f84f6953..cc94d10c6 100644 --- a/src/mod_roster_odbc.erl +++ b/src/mod_roster_odbc.erl @@ -122,20 +122,13 @@ process_iq_get(From, To, #iq{sub_el = SubEl} = IQ) -> get_user_roster(Acc, {LUser, LServer}) -> Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - LServer, - ["select username, jid, nick, subscription, ask, " - "askmessage, server, subscribe, type from rosterusers " - "where username='", Username, "'"]) of + case catch odbc_queries:get_roster(LServer, Username) of {selected, ["username", "jid", "nick", "subscription", "ask", "askmessage", "server", "subscribe", "type"], Items} when is_list(Items) -> - JIDGroups = case catch ejabberd_odbc:sql_query( - LServer, - ["select jid, grp from rostergroups " - "where username='", Username, "'"]) of - {selected, ["jid","grp"], - JGrps} when is_list(JGrps) -> + JIDGroups = case catch odbc_queries:get_roster_jid_groups(LServer, Username) of + {selected, ["jid","grp"], JGrps} + when is_list(JGrps) -> JGrps; _ -> [] @@ -148,10 +141,11 @@ get_user_roster(Acc, {LUser, LServer}) -> R -> SJID = jlib:jid_to_string(R#roster.jid), Groups = lists:flatmap( - fun({S, G}) when S == SJID -> - [G]; - (_) -> - [] + fun({S, G}) -> + case jlib:jid_tolower(S) of + SJID -> [G]; + _ -> [] + end end, JIDGroups), [R#roster{groups = Groups}] end @@ -216,13 +210,7 @@ process_item_set(From, To, {xmlelement, _Name, Attrs, Els}) -> {selected, ["username", "jid", "nick", "subscription", "ask", "askmessage", "server", "subscribe", "type"], - Res} = - ejabberd_odbc:sql_query_t( - ["select username, jid, nick, subscription, " - "ask, askmessage, server, subscribe, type " - "from rosterusers " - "where username='", Username, "' " - "and jid='", SJID, "'"]), + Res} = odbc_queries:get_roster_by_jid(LServer, Username, SJID), Item = case Res of [] -> #roster{usj = {LUser, LServer, LJID}, @@ -239,39 +227,11 @@ process_item_set(From, To, {xmlelement, _Name, Attrs, Els}) -> Item2 = process_item_els(Item1, Els), case Item2#roster.subscription of remove -> - ejabberd_odbc:sql_query_t( - ["delete from rosterusers " - " where username='", Username, "' " - " and jid='", SJID, "';"]), - ejabberd_odbc:sql_query_t( - ["delete from rostergroups " - " where username='", Username, "' " - " and jid='", SJID, "';"]); + odbc_queries:del_roster(LServer, Username, SJID); _ -> ItemVals = record_to_string(Item2), ItemGroups = groups_to_string(Item2), - ejabberd_odbc:sql_query_t( - ["delete from rosterusers " - " where username='", Username, "' " - " and jid='", SJID, "';"]), - ejabberd_odbc:sql_query_t( - ["insert into rosterusers(" - " username, jid, nick, " - " subscription, ask, " - " askmessage, server, " - " subscribe, type) " - " values ", ItemVals, ";"]), - ejabberd_odbc:sql_query_t( - ["delete from rostergroups " - " where username='", Username, "' " - " and jid='", SJID, "';"]), - lists:foreach(fun(ItemGroup) -> - ejabberd_odbc:sql_query_t( - ["insert into rostergroups(" - " username, jid, grp) " - " values ", ItemGroup, ";"]) - end, - ItemGroups) + odbc_queries:update_roster(LServer, Username, SJID, ItemVals, ItemGroups) end, %% If the item exist in shared roster, take the %% subscription information from there: @@ -279,7 +239,7 @@ process_item_set(From, To, {xmlelement, _Name, Attrs, Els}) -> LServer, Item2, [LServer]), {Item, Item3} end, - case ejabberd_odbc:sql_transaction(LServer, F) of + case odbc_queries:sql_transaction(LServer, F) of {atomic, {OldItem, Item}} -> push_item(User, LServer, To, Item), case Item#roster.subscription of @@ -411,11 +371,7 @@ get_subscription_lists(_, User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - LServer, - ["select username, jid, nick, subscription, ask, " - "askmessage, server, subscribe, type from rosterusers " - "where username='", Username, "'"]) of + case catch odbc_queries:get_roster(LServer, Username) of {selected, ["username", "jid", "nick", "subscription", "ask", "askmessage", "server", "subscribe", "type"], Items} when is_list(Items) -> @@ -460,22 +416,14 @@ process_subscription(Direction, User, Server, JID1, Type, Reason) -> SJID = ejabberd_odbc:escape(jlib:jid_to_string(LJID)), F = fun() -> Item = - case ejabberd_odbc:sql_query_t( - ["select username, jid, nick, subscription, ask, " - "askmessage, server, subscribe, type " - "from rosterusers " - "where username='", Username, "' " - "and jid='", SJID, "';"]) of + case odbc_queries:get_roster_by_jid(LServer, Username, SJID) of {selected, ["username", "jid", "nick", "subscription", "ask", "askmessage", "server", "subscribe", "type"], [I]} -> R = raw_to_record(LServer, I), Groups = - case ejabberd_odbc:sql_query_t( - ["select grp from rostergroups " - "where username='", Username, "' " - "and jid='", SJID, "';"]) of + case odbc_queries:get_roster_groups(LServer, Username, SJID) of {selected, ["grp"], JGrps} when is_list(JGrps) -> [JGrp || {JGrp} <- JGrps]; _ -> @@ -521,21 +469,11 @@ process_subscription(Direction, User, Server, JID1, Type, Reason) -> ask = Pending, askmessage = AskMessage}, ItemVals = record_to_string(NewItem), - ejabberd_odbc:sql_query_t( - ["delete from rosterusers " - " where username='", Username, "' " - " and jid='", SJID, "';"]), - ejabberd_odbc:sql_query_t( - ["insert into rosterusers(" - " username, jid, nick, " - " subscription, ask, " - " askmessage, server, subscribe, " - " type) " - " values ", ItemVals, ";"]), + odbc_queries:roster_subscribe(LServer, Username, SJID, ItemVals), {{push, NewItem}, AutoReply} end end, - case ejabberd_odbc:sql_transaction(LServer, F) of + case odbc_queries:sql_transaction(LServer, F) of {atomic, {Push, AutoReply}} -> case AutoReply of none -> @@ -662,16 +600,7 @@ remove_user(User, Server) -> LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), Username = ejabberd_odbc:escape(LUser), - ejabberd_odbc:sql_transaction( - LServer, - fun() -> - ejabberd_odbc:sql_query_t( - ["delete from rosterusers " - " where username='", Username, "';"]), - ejabberd_odbc:sql_query_t( - ["delete from rostergroups " - " where username='", Username, "';"]) - end), + odbc_queries:del_user_roster_t(LServer, Username), ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -680,7 +609,7 @@ set_items(User, Server, SubEl) -> {xmlelement, _Name, _Attrs, Els} = SubEl, LUser = jlib:nodeprep(User), LServer = jlib:nameprep(Server), - catch ejabberd_odbc:transaction( + catch odbc_queries:transaction( LServer, lists:map(fun(El) -> process_item_set_t(LUser, LServer, El) @@ -703,31 +632,11 @@ process_item_set_t(LUser, LServer, {xmlelement, _Name, Attrs, Els}) -> Item2 = process_item_els(Item1, Els), case Item2#roster.subscription of remove -> - [["delete from rosterusers " - " where username='", Username, "' " - " and jid='", SJID, "';"], - ["delete from rostergroups " - " where username='", Username, "' " - " and jid='", SJID, "';"]]; + odbc_queries:del_roster_sql(Username, SJID); _ -> ItemVals = record_to_string(Item1), ItemGroups = groups_to_string(Item2), - [["delete from rosterusers " - " where username='", Username, "' " - " and jid='", SJID, "';"], - ["insert into rosterusers(" - " username, jid, nick, " - " subscription, ask, " - " askmessage, server, subscribe, " - " type) " - " values ", ItemVals, ";"], - ["delete from rostergroups " - " where username='", Username, "' " - " and jid='", SJID, "';"], - [["insert into rostergroups(" - " username, jid, grp) " - " values ", ItemGroup, ";"] || - ItemGroup <- ItemGroups]] + odbc_queries:update_roster_sql(Username, SJID, ItemVals, ItemGroups) end end; process_item_set_t(_LUser, _LServer, _) -> @@ -773,34 +682,24 @@ process_item_attrs_ws(Item, [{Attr, Val} | Attrs]) -> process_item_attrs_ws(Item, []) -> Item. - get_in_pending_subscriptions(Ls, User, Server) -> JID = jlib:make_jid(User, Server, ""), LUser = JID#jid.luser, LServer = JID#jid.lserver, Username = ejabberd_odbc:escape(LUser), - case catch ejabberd_odbc:sql_query( - LServer, - ["select username, jid, nick, subscription, ask, " - "askmessage, server, subscribe, type from rosterusers " - "where username='", Username, "'"]) of + case catch odbc_queries:get_roster(LServer, Username) of {selected, ["username", "jid", "nick", "subscription", "ask", "askmessage", "server", "subscribe", "type"], Items} when is_list(Items) -> Ls ++ lists:map( fun(R) -> Message = R#roster.askmessage, - Status = if is_binary(Message) -> - binary_to_list(Message); - true -> - "" - end, {xmlelement, "presence", [{"from", jlib:jid_to_string(R#roster.jid)}, {"to", jlib:jid_to_string(JID)}, {"type", "subscribe"}], [{xmlelement, "status", [], - [{xmlcdata, Status}]}]} + [{xmlcdata, Message}]}]} end, lists:flatmap( fun(I) -> @@ -825,11 +724,7 @@ get_jid_info(_, User, Server, JID) -> LJID = jlib:jid_tolower(JID), Username = ejabberd_odbc:escape(LUser), SJID = ejabberd_odbc:escape(jlib:jid_to_string(LJID)), - case catch ejabberd_odbc:sql_query( - LServer, - ["select subscription from rosterusers " - "where username='", Username, "' " - "and jid='", SJID, "'"]) of + case catch odbc_queries:get_subscription(LServer, Username, SJID) of {selected, ["subscription"], [{SSubscription}]} -> Subscription = case SSubscription of "B" -> both; @@ -837,11 +732,7 @@ get_jid_info(_, User, Server, JID) -> "F" -> from; _ -> none end, - Groups = case catch ejabberd_odbc:sql_query( - LServer, - ["select grp from rostergroups " - "where username='", Username, "' " - "and jid='", SJID, "'"]) of + Groups = case catch odbc_queries:get_roster_group_by_jid(LServer, Username, SJID) of {selected, ["grp"], JGrps} when is_list(JGrps) -> [JGrp || {JGrp} <- JGrps]; _ -> @@ -855,11 +746,7 @@ get_jid_info(_, User, Server, JID) -> {none, []}; true -> SRJID = ejabberd_odbc:escape(jlib:jid_to_string(LRJID)), - case catch ejabberd_odbc:sql_query( - LServer, - ["select subscription from rosterusers " - "where username='", Username, "' " - "and jid='", SRJID, "'"]) of + case catch odbc_queries:get_subscription(LServer, Username, SRJID) of {selected, ["subscription"], [{SSubscription}]} -> Subscription = case SSubscription of "B" -> both; @@ -867,11 +754,7 @@ get_jid_info(_, User, Server, JID) -> "F" -> from; _ -> none end, - Groups = case catch ejabberd_odbc:sql_query( - LServer, - ["select grp from rostergroups " - "where username='", Username, "' " - "and jid='", SRJID, "'"]) of + Groups = case catch odbc_queries:get_rostergroup_by_jid(LServer, Username, SRJID) of {selected, ["grp"], JGrps} when is_list(JGrps) -> [JGrp || {JGrp} <- JGrps]; _ -> @@ -939,22 +822,26 @@ record_to_string(#roster{us = {User, _Server}, in -> "I"; none -> "N" end, - ["(" - "'", Username, "'," + ["'", Username, "'," "'", SJID, "'," "'", Nick, "'," "'", SSubscription, "'," "'", SAsk, "'," "'", AskMessage, "'," - "'N', '', 'item')"]. + "'N', '', 'item'"]. groups_to_string(#roster{us = {User, _Server}, jid = JID, groups = Groups}) -> Username = ejabberd_odbc:escape(User), SJID = ejabberd_odbc:escape(jlib:jid_to_string(jlib:jid_tolower(JID))), - [["(" - "'", Username, "'," - "'", SJID, "'," - "'", ejabberd_odbc:escape(Group), "')"] || Group <- Groups]. + + %% Empty groups do not need to be converted to string to be inserted in + %% the database + lists:foldl(fun([], Acc) -> Acc; + (Group, Acc) -> + String = ["'", Username, "'," + "'", SJID, "'," + "'", ejabberd_odbc:escape(Group), "'"], + [String|Acc] end, [], Groups). diff --git a/src/odbc/Makefile.in b/src/odbc/Makefile.in index 8e291bebf..af2a2463f 100644 --- a/src/odbc/Makefile.in +++ b/src/odbc/Makefile.in @@ -13,12 +13,13 @@ OUTDIR = .. EFLAGS = -I .. -pz .. OBJS = \ $(OUTDIR)/ejabberd_odbc.beam \ - $(OUTDIR)/ejabberd_odbc_sup.beam + $(OUTDIR)/ejabberd_odbc_sup.beam \ + $(OUTDIR)/odbc_queries.beam all: $(OBJS) $(OUTDIR)/%.beam: %.erl - @ERLC@ -W $(EFLAGS) -o $(OUTDIR) $< + @ERLC@ -W $(EFLAGS) -D@db_type@ -o $(OUTDIR) $< clean: diff --git a/src/odbc/Makefile.win32 b/src/odbc/Makefile.win32 index 072813563..cd9fbfbe2 100644 --- a/src/odbc/Makefile.win32 +++ b/src/odbc/Makefile.win32 @@ -6,7 +6,8 @@ EFLAGS = -I .. -pz .. OBJS = \ $(OUTDIR)\ejabberd_odbc.beam \ - $(OUTDIR)\ejabberd_odbc_sup.beam + $(OUTDIR)\ejabberd_odbc_sup.beam \ + $(OUTDIR)\odbc_queries.beam ALL : $(OBJS) @@ -18,3 +19,7 @@ $(OUTDIR)\ejabberd_odbc.beam : ejabberd_odbc.erl $(OUTDIR)\ejabberd_odbc_sup.beam : ejabberd_odbc_sup.erl erlc -W $(EFLAGS) -o $(OUTDIR) ejabberd_odbc_sup.erl + +$(OUTDIR)\odbc_queries.beam : odbc_queries.erl + erlc -W $(EFLAGS) -o $(OUTDIR) -D$(DBTYPE) odbc_queries.erl + diff --git a/src/odbc/ejabberd_odbc.erl b/src/odbc/ejabberd_odbc.erl index b0776c5cb..b4fd41244 100644 --- a/src/odbc/ejabberd_odbc.erl +++ b/src/odbc/ejabberd_odbc.erl @@ -87,16 +87,7 @@ sql_query_t(Query) -> %% Escape character that will confuse an SQL engine escape(S) when is_list(S) -> - [escape(C) || C <- S]; -escape($\0) -> "\\0"; -escape($\n) -> "\\n"; -escape($\t) -> "\\t"; -escape($\b) -> "\\b"; -escape($\r) -> "\\r"; -escape($') -> "\\'"; -escape($") -> "\\\""; -escape($\\) -> "\\\\"; -escape(C) -> C. + [odbc_queries:escape(C) || C <- S]. %% Escape character that will confuse an SQL engine %% Percent and underscore only need to be escaped for pattern matching like @@ -105,7 +96,7 @@ escape_like(S) when is_list(S) -> [escape_like(C) || C <- S]; escape_like($%) -> "\\%"; escape_like($_) -> "\\_"; -escape_like(C) -> escape(C). +escape_like(C) -> odbc_queries:escape(C). %%%---------------------------------------------------------------------- diff --git a/src/odbc/mssql.sql b/src/odbc/mssql.sql new file mode 100644 index 000000000..6a8a298d9 --- /dev/null +++ b/src/odbc/mssql.sql @@ -0,0 +1,901 @@ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO + +exec sp_dboption N'ejabberd', N'autoclose', N'false' +GO + +exec sp_dboption N'ejabberd', N'bulkcopy', N'true' +GO + +exec sp_dboption N'ejabberd', N'trunc. log', N'false' +GO + +exec sp_dboption N'ejabberd', N'torn page detection', N'true' +GO + +exec sp_dboption N'ejabberd', N'read only', N'false' +GO + +exec sp_dboption N'ejabberd', N'dbo use', N'false' +GO + +exec sp_dboption N'ejabberd', N'single', N'false' +GO + +exec sp_dboption N'ejabberd', N'autoshrink', N'false' +GO + +exec sp_dboption N'ejabberd', N'ANSI null default', N'false' +GO + +exec sp_dboption N'ejabberd', N'recursive triggers', N'false' +GO + +exec sp_dboption N'ejabberd', N'ANSI nulls', N'false' +GO + +exec sp_dboption N'ejabberd', N'concat null yields null', N'false' +GO + +exec sp_dboption N'ejabberd', N'cursor close on commit', N'false' +GO + +exec sp_dboption N'ejabberd', N'default to local cursor', N'false' +GO + +exec sp_dboption N'ejabberd', N'quoted identifier', N'false' +GO + +exec sp_dboption N'ejabberd', N'ANSI warnings', N'false' +GO + +exec sp_dboption N'ejabberd', N'auto create statistics', N'true' +GO + +exec sp_dboption N'ejabberd', N'auto update statistics', N'true' +GO + +use [ejabberd] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[last]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[last] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[rostergroups]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[rostergroups] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[rosterusers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[rosterusers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spool]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[spool] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[users] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vcard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) +drop table [dbo].[vcard] +GO + +CREATE TABLE [dbo].[last] ( + [username] [varchar] (250) NOT NULL , + [seconds] [varchar] (50) NOT NULL , + [state] [varchar] (100) NULL , + [Modify_Date] [datetime] NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[rostergroups] ( + [username] [varchar] (250) NOT NULL , + [jid] [varchar] (250) NOT NULL , + [grp] [varchar] (100) NOT NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[rosterusers] ( + [username] [varchar] (250) NOT NULL , + [jid] [varchar] (250) NOT NULL , + [nick] [varchar] (50) NULL , + [subscription] [char] (1) NOT NULL , + [ask] [char] (1) NOT NULL , + [askmessage] [varchar] (250) NULL , + [server] [char] (1) NOT NULL , + [subscribe] [varchar] (200) NULL , + [type] [varchar] (50) NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[spool] ( + [id] [numeric](19, 0) IDENTITY (1, 1) NOT NULL , + [username] [varchar] (250) NOT NULL , + [xml] [text] NULL , + [notifyprocessed] [bit] NULL , + [created] [datetime] NULL , + [MustDelete] [bit] NULL +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +CREATE TABLE [dbo].[users] ( + [username] [varchar] (250) NOT NULL , + [password] [varchar] (50) NOT NULL , + [created] [datetime] NULL +) ON [PRIMARY] +GO + +CREATE TABLE [dbo].[vcard] ( + [username] [varchar] (250) NOT NULL , + [full_name] [varchar] (250) NULL , + [first_name] [varchar] (50) NULL , + [last_name] [varchar] (50) NULL , + [nick_name] [varchar] (50) NULL , + [url] [varchar] (1024) NULL , + [address1] [varchar] (50) NULL , + [address2] [varchar] (50) NULL , + [locality] [varchar] (50) NULL , + [region] [varchar] (50) NULL , + [pcode] [varchar] (50) NULL , + [country] [varchar] (50) NULL , + [telephone] [varchar] (50) NULL , + [email] [varchar] (250) NULL , + [orgname] [varchar] (50) NULL , + [orgunit] [varchar] (50) NULL , + [title] [varchar] (50) NULL , + [role] [varchar] (50) NULL , + [b_day] [datetime] NULL , + [descr] [varchar] (500) NULL +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[last] WITH NOCHECK ADD + CONSTRAINT [PK_last] PRIMARY KEY CLUSTERED + ( + [username] + ) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +ALTER TABLE [dbo].[rostergroups] WITH NOCHECK ADD + CONSTRAINT [PK_rostergroups] PRIMARY KEY CLUSTERED + ( + [username], + [jid], + [grp] + ) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +ALTER TABLE [dbo].[spool] WITH NOCHECK ADD + CONSTRAINT [PK_spool] PRIMARY KEY CLUSTERED + ( + [username], + [id] + ) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +ALTER TABLE [dbo].[users] WITH NOCHECK ADD + CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED + ( + [username] + ) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +ALTER TABLE [dbo].[vcard] WITH NOCHECK ADD + CONSTRAINT [PK_vcard] PRIMARY KEY CLUSTERED + ( + [username] + ) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE CLUSTERED INDEX [IX_rosterusers_user] ON [dbo].[rosterusers]([username]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +ALTER TABLE [dbo].[last] WITH NOCHECK ADD + CONSTRAINT [DF_last_updated] DEFAULT (getdate()) FOR [Modify_Date] +GO + +ALTER TABLE [dbo].[spool] WITH NOCHECK ADD + CONSTRAINT [DF_spool_notifyprocessed] DEFAULT (0) FOR [notifyprocessed], + CONSTRAINT [DF_spool_created] DEFAULT (getdate()) FOR [created], + CONSTRAINT [DF_spool_MustDelete] DEFAULT (0) FOR [MustDelete] +GO + +ALTER TABLE [dbo].[users] WITH NOCHECK ADD + CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created] +GO + + CREATE INDEX [IX_rostergroups_jid] ON [dbo].[rostergroups]([jid]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IX_rostergroups_user] ON [dbo].[rostergroups]([username]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IX_rosterusers_jid] ON [dbo].[rosterusers]([username], [jid]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IX_spool_user] ON [dbo].[spool]([username]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IX_spool_process] ON [dbo].[spool]([created], [notifyprocessed]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IK_Spool_Del] ON [dbo].[spool]([MustDelete]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + + CREATE INDEX [IK_Spool_Created] ON [dbo].[spool]([created]) WITH FILLFACTOR = 90 ON [PRIMARY] +GO + +/*********************************************************/ +/** These store procedures are for use with ejabberd **/ +/** 1.1 and Microsoft Sql Server 2000 **/ +/** **/ +/** The stored procedures reduce the need to sql **/ +/** compilation of the database and also allow for also **/ +/** provide each of database integration. The store **/ +/** procedure have been optimized to increase database **/ +/** performance and a reduction of 80% in CPU was **/ +/** achive over the use of standard sql. **/ +/*********************************************************/ + +/****** Object: StoredProcedure [dbo].[add_roster] ******/ +/** Add or update user entries in the roster **/ +/*********************************************************/ +CREATE PROCEDURE [dbo].[add_roster] + @Username varchar(250), + @JID varchar(250), + @Nick varchar(50), + @Subscription char(1), + @Ask char(1), + @AskMessage varchar(250), + @Server char(1), + @Subscribe varchar(200), + @Type varchar(50), + @Grp varchar(100) +AS +BEGIN + BEGIN TRANSACTION + --- Update Roster if user exist else add roster item + IF EXISTS (SELECT username FROM rosterusers WITH (NOLOCK) WHERE rosterusers.username=@Username AND rosterusers.jid=@JID) + BEGIN + UPDATE rosterusers + SET rosterusers.username=@Username, + rosterusers.jid=@JID, + rosterusers.nick=@Nick, + rosterusers.subscription=@Subscription, + rosterusers.ask=@Ask, + rosterusers.askmessage=@AskMessage, + rosterusers.server=@Server, + rosterusers.subscribe=@Subscribe, + rosterusers.type=@Type + WHERE (rosterusers.username=@Username) AND (rosterusers.jid=@JID); + END + ELSE + BEGIN + INSERT INTO rosterusers + ( rosterusers.username, + rosterusers.jid, + rosterusers.nick, + rosterusers.subscription, + rosterusers.ask, + rosterusers.askmessage, + rosterusers.server, + rosterusers.subscribe, + rosterusers.type + ) + VALUES + ( @Username, + @JID, + @Nick, + @Subscription, + @Ask, + @AskMessage, + @Server, + @Subscribe, + @Type + ); + END + + --- Update Roster Groups if exist else add group entry + IF NOT EXISTS (SELECT username FROM rostergroups WITH (NOLOCK) WHERE rostergroups.username=@Username AND rostergroups.jid=@JID AND rostergroups.grp=@Grp) + BEGIN + INSERT INTO rostergroups + ( rostergroups.username, + rostergroups.jid, + rostergroups.grp + ) + VALUES + ( @Username, + @JID, + @Grp + ); + END + + COMMIT +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[add_roster_group] ******/ +/** Add or update user group entries in the roster groups **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[add_roster_group] + @Username varchar(250), + @JID varchar(250), + @Grp varchar(100) +AS +BEGIN + --- Update Roster Groups if exist else add group + IF NOT EXISTS (SELECT username FROM rostergroups WHERE rostergroups.username=@Username AND rostergroups.jid=@JID AND rostergroups.grp=@Grp) + BEGIN + INSERT INTO rostergroups + ( rostergroups.username, + rostergroups.jid, + rostergroups.grp + ) + VALUES + ( @Username, + @JID, + @Grp + ) + END +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[add_roster_user] ******/ +/** Add or update user entries in the roster **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[add_roster_user] + @Username varchar(250), + @JID varchar(250), + @Nick varchar(50), + @Subscription char(1), + @Ask char(1), + @AskMessage varchar(250), + @Server char(1), + @Subscribe varchar(200), + @Type varchar(50), + @Grp varchar(100) = Null +AS +BEGIN + BEGIN TRANSACTION + --- Update Roster Users if exist of add new user + IF EXISTS (SELECT username FROM rosterusers WHERE rosterusers.username=@Username AND rosterusers.jid=@JID) + BEGIN + UPDATE rosterusers + SET rosterusers.username=@Username, + rosterusers.jid=@JID, + rosterusers.nick=@Nick, + rosterusers.subscription=@Subscription, + rosterusers.ask=@Ask, + rosterusers.askmessage=@AskMessage, + rosterusers.server=@Server, + rosterusers.subscribe=@Subscribe, + rosterusers.type=@Type + WHERE (rosterusers.username=@Username) AND (rosterusers.jid=@JID); + END + ELSE + BEGIN + INSERT INTO rosterusers + ( rosterusers.username, + rosterusers.jid, + rosterusers.nick, + rosterusers.subscription, + rosterusers.ask, + rosterusers.askmessage, + rosterusers.server, + rosterusers.subscribe, + rosterusers.type + ) + VALUES + ( @Username, + @JID, + @Nick, + @Subscription, + @Ask, + @AskMessage, + @Server, + @Subscribe, + @Type + ); + END + + --- Update Roster Group if exist of add new group + IF @Grp IS NOT NULL + EXECUTE [dbo].[add_roster_group] @Username, @JID, @Grp + + COMMIT +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[del_roster_groups] ******/ +/** Remove user group entries from the roster groups table **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[del_roster_groups] + @Username varchar(250), + @JID varchar(250) +AS +BEGIN + DELETE FROM rostergroups + WITH (ROWLOCK) + WHERE (rostergroups.username = @Username) AND (rostergroups.jid = @JID); +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[add_spool] ******/ +/** Add a entry to the spool table **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[add_spool] + @Username varchar(250), + @XML varchar(8000) +AS +BEGIN + INSERT INTO spool + ( spool.username, + spool.xml + ) + VALUES + ( @Username, + @XML + ) +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[add_user] ******/ +/** Add or update user entries to jabber **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[add_user] + @Username varchar(200), + @Password varchar(50) +AS +BEGIN + INSERT INTO users + ( username, + [password] + ) + VALUES + ( @Username, + @Password + ); +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[set_password] **/ +/** Update users password **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[set_password] + @Username varchar(200), + @Password varchar(50) +AS +BEGIN + IF EXISTS (SELECT username FROM users WITH (NOLOCK) WHERE username=@Username) + BEGIN + UPDATE users SET username=@Username, password=@Password WHERE username=@Username; + END + ELSE + BEGIN + INSERT INTO users (username, password) VALUES (@Username, @Password); + END +END +GO +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_password] **/ +/** Retrive the user password **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_password] + @Username varchar(200) +AS +BEGIN + SELECT users.password as password + FROM users WITH (NOLOCK) + WHERE username=@Username; +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[clean_spool_msg] ******/ +/** Delete messages older that 3 days from spool **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[clean_spool_msg] +AS +DECLARE + @dt datetime, + @myRowCount int +BEGIN + -- Delete small amounts because if locks the database table + SET ROWCOUNT 500 + SET @myRowCount = 1 + + WHILE (@myRowCount) > 0 + BEGIN + BEGIN TRANSACTION + SELECT @dt = DATEADD(d, -3, GETDATE()) + DELETE FROM spool + WITH (ROWLOCK) + WHERE (MustDelete=1) OR (Created < @dt); + + SET @myRowCount = @@RowCount + COMMIT + END +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[del_last] ******/ +/** Delete an entry from the last table **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[del_last] + @Username varchar(250) +AS +BEGIN + DELETE FROM [last] + WITH (ROWLOCK) + WHERE [last].username=@Username; +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[del_roster] ******/ +/** Delete an entry from the roster **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[del_roster] + @Username varchar(250), + @JID varchar(250) +AS +BEGIN + BEGIN TRANSACTION + DELETE FROM rosterusers + WITH (ROWLOCK) + WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID); + + DELETE FROM rostergroups + WITH (ROWLOCK) + WHERE (rostergroups.username = @Username) AND (rostergroups.jid = @JID); + + COMMIT +END +GO + + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[del_spool_msg] ******/ +/** Delete an entry from the spool table **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[del_spool_msg] + @Username varchar(250) +AS +BEGIN + DELETE FROM spool + WITH (ROWLOCK) + WHERE spool.username=@Username; +END +GO + +/***************************************************************/ +/****** Object: StoredProcedure [dbo].[del_user] ******/ +/** Delete an entry from the user table **/ +/***************************************************************/ +CREATE PROCEDURE [dbo].[del_user] + @Username varchar(200) +AS +BEGIN + DELETE FROM users + WITH (ROWLOCK) + WHERE username=@Username; +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[del_user_return_password]**/ +/** Delete an entry from the user table and return user password **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[del_user_return_password] + @Username varchar(250) +AS +DECLARE + @Pwd varchar(50) +BEGIN + EXECUTE @Pwd = dbo.get_password @Username + DELETE FROM users + WITH (ROWLOCK) + WHERE username=@Username + + SELECT @Pwd; +END +GO + + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[del_user_roster] **/ +/** Delete the users roster **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[del_user_roster] + @Username varchar(250) +AS +BEGIN + BEGIN TRANSACTION + DELETE FROM rosterusers + WITH (ROWLOCK) + WHERE rosterusers.username = @Username; + + DELETE FROM rostergroups + WITH (ROWLOCK) + WHERE rostergroups.username = @Username; + + COMMIT +END +GO + + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_and_del_spool_msg] **/ +/** Fetch and delete the users offline messages **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_and_del_spool_msg] + @Username varchar(250) +AS +DECLARE + @vSpool table( username varchar(1), + xml varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM spool with (nolock) WHERE spool.username=@Username) + BEGIN + SELECT spool.username AS username, + spool.xml AS xml + FROM spool WITH (NOLOCK) + WHERE spool.username=@Username; + + DELETE spool + WITH (ROWLOCK) + WHERE spool.username=@Username + END + ELSE + BEGIN + SELECT * FROM @vSpool; + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_last] **/ +/** Retrive the last user login **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_last] + @Username varchar(250) +AS +BEGIN + SELECT last.seconds AS seconds, + last.state AS state + FROM last WITH (NOLOCK) + WHERE last.username=@Username; +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_roster] **/ +/** Retrive the user roster **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_roster] + @Username varchar(200) +AS +DECLARE + @vRosterusers table( username varchar(1), + jid varchar(1), + nick varchar(1), + subscription varchar(1), + ask varchar(1), + askmessage varchar(1), + server varchar(1), + subscribe varchar(1), + type varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE rosterusers.username = @Username) + BEGIN + SELECT rosterusers.username AS username, + rosterusers.jid AS jid, + rosterusers.nick AS nick, + rosterusers.subscription AS subscription, + rosterusers.ask AS ask, + rosterusers.askmessage AS askmessage, + rosterusers.server AS server, + rosterusers.subscribe AS subscribe, + rosterusers.type AS type + FROM rosterusers WITH (NOLOCK) + WHERE rosterusers.username = @Username; + END + ELSE + BEGIN + SELECT * FROM @vRosterusers + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_roster_by_jid] **/ +/** Retrive the user roster via JID **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_roster_by_jid] + @Username varchar(200), + @JID varchar(250) +AS +DECLARE + @vRosterusers table( username varchar(1), + jid varchar(1), + nick varchar(1), + subscription varchar(1), + ask varchar(1), + askmessage varchar(1), + server varchar(1), + subscribe varchar(1), + type varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID)) + BEGIN + SELECT rosterusers.username AS username, + rosterusers.jid AS jid, + rosterusers.nick AS nick, + rosterusers.subscription AS subscription, + rosterusers.ask AS ask, + rosterusers.askmessage AS askmessage, + rosterusers.server AS server, + rosterusers.subscribe AS subscribe, + rosterusers.type AS type + FROM rosterusers WITH (NOLOCK) + WHERE (rosterusers.username = @Username) AND (rosterusers.jid = @JID); + END + ELSE + BEGIN + SELECT * FROM @vRosterusers + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_roster_jid_groups] **/ +/** Retrieve the user roster groups **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_roster_jid_groups] + @Username varchar(200) +AS +DECLARE + @vrostergroups table( jid varchar(1), + grp varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rostergroups with (nolock) WHERE rostergroups.username = @Username) + BEGIN + SELECT rostergroups.jid AS jid, + rostergroups.grp AS grp + FROM rostergroups WITH (NOLOCK) + WHERE rostergroups.username = @Username; + END + ELSE + BEGIN + SELECT * FROM @vrostergroups + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_roster_groups] **/ +/** Retrive the user roster groups **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_roster_groups] + @Username varchar(200), + @JID varchar(250) +AS +DECLARE + @vrostergroups table( grp varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rostergroups with (nolock) WHERE rostergroups.username = @Username) + BEGIN + SELECT rostergroups.grp AS grp + FROM rostergroups WITH (NOLOCK) + WHERE (rostergroups.username = @Username) AND (rostergroups.jid = @JID); + END + ELSE + BEGIN + SELECT * FROM @vrostergroups + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_rostergroup_by_jid] **/ +/** Retrive the user roster groups via JID **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_rostergroup_by_jid] + @Username varchar(250), + @JID varchar(250) +AS +DECLARE + @vrostergroups table(grp varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rostergroups with (nolock) WHERE rostergroups.username=@Username AND rostergroups.jid=@JID) + BEGIN + SELECT rostergroups.grp AS grp + FROM rostergroups WITH (NOLOCK) + WHERE rostergroups.username=@Username AND rostergroups.jid=@JID; + END + ELSE + BEGIN + SELECT * FROM @vrostergroups + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[get_subscription] **/ +/** Retrive the user subscription requests **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[get_subscription] + @Username varchar(250), + @JID varchar(250) +AS +DECLARE + @vrosterusers table( subscription varchar(1)) +BEGIN + IF EXISTS (SELECT username FROM rosterusers with (nolock) WHERE rosterusers.username=@Username AND rosterusers.jid=@JID) + BEGIN + SELECT rosterusers.subscription AS subscription + FROM rosterusers WITH (NOLOCK) + WHERE rosterusers.username=@Username AND rosterusers.jid=@JID; + END + ELSE + BEGIN + SELECT * FROM @vrosterusers + END +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[list_users] **/ +/** Retrive a list of all users **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[list_users] +AS +BEGIN + SELECT users.username AS username FROM users WITH (NOLOCK); +END +GO + +/******************************************************************/ +/****** Object: StoredProcedure [dbo].[set_last] **/ +/** Update users last login status **/ +/******************************************************************/ +CREATE PROCEDURE [dbo].[set_last] + @Username varchar(250), + @Seconds varchar(50), + @State varchar(100) +AS +BEGIN + IF EXISTS (SELECT username FROM [last] WITH (NOLOCK) WHERE username=@Username) + BEGIN + UPDATE [last] + SET [last].username = @Username, + [last].seconds = @Seconds, + [last].state = @State + WHERE last.username=@Username; + END + ELSE + BEGIN + INSERT INTO [last] + ( [last].username, + [last].seconds, + [last].state + ) + VALUES + ( @Username, + @Seconds, + @State + ) + END +END +GO diff --git a/src/odbc/odbc_queries.erl b/src/odbc/odbc_queries.erl new file mode 100644 index 000000000..7732e62a7 --- /dev/null +++ b/src/odbc/odbc_queries.erl @@ -0,0 +1,434 @@ +%% Copyrigh 2006, Process-one +%% This module is intended to take into account relational databases behaviour +%% differences +-module(odbc_queries). +-author("mickael.remond@process-one.net"). + +-export([get_db_type/0, + sql_transaction/2, + get_last/2, + set_last_t/4, + del_last/2, + get_password/2, + set_password_t/3, + add_user/3, + del_user/2, + del_user_return_password/3, + list_users/1, + add_spool_sql/2, + add_spool/2, + get_and_del_spool_msg_t/2, + del_spool_msg/2, + get_roster/2, + get_roster_jid_groups/2, + get_roster_groups/3, + del_user_roster_t/2, + get_roster_by_jid/3, + get_rostergroup_by_jid/3, + del_roster/3, + del_roster_sql/2, + update_roster/5, + update_roster_sql/4, + roster_subscribe/4, + get_subscription/3, + escape/1]). + +%-define(generic, true). +%-define(mssql, true). + +%% ----------------- +%% Generic queries +-ifdef(generic). + +get_db_type() -> + generic. + +sql_transaction(LServer, F) -> + ejabberd_odbc:sql_transaction(LServer, F). + +get_last(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["select seconds, state from last " + "where username='", Username, "'"]). + +set_last_t(LServer, Username, Seconds, State) -> + %% MREMOND: I think this should be turn into a non transactional behaviour + ejabberd_odbc:sql_transaction( + LServer, + [["delete from last where username='", Username, "';"], + ["insert into last(username, seconds, state) " + "values ('", Username, "', '", Seconds, "', '", State, "');"]]). + +del_last(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["delete from last where username='", Username, "'"]). + +get_password(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["select password from users " + "where username='", Username, "';"]). + +set_password_t(LServer, Username, Pass) -> + ejabberd_odbc:sql_transaction( + LServer, + [["delete from users where username='", Username ,"';"], + ["insert into users(username, password) " + "values ('", Username, "', '", Pass, "');"]]). + +add_user(LServer, Username, Pass) -> + ejabberd_odbc:sql_query( + LServer, + ["insert into users(username, password) " + "values ('", Username, "', '", Pass, "');"]). + +del_user(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["delete from users where username='", Username ,"';"]). + +del_user_return_password(_LServer, Username, Pass) -> + ejabberd_odbc:sql_query_t( + ["select password from users where username='", + Username, "';"]), + ejabberd_odbc:sql_query_t(["delete from users " + "where username='", Username, + "' and password='", Pass, "';"]). + +list_users(LServer) -> + ejabberd_odbc:sql_query( + LServer, + "select username from users"). + +add_spool_sql(Username, XML) -> + ["insert into spool(username, xml) " + "values ('", Username, "', '", + XML, + "');"]. + +add_spool(LServer, Queries) -> + ejabberd_odbc:sql_transaction( + LServer, Queries). + +get_and_del_spool_msg_t(LServer, Username) -> + F = fun() -> + Result = ejabberd_odbc:sql_query_t( + ["select username, xml from spool where username='", Username, "'" + " order by seq;"]), + ejabberd_odbc:sql_query_t( + ["delete from spool where username='", Username, "';"]), + Result + end, + ejabberd_odbc:sql_transaction(LServer,F). + +del_spool_msg(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["delete from spool where username='", Username, "';"]). + +get_roster(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["select username, jid, nick, subscription, ask, " + "askmessage, server, subscribe, type from rosterusers " + "where username='", Username, "'"]). + +get_roster_jid_groups(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["select jid, grp from rostergroups " + "where username='", Username, "'"]). + +get_roster_groups(_LServer, Username, SJID) -> + ejabberd_odbc:sql_query_t( + ["select grp from rostergroups " + "where username='", Username, "' " + "and jid='", SJID, "';"]). + +del_user_roster_t(LServer, Username) -> + ejabberd_odbc:sql_transaction( + LServer, + fun() -> + ejabberd_odbc:sql_query_t( + ["delete from rosterusers " + " where username='", Username, "';"]), + ejabberd_odbc:sql_query_t( + ["delete from rostergroups " + " where username='", Username, "';"]) + end). + +get_roster_by_jid(_LServer, Username, SJID) -> + ejabberd_odbc:sql_query_t( + ["select username, jid, nick, subscription, " + "ask, askmessage, server, subscribe, type from rosterusers " + "where username='", Username, "' " + "and jid='", SJID, "';"]). + +get_rostergroup_by_jid(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["select grp from rostergroups " + "where username='", Username, "' " + "and jid='", SJID, "'"]). + +del_roster(_LServer, Username, SJID) -> + ejabberd_odbc:sql_query_t( + ["delete from rosterusers " + " where username='", Username, "' " + " and jid='", SJID, "';"]), + ejabberd_odbc:sql_query_t( + ["delete from rostergroups " + " where username='", Username, "' " + " and jid='", SJID, "';"]). + +del_roster_sql(Username, SJID) -> + [["delete from rosterusers " + " where username='", Username, "' " + " and jid='", SJID, "';"], + ["delete from rostergroups " + " where username='", Username, "' " + " and jid='", SJID, "';"]]. + +update_roster(_LServer, Username, SJID, ItemVals, ItemGroups) -> + ejabberd_odbc:sql_query_t( + ["delete from rosterusers " + " where username='", Username, "' " + " and jid='", SJID, "';"]), + ejabberd_odbc:sql_query_t( + ["insert into rosterusers(" + " username, jid, nick, " + " subscription, ask, askmessage, " + " server, subscribe, type) " + " values (", ItemVals, ");"]), + ejabberd_odbc:sql_query_t( + ["delete from rostergroups " + " where username='", Username, "' " + " and jid='", SJID, "';"]), + lists:foreach(fun(ItemGroup) -> + ejabberd_odbc:sql_query_t( + ["insert into rostergroups(" + " username, jid, grp) " + " values (", ItemGroup, ");"]) + end, + ItemGroups). + +update_roster_sql(Username, SJID, ItemVals, ItemGroups) -> + [["delete from rosterusers " + " where username='", Username, "' " + " and jid='", SJID, "';"], + ["insert into rosterusers(" + " username, jid, nick, " + " subscription, ask, askmessage" + " server, subscribe, type) " + " values (", ItemVals, ");"], + ["delete from rostergroups " + " where username='", Username, "' " + " and jid='", SJID, "';"], + [["insert into rostergroups(" + " username, jid, grp) " + " values (", ItemGroup, ");"] || + ItemGroup <- ItemGroups]]. + +roster_subscribe(_LServer, Username, SJID, ItemVals) -> + ejabberd_odbc:sql_query_t( + ["delete from rosterusers " + " where username='", Username, "' " + " and jid='", SJID, "';"]), + ejabberd_odbc:sql_query_t( + ["insert into rosterusers(" + " username, jid, nick, " + " subscription, ask, askmessage, " + " server, subscribe, type) " + " values (", ItemVals, ");"]). + +get_subscription(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["select subscription from rosterusers " + "where username='", Username, "' " + "and jid='", SJID, "'"]). + +%% Characters to escape +escape($\0) -> "\\0"; +escape($\n) -> "\\n"; +escape($\t) -> "\\t"; +escape($\b) -> "\\b"; +escape($\r) -> "\\r"; +escape($') -> "\\'"; +escape($") -> "\\\""; +escape($\\) -> "\\\\"; +escape(C) -> C. + +-endif. + +%% ----------------- +%% MSSQL queries +-ifdef(mssql). + +get_db_type() -> + mssql. + +sql_transaction(_LServer, F) -> + {atomic, catch F()}. + +get_last(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_last '", Username, "'"]). + +set_last_t(LServer, Username, Seconds, State) -> + Result = ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.set_last '", Username, "', '", Seconds, + "', '", State, "'"]), + {atomic, Result}. + +del_last(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_last '", Username, "'"]). + +get_password(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_password '", Username, "'"]). + +set_password_t(LServer, Username, Pass) -> + Result = ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.set_password '", Username, "', '", Pass, "'"]), + {atomic, Result}. + +add_user(LServer, Username, Pass) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.add_user '", Username, "', '", Pass, "'"]). + +del_user(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_user '", Username ,"'"]). + +del_user_return_password(LServer, Username, Pass) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_user_return_password '", Username, "'"]), + Pass. + +list_users(LServer) -> + ejabberd_odbc:sql_query( + LServer, + "EXECUTE dbo.list_users"). + +add_spool_sql(Username, XML) -> + ["EXECUTE dbo.add_spool '", Username, "' , '",XML,"'"]. + +add_spool(LServer, Queries) -> + lists:foreach(fun(Query) -> + ejabberd_odbc:sql_query(LServer, Query) + end, + Queries). + +get_and_del_spool_msg_t(LServer, Username) -> + [Result] = case ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_and_del_spool_msg '", Username, "'"]) of + Rs when list(Rs) -> + lists:filter(fun({selected, _Header, _Row}) -> + true; + ({updated, _N}) -> + false + end, + Rs); + Rs -> [Rs] + end, + {atomic, Result}. + +del_spool_msg(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_spool_msg '", Username, "'"]). + +get_roster(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_roster '", Username, "'"]). + +get_roster_jid_groups(LServer, Username) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_roster_jid_groups '", Username, "'"]). + +get_roster_groups(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_roster_groups '", Username, "' , '", SJID, "'"]). + +del_user_roster_t(LServer, Username) -> + Result = ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_user_roster '", Username, "'"]), + {atomic, Result}. + +get_roster_by_jid(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_roster_by_jid '", Username, "' , '", SJID, "'"]). + +get_rostergroup_by_jid(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_rostergroup_by_jid '", Username, "' , '", SJID, "'"]). + +del_roster(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.del_roster '", Username, "', '", SJID, "'"]). + +del_roster_sql(Username, SJID) -> + ["EXECUTE dbo.del_roster '", Username, "', '", SJID, "'"]. + +update_roster(LServer, Username, SJID, ItemVals, ItemGroups) -> + Query1 = ["EXECUTE dbo.del_roster '", Username, "', '", SJID, "' "], + ejabberd_odbc:sql_query(LServer, lists:flatten(Query1)), + Query2 = ["EXECUTE dbo.add_roster_user ", ItemVals], + ejabberd_odbc:sql_query(LServer, lists:flatten(Query2)), + Query3 = ["EXECUTE dbo.del_roster_groups '", Username, "', '", SJID, "' "], + ejabberd_odbc:sql_query(LServer, lists:flatten(Query3)), + lists:foreach(fun(ItemGroup) -> + Query = ["EXECUTE dbo.add_roster_group ", + ItemGroup], + ejabberd_odbc:sql_query(LServer, + lists:flatten(Query)) + end, + ItemGroups). + +update_roster_sql(Username, SJID, ItemVals, ItemGroups) -> + ["BEGIN TRANSACTION ", + "EXECUTE dbo.del_roster_groups '", Username, "','", SJID, "' ", + "EXECUTE dbo.add_roster_user ", ItemVals, " "] ++ + [lists:flatten("EXECUTE dbo.add_roster_group ", ItemGroup, " ") + || ItemGroup <- ItemGroups] ++ + ["COMMIT"]. + +roster_subscribe(LServer, _Username, _SJID, ItemVals) -> + catch ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.add_roster_user ", ItemVals]). + +get_subscription(LServer, Username, SJID) -> + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_subscription '", Username, "' , '", SJID, "'"]). + +%% Characters to escape +escape($\0) -> "\\0"; +escape($\t) -> "\\t"; +escape($\b) -> "\\b"; +escape($\r) -> "\\r"; +escape($') -> "\''"; +escape($") -> "\\\""; +escape(C) -> C. +-endif. diff --git a/src/odbc/pg.sql b/src/odbc/pg.sql index a7059d503..32f20fdd0 100644 --- a/src/odbc/pg.sql +++ b/src/odbc/pg.sql @@ -18,7 +18,7 @@ CREATE TABLE rosterusers ( nick text, subscription character(1) NOT NULL, ask character(1) NOT NULL, - askmessage text NOT NULL, + askmessage text, server character(1) NOT NULL, subscribe text, "type" text