# # $Id: envs.in,v 1.5 2003/09/26 17:03:32 jmmv Exp $ # Detect language environments. # # 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. # # -------------------------------------------------------------------- # Language environments # -------------------------------------------------------------------- bt_define_ml_check bt_check_env __GNUC_WARN="-Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wpointer-arith -Wreturn-type -Wswitch \ -Wcast-qual -Wwrite-strings" bt_check_env_c() { local lang wflag [ ${BT_ENV_C:-NULL} != NULL ] && return lang=${Language} bt_language_select c bt_check_prog_cc bt_check_prog_cpp bt_check_prog_ld bt_check_hdr_std_c bt_language_select ${lang} BT_ENV_C=yes if [ $(echo ${BT_FEATURE_DEVELOPER} | swcase -ld) = yes ]; then if [ ${BT_PROG_CC_NAME} = gnu ]; then for wflag in -g ${__GNUC_WARN} ${BT_FLAGS_CC_WARN}; do bt_check_prog_cc_flag ${wflag} && \ BT_FLAGS_CC+=${wflag} done fi fi bt_check_lib_howto bt_check_prog_depgen } bt_check_env_cxx() { local lang wflag [ ${BT_ENV_CXX:-NULL} != NULL ] && return lang=${Language} bt_language_select cxx bt_check_prog_cxx bt_check_prog_cpp bt_check_prog_ld bt_check_hdr_std_cxx bt_language_select ${lang} BT_ENV_CXX=yes if [ $(echo ${BT_FEATURE_DEVELOPER} | swcase -ld) = yes ]; then if [ ${BT_PROG_CXX_NAME} = gnu ]; then for wflag in -g ${__GNUC_WARN} ${BT_FLAGS_CXX_WARN}; do bt_check_prog_cxx_flag ${wflag} && \ BT_FLAGS_CXX+=${wflag} done fi fi bt_check_lib_howto bt_check_prog_depgen } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh