#! /bin/bash # # $HEADER$ # # This script is run on developer copies of LAM/MPI -- *not* # distribution tarballs. ############################################################################## # # User-definable parameters (search path and minimum supported versions) # ############################################################################## lam_aclocal_search="aclocal" lam_autoheader_search="autoheader" lam_autoconf_search="autoconf" lam_libtoolize_search="libtoolize glibtoolize" lam_automake_search="automake" lam_automake_version="1.6" lam_autoconf_version="2.58" lam_libtool_version="1.5" ############################################################################## # # Global variables - should not need to modify defaults # ############################################################################## lam_aclocal_version="$lam_automake_version" lam_autoheader_version="$lam_autoconf_version" lam_libtoolize_version="$lam_libtool_version" # program names to execute lam_aclocal="" lam_autoheader="" lam_autoconf="" lam_libtoolize="" lam_automake="" ############################################################################ # # Version check - does major,minor,release check (hopefully ignoring # beta et al) # # INPUT: # - minimum version allowable # - version we found # # OUTPUT: # - 0 version is ok # - 1 version is not ok # # SIDE EFFECTS: # none # ############################################################################## check_version() { local min_version="$1" local version="$2" local min_major_version="`echo $min_version | cut -f1 -d.`" local min_minor_version="`echo $min_version | cut -f2 -d.`" local min_release_version="`echo $min_version | cut -f3 -d.`" if test "$min_release_version" = "" ; then min_release_version=0 fi local major_version="`echo $version | cut -f1 -d.`" local minor_version="`echo $version | cut -f2 -d.`" local release_version="`echo $version | cut -f3 -d.`" if test "$release_version" = "" ; then release_version=0 fi if test $min_major_version -lt $major_version ; then return 0 elif test $min_major_version -gt $major_version ; then return 1 fi if test $min_minor_version -lt $minor_version ; then return 0 elif test $min_minor_version -gt $minor_version ; then return 1 fi if test $min_release_version -gt $release_version ; then return 1 fi return 0 } ############################################################################## # # find app - find a version of the given application that is new # enough for use # # INPUT: # - name of application (eg aclocal) # # OUTPUT: # none # # SIDE EFFECTS: # - sets application_name variable to working executable name # - aborts on error finding application # ############################################################################## find_app() { local app_name="$1" local version="0.0.0" local min_version="99.99.99" local found=0 eval "min_version=\"\$lam_${app_name}_version\"" eval "search_path=\"\$lam_${app_name}_search\"" for i in $search_path ; do version="`${i} --version 2>&1`" if test "$?" != 0 ; then continue fi version="`echo $version | cut -f2 -d')'`" version="`echo $version | cut -f1 -d' '`" if check_version $min_version $version ; then eval "lam_${app_name}=\"${i}\"" found=1 fi done if test "$found" = "0" ; then cat < Errr... there's no configure.in or configure.ac file!" fi if test -n "$fad_cfile"; then auxdir="`grep AC_CONFIG_AUX_DIR $fad_cfile | cut -d\( -f 2 | cut -d\) -f 1`" fi if test -f "$auxdir/$fad_file"; then rm -f "$auxdir/$fad_file" fi fi } ############################################################################## # # main - do the real work... # ############################################################################## # announce echo "[Checking] prerequisites" # sanity check to make sure user isn't being stupid if test ! -d CVS ; then cat < configure.new mv configure.new configure chmod a+x configure run_and_check $lam_libtoolize --automake --copy run_and_check $lam_automake --foreign -a --copy --include-deps # All done exit 0