# # $Id: frontend.in,v 1.23 2004/02/03 22:59:11 jmmv Exp $ # bt_wizard's frontend. # # 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. # usage() { local exitstat=$1 cat 1>&2 <> $1 # NOLINT } interactive() { clear cat </dev/null; then btcmn_warn "unknown option \`$1'" else btcmn_warn "extra argument \`$1'" fi usage 1 ;; esac shift done [ ${automatic} = no ] && interactive # ------------------------------------------------------------------------ # Create directories # ------------------------------------------------------------------------ if [ ${AnsDir} != . ]; then echo -n "Entering directory ${AnsDir}..." mkdir -p ${AnsDir} cd ${AnsDir} echo " done." fi echo -n "Creating directories..." if [ ${AnsIsProg} != n ]; then echo -n " src" mkdir -p src fi if [ ${AnsIsLib} != n ]; then echo -n " data" mkdir -p data echo -n " lib" mkdir -p lib fi echo # ------------------------------------------------------------------------ # Create definitions file # ------------------------------------------------------------------------ createfile Generic.bt cat >> Generic.bt <> Generic.bt fi cat >> Generic.bt <> Generic.bt echo "config_init() {" >> Generic.bt [ ${AnsPkgconfig} = y ] && echo " bt_subrload pkgconfig" >> Generic.bt [ ${AnsThreads} = y ] && echo " bt_subrload pthread" >> Generic.bt [ ${AnsX11} = y ] && echo " bt_subrload x11" >> Generic.bt echo "}" >> Generic.bt echo >> Generic.bt echo "config() {" >> Generic.bt [ ${AnsC} = y ] && echo " bt_check_env_c" >> Generic.bt [ ${AnsCXX} = y ] && echo " bt_check_env_cxx" >> Generic.bt echo >> Generic.bt blankline=no if [ ${AnsAwk} = y ]; then echo " bt_check_prog_awk" >> Generic.bt blankline=yes fi if [ ${AnsLex} = y ]; then echo " bt_check_prog_lex" >> Generic.bt blankline=yes fi if [ ${AnsYacc} = y ]; then echo " bt_check_prog_yacc" >> Generic.bt blankline=yes fi if [ ${blankline} = yes ]; then echo >> Generic.bt fi if [ ${AnsThreads} = y ]; then echo " pthread_check" >> Generic.bt echo >> Generic.bt fi if [ ${AnsIsLib} = y ]; then echo " bt_generate_output data/${AnsName}.bpf" >> Generic.bt fi if [ ${AnsC} = y -o ${AnsCXX} = y ]; then echo " bt_generate_configh" >> Generic.bt fi echo "}" >> Generic.bt # ------------------------------------------------------------------------ # Create documentation # ------------------------------------------------------------------------ cat >> Generic.bt <> Generic.bt <> src/Logic.bt <> lib/Logic.bt <> data/Logic.bt </dev/null 2>&1 || true } } EOF echo " done." fi return 0 } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh