Changeset 35


Ignore:
Timestamp:
Jun 3, 2006 2:25:47 AM (14 years ago)
Author:
andreasw
Message:

improved check for correct version of autotools

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r34 r35  
    805805  rm -f confauto.out
    806806
     807  # Check if the executable autoconf is picked up from the correct location
     808  AC_MSG_CHECKING([whether autoconf is coming from the correct location])
     809  autoconf_dir=`which autoconf | sed -e 's=/autoconf=='`
     810  autoconf_dir=`cd $autoconf_dir; pwd`
     811  if test x$AUTOTOOLS_DIR = x; then
     812    want_dir=$HOME/bin
     813  else
     814    want_dir=$AUTOTOOLS_DIR/bin
     815  fi
     816  if test $autoconf_dir = `cd $want_dir; pwd`; then
     817    AC_MSG_RESULT([yes])
     818  else
     819    rm -f confauto.out
     820    AC_MSG_RESULT([no])
     821    AC_MSG_ERROR([The autoconf executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
     822  fi
     823
    807824  # Check if we have automake
    808825  AC_CHECK_PROG([have_automake],[automake],[yes],[no])
     
    825842  rm -f confauto.out
    826843
     844  # Check if the executable automake is picked up from the correct location
     845  AC_MSG_CHECKING([whether automake is coming from the correct location])
     846  automake_dir=`which automake | sed -e 's=/automake=='`
     847  automake_dir=`cd $automake_dir; pwd`
     848  if test x$AUTOTOOLS_DIR = x; then
     849    want_dir=$HOME/bin
     850  else
     851    want_dir=$AUTOTOOLS_DIR/bin
     852  fi
     853  if test $automake_dir = `cd $want_dir; pwd`; then
     854    AC_MSG_RESULT([yes])
     855  else
     856    rm -f confauto.out
     857    AC_MSG_RESULT([no])
     858    AC_MSG_ERROR([The automake executable should be picked up from \$HOME/bin or \$AUTOTOOLS_DIR/bin.])
     859  fi
     860
    827861  # Check if we can find the libtool file
    828   if test "${LIBTOOLPREFIX:+set}" != set; then
    829     for p in $HOME ; do
    830       AC_CHECK_FILE([$p/share/aclocal/libtool.m4],
    831                     [LIBTOOLM4="$p/share/aclocal/libtool.m4"
    832                      LIBTOOLPREFIX="$p"],)
    833       if test x"$LIBTOOLM4" != x; then
    834         break;
    835       fi
    836     done
    837     if test x"$LIBTOOLM4" = x; then
    838       AC_MSG_ERROR([You specified you want to use maintainer mode, but I cannot find the file libtool.m4 on your system.  Please set the prefix of the location of the correct file with the LIBTOOLPREFIX variable, so that it is in $LIBTOOLPREFIX/share/aclocal.  We assume here that it is the plain version obtained from the GNU tarball.])
    839     fi
     862  if test x$AUTOTOOLS_DIR = x; then
     863    want_dir=$HOME/share
    840864  else
    841     AC_CHECK_FILE([$LIBTOOLPREFIX/share/aclocal/libtool.m4],
    842                   [LIBTOOLM4="$LIBTOOLPREFIX/share/aclocal/libtool.m4"],
    843                   [AC_MSG_ERROR([You specified LIBTOOLPREFIX, but I cannot find the file libtool.m4 in $LIBTOOLPREFIX/share/aclocal.])])
    844   fi
     865    want_dir=$AUTOTOOLS_DIR/share
     866  fi
     867  AC_CHECK_FILE([$want_dir/aclocal/libtool.m4],
     868                [LIBTOOLM4="$want_dir/aclocal/libtool.m4"],
     869                [AC_MSG_ERROR([I cannot find the libtool.m4 file.])])
    845870
    846871  # Check if this is the correct version of libtool (with escaped dots)
    847872  correct_version='1.5.22'
    848873  grep_version=`echo  $correct_version | sed -e 's/\\./\\\\\\./g'`
    849   AC_CHECK_FILE([$LIBTOOLPREFIX/share/libtool/ltmain.sh],
     874  AC_CHECK_FILE([$want_dir/libtool/ltmain.sh],
    850875                [have_ltmain=yes],
    851876                [have_ltmain=no])
    852877  AC_MSG_CHECKING([whether we are using the correct version ($correct_version) of libtool.])
    853878  if test $have_ltmain = yes; then
    854     if $EGREP $grep_version $LIBTOOLPREFIX/share/libtool/ltmain.sh >/dev/null 2>&1; then
     879    if $EGREP $grep_version $want_dir/libtool/ltmain.sh >/dev/null 2>&1; then
    855880      AC_MSG_RESULT([yes])
    856881    else
    857882      AC_MSG_RESULT([no])
    858       AC_MSG_ERROR([You don't have the correct version of libtool.  Please set LIBTOOLPREFIX to the correct installation prefix, so that the correct version of ltmain.sh is in $LIBTOOLPREFIX/share/libtool.])
     883      AC_MSG_ERROR([You don't have the correct version of libtool.])
    859884    fi
    860885  else
    861     AC_MSG_ERROR([I cannot find the file ltmain.sh in $LIBTOOLPREFIX/share/libtool])
     886    AC_MSG_RESULT([no])
     887    AC_MSG_ERROR([I cannot find the ltmain.sh file.])
    862888  fi 
    863889
  • trunk/run_autotools

    r29 r35  
    2121cp $toolsdir/config.guess $toolsdir/config.sub $toolsdir/depcomp $toolsdir/install-sh $toolsdir/ltmain.sh $toolsdir/missing .
    2222
     23if test x$AUTOTOOLS_DIR = x; then
     24  AUTOTOOLS_DIR=$HOME
     25fi
     26
    2327for dir in $dirs; do
    2428  (cd $dir
    2529   echo creating acinclude.m4 in $dir
    26    cat $HOME/share/aclocal/libtool.m4 $toolsdir/coin.m4> acinclude.m4
     30   cat $AUTOTOOLS_DIR/share/aclocal/libtool.m4 $toolsdir/coin.m4> acinclude.m4
    2731   echo running aclocal in $dir
    2832   aclocal
Note: See TracChangeset for help on using the changeset viewer.