1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
#! /bin/sh
#
# This file is part of the PARI/GP package.
#
# PARI/GP is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation. It is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY WHATSOEVER.
#
# Check the License for details. You should have received a copy of it, along
# with the package; see the file 'COPYING'. If not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Configuration file for GP/PARI. Run Configure --help for Usage.
#
# Perl's Configure and GNU autoconfig were of much help in writing these files.
# $Id: Configure 7915 2006-05-15 11:57:39Z kb $
TOP=`pwd`
config_dir=config
data_dir=data
doc_dir=doc
emacs_dir=emacs
examples_dir=examples
misc_dir=misc
src_dir=src
desc_dir=src/desc
extract_dir_list="$doc_dir $emacs_dir $misc_dir" # for extract_files
cd $config_dir
# Process options, initialize
. ./get_head # do we need head -n # or head -# ?
. ./get_config_options
####################### CONFIGURE - SHELL ###################################
. ./get_nl # how to get echo without \n ? (for config questions)
. ./get_PATH
# We might need the following :
echo Looking for some tools first ...
list='ld zcat gzip ranlib perl emacs'
pathspace=`echo $PATH | sed -e "s/$dir_sep/ /g" | sed -e 's,\\\\,/,g'`
for file in $list; do
x=`./locate $file '' $pathspace`
eval $file=$x
case $x in
# support also DOS filesystems (hard drive prepended)
?:/*|/*) echo ..."$file is $x";;
*) echo ..."I could not find $file." >&2;;
esac
done
if test -z "$zcat" -a -n "$gzip"; then zcat="$gzip -dc"; fi
####################### CONFIGURE - ARCHITECTURE ############################
. ./get_archos # arch, osname
####################### CONFIGURE - COMPILATION #############################
. ./get_cc # $_cc_list (includes 'optimization'), extraflag
. ./get_double_format # doubleformat, sizeof_long
. ./get_kernel # asmarch, pretty
. ./get_dlcflags # DLCFLAGS, update CFLAGS
. ./get_ld # $_ld_list
. ./get_dlld # $_dlld_list
. ./get_perl # $_perl_list
####################### CONFIGURE - LIBC ####################################
. ./get_libc # $_has_list, update LIBS
####################### CONFIGURE - LIBRARIES ###############################
# Looking for libraries: gmp, X11, fltk, Qt, readline
echo Checking for optional libraries and headers...
. ./get_libpth # initialize
if test -n "$kernel"; then # kernel explicitly provided
case "$kernlvl1" in
none) with_gmp=;;
gmp) if test -z "$with_gmp"; then with_gmp=yes; fi ;;
esac
fi
if test -n "$with_gmp" -o "$fastread" != yes; then
. ./get_gmp # $_gmp_list
fi
if test "$optimization" != profiling; then
. ./get_X11 # X11, X11_INC, X11_LIBS
. ./get_graphic_lib # which_graphic_lib
. ./get_fltk # FLTKDIR, FLTK_LIBS
. ./get_Qt # QTDIR, QTLIB
echo "Hi-Res Graphics: $which_graphic_lib"
. ./get_readline # $_readline_list (includes 'readline')
else
which_graphic_lib=none
fi
#############################################################################
case $kernlvl1 in
gmp) libpari_base=pari-gmp;;
none) libpari_base=pari;;
esac
if test `expr $VersionMinor % 2` = 0; then
libpari_base=$libpari_base-$version
fi
####################### CONFIGURE - MAKE ####################################
. ./get_install # $_install_list
. ./get_objdir # objdir, cdobjdir
. ./get_static # static
# For dynamic linking, before and after installing
runpath="$libdir"
LDDYN="-L$libdir -lpari"
# get_modld needs $includedir from get_install, static, and LDDYN
. ./get_modld # $_modld_list
# Which copy, SHELL ?
case "$osname" in
os2) ln_s=cp; make_sh=sh;;
*) ln_s="ln -s"; make_sh="/bin/sh";;
esac
####################### CONFIGURE - CLEANUP #################################
rm -f gmon.out # created by Configure -pg
####################### CONFIGURE - SPIT ####################################
. ./get_tests #test_basic, test_extra, top_test_extra, top_dotest_extra
# Now spit out the results
cat << EOT
==========================================================================
EOT
cd "$TOP"
if test ! -d $objdir; then mkdir -p $objdir; fi
dflt_conf_file=$objdir/$dflt_conf_file
cat > $dflt_conf_file << EOT
# Config file for Pari $release -- $pretty
EOT
case "$osname" in
os2) shell_q='"'; echo "shell_q='\"'" >> $dflt_conf_file;;
*) shell_q="'"; echo "shell_q=\"'\"" >> $dflt_conf_file;;
esac
for variable in\
pari_release pari_release_verbose version libpari_base static TOP objdir\
arch asmarch osname pretty\
kernlvl0 kernlvl1 LIBS\
dir_sep runpath runpathprefix LDDYN\
ranlib gzip zcat emacs perl ln_s make_sh\
sizeof_long doubleformat\
X11 X11_INC X11_LIBS which_graphic_lib\
FLTKDIR FLTK_LIBS QTDIR QTLIB\
$_test_list\
$_install_list\
$_perl_list\
$_cc_list\
$_ld_list\
$_dl_list\
$_dlld_list\
$_modld_list\
$_readline_list\
$_gmp_list\
$_has_list; do
eval "echo $variable=\'"'$'"$variable\'" \>\> $dflt_conf_file
done
. $config_dir/extract_files
# Building...
cat << EOT
==========================================================================
EOT
echo $n "Shall we try to build pari $version.$patch ($status) now (y/n)? $c"
dflt=n; rep='y n'; . $config_dir/myread
mkobjdir=`$config_dir/objdir`
cdobjdir=
if test "$objdir" != "$mkobjdir"; then
cdobjdir="cd $objdir; "
fi
case $ans in
y) if (cd $objdir; make gp); then
echo $n "Shall we install the files where they belong (y/n)? $c"
dflt=n; rep='y n'; . $config_dir/myread
case $ans in
y) make install;;
n) echo "Ok. Type \"${cdobjdir}make install\" when you are ready";;
esac
fi;;
n) echo "Ok. Type \"${cdobjdir}make install\" when you are ready";;
esac
echo 'Bye !'
|