#!/usr/lib/buildtool/bt_sh
# $Id: sh_head.in,v 1.29 2004/05/08 20:05:19 jmmv Exp $
# Common header for shell scripts, including shared functions.
#
# buildtool
# Copyright (c) 2003, 2004 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

ProgName=${0##*/}
LogName=

ConfigFile=
DefsFile=
DocsFile=
LogicFile=

# -------------------------------------------------------------------------

#
# btcmn_err message
#   Show error message on stderr and exit with error status.
#
btcmn_err() {
    local spaces="$(echo ${ProgName} | sed -e 's/./ /g')"

    echo "${ProgName}: $1" 1>&2
    shift
    while [ $# -gt 0 ]; do
        echo "${spaces}  $1" 1>&2
        shift
    done
    exit 1
}

# -------------------------------------------------------------------------

#
# btcmn_warn message
#   Show warning message on stderr.
#
btcmn_warn() {
    local spaces="$(echo ${ProgName} | sed -e 's/./ /g')"

    echo "${ProgName}: $1" 1>&2
    shift
    while [ $# -gt 0 ]; do
        echo "${spaces}  $1" 1>&2
        shift
    done
}

# -------------------------------------------------------------------------

#
# btcmn_log_start name
#    Open the given log file and add a header to it for the current
#    session.
#
btcmn_log_start() {
    LogName=$1
    [ -f ${LogName} ] && echo >> ${LogName}
    echo "-------------------------------------------------------------------------" >> ${LogName} # NOLINT
    echo "LOG STARTED FOR MODULE ${ProgName} ON $(date)" >> ${LogName}
    echo >> ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_log_name
#    Get the current log name.
#
btcmn_log_name() {
    echo ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_log_msg text
#    Append the given message to the log file.
#
btcmn_log_msg() {
    echo $* >> ${LogName}
}

# -------------------------------------------------------------------------

#
# btcmn_req_project
#   Check if we are executing Buildtool inside a buildtoolized project.
#   If so, set BT_TOPDIR to its top directory, set all *File variables
#   pointing to the right script, check if the current Buildtool version
#   is enough to work with this project and automatically source the defs
#   block.  The function does not return if the check fails.
#
btcmn_req_project() {
    local major minor oldpwd

    config() {
        btcmn_err "no config() function defined; cannot continue."
    }

    defs() {
        btcmn_err "no defs() function defined; cannot continue."
    }

    docs() {
        btcmn_err "no docs() function defined; cannot continue."
    }

    oldpwd=$(pwd)
    BT_TOPDIR=
    while [ -z "${BT_TOPDIR}" -a $(pwd) != / ]; do
        if [ -f Generic.bt -o -f Defs.bt ]; then
            BT_TOPDIR=$(pwd)
        else
            cd ..
        fi
    done
    [ -z "${BT_TOPDIR}" ] &&
        btcmn_err \
            "this module needs to be run from inside a Buildtool project"

    if [ -f Config.bt ]; then
        ConfigFile=${BT_TOPDIR}/Config.bt
    else
        ConfigFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Defs.bt ]; then
        DefsFile=${BT_TOPDIR}/Defs.bt
    else
        DefsFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Docs.bt ]; then
        DocsFile=${BT_TOPDIR}/Docs.bt
    else
        DocsFile=${BT_TOPDIR}/Generic.bt
    fi

    if [ -f Logic.bt ]; then
        LogicFile=${BT_TOPDIR}/Logic.bt
    else
        LogicFile=${BT_TOPDIR}/Generic.bt
    fi

    cd ${oldpwd}

    [ -f Logic.bt ] && LogicFile=$(pwd)/Logic.bt

    BT_REQUIRE=
    . ${DefsFile}
    defs
    if [ -z "${BT_REQUIRE}" ]; then
        btcmn_err "broken package; does not define BT_REQUIRE"
    fi

    major=$(echo ${BT_REQUIRE} | cut -d . -f 1)
    minor=$(echo ${BT_REQUIRE} | cut -d . -f 2)

    [ ${major} -ne 0 -a ${major} -ne 0 ] && \
        btcmn_err "this package requires the Buildtool ${major}.x branch"
    [ ${minor} -gt 16 ] && \
        btcmn_err "this package requires Buildtool ${BT_REQUIRE}"
}

# -------------------------------------------------------------------------

#
# btcmn_req_config
#   Check for the presence of the config script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_config() {
    [ ! -f ${ConfigFile} ] && btcmn_err "cannot open ${ConfigFile}"
    config_init() { return 0; }
    config() { return 0; }
    . ${ConfigFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_defs
#   Check for the presence of the defs script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_defs() {
    [ ! -f ${DefsFile} ] && btcmn_err "cannot open ${DefsFile}"
    defs() { return 0; }
    . ${DefsFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_docs
#   Check for the presence of the docs script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_docs() {
    [ ! -f ${DocsFile} ] && btcmn_err "cannot open ${DocsFile}"
    docs() { return 0; }
    . ${DocsFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_logic
#   Check for the presence of the logic script and source it if found.
#   Does not return if the file is not found.
#
btcmn_req_logic() {
    [ ! -f ${LogicFile} ] && btcmn_err "cannot open ${LogicFile}"
    logic() { return 0; }
    . ${LogicFile}
}

# -------------------------------------------------------------------------

#
# btcmn_req_runtime
#   Check if we were executed by the main buildtool wrapper program.
#
btcmn_req_runtime() {
    if [ ${__BUILDTOOL:-no} != yes ]; then
        btcmn_err "this program must be run through Buildtool"
    fi
}

# -------------------------------------------------------------------------

#
# btcmn_run_module module [args]
#   Execute the given module passing all extra arguments to it.
#
btcmn_run_module() {
    local module="$1"; shift

    case ${module} in
        config)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_config ${BT_PKG_CONFIG_FLAGS} "$@"
            ;;
        dist)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_dist ${BT_PKG_DIST_FLAGS} "$@"
            ;;
        doc)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_doc ${BT_PKG_DOC_FLAGS} "$@"
            ;;
        lint)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_lint ${BT_PKG_LINT_FLAGS} "$@"
            ;;
        logic)
            btcmn_req_project
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_logic ${BT_PKG_LOGIC_FLAGS} "$@"
            ;;
        pkgflags)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_pkgflags "$@"
            ;;
        swcgen)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_swcgen "$@"
            ;;
        wizard)
            __BUILDTOOL=yes /usr/lib/buildtool/bt_sh ${BT_SH_FLAGS} \
                /usr/lib/buildtool/bt_wizard "$@"
            ;;
        *)
            btcmn_err "no such module \`${module}' (internal error)"
            ;;
    esac
}

