#!/bin/sh echo This script will ask you several questions related to the configuration echo of your system. To choose the default answer \(the one printed between echo the brackets\), simply press Enter. echo echo "Checking echo to see how to suppress newlines..." if (echo "hi\c"; echo " ") | grep c >/dev/null 2>&1 ; then echo "...using -n."; n=-n; c= else cat <$c"; echo '*' if test -r ./config.in; then . ./config.in; fi # TODO : gestion du echo -n... # On determine OS et on met en place les flags bizarres. syst=`uname -a | awk '{print $1$3}'` case $syst in FreeBSD*) ostype=freebsd defC=/usr/bin/gcc make=/usr/bin/make ldlibs="-lm" ;; CYGWIN*) ostype="cygwin" defC="gcc" make="make" ldlibs="-lm" ;; SunOS5*) ostype=solaris defC=/usr/local/bin/gcc machtype=sparc make=/usr/ccs/bin/make ldlibs="-lm" ;; Linux*) fpucw=`grep __setfpucw /usr/include/fpu_control.h` if test -z "$fpucw"; then special="-DLIBC211"; fi; # for __setfpucw ostype=linux defC=/usr/bin/gcc make=/usr/bin/make machtype=`uname -a | awk '{print $11}'` if [ "$machtype" = "alpha" ]; then special="-mfp-rounding-mode=d -mieee-with-inexact"; fi; ldlibs="-lm" ;; OSF*) special="-D__STDC__ $special -mfp-rounding-mode=d -mieee-with-inexact -ffloat-store"; ostype=alpha defC=/usr/local/bin/gcc make=/usr/local/gnu/bin/make # pour $LDLIBS des tests machtype=dec ldlibs="-lm" ;; SunOS4*) ostype=sunos machtype=sparc defC=/usr/local/gnu/bin/gcc make=/usr/local/gnu/bin/make ldlibs="-lm" ;; IRIX64*) ostype=IRIX64 machtype=sgi defC=/usr/local/gnu/bin/gcc make=/usr/local/gnu/bin/make ldlibs="-lm" ;; HP-UX*) ostype=HPUX machtype=HP defC=/usr/local/gnu/bin/gcc make=/usr/local/gnu/bin/make special="-Dhpux" ldpath="-L/lib/pa1.1" ldlibs="-lM" ;; AIX*) ostype=AIX machtype=IBM defC=/usr/local/bin/gcc make=/usr/local/bin/make ldlibs="-lm" ;; *) ostype=unknown make=/usr/local/gnu/bin/make machtype=default;; # we should try to look for gcc there esac echo You seem to be using a $machtype running $ostype. echo if [ "$ostype" = "IRIX64" ]; then echo On this architecture you need to decide whether your program echo will be compiled as a 32-bit or a 64-bit executable. echo while :; do echo $n "32/64 bits mode [32] ? $c" read ans case "$ans" in '' | 32*) special="-mabi=n32 $special" break ;; 64*) special="-mabi=64 $special" break;; *) echo Invalid choice ;; esac done; fi while :; do echo $n "Which C compiler are you going to use [$defC] ? $c" read ans case "$ans" in '') ans="$defC" break ;; *) if test -x "$ans"; then break; fi echo $n "*** $ans: file does not exist or execution permission denied" esac done defC=$ans echo Using compiler $defC echo echo I now need to know where to find the GMP distribution. I do not actually echo need the full distribution, but only the following include files : echo gmp.h, gmp-impl.h, gmp-mparam.h, longlong.h, stack-alloc.h while :; do echo $n "Where should I look for these files [$inc] ? $c" read ans case "$ans" in '') ans=$inc ;; *) ;; esac if test -r "$ans"/gmp.h -a -r "$ans"/gmp-impl.h -a -r "$ans"/gmp-mparam.h -a -r "$ans"/longlong.h -a -r "$ans"/stack-alloc.h; then incflags="-I$ans" break; fi; # ad hoc installation if test -r "$ans"/gmp.h -a \ -r "$ans"/gmp-impl.h -a \ -r "$ans"/mpn/gmp-mparam.h -a \ -r "$ans"/longlong.h -a \ -r stack-alloc.h; then incflags="-I$ans -I$ans/mpn " break; fi; # gmp distrib echo I could not find some of the files at that place, or could not read echo some of them. Please try again. echo done inc=$ans echo echo If you wish to compile a program with the mpfr library, you will need echo the gmp library. In particular, in order to compile the tests, you will echo need it. Could you tell me where to find it ? echo $n "(You can lie, I won't check) path for the libgmp.a file [$lib] ? $c" read ans if test -z "$ans"; then ans=$lib; fi; if test -d "$ans" -a -r "$ans/libgmp.a"; then lib="$ans/libgmp.a"; fi; olib=$ans echo echo Unless you know what you are doing, you should not answer anything echo to the following question. echo $n "Flags for floating point rounding modes [$contrspecial] ? $c" read ans case "$ans" in '') ans="$contrspecial" ;; *) ;; esac contrspecial=$ans if test -z "$cflags"; then cflags="-ansi -Wall -g -O2"; fi; echo echo $n "What supplementary (optimization/debugging) flags are you willing to use [$cflags] ? $c" read ans case "$ans" in '') ans="$cflags" ;; *) ;; esac cflags=$ans echo echo Now dumping the Makefile. cat > config.in< Makefile < tests/Makefile <