# # $Id: library.subr.in,v 1.17 2004/05/13 18:26:09 jmmv Exp $ # Library type specification. # # 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. # BT_TARGET_DEFS="${BT_TARGET_DEFS} BT_INCLUDES BT_INCLUDESDIR BT_MANPAGES \ BT_OBJECTS BT_SOURCES" library_defs() { local target="${1}" local src : ${BT_INCLUDESDIR:=${BT_DIR_INCLUDE}} if [ ${BT_LIB_MKSTATIC} = yes ]; then BT_DEPENDS+=${BT_TARGET}_archive eval "target_${BT_TARGET}_archive() { \ BT_TYPE=\"archive\"; \ BT_BASENAME=\"lib${target}\"; \ BT_SOURCES=\"${BT_SOURCES}\"; \ BT_LIB_MKPIC=no; \ BT_LIB_MKSTATIC=yes; \ }" fi if [ ${BT_LIB_MKPIC} = yes ]; then BT_DEPENDS+=${BT_TARGET}_shlib eval "target_${BT_TARGET}_shlib() { \ BT_TYPE=\"shlib\"; \ BT_BASENAME=\"lib${target}\"; \ BT_SOURCES=\"${BT_SOURCES}\"; \ BT_LIB_MAJOR=\"${BT_LIB_MAJOR}\"; \ BT_LIB_MINOR=\"${BT_LIB_MINOR}\"; \ BT_LIB_MICRO=\"${BT_LIB_MICRO}\"; \ }" fi BT_FIX_PATHS+=BT_INCLUDES BT_DEPENDS+=${BT_MANPAGES} } library_deinstall() { local inc incdir local mp mpdir for inc in ${BT_INCLUDES}; do eval incdir=\"\${BT_INCLUDESDIR_$(echo ${inc##*/} | tr . _)}\" : ${incdir:=${BT_INCLUDESDIR}} bt_remove ${incdir}/${inc##*/} rmdir -p ${incdir} 2>/dev/null || true done for mp in ${BT_MANPAGES}; do mpdir=${BT_DIR_MAN}/man$(echo ${mp} | sed -e 's/.*\.\([0-9]*\)$/\1/') bt_remove ${mpdir}/${mp##*/} rmdir -p ${mpdir} 2>/dev/null || true done } library_install() { local inc incdir local mp mpdir for inc in ${BT_INCLUDES}; do eval incdir=\"\${BT_INCLUDESDIR_$(echo ${inc##*/} | tr . _)}\" : ${incdir:=${BT_INCLUDESDIR}} bt_install_dir ${incdir} bt_install_data ${inc} ${incdir} done for mp in ${BT_MANPAGES}; do mpdir=${BT_DIR_MAN}/man$(echo ${mp} | sed -e 's/.*\.\([0-9]*\)$/\1/') bt_install_dir ${mpdir} bt_install_data ${mp} ${mpdir} done } # Local Variables: *** # mode: shell-script *** # End: *** # vim: syntax=sh