# -------------------------------------------------------------------------

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
#
# $Id: frontend.in,v 1.14 2003/09/25 18:08:01 jmmv Exp $
# Generate system wide cache files for bt_config.
#
# buildtool
# Copyright (c) 2003 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

InFile="/etc/buildtool/bt_config.conf.in"
OutFile="/etc/buildtool/bt_config.conf"
TmpDir=/tmp/bt_swcgen.$$

usage() {
    local exitstat=$1

    cat 1>&2 <<EOF
buildtool version 0.16 - ${ProgName} module
usage: ${ProgName} [options]

Available options:
    {-h,--help}            Show this help message.
    {-i ,--input=}file     Input file.
    {-o ,--output=}file    Output file.

By default, the following files are used:
Input:  ${InFile}
Output: ${OutFile}

See buildtool(1) for more information.
EOF

    exit ${exitstat}
}

main() {
    btcmn_req_runtime

    while [ $# -gt 0 ]; do
        case $1 in
            -h|--help)
                usage 0
                ;;
            -i)
                InFile=$2; shift
                ;;
            --input=*)
                InFile=$(echo $1 | sed -e 's|--input=||')
                ;;
            -o)
                OutFile=$2; shift
                ;;
            --output=*)
                OutFile=$(echo $1 | sed -e 's|--output=||')
                ;;
            *)
                btcmn_warn "unknown argument \`$1'"
                usage 1
                ;;
        esac
        shift
    done

    if [ -d ${TmpDir} ]; then
        btcmn_err "${TmpDir} exists; cannot continue"
    fi

    if [ ! -f ${InFile} ]; then
        echo "Failed to open input configuration file from:" 1>&2
        echo "    ${InFile}" 1>&2
        echo "To get started, copy and modify the sample file located in:" 1>&2
        echo "    /usr/share/buildtool/templates/bt_config.conf.in" 1>&2
        btcmn_err "cannot open ${InFile}"
    fi

    echo "Input:  ${InFile}"
    echo "Output: ${OutFile}"
    echo

    echo "${ProgName}: running bt_wizard to create temporary project skeleton"
    btcmn_run_module wizard -a -n bt_swcgen -v 0.16 -d ${TmpDir}

    echo "${ProgName}: generating configuration script and cache"
    generate_out_conf ${InFile} ${TmpDir}/conf.in
    generate_out_script ${InFile} ${TmpDir}/Config.bt

    ( cd ${TmpDir} && btcmn_run_module config --ignore-sw-config \
        --dir-etc=/etc/buildtool --enable-developer )
    if [ $? -ne 0 ]; then
        btcmn_err "configuration failed; check the ${TmpDir}/bt_config.log log file for details." # NOLINT
    fi

    echo "${ProgName}: creating system wide configuration file"
    ${TmpDir}/bt_output ${TmpDir}/conf
    cp ${TmpDir}/conf ${OutFile}
    echo "${ProgName}: ${OutFile} created"

    rm -rf ${TmpDir}

    cat << EOF

===========================================================================
PLEASE NOTE THE FOLLOWING:

    Installed: ${OutFile}

    By using a system wide configuration file for bt_config that stores
    check results, you assume that they may get obsoleted with respect to
    your system, specially after software updates.  Be careful to only
    store results that are unlikely to change with time.  Anyway, you are
    encouraged to re-run this program periodically to regenerate the file
    with new results.

    If a third party program fails to configure after a check that shows
    the \`(cached)' string in it, try to pass the \`--ignore-sw-config'
    flag to bt_config before thinking it is a bug in your system or in
    the package.  DO NOT DISTURB SOFTWARE AUTHORS BEFORE DOUBLE CHECKING
    THAT THERE IS A PROBLEM IN THEIR SOFTWARE.  YOU HAVE BEEN WARNED.
===========================================================================

EOF

    return 0
}

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
#
# $Id: out.in,v 1.9 2004/05/14 15:28:47 jmmv Exp $
# Generate files used by bt_swcgen at runtime.
#
# buildtool
# Copyright (c) 2003, 2004 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

generate_out_conf() {
    local src="$1" dest="$2"

    rm -f ${dest}
    Mode=conf . ${src} >> ${dest}
}

generate_out_script() {
    local src="$1" dest="$2"

    cat >${dest} <<EOF
config() {
    TIMESTAMP="$(date)"
    bt_subst TIMESTAMP

EOF

    Mode=script . ${src} >> ${dest}

    cat >>${dest} <<EOF
    bt_subst_cache
    bt_generate_output
}
EOF
}

varname() {
    echo $* | swcase -ud
}

printconf() {
    echo ": \${$1:=\"@$1@\"}"
}

bt_cache_attribute() {
    case ${Mode} in
        conf)
            printconf BT_HAVE_KEYWORD_C_ATTRIBUTE
            printconf BT_HAVE_KEYWORD_CXX_ATTRIBUTE
            ;;
        script)
            echo bt_check_attribute_c
            echo bt_check_attribute_cxx
            ;;
    esac
}

__GNUC_WARN="-Wall -Wstrict-prototypes -Wmissing-prototypes \
             -Wpointer-arith -Wreturn-type -Wswitch \
             -Wcast-qual -Wwrite-strings"

bt_cache_env() {
    local flag

    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                case $1 in
                    c)
                        bt_cache_prog cc
                        for flag in -g ${__GNUC_WARN}; do
                            printconf BT_PROG_HAVE_FLAG_C_$(varname ${flag})
                        done
                        ;;
                    cxx)
                        bt_cache_prog cxx
                        for flag in -g ${__GNUC_WARN}; do
                            printconf BT_PROG_HAVE_FLAG_CXX_$(varname ${flag})
                        done
                        ;;
                esac
                ;;
            script)
                echo bt_check_env_$1
                ;;
        esac
        shift
    done

    if [ ${Mode} = conf ]; then
        bt_cache_prog cpp ld
        bt_cache_hdr stdio.h sys/types.h sys/stat.h stdlib.h string.h unistd.h
        bt_cache_lib_howto
    fi
}

bt_cache_func() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                printconf BT_HAVE_FUNC_C_$(varname $1)
                printconf BT_HAVE_FUNC_CXX_$(varname $1)
                ;;
            script)
                echo "bt_check_func_c $1"
                echo "bt_check_func_cxx $1"
                ;;
        esac
        shift
    done
}

bt_cache_hdr() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                printconf BT_HAVE_HDR_C_$(varname $1)
                printconf BT_HAVE_HDR_CXX_$(varname $1)
                ;;
            script)
                echo "bt_check_hdr_c $1"
                echo "bt_check_hdr_cxx $1"
                ;;
        esac
        shift
    done
}

bt_cache_lib() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                printconf BT_HAVE_LIB_C_$(varname $1)
                printconf BT_HAVE_LIB_CXX_$(varname $1)
                ;;
            script)
                echo "bt_check_lib_c $1"
                echo "bt_check_lib_cxx $1"
                ;;
        esac
        shift
    done
}

bt_cache_lib_howto() {
    case ${Mode} in
        conf)
            bt_cache_prog ar ranlib
            printconf BT_LIB_MKPIC
            printconf BT_LIB_MKSTATIC
            printconf BT_LIB_PIC_COMPILE_PREARGS
            printconf BT_LIB_PIC_SONAME
            printconf BT_LIB_PIC_LINK_PREARGS
            printconf BT_LIB_PIC_LINK_POSTARGS
            printconf BT_LINK_FLAG_RPATH
            printconf BT_LINK_FLAG_EXPORTDYNAMIC
            ;;
        script)
            echo bt_check_lib_howto
            ;;
    esac
}

bt_cache_prog() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                case $1 in
                    cc)
                        printconf BT_PROG_CC
                        printconf BT_PROG_CC_NAME
                        printconf BT_PROG_CC_VERSION
                        ;;
                    cxx)
                        printconf BT_PROG_CXX
                        printconf BT_PROG_CXX_NAME
                        printconf BT_PROG_CXX_VERSION
                        ;;
                    info)
                        printconf BT_PROG_MAKEINFO
                        printconf BT_PROG_INSTALLINFO
                        ;;
                    lex)
                        printconf BT_PROG_LEX
                        printconf BT_LIBS_LEX
                        ;;
                    make)
                        printconf BT_PROG_MAKE
                        printconf BT_PROG_MAKE_TYPE
                        ;;
                    *)
                        printconf BT_PROG_$(varname $1)
                        ;;
                esac
                ;;
            script)
                case $1 in
                    cc|cxx|info|lex|make)
                        echo "bt_check_prog_$1"
                        ;;
                    *)
                        echo "bt_check_progs BT_PROG_$(varname $1) $1"
                        ;;
                esac
                ;;
        esac
        shift
    done
}

bt_cache_sizeof() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                printconf BT_SIZEOF_C_$(varname $1)
                printconf BT_SIZEOF_CXX_$(varname $1)
                ;;
            script)
                echo "bt_check_sizeof_c \"$1\""
                echo "bt_check_sizeof_cxx \"$1\""
                ;;
        esac
        shift
    done
}

bt_cache_type() {
    while [ $# -gt 0 ]; do
        case ${Mode} in
            conf)
                printconf BT_HAVE_TYPE_C_$(varname $1)
                printconf BT_HAVE_TYPE_CXX_$(varname $1)
                ;;
            script)
                echo "bt_check_type_c $1"
                echo "bt_check_type_cxx $1"
                ;;
        esac
        shift
    done
}

bt_echo() {
    [ ${Mode} = conf ] || return
    while [ ${#} -gt 0 ]; do
        echo "${1}"
        shift
    done
}

bt_source() {
    [ ${Mode} = conf ] || return
    if [ ${#} -gt 0 ]; then
        while [ ${#} -gt 0 ]; do
            cat ${1}
            shift
        done
    else
        cat
    fi
}

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
#
# $Id: sh_tail.in,v 1.3 2003/09/23 16:40:23 jmmv Exp $
# Common footer for shell scripts.
#
# buildtool
# Copyright (c) 2003 Julio M. Merino Vidal.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the author nor the names of contributors may
#    be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

main "$@"

# Local Variables: ***
# mode: shell-script ***
# End: ***
# vim: syntax=sh
