Annotation of OpenXM_contrib/pari-2.2/Configure, Revision 1.2
1.1 noro 1: #! /bin/sh
2: #
3: # This file is part of the PARI/GP package.
4: #
5: # PARI/GP is free software; you can redistribute it and/or modify it under the
6: # terms of the GNU General Public License as published by the Free Software
7: # Foundation. It is distributed in the hope that it will be useful, but WITHOUT
8: # ANY WARRANTY WHATSOEVER.
9: #
10: # Check the License for details. You should have received a copy of it, along
11: # with the package; see the file 'COPYING'. If not, write to the Free Software
12: # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
13:
14: # Configuration file for GP/PARI. (K.B & Ptitboul).
15: #
16: # Run Configure -help for Usage.
17: #
18: # The Configure included in Perl distribution (written by Larry Wall), as
19: # well as GNU autoconfig package were of much help in writing these config
20: # files.
21:
22: TOP=`pwd`
23: dflt_conf_file=dft.Config.in
24:
25: # Directories
26: config_dir=config
27: data_dir=data
28: doc_dir=doc
29: emacs_dir=emacs
30: examples_dir=examples
31: misc_dir=misc
32: src_dir=src
33:
34: extract_dir_list="$doc_dir $emacs_dir $misc_dir"
35:
36: # Version number and patch level.
37: . $config_dir/version
38: version=$VersionMajor.$VersionMinor
39: if test `expr $VersionMinor % 2` = 1; then
40: echo "Configuring pari-$version.$patch (STABLE)"
41: libpari_base=pari
42: else
43: echo "Configuring pari-$version.$patch (DEVELOPMENT VERSION)"
44: libpari_base=pari-$version
45: fi
46:
47: cd $config_dir
48:
49: ####################### CONFIGURE - OPTIONS #################################
50: #
51: # Processing Options
52: #
53: fastread=yes
54: config_file=
55: optimization=full
56: prefix=/usr/local
57: share_prefix=
58: target_host=
59: which_graphic_lib=none
60: test -n "$GP_INSTALL_PREFIX" && prefix=$GP_INSTALL_PREFIX
61: while test $# -gt 0; do
62: case "$1" in
63: -l|-load) shift; initfile=$1;
64: cd $TOP
65: PATH=.:$PATH; export PATH
66: if test -z "$1";then
67: tmp_host=`$config_dir/arch-osname`
68: arch=`echo "$tmp_host" | sed -e 's/\(.*\)-.*/\1/'`
69: osname=`echo "$tmp_host" | sed -e 's/.*-\(.*\)/\1/'`
70: objdir=O$osname-$arch;
71: initfile=$objdir/$dflt_conf_file;
72: fi
73: if test -r "$initfile"; then
74: . $initfile
75: if test ! -d $objdir; then mkdir $objdir; fi
76: . $config_dir/extract_files
77: exit 0
78: else
79: echo "Cannot read config file \"$initfile\"." >&2
80: exit 1
81: fi;;
82: -p|-prefix) shift; prefix=$1;;
83: --prefix=*|--prefi=*|--pref=*|--pre=*|--pr=*|--p=*)
84: prefix=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
85: --share-prefix=*)
86: share_prefix=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
87: --bindir=*) dfltbindir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
88: --libdir=*) dfltlibdir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
89: --mandir=*) dfltmandir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
90: --miscdir=*) dfltmiscdir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
91: --datadir=*) dfltdatadir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
92: --includedir=*) dfltincludedir=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
93: --host=*)
94: target_host=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
95: --disable-kernel) kernel=no;;
96: -a|-ask|--ask) fastread=no;;
97: -g) optimization=debugging;;
98: -pg) optimization=profiling;;
99: -rdll) DYNRELOC=yes;;
100: -h|-help|--help|-\?)error=true;;
101: -v|-verbhelp|--verbhelp)error=verb;;
102: -s|--static) static=y;;
103: -graphic|--graphic) shift; which_graphic_lib=$1; graph_cmd=yes ;;
104: --graphic=*|--graphi=*|--graph=*|--grap=*|--gra=*|--gr=*|--g=*)
105: graph_cmd=yes
106: which_graphic_lib=`echo "$1" | sed -e 's/[-a-z]*=//'`;;
107: *) echo "*** Unrecognized option $1." >&2; error=true;;
108: esac
109: shift
110: done
111:
112: case "$error" in
113: true) cat >&2 <<EOT
114: Usage: Configure [-ask|-help|-g|-pg] [ -load <filename> ] [ --prefix=<dir> ]
115:
116: Options: some names can be abbreviated to one character (e.g -h = -help)
117: -a, --ask interactive configuration
118: -h, --help this message
119: -l, --load skip Configure and specify a default config file
120: -s, --static build static GP binary only
121: -v, --verbhelp a longer help message
122: Build Options:
123: --host=<arch-osname> target achitecture
124: --graphic=<gr> graphic library used (default X11) (none X11 gnuplot)
125: Additional developer options:
126: -g creates debugging version (in Oxxx.dbg)
127: -pg creates profiling version (in Oxxx.prf)
128: -rdll creates relocatable DLL (Cygwin32 only)
129:
130: Installation directories:
131: --prefix=<dir> install files in <dir> (default $prefix)
132: --share-prefix=<dir> as 'prefix', for architecture independant files
133: --bindir=<dir> for binaries
134: --libdir=<dir> for libraries
135: --mandir=<dir> for manual pages
136: --miscdir=<dir> for documentation, examples and emacs macros
137: --datadir=<dir> for precomputed data (Galois resolvents for polgalois)
138: --includedir=<dir> for C header files
139: EOT
140: exit 1
141: ;;
142: verb) cat >&2 <<EOT
143: Architecture, operating system and asm kernel.
144: Configure tries to detect what is the architecture of the machine (CPU type)
145: and what operating system it is running. Then, it decides whether an asm
146: kernel exists and should be used. You can override this with Configure -ask.
147: Which compiler will be used ?
148: Depending on the machine (architecture and operating system) and on what is
149: found in the path, a compiler is automatically chosen. If you set the
150: environment variable CC before typing Configure, it will be used instead.
151: Typeset the installation help ('tex INSTALL.tex') for more details.
152: EOT
153: exit 1
154: ;;
155: esac
156:
157: test "$fastread" = yes || cat <<EOT
158: ==========================================================================
159: Beginning configuration questions for GP/PARI.
160:
161: You will be asked some questions about your system. Most of the time, a list
162: of acceptable answers will be supplied as well as a default between brackets.
163: Type a carriage return ('Enter') to accept these defaults.
164:
165: Though the present script strives to prevent any fatal mistake on your part,
166: there is currently no easy way out if you make one. Your best bet is to press
167: Ctrl-C, then start again. Another possibility is to wait till the questions
168: end, edit the file "Oxxx/$dflt_conf_file", then run
169:
170: Configure -load Oxxx/$dflt_conf_file
171:
172: (which can be abbreviated to simply "Configure -l", provided your architecture
173: is correctly detected)
174: ==========================================================================
175: EOT
176:
177: ####################### CONFIGURE - SHELL ###################################
178: if test -z "$OS2_SHELL"; then dir_sep=':' ; else dir_sep=';' ; fi
179:
180: #
181: # Proper PATH setting
182: #
183: pth="\
184: /bin\
185: /usr/bin\
186: /usr/locateal/bin\
187: /usr/ucb\
188: /usr/locateal\
189: /usr/lbin\
190: /usr/5bin\
191: /etc\
192: /usr/etc\
193: /usr/gnu/bin\
194: /usr/new\
195: /usr/new/bin\
196: /usr/nbin\
197: /sys5.3/bin\
198: /sys5.3/usr/bin\
199: /bsd4.3/bin\
200: /bsd4.3/usr/ucb\
201: /bsd4.3/usr/bin\
202: /usr/bsd\
203: /bsd43/bin\
204: /opt/ansic/bin\
205: /usr/ccs/bin\
206: /usr/lib\
207: /usr/ucblib\
208: /lib\
209: /usr/ccs/lib\
210: /sbin\
211: /usr/sbin\
212: /usr/libexec\
213: /usr/openwin/bin\
214: /usr/local/bin\
215: "
216: # /usr/openwin/bin added for xmkmf
217:
218: for p in $pth
219: do
220: case "$dir_sep$PATH$dir_sep" in
221: *$dir_sep$p$dir_sep*) ;;
222: *) test -d $p && PATH=$PATH$dir_sep$p ;;
223: esac
224: done
225: PATH=.$dir_sep$PATH; export PATH
226:
227: echo "Checking echo to see how to suppress newlines..."
228:
229: if (echo "hi\c"; echo " ") | grep c >/dev/null 2>&1 ; then
230: echo "...using -n."; n=-n; c=
231: else
232: cat <<EOM
233: ...using \c
234: EOM
235: n=; c='\c'
236: fi
237: if test "$fastread" != yes; then
238: echo $n ..."The star should be here-->$c"; echo '*'
239: fi
240:
241: #
242: # We might need the following :
243: #
244: echo Looking for some tools first ...
245: list='ld zcat gzip ranlib perl emacs'
246: pathspace=`echo $PATH | sed -e "s/$dir_sep/ /g" | sed -e 's,\\\\,/,g'`
247:
248: for file in $list; do
249: x=`./locate $file '' $pathspace`
250: eval $file=$x
251: case $x in
252: # support also DOS filesystems (hard drive prepended)
253: ?:/*|/*) echo ..."$file is $x";;
254: *) echo ..."I could not find $file." >&2;;
255: esac
256: done
257: if test -z "$zcat" -a -n "$gzip"; then zcat="$gzip -dc"; fi
258:
259: ####################### CONFIGURE - ARCHITECTURE ############################
260: #
261: # Testing Architectures. Try uname to provide a default, then ask user.
262: #
263: if test -z "$target_host"; then
264: target_host=`./arch-osname`
265: fi
266: arch=`echo "$target_host" | sed -e 's/\(.*\)-.*/\1/'`
267: osname=`echo "$target_host" | sed -e 's/.*-\(.*\)/\1/'`
268:
269: if test "$fastread" != yes; then
270: cat << EOM
271: ==========================================================================
272: Currently supported architectures:
273: EOM
274: rep='none sparcv7 sparcv8_super sparcv8_micro sparcv9
275: m68k ix86 i386 i486 i586 i686 hppa alpha mips fx2800'
276: . ./display
277: echo $n ..."Which of these apply, if any ? $c"
278: dflt=$arch; . ./myread; arch=$ans
279: fi
280:
281: #
282: # Test OS, using the info uname provided.
283: #
284: if test "$fastread" != yes; then
285: cat << EOM
286: ==========================================================================
287: I know of the following Operating Systems
288: EOM
289: rep='os2 freebsd cygwin linux hpux aix osf1 solaris sunos nextstep concentrix irix';
290: . ./display
291: echo $n ..."Any of these apply ? $c"
292: dflt=$osname; . ./myread
293: osname=$ans
294: fi
295:
296: #
297: # A pretty name for the architecture
298: # The asm file used (if any)
299: #
300: case "$arch" in
301: sparc) asmarch=sparcv8_micro; pretty=Sparc ;;
302: sparcv7) asmarch=$arch; pretty=SparcV7 ;;
303: sparcv8_micro) asmarch=$arch; pretty=MicroSparc ;;
304: sparcv8_super) asmarch=$arch; pretty=SuperSparc ;;
305: sparcv9) asmarch=sparcv8_micro; pretty=UltraSparc ;;
306: m68k) asmarch=$arch; pretty="MC680x0, x>=2" ;;
307: i?86) asmarch=ix86 ; pretty=$arch ;;
308: hppa) asmarch=none ; pretty=HP
309: case "$osname-`uname -r`" in
310: hpux-?.09.*) asmarch=none ;;
311: hpux-?.10.*) asmarch=$arch ;;
312: esac ;;
313: alpha) asmarch=$arch; pretty=Alpha ;;
314: mips) asmarch=none; pretty=Mips ;;
315: fx2800) asmarch=none; pretty="Alliant FX/2800" ;;
316: none) asmarch=none; pretty="unknown" ;;
317: *) asmarch=none; pretty=$arch
318: echo " Warning ! architecture $arch not tested";;
319: esac
320:
321: #
322: # Modifications for pretty name and asm file
323: #
324: case "$osname" in
325: cygwin*|linux|freebsd|os2) pretty="$pretty running $osname";;
326: nextstep) pretty="$pretty running $osname";
327: if test "$arch" = m68k; then asmarch=none; fi ;;
328: esac
329:
330: if test "$kernel" = no; then
331: asmarch=none;
332: echo "assembler micro kernel disabled"
333: else
334: if test "$fastread" != yes; then
335: cat << EOM
336: ==========================================================================
337: An optimized Pari kernel is available for these architectures
338: ("none" means that we will use the portable C version of GP/PARI)
339: EOM
340: rep='none sparcv7 sparcv8_super sparcv8_micro m68k ix86 alpha hppa'
341: . ./display
342: echo $n ..."Which of these apply, if any ? $c"
343: dflt=$asmarch; . ./myread; asmarch=$ans
344: cat << EOM
345: ==========================================================================
346: EOM
347: fi
348: fi
349: case "$asmarch" in
350: none) prettyk="C portable";;
351: sparcv7) prettyk=SparcV7;;
352: sparcv8_super) prettyk=SuperSparc;;
353: sparcv8_micro) prettyk=MicroSparc;;
354: m68k) prettyk="MC680x0, x>=2";;
355: ix86) prettyk=ix86;;
356: hppa) prettyk=HPPA;;
357: alpha) prettyk=Alpha;;
358: ppc) prettyk=PPC;;
359: *) prettyk="$asmarch";;
360: esac
361: # 'i386 (running ix86 kernel)' looks ugly
362: if test "$arch" != "$asmarch" -a \( "$arch" != "i386" -o "$asmarch" != "ix86" \)
363: then
364: pretty="$pretty ($prettyk kernel)"
365: fi
366: echo "Building for architecture: $pretty"
367:
368: #
369: # Which copy, SHELL ?
370: #
371: case "$osname-$arch" in
372: os2-*) ln_s=cp; make_sh=sh; exe_suff=.exe; extraflag="-Zexe" ;;
373: cygwin*) ln_s="ln -s"; make_sh="/bin/sh"; exe_suff=.exe; extraflag="" ;;
374: *) ln_s="ln -s"; make_sh="/bin/sh"; exe_suff=; extraflag="" ;;
375: esac
376:
377: ####################### CONFIGURE - LIBRARIES ###############################
378: #
379: # Looking for libraries now
380: #
381: case "$osname" in
382: cygwin*) ver=`uname -r | cut -d. -f1`
383: cygtop=/cygdrive/c
384: if test ! -d $cygtop; then
385: cygtop=/Cygnus/cygwin/B$ver
386: if test ! -d $cygtop; then
387: cygtop=/Cygnus/cygwin-B$ver
388: if test ! -d $cygtop; then
389: cygtop=/usr/${arch}-pc-cygwin
390: if test ! -d $cygtop; then
391: echo ..."I could not find Cygwin top directory" >&2
392: fi
393: fi
394: fi
395: fi;;
396: esac
397: readline_enabledp="nil"
398: if test "$optimization" != profiling; then
399: # First, construct the PATHs
400: case "$osname" in
401: cygwin*) if test "$cygtop" = /cygdrive/c; then
402: # cygnus for version 1.*
403: libpth="
404: /usr/local/lib\
405: /lib\
406: "
1.2 ! noro 407: # this must be a bug.
! 408: # cygtop=/
! 409: cygtop=
1.1 noro 410: else
411: # cygnus for version 0.*
412: libpth="
413: $cygtop/H-${arch}-cygwin32/lib\
414: $cygtop/H-${arch}-cygwin32/${arch}-cygwin32/lib\
415: "
416: fi;;
417: os2) libpth=`echo $LIBRARY_PATH | sed 's/;/ /g' | sed 's,\\\\,/,g'`;;
418: *) libpth="\
419: /usr/local/lib\
420: /lib\
421: /usr/lib\
422: /opt/lib\
423: /opt/local/lib\
424: /opt/gnu/lib\
425: /lib/pa1.1\
426: /usr/lib/large\
427: /lib/large\
428: /usr/lib/small\
429: /lib/small\
430: /usr/ccs/lib\
431: /usc/ucblib\
432: /usr/shlib\
433: .\
434: ";;
435: esac
436:
437: if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
438: eval `make gp-X11 2> /dev/null | grep -v make`
439: rm -f Makefile Makefile.bak
440: x11pth="$usrlibdir $libdir";
441: fi
442:
443: # We want these libraries:
444: #
445: echo Checking for optional libraries and headers...
446: # LIB: X11
447: pth=$x11pth
448: lib=X11; . ./locatelib
449: if test -f $Xincroot/X11/Xos.h -a -z "$graph_cmd"; then
450: which_graphic_lib=X11
451: test -n "$extralib" && echo ..."Extra Libraries are $extralib"
452: echo ..."Found X11 header files in $Xincroot/X11"
453: fi
454:
455: pth=$libpth
456: # LIB: gnuplot
457: opth="$pth"
458: pth="$TOP/gnuplot-$osname-$arch $TOP/gnuplot $TOP/../gnuplot-$osname-$arch $TOP/../gnuplot $TOP/../../gnuplot-$osname-$arch $TOP/../../gnuplot $pth"
459: gpth="$pth"
460: lib=gnuplot; . ./locatelib
461: gnuplot_fullpath="$try"
462: pth="$opth"
463: gnuplot_libs=
464: case $gnuplot in
465: /*|[c-z]:/*)
466: addgnuplot=gnuplot
467: for lib in vga vesa jmgraph linuxvga gd png z
468: do
469: . ./locatelib
470: eval "elib=\$$lib"
471: case $elib in
472: /*|[c-z]:/*) gnuplot_libs="$gnuplot_libs -l$lib";;
473: esac
474: done
475: if test "$which_graphic_lib" = gnuplot; then
476: if test -z "$gnuplot_libs"; then
477: echo "...I expect that no libraries are needed for gnuplot"
478: else
479: echo "...I expect that libraries $gnuplot_libs are needed for gnuplot"
480: fi
481: fi
482: ;;
483: *)
484: if test "$which_graphic_lib" = gnuplot; then
485: echo "###"
486: echo "### Could not find gnuplot library in:"
487: echo "### ./gnuplot-$osname-$arch ./gnuplot"
488: echo "### ../gnuplot-$osname-$arch ../gnuplot"
489: echo "### ../../gnuplot-$osname-$arch ../../gnuplot"
490: echo "### $pth"
491: echo "###"
492: case "$osname" in
493: os2) tlib=gnuplot.a ;;
494: *) tlib=libgnuplot.a ;;
495: esac
496: echo "### You may need to execute"
497: echo "### ar cr $tlib version.o util.o term.o bitmap.o stdfn.o"
498: echo "### In the build directory of gnuplot-3.7, and move"
499: echo "### $tlib to ./gnuplot-$osname-$arch or ./gnuplot subdirs"
500: echo "### or to similarly-named directories up the directory tree."
501: echo "###"
502: fi
503: ;;
504: esac
505:
506: # LIB: GNU ReadLine
507: readline_add="$GP_READLINE $TOP/readline-$osname-$arch $TOP/readline"
508: pth="$readline_add $pth"
509: lib=readline; . ./locatelib
510: rl_fullname=$try
511:
512: if test -n "$readline"; then
513: # Readline -- TermCap
514: lib=$rl_fullname; sym=tgetent; . ./locatesymbol
515: if test -n "$try"; then # tgetent needed
516: lib=ncurses; . ./locatelib
517: if test -n "$try"; then # ncurses found. Does it contain tgetent ?
518: lib=$try; . ./locatesymbol
519: fi
520: if test -n "$try"; then
521: rl_ncurses=$ncurses
522: else
523: lib=termcap; . ./locatelib
524: rl_termcap=$termcap
525: fi
526: fi
527: # Readline -- Allocation
528: lib=$rl_fullname; sym=alloca; . ./locatesymbol
529: if test -n "$try"; then # alloca needed
530: lib=iberty; . ./locatelib
531: rl_liberty="$try"
532: fi
533: # Readline -- Headers
534: case "$osname" in
535: os2) incpth=`echo $C_INCLUDE_PATH | sed -e 's/\([^;]\)$/\1;/g' -e 's%;%/readline %g' -e 's,\\\\,/,g'` ;;
536: cygwin*) incpth="\
537: $cygtop/usr/local/include/readline\
538: $cygtop/usr/local/include\
539: $cygtop/usr/include/readline\
540: $cygtop/usr/include\
541: $cygtop/H-${arch}-cygwin32/${arch}-cygwin32/include\
542: ";;
543: *) incpth="\
544: /usr/local/include/readline\
545: /usr/include/readline\
546: /opt/include/readline\
547: /opt/local/include/readline\
548: /opt/gnu/include/readline\
549: /usr/unsupported/include/readline\
550: /usr/local/include\
551: /usr/include\
552: /opt/include\
553: /opt/local/include\
554: /opt/gnu/include\
555: ";;
556: esac
557: pth="$readline_add $incpth"
558: x=`./locate 'readline.h' '' $pth`
559: CPPF_defined=
560: case $x in
561: ?:/*|/*) rl_include=`echo $x | sed 's,/readline.h,,'`
562: if (grep CPPFunction $x > /dev/null 2>&1); then CPPF_defined=yes; fi
563: if (grep rl_message $x > /dev/null 2>&1); then rl_message=yes; fi
564: if (grep rl_completion_matches $x > /dev/null 2>&1); then
565: rl_completion_matches=yes;
566: fi
567: if (grep rl_completion_func_t $x > /dev/null 2>&1); then
568: rl_completion_func_t=yes;
569: fi
570: if (grep "rl_refresh_line *()" $x > /dev/null 2>&1); then
571: rl_refresh_line_oldproto=yes
572: fi
573: if (grep rl_completion_append_character $x > /dev/null 2>&1); then
574: rl_appendchar=yes
575: fi
576: if (grep rl_generic_bind $x > /dev/null 2>&1); then
577: rl_genericbind=yes
578: fi
579: if (grep rl_save_prompt $x > /dev/null 2>&1); then
580: rl_save_prompt=yes;
581: else
582: lib=$rl_fullname; sym=rl_save_prompt; . ./locatesymbol
583: _rl_save_prompt=$try
584: fi;;
585: *) echo ..."But no header file has been found"
586: readline=;;
587: esac
588: fi
589:
590: if test -n "$readline"; then
591: echo ..."Found GNU readline header in $rl_include"
592: if (echo $rl_include | grep "readline$" > /dev/null); then
593: rl_include=`echo $rl_include | sed 's,/readline$,,'`
594: RLINCLUDE="-I$rl_include"
595: else
596: # in case headers are not installed correctly
597: RLINCLUDE="-I$rl_include -DREADLINE_LIBRARY"
598: fi
599: RLLIBS="-L$readline -lreadline"
600: if test -n "$rl_ncurses"; then
601: echo ..."Library ncurses needed by readline"
602: RLLIBS="$RLLIBS -lncurses"
603: fi
604: if test -n "$rl_termcap"; then
605: echo ..."Library termcap needed by readline"
606: RLLIBS="$RLLIBS -ltermcap"
607: fi
608: if test -n "$rl_liberty"; then
609: echo ..."Library liberty needed by readline"
610: RLLIBS="$RLLIBS -liberty"
611: fi
612: if test -z "$rl_appendchar"; then
613: echo ..."Library readline does not have completion_append_char"
614: fi
615: if test -z "$rl_genericbind"; then
616: echo ..."Library readline does not have rl_generic_bind"
617: fi
618: if test -z "$rl_save_prompt"; then
619: echo ..."Library readline does not have rl_save_prompt"
620: if test -n "$_rl_save_prompt"; then
621: echo ......"but it has _rl_save_prompt"
622: fi
623: fi
624:
625: if test "$fastread" != yes; then
626: cat << EOM
627: ==========================================================================
628: EOM
629: echo $n "Do you want to use GNU readline library within GP ? $c"
630: rep='y n'; dflt=y; . ./myread
631: case $ans in
632: n) readline=;;
633: esac
634: fi
635: fi
636:
637: if test -n "$readline"; then readline_enabledp="t"; fi
638:
639: # Graphic libs now.
640: #
641: if test "$fastread" != yes; then
642: if test -n "$X11"; then addX11=X11; fi
643: cat << EOT
644: ==========================================================================
645: GP contains high resolution plotting functions. Choose among
646: none $addX11 $addgnuplot
647: EOT
648: echo $n ..."Use which graphic library (\"none\" means no hi-res plot) ? $c"
649: rep="none $addX11 $addgnuplot";
650: dflt=$which_graphic_lib; . ./myread
651: which_graphic_lib=$ans
652:
653: case "$which_graphic_lib" in
654: X11)
655: gnuplot=;
656: # If xmkmf did not give the right answer
657: # X11 -- Headers
658: if test ! -f $Xincroot/X11/Xos.h; then
659: x11pth="\
660: /usr/openwin/share/lib\
661: /usr/openwin/lib\
662: /usr/X11R6/lib\
663: /usr/X11R5/lib\
664: /usr/X11R4/lib\
665: /usr/lib/X11R6\
666: /usr/lib/X11R5\
667: /usr/lib/X11R4\
668: /usr/local/X11R6/lib\
669: /usr/local/X11R5/lib\
670: /usr/local/X11R4/lib\
671: /usr/local/lib/X11R6\
672: /usr/local/lib/X11R5\
673: /usr/local/lib/X11R4\
674: /usr/X11/lib\
675: /usr/lib/X11\
676: /usr/local/X11/lib\
677: /usr/local/lib/X11\
678: /usr/X386/lib\
679: /usr/x386/lib\
680: /usr/XFree86/lib/X11\
681: /usr/lib\
682: /usr/local/lib\
683: /usr/unsupported/lib\
684: /usr/athena/lib\
685: /usr/local/x11r5/lib\
686: /usr/lpp/Xamples/lib\
687: ";
688: pth=`echo $x11pth | s,/lib,/include,g`
689: x=`./locate X11/Xos.h '' $pth`
690: case $x in
691: /*) Xincroot=`echo $x | sed 's,/X11/Xos.h,,'`;;
692: *) Xincroot=;;
693: esac
694: if test -n "$Xincroot"; then
695: echo ..."Found X11 header files in $Xincroot/X11"
696: fi
697: fi
698: # X11 -- Lib
699: if test -f $Xincroot/X11/Xos.h -a -z "$X11"; then
700: pth=$x11pth;
701: lib=X11; . ./locatelib
702: fi ;;
703: gnuplot);;
704: *)gnuplot=;;
705: esac
706: else # fastread = yes
707: if test "$which_graphic_lib" = none -a -z "$graph_cmd" -a -n "$gnuplot"; then
708: which_graphic_lib=gnuplot
709: fi
710: if test -z "$X11" -a -z "$gnuplot" -a -z "$readline"; then
711: echo ...none
712: fi
713: fi
714: fi
715:
716: ####################### CONFIGURE - COMPILATION #############################
717: #
718: # Which optimization ?
719: #
720: if test "$fastread" != yes; then
721: cat << EOT
722: ==========================================================================
723: The default is to fully optimize the compilation. You may choose to build
724: an executable for debugging or profiling instead. Choose among :
725: full debugging profiling
726: EOT
727: echo $n ..."Which optimization do you prefer ? $c"
728: dflt=$optimization; rep='full debugging profiling'; . ./myread
729: optimization=$ans
730: fi
731:
732: #
733: # Which Compiler ?
734: #
735: if test -z "$CC"; then
736: echo Looking for the compilers ...
737: # Native Compilers
738: cc=`./locate cc '' $pathspace`
739: case "$osname" in
740: hpux) if test "$cc" = /usr/ccs/bin/cc -a -f /opt/ansic/bin/cc; then
741: cc=/opt/ansic/bin/cc; fi ;; # This is a better compiler
742: esac
743: case "$cc" in ?:/*|/*) echo ..."cc is $cc";;
744: *) echo ..."I could not find cc.";; esac
745: # GNU Compilers
746: gcc=`./locate gcc '' $pathspace`
747: if test -z "$gcc"; then
748: exe=$osname-$arch-gnu$$
749: $cc $extraflag -o $exe gnu.c
750: if $exe; then gcc=$cc; fi; rm -f $exe
751: fi
752: case "$gcc" in
753: ?:/*|/*) echo ..."gcc is $gcc";;
754: *) echo ..."I could not find gcc."; gcc=;;
755: esac
756: if test -n "$gcc"; then
757: __gnuc__=`$gcc -v 2>&1 | sed -n 's/.*version //p'`
758: if test -z "$__gnuc__"; then __gnuc__=unknown; fi
759: echo GNU compiler version $__gnuc__
760: fi
761: case "$osname" in
762: aix) __gnuc__=;; # Native compilers are faster
763: hpux) __gnuc__=;; # versions older than 2.7 cannot build PIC code
764: # gp built with recent versions has bugs
765: concentrix) case "$__gnuc__" in 2.[78].*);; *)
766: __gnuc__=;; esac;;
767: esac
768: # Choosing the compiler
769: if test -n "$__gnuc__"; then CC=$gcc; else CC=$cc; fi
770: fi
771:
772: if test "$which_graphic_lib" = gnuplot -a -z "$gcc"; then
773: lib=$gnuplot_fullpath; sym=_eprintf; . ./locatesymbol
774: if test -n "$try"; then
775: echo "...Looks like gcc-compiled gnuplot. I add -lgcc to graphic libraries"
776: _ogcc="$gcc"
777: opth="$pth"
778: pth="$pth /opt/local/gnu/lib /usr/local/gnu/lib"
779: gcclibspec="`gcc -v 2>&1 | grep specs | sed 's/.*specs from //'`"
780: if test -n "$gcclibspec"; then
781: pth="`dirname $gcclibspec` $pth"
782: fi
783: lib=gcc; . ./locatelib
784: if test -n "$gcc"; then
785: gnuplot_libs="$gnuplot_libs -L$gcc"
786: else
787: echo "...### I did not find -lgcc library in $pth."
788: echo "...### You may need to manually add something like -L/opt/gnu/lib to the "
789: echo "...### PLOTLIBS = ..."
790: echo "...### line in your architecture-Makefile."
791: fi
792: pth="$opth"
793: gcc="$_ogcc"
794: gnuplot_libs="$gnuplot_libs -lgcc"
795: fi
796: fi
797:
798:
799: if test "$fastread" != yes; then
800: cat << EOT
801: ==========================================================================
802: Only ANSI C and C++ compilers are supported. Choosing the GNU compiler
803: gcc/g++ enables the inlining of kernel routines (about 20% speedup; if you
804: use a recent g++, it is a good idea to include the -fpermissive flag).
805: If you choose not to use gcc, the C++ version of Pari will be a little
806: faster because of general inlining, but can be used in library mode only
807: with C++ programs (we **really** recommand using gcc all the way through).
808: EOT
809: echo $n ..."Which C compiler shall I use ? $c"
810: dflt=$CC; rep=; . ./myread
811: CC=$ans
812: fi
813:
814: #
815: # Which Flags for Compiler ?
816: #
817: if test "$CC" != "$gcc"; then __gnuc__=; fi
818: if test -z "$__gnuc__"; then
819: exe=$osname-$arch-gnu$$
820: $CC $extraflag -o $exe gnu.c
821: if $exe; then __gnuc__=yes; fi
822: rm -f $exe
823: fi
824:
825: if test -n "$__gnuc__"; then
826: __GNUC__="-D__GNUC__"
827: warn="-Wall -Wno-implicit"
828: OPTFLAGS="-O3 -DGCC_INLINE $warn"
829: DBGFLAGS="-g $warn"
830: # Some architectures need -fPIC for building dynamic lib
831: case "$osname-$arch" in hpux-*) DLCFLAGS=-fPIC;; esac
832: # Specific optimisations for some architectures
833: case "$osname-$arch" in
834: linux-i?86|cygwin*) OPTFLAGS="$OPTFLAGS \
835: -malign-loops=2 -malign-jumps=2 -malign-functions=2";;
836: os2-*) cflags=-Zmt;;
837: *-sparcv8*) cflags=-mv8;;
838: esac
839: # omit-frame-pointer incompatible with -pg
840: PRFFLAGS="-pg $OPTFLAGS"
841: case "$optimization" in
842: full) OPTFLAGS="$OPTFLAGS -fomit-frame-pointer";;
843: esac
844: else
845: cflags=
846: DBGFLAGS="-g"
847: PRFFLAGS="-pg"
848: case "$osname-$arch" in
849: hpux-*) # -Aa is for ANSI C, +z for PIC code (for commercial HPUX compilers)
850: OPTFLAGS=-O; cflags=-Aa; DLCFLAGS=+z;;
851: # best tuning option, even for PPC604:
852: aix-*) OPTFLAGS=-O2; cflags='-qlanglvl=ansi -qtune=601';;
853: cygwin*|linux-i?86|freebsd-i?86)
854: OPTFLAGS=-O2; cflags=-m486;;
855: osf1-*) OPTFLAGS='-O4 -migrate -ifo -Olimit 9999';;
856: sunos-*) OPTFLAGS=-fast; PRFFLAGS='-pg -Bstatic';;
857: solaris-*) OPTFLAGS=-fast; PRFFLAGS=-xpg;;
858: concentrix-*) OPTFLAGS=-Ogi;;
859: *) OPTFLAGS=-O;;
860: esac
861: PRFFLAGS="$PRFFLAGS $OPTFLAGS"
862: fi
863: cflags="$cflags $DLCFLAGS"
864:
865: case "$osname" in
866: nextstep) cflags="-traditional-cpp $cflags";;
867: esac
868:
869: case "$optimization" in
870: full) suffix=; cflags="$OPTFLAGS $cflags";;
871: profiling) suffix=.prf; cflags="$PRFFLAGS $cflags";;
872: debugging) suffix=.dbg; cflags="-DMEMSTEP=1048576 $DBGFLAGS $cflags";;
873: esac
874:
875: if test "$fastread" != yes; then
876: echo $n ..."With which flags ? $c"
877: dflt=${CFLAGS:-cflags}; rep=; . ./myread
878: cflags=$ans
879: fi
880:
881: # Here we should check it is an ANSI compiler...
882: echo "C compiler is $CC $cflags"
883:
884: #
885: # Which Assembler ?
886: #
887: if test -z "$AS"; then
888: echo Looking for an assembler ...
889: if test "$osname" = hpux
890: then AS=`./locate as '' /usr/ccs/bin /bin` # We don't want GNU as
891: else AS=`./locate as '' $pathspace`
892: fi
893: case "$AS" in ?:/*|/*) echo ..."as is $AS";;
894: *) echo ..."I could not find as." ;; esac
895: fi
896: gnuas=no
897: if (echo | $AS --version 2>&1 | grep GNU > /dev/null); then
898: gnuas=yes
899: else
900: if (echo | $AS -v 2>&1 | grep GNU > /dev/null); then
901: gnuas=yes
902: fi
903: fi
904: if test "$gnuas" = yes; then
905: echo "...Hum, this looks like GNU as"
906: case "$osname-$asmarch" in
907: solaris-sparc*) KERNELCPPFLAGS="-DNO_UNDERSCORE $__GNUC__";;
908: esac
909: else
910: case "$osname-$asmarch" in
911: osf1-alpha) ASFLAGS="-O1";;
912: sunos-sparc*) ASFLAGS="-P -I. $__GNUC__";;
913: solaris-sparc*) ASFLAGS="-P -I. $__GNUC__ -T";;
914: hpux-hppa) ASFLAGS="+DA1.1";;
915: *) ASFLAGS=;;
916: esac
917: fi
918: echo "Assembler is $AS $ASFLAGS"
919:
920: #
921: # Which C PreProcessor ?
922: #
923: case "$osname" in
924: nextstep) cppfl="-traditional-cpp" ;;
925: freebsd)
926: if test $PORTOBJFORMAT = "elf"; then
927: cppfl="-DUSE_ELF"
928: FREEBSD_ELF=1
929: else
930: FREEBSD_ELF=0
931: fi ;;
932: esac
933: CPP="$CC $cppfl -E -I."
934:
935: echo "C PreProcessor is $CPP"
936:
937: #
938: # Which Executable Linker ?
939: #
940: LIBS=-lm
941: case "$osname" in
942: darwin) LIBS= ;;
943: esac
944: case "$osname-$arch" in
945: linux-*|cygwin*)
946: LD=$CC; LDFLAGS="$cflags -Xlinker -export-dynamic"
947: runpathprefix='-Xlinker -rpath -Xlinker ';;
948: osf1-alpha)
949: LD=$ld; LIBS="$LIBS -lots -lc"; runpathprefix='-rpath '
950: LDFLAGS='-std0 -call_shared /usr/lib/cmplrs/cc/crt0.o'
951: case "$optimization" in
952: full|profiling) LDFLAGS="-g0 -O4 $LDFLAGS";;
953: esac;;
954: solaris-*) LD=$CC; LDFLAGS=$cflags; runpathprefix=-R ;;
955: os2-*) LD=$CC; LDFLAGS="$cflags -Zexe"
956: case "$optimization" in
957: full) LDFLAGS="$LDFLAGS -s";;
958: esac;;
959: *) LD=$CC; LDFLAGS=$cflags ;;
960: esac
961:
962: if test "$fastread" != yes; then
963: echo $n ..."Which linker for building executables ? $c"
964: dflt=$LD; rep=; . ./myread
965: LD=$ans
966: fi
967:
968: #
969: # Which Flags for Executable Linker?
970: #
971: if test "$fastread" != yes; then
972: echo $n ..."With which flags ? $c"
973: dflt=$LDFLAGS; rep=; . ./myread
974: LDFLAGS=$ans
975: fi
976:
977: echo "Executable linker is $LD $LDFLAGS"
978:
979: if test "$optimization" = profiling; then DLLD=; else
980: DLLD=${DLLD-ld}
981: DLSUFFIX=so
982: # Which suffix for Dynamic Lib?
983: # Some linkers (SunOS 4) need minor and major lib version numbers.
984: # Some others (SunOS 5) need a link from a .so
985: # Some others (HPUX 09) do not want version numbers.
986: #
987: soname=$soname_num
988: case "$osname-$arch" in
989: # aix-*) DLSUFFIX=a ;; dynamic linking does not work!
990: sunos-*) sodest=$VersionMajor$VersionMinor.$patch
991: soname=$sodest;;
992: *-alpha|solaris-*|linux-*|freebsd-*)
993: case $libpari_base in
994: pari) sodest=$version.$patch;; # released versions
995: *) sodest=$patch.0.0;; # unstable versions
996: esac ;;
997: cygwin*) soname= ; sodest= ; DLSUFFIX=dll;;
998: hpux-*) soname= ; sodest= ; DLSUFFIX=sl;;
999: irix-*) soname= ; sodest= ;;
1000: *) DLLD=;;
1001: esac
1002: fi
1003:
1004: if test -n "$DLLD"; then
1005: # Which Dynamic Lib Linker?
1006: #
1007: if test $DLLD = ld -a -n "$ld"; then
1008: DLLD=$ld;
1009: fi
1010: if test "$fastread" != yes; then
1011: echo $n ..."Which linker for building dynamic libs? $c"
1012: dflt=$DLLD; rep=; . ./myread
1013: DLLD=$ans
1014: fi
1015:
1016: # Which Flags for Dynamic Lib Linker ?
1017: #
1018: if ($DLLD -v 2>&1 | grep GNU > /dev/null); then
1019: echo "...Hum, this looks like GNU ld"
1020: DLLDFLAGS="-shared -soname \$(LIBPARI_SONAME)"
1021: else
1022: # not GNU ld
1023: case "$osname-$arch" in
1024: aix-*) DLLDFLAGS="-r" ;;
1025: hpux-*) DLLDFLAGS="-b -E" ;;
1026: freebsd-*) DLLDFLAGS="-Bshareable -x" ;;
1027: linux-*) DLLDFLAGS="-shared -soname \$(LIBPARI_SONAME)" ;;
1028: irix-*) DLLDFLAGS="-shared -elf -no_unresolved -all" ;;
1029: *-alpha) DLLDFLAGS="-shared"; EXTRADLLDFLAGS='${LIBS}'
1030: case "$optimization" in
1031: full) DLLDFLAGS="$DLLDFLAGS -O3" ;;
1032: esac;;
1033: sunos-*) DLLDFLAGS="-assert nodefinitions" ;;
1034: solaris-*) DLLDFLAGS="-G -h \$(LIBPARI_SONAME)" ;;
1035: *) DLLD=;;
1036: esac
1037: fi
1038:
1039: if test "$fastread" != yes; then
1040: echo $n ..."Which flags for linker? $c"
1041: dflt=$DLLDFLAGS; rep=; . ./myread
1042: DLLDFLAGS=$ans
1043: fi
1044: fi
1045:
1046: if test -z "$DLLD"; then
1047: echo "No Dynamic Lib"
1048: static=y
1049: else
1050: echo "Dynamic Lib linker is $DLLD $DLLDFLAGS"
1051: static=${static-n}
1052: fi
1053:
1054: if test "$fastread" != yes; then
1055: cat << EOT
1056: ==========================================================================
1057: Should you change your mind, you only need to modify the lines
1058: CC="$CC"
1059: CFLAGS="$cflags"
1060: LD="$LD"
1061: LDFLAGS="$LDFLAGS"
1062: DLLD="$DLLD"
1063: DLLDFLAGS="$DLLDFLAGS"
1064: in the Makefile
1065: ==========================================================================
1066: EOT
1067: fi
1068:
1069: ####################### CONFIGURE - READLINE VERSION ########################
1070: if test -n "$readline"; then
1071: exe=$osname-$arch-rlv$$
1072: $CC $extraflag $RLINCLUDE -o $exe rl_version.c $RLLIBS 2>/dev/null
1073: if test -r $exe; then readline=`$exe`; else readline=1.0; fi
1074: rm -f $exe $exe$exe_suff
1075: fi
1076:
1077: ####################### CONFIGURE - LIBC ####################################
1078: #
1079: # Long integer ?
1080: #
1081: endian=4321;
1082: exe=$osname-$arch-endian$$
1083: if ($CC $extraflag endian.c -o $exe 2>/dev/null); then
1084: endian=`$exe`;
1085: fi
1086: rm -f $exe $exe$exe_suff
1087:
1088: if test "$fastread" != yes; then
1089: cat << EOT
1090: Determining sizeof(long) and endianness. If your hardware supports different
1091: size of longs (e.g SGI/MIPS), you can decide to use a particular word size
1092: by specifying endianness (e.g answer 4321 instead of the proposed 87654321).
1093: You'll probably have to specify some exotic compilation flag (e.g -o32,-n32)
1094: ============================================================================
1095: EOT
1096: echo $n "What is the internal byte representation of long integer ? $c"
1097: dflt=$endian; rep='12345678 87654321 1234 4321'; . ./myread
1098: endian=$ans
1099: fi
1100: echo "The internal byte representation of your long integers is $endian."
1101:
1102: case $endian in
1103: *8|8*) sizeof_long=8; pretty="$pretty 64-bit version";;
1104: *) sizeof_long=4; pretty="$pretty 32-bit version";;
1105: esac
1106:
1107:
1108: #
1109: # Looking in C lib for some functions.
1110: #
1111: exe=$osname-$arch-tmp$$
1112: echo Checking some common types...
1113: list=ulong; . ./look
1114: echo Looking in C lib for some symbols...
1115: extra_flags=
1116: list=exp2; . ./look
1117: list=strftime; . ./look
1118: case "$arch" in
1119: alpha) list='times ftime';; # gp-dyn has problems with getrusage
1120: *) case "$osname" in
1121: *cygwin*) list='times ftime';; # getrusage based timer always returns 0
1122: *) list='getrusage times ftime';;
1123: esac;;
1124: esac; . ./look
1125: list='sigrelse sigsetmask'; . ./look
1126: list=TIOCGWINSZ; . ./look
1127: list=getrlimit; . ./look
1128: list=opendir; . ./look
1129:
1130: # For install(). Do we need libdl.so?
1131: # on irix and osf1 -ldl not needed
1132: extra_flags=
1133: list=dlopen; . ./look
1134: if test "$has_dlopen" = no; then
1135: echo "Try again, with -ldl this time..."
1136: extra_flags=-ldl; . ./look
1137: if test "$has_dlopen" = yes; then
1138: LIBS="-ldl $LIBS"
1139: fi
1140: fi
1141:
1142: ####################### CONFIGURE - MAKE ####################################
1143: dflt=$prefix; rep=
1144: test "$fastread" = yes || cat <<EOT
1145: ==========================================================================
1146: By default, gp will be installed in $dflt/bin, manual pages under
1147: $dflt/man, etc..., with $dflt as prefix for all installation directories.
1148: If you wish to have binaries under /bin but manual pages under
1149: /usr/local/man, that's ok: you will be prompted separately for each of the
1150: installation directories, the prefix being only used to set the defaults.
1151: (You will be prompted before the actual installation is done.)
1152: The names of executables and libraries contain their version number $version.
1153: A symbolic link to gp or libpari.[a/so] will point to the most recent
1154: installation of GP/PARI.
1155: EOT
1156: echo $n "Installation prefix ? $c"
1157: . ./myread; prefix=$ans
1158:
1159: echo $n "...for architecture-independant files (share-prefix) ? $c"
1160: dflt=$share_prefix; . ./myread; share_prefix=$ans
1161:
1162: if test -z "$share_prefix"; then
1163: dfltman=$prefix/man/man1
1164: dfltall=$prefix/lib/pari
1165: else
1166: dfltman=$share_prefix/man/man1
1167: dfltall=$share_prefix/doc/pari
1168: fi
1169:
1170: echo $n ..."\"gp\" executable ? $c"
1171: dflt=${dfltbindir:-$prefix/bin}; . ./myread; bindir=$ans
1172:
1173: echo $n ..."\"pari\" library ? $c"
1174: dflt=${dfltlibdir:-$prefix/lib}; . ./myread; libdir=$ans
1175:
1176: echo $n ..."include files ? $c"
1177: dflt=${dlftincludedir:-$prefix/include/pari}; . ./myread; includedir=$ans
1178:
1179: echo $n ..."manual pages ? $c"
1180: dflt=${dfltmandir:-$dfltman}; . ./myread; mandir=$ans
1181:
1182: echo $n ..."documentation, examples, and emacs macros ? $c"
1183: dflt=${dfltmiscdir:-$dfltall}; . ./myread; miscdir=$ans
1184:
1185: if test -z "$share_prefix"; then
1186: dfltdat=$miscdir/galdata
1187: else
1188: dfltdat=$share_prefix/pari/galdata
1189: fi
1190:
1191: echo $n ..."miscellaneous data (galois resolvents) ? $c"
1192: dflt=${dfltdatadir:-$dfltdat}; . ./myread; datadir=$ans
1193:
1194: if test "$optimization" = debugging; then static=y; fi
1195: if test "$fastread" != yes; then
1196: if test -z "$DLLD"; then
1197: cat <<EOT
1198: ==========================================================================
1199: We cannot build a dynamic executable. We will build the static version.
1200: EOT
1201: else
1202: cat <<EOT
1203: ==========================================================================
1204: By default, we will try to build the shared library and gp will be an
1205: executable dynamically linked with it. Do you prefer to have the static
1206: archive libpari.a and a statically linked executable (which is a bit
1207: faster, but takes more disk place) ?
1208: You can always type "make all" in case you want both later.
1209: EOT
1210: echo $n "Do you want static executable and library ? $c"
1211: dflt=$static; rep='y n'; . ./myread; static=$ans
1212: fi
1213: fi
1214: case "$static" in
1215: y) echo "Default is static executable and archive library, graphic=$which_graphic_lib" ;;
1216: n) echo "Default is dynamic executable and shared library, graphic=$which_graphic_lib" ;;
1217: esac
1218:
1219: #
1220: # Target directory
1221: #
1222: pre=O
1223: case "$optimization" in
1224: full) objdir=$pre$osname-$arch ;;
1225: debugging) objdir=$pre$osname-$arch.dbg ;;
1226: profiling) objdir=$pre$osname-$arch.prf ;;
1227: esac
1228: if test "$fastread" != yes; then
1229: cat << EOT
1230: ==========================================================================
1231: This is the name of the directory where all the object files will be :
1232: EOT
1233: echo $n ..."Enter dir name : $c"
1234: dflt=$objdir; rep=; . ./myread
1235: objdir=$ans
1236: fi
1237:
1238: #
1239: # For dynamic linking, before and after installing
1240: #
1241: case "$osname" in
1242: *cygwin*) LDDYN="-L$libdir -lpari_dll" ; runpath="$libdir" ;
1243: DYNLIBS=-lpari_dll ; DYNFLAGS=-Dlibpari_USE_DLL ;;
1244: *) LDDYN="-L$libdir -l$libpari_base" ; runpath="$libdir" ;;
1245: esac
1246:
1247: cat << EOT
1248: ==========================================================================
1249: EOT
1250:
1251: ####################### CONFIGURE - SPIT ####################################
1252: #
1253: # Now spit out the results
1254: #
1255: cd $TOP
1256: if test ! -d $objdir; then mkdir -p $objdir; fi
1257: dflt_conf_file=$objdir/$dflt_conf_file
1258:
1259: cat > $dflt_conf_file << EOT
1260: # Config file for Pari $release -- $pretty
1261:
1262: EOT
1263: case "$osname" in
1264: os2) shell_q='"'; echo "shell_q='\"'" >> $dflt_conf_file;;
1265: *) shell_q="'"; echo "shell_q=\"'\"" >> $dflt_conf_file;;
1266: esac
1267:
1268: for variable in\
1269: libpari_base version TOP config_dir src_dir emacs_dir doc_dir\
1270: bindir includedir mandir miscdir libdir datadir\
1271: optimization objdir static suffix\
1272: arch asmarch osname pretty prefix share_prefix\
1273: __gnuc__ gnuas CPP AS ASFLAGS CC cflags DBGFLAGS OPTFLAGS LD LDFLAGS\
1274: DLLD DLSUFFIX soname sodest KERNELCPPFLAGS DLLDFLAGS EXTRADLLDFLAGS\
1275: runpath runpathprefix LDDYN LIBS DYNLIBS DYNFLAGS DYNRELOC\
1276: ranlib gzip zcat emacs perl ln_s make_sh exe_suff\
1277: readline readline_enabledp CPPF_defined rl_refresh_line_oldproto\
1278: rl_appendchar rl_genericbind rl_save_prompt _rl_save_prompt rl_message\
1279: rl_completion_matches rl_completion_func_t\
1280: RLINCLUDE RLLIBS\
1281: sizeof_long endian has_exp2\
1282: has_getrusage has_times has_ulong has_ftime has_strftime has_opendir\
1283: has_sigrelse has_sigsetmask has_dlopen has_TIOCGWINSZ has_getrlimit\
1284: gnuplot extralib X11 Xincroot which_graphic_lib gnuplot_libs\
1285: ; do
1286: eval "echo $variable=\'"'$'"$variable\'" \>\> $dflt_conf_file
1287: done
1288:
1289: . $config_dir/extract_files
1290:
1291: #
1292: # Building...
1293: #
1294: cat << EOT
1295: ==========================================================================
1296: EOT
1297:
1298: echo $n "Shall we try to build pari $version.$patch ($status) now (y/n)? $c"
1299: dflt=n; rep='y n'; . $config_dir/myread
1300:
1301: case $ans in
1302: y) if (make gp); then
1303: echo $n "Shall we install the files where they belong (y/n)? $c"
1304: dflt=n; rep='y n'; . $config_dir/myread
1305: case $ans in
1306: y) make install;;
1307: n) echo "Ok. Type \"make install\" when you are ready";;
1308: esac
1309: fi;;
1310: n) echo "Ok. Type \"make install\" when you are ready";;
1311: esac
1312: echo 'Bye !'
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>