#!/bin/sh # # ${R_HOME}/bin/SHLIB # @configure_input@ revision='$Revision: 1.16.2.1 $' version=`set - ${revision}; echo ${2}` version="R shared library builder ${version} Copyright (C) 2000 The R Core Development Team. This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO warranty." usage="Usage: R CMD SHLIB [options] files Build a shared library for dynamic loading from the specified source or object files (which are automagically made from their sources). If not given via \`--output', the name for the library is determined from the first file. Options: -h, --help print short help message and exit -v, --version print version info and exit -o, --output=LIB use LIB as (full) name for the built library Report bugs to ." lib= objs= MAKE=${MAKE-@MAKE@} makeargs= makefiles="-f ${R_HOME}/etc/Makeconf" with_cxx=false with_f77=false while test -n "${1}"; do case ${1} in -h|--help) echo "${usage}"; exit 0 ;; -v|--version) echo "${version}"; exit 0 ;; -o) lib=${2}; shift ;; --output=*) lib=`echo "${1}" | sed -e 's/[^=]*=//'` ;; *.cc|*.cpp|.*C) with_cxx=true if test -z "${lib}"; then lib="`echo ${1} | sed 's/\.[^\.][^\.]*$/.@SHLIB_EXT@/'`" fi objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;; *.f) with_f77=true if test -z "${lib}"; then lib="`echo ${1} | sed 's/\.[^\.][^\.]*$/.@SHLIB_EXT@/'`" fi objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;; *.[co]) if test -z "${lib}"; then lib="`echo ${1} | sed 's/\.[^\.][^\.]*$/.@SHLIB_EXT@/'`" fi objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;; esac shift done if test -r Makevars; then makefiles="-f Makevars ${makefiles}" fi makeargs="SHLIB=\"${lib}\" OBJS=\"${objs}\"" if ${with_cxx}; then makeargs="SHLIB_LDFLAGS='\$(SHLIB_CXXLDFLAGS)' ${makeargs}" makeargs="SHLIB_LD='\$(SHLIB_CXXLD)' ${makeargs}" fi if ${with_f77}; then makeargs="${makeargs} SHLIB_LIBADD='\$(FLIBS)'" fi eval ${MAKE} ${makefiles} ${makeargs} ### Local Variables: *** ### mode: sh *** ### sh-indentation: 2 *** ### End: ***