dnl dnl Process this file with autoconf-2.3 (and greater) to produce a dnl configure script. dnl dnl dnl Initialize, check autoconf version and add our bin directory to dnl those autoconf will search for binaries. dnl echo "starting MWRANK configuration ..." AC_INIT() AC_PREREQ(2.3) dnl dnl Checks for the C++ compiler. dnl AC_PROG_CC AC_PROG_CPP AC_PROG_CXX dnl dnl Checks for ranlib. Use echo if we don't have ranlib. dnl AC_CHECK_PROG(RANLIB, ranlib, ranlib) if test -z "$RANLIB" ; then RANLIB="echo" fi AC_SUBST(RANLIB) dnl dnl Checks for libraries libm.a, libstdc++.a dnl warn_missing_library() { if test "$1" = "no" ; then echo "configure:: warning:: missing lib$2.a. Linking programs may" echo " not work! In case of problems, please" echo " install \"lib$2.a\" and recompile." fi } AC_CHECK_LIB(m, main, M_LIB="-lm",M_LIB="") warn_missing_library $ac_cv_lib_m_main m AC_SUBST(M_LIB) AC_CHECK_LIB(g++, main, GXX_LIB="-lg++",GXX_LIB="") warn_missing_library $ac_cv_lib_g++_main g++ AC_SUBST(GXX_LIB) AC_CHECK_LIB(stdc++, main, STDCXX_LIB="-lstdc++",STDCXX_LIB="") warn_missing_library $ac_cv_lib_stdc++_main stdc++ AC_SUBST(STDCXX_LIB) dnl dnl Checks for library function times dnl AC_CHECK_FUNCS(times) dnl dnl Checks for canonical host name. dnl AC_CANONICAL_HOST dnl dnl Get CPU name for the installation procedure. dnl ARCH="$host_cpu-$host_vendor-$host_os" AC_SUBST(ARCH) dnl dnl Ask for the usage of the LiDIA library dnl echo " " echo "You will be now asked for some additional information to" echo "complete the configuration on your system. To most of the" echo "following questions you can reply by simply typing a cha-" echo "racter followed by RETURN." YES="y" NO="n" DONE=$NO while test $DONE != $YES; do echo " " echo "Do you want to use the LiDIA library (y/n) ? " read ANSWER if test $ANSWER = $YES -o $ANSWER = $NO; then USER_ANSWER=$ANSWER DONE=$YES else echo "Please enter y for YES and n for NO." fi done if test $USER_ANSWER = $YES ; then PURE_MODE=1 MIXED_MODE=2 DONE=$NO echo " " echo "You can compile the MWRANK program using LiDIA in two different modes" echo " " echo "1 - pure mode: uses LiDIA bigints, bigrationals and bigfloats" echo "2 - mixed mode: uses LiDIA bigints, bigrationals and doubles" while test $DONE != $YES; do echo " " echo "Which mode do you prefer (1/2) ? " read ANSWER if test $ANSWER = $PURE_MODE -o $ANSWER = $MIXED_MODE; then USER_ANSWER=$ANSWER DONE=$YES else echo "Please enter 1 for pure mode and 2 for mixed mode." fi done COMPILE=$USER_ANSWER echo " " echo "As the last action, you have to enter the paths to the directories" echo "containing LiDIA's include files and library for the architecture" echo " " echo " $ARCH" echo " " DONE=$NO while test $DONE != $YES ; do echo " " echo "Enter the path to the directory contaning LiDIA's include files"; read LIDIAINCDIR if test -d $LIDIAINCDIR ; then if test -d $LIDIAINCDIR/LiDIA ; then DONE=$YES else echo "There is no LiDIA subdirectory in $LIDIAINCDIR!" fi else echo "$LIDIAINCDIR is not a valid directory!" fi done DONE=$NO while test $DONE != $YES ; do echo " " echo "Enter the path to the directory contaning LiDIA's library"; read LIDIALIBDIR if test -d $LIDIALIBDIR ; then if test -f $LIDIALIBDIR/libLiDIA.a ; then DONE=$YES else echo "There is no libLiDIA.a in $LIDIALIBDIR!" fi else echo "$LIDIALIBDIR is not a valid directory!" fi done AC_SUBST(LIDIAINCDIR) AC_SUBST(LIDIALIBDIR) else DONE=$NO while test $DONE != $YES; do echo " " echo "Do you want to use NTL (y/n) ? " read ANSWER if test $ANSWER = $YES -o $ANSWER = $NO; then USER_ANSWER=$ANSWER DONE=$YES else echo "Please enter y for YES and n for NO." fi done if test $USER_ANSWER = $YES ; then COMPILE=3 echo " " echo "The NTL include files and library are expected to be in " echo "standard places, e.g. /usr/local/include for NTL/*.h and " echo "/usr/local/lib for libntl.a" echo "If not, manually edit the Makefile!" DONE=$NO while test $DONE != $YES ; do NTLINCDIR=/usr/local/include echo " " if test -d $NTLINCDIR ; then if test -d $NTLINCDIR/NTL ; then DONE=$YES else echo "There is no NTL subdirectory in $NTLINCDIR!" fi else echo "$NTLINCDIR is not a valid directory!" fi done DONE=$NO while test $DONE != $YES ; do echo " " NTLLIBDIR=/usr/local/lib if test -d $NTLLIBDIR ; then if test -f $NTLLIBDIR/libntl.a ; then DONE=$YES else echo "There is no libntl.a in $NTLLIBDIR!" fi else echo "$NTLLIBDIR is not a valid directory!" fi done else COMPILE=0 fi fi echo " " AC_SUBST(COMPILE) dnl dnl Creates the makefiles and the configuration files. dnl AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile)