/[ascend]/trunk/base/unixAC213/configure.in
ViewVC logotype

Annotation of /trunk/base/unixAC213/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (hide annotations) (download)
Sat Nov 13 20:52:45 2004 UTC (19 years, 8 months ago) by aw0a
File size: 65087 byte(s)
committing partly modified configure.in plus the moving of config/
1 aw0a 12 #--------------------------------------------------------------------
2     # A configure.in file for ASCEND.
3     #
4     # Process `configure.in' file with `autoconf' to produce
5     # a `configure' script. This `configure.in' was prepared
6     # for AutoConf v2.59.
7     #--------------------------------------------------------------------
8    
9     #--------------------------------------------------------------------
10     # Disable caching since it seems to get in the way
11     # more times than it helps us.
12     #--------------------------------------------------------------------
13     define([AC_CACHE_LOAD], )dnl
14     define([AC_CACHE_SAVE], )dnl
15    
16    
17     #--------------------------------------------------------------------
18     # This file must exist for configure to continue. It's
19     # how we know we're in the right place.
20     #--------------------------------------------------------------------
21     ##AWW20041113: AC_INIT(ascend4/compiler/ascParse.y)
22     AC_INIT(../generic/compiler/ascParse.y)
23    
24    
25     #--------------------------------------------------------------------
26     # CVS Most Recent Revision Data
27     # Put this data after AC_INIT since we want this information
28     # to also appear in configure and autoconf, when creating
29     # configure, strips all comments that appear in configure.in
30     # before AC_INIT
31     # $Revision: 1.38 $
32     # $Date: 2003/11/23 19:36:39 $
33     # $Author: ballan $
34     # $Source: /afs/cs.cmu.edu/project/ascend/Repository/configure.in,v $
35     #--------------------------------------------------------------------
36    
37    
38     #--------------------------------------------------------------------
39     # Where configure should look for files it needs.
40     #--------------------------------------------------------------------
41     AC_CONFIG_AUX_DIR(config)
42    
43     #--------------------------------------------------------------------
44     # Set the output variables prefix and exec_prefix that
45     # determine where things will be installed.
46     #--------------------------------------------------------------------
47     if test "${prefix}" = "NONE"; then
48     prefix=/usr/local
49     fi
50     if test "${exec_prefix}" = "NONE"; then
51     exec_prefix=$prefix
52     fi
53    
54    
55     #--------------------------------------------------------------------
56     # For the Fortran support libraries and the TCL/TK libraries
57     # and header files, we unfortunately need the full path to
58     # these files. The problem with having the full path is that
59     # if the user moves the source tree, things will break unless
60     # the user re-runs configure.
61     #--------------------------------------------------------------------
62     ##AWW20041113: FIXME - I think this is okay
63     ##AWW ascpwd will be set to the path for the directory one is in
64     ##AWW when invoking configure (which may not be where configure
65     ##AWW is located. So if one invokes it using the instruction
66     ##AWW from /home/me/a4/tmp and invokes ../asc4/configure, ascpwd
67     ##AWW would be set to /home/me/a4/tmp.
68     ascpwd=`pwd`
69     fullpathsrcdir=`cd $srcdir ; pwd`
70    
71    
72     #--------------------------------------------------------------------
73     # When one invokes configure from where one is, it is done
74     # with the path $srcdir/configure. For example, if one is
75     # in the directory containing configure, one would invoke
76     # ./configure and $srcdir would have the value ".".
77     #
78     # The asc_include variable is (directory) path to the ascend4
79     # SOURCE directory relative to the immediate subdirectories of
80     # the ascend4 OBJECT directory.
81     # -- If we are building in the source directory ($srcdir is "."
82     # asc_include is simply "../."
83     # -- If the user gives us a full path to the configure script,
84     # we just append "../generic" to that full path:
85     # "$scrdir/../generic"
86     # -- For any other value of $srcdir (like ../src/), we go up
87     # two directories (to get to the top of the OBJECT tree,
88     # insert the source directory, and then go back down one
89     # level to the ascend4 directory: "../../$srcdir/../generic"
90     #--------------------------------------------------------------------
91     ##AWW20041113: FIXME??
92     case "$srcdir" in
93     .)
94     asc_include="../$srcdir"
95     ;;
96     /*)
97     #AWW20041113: asc_include="$srcdir/ascend4"
98     asc_include="$srcdir/../generic"
99     ;;
100     *)
101     #AWW20041113: asc_include="../../$srcdir/ascend4"
102     asc_include="../../$srcdir/../generic"
103     ;;
104     esac
105    
106    
107     #--------------------------------------------------------------------
108     # Do basic checks to determine
109     # * if we have `ranlib'
110     # * if we can create symbolic links
111     # * if `make' sets the MAKE macro
112     # * a bsd-compatible `install' program
113     # If we use the install-sh script that comes with configure,
114     # prefix it with the current directory so it'll work in
115     # subdirectories. Unfortunately, it won't work if the user
116     # moves the source tree.
117     #--------------------------------------------------------------------
118     AC_PROG_RANLIB
119     AC_PROG_LN_S
120     AC_PROG_MAKE_SET
121     AC_PROG_INSTALL
122     ##AWW20041113: FIXME?? No fixing seems necessary.
123     case "X$INSTALL" in
124     X/*)
125     ;;
126     *)
127     INSTALL="$ascpwd/$INSTALL"
128     ;;
129     esac
130    
131    
132     #--------------------------------------------------------------------
133     # Get the host type for various checks along the way
134     #--------------------------------------------------------------------
135     AC_CANONICAL_HOST
136    
137    
138     #--------------------------------------------------------------------
139     # Check for the C compiler: set CC and CFLAGS.
140     # If the user does NOT specify `--enable-gcc' on the configure
141     # command command line, set CC to either the envar CC or `cc'.
142     # Call AC_PROG_CC which will use the value of CC (perhaps set
143     # immediately above) or will check for `gcc' and then for `cc'
144     # if `gcc' is not found.
145     #
146     # If we are using GCC, then assume it groks ANSI. Otherwise,
147     # try to compile a small program using ANSI constructs with
148     # CC. If this fails, try to locate each of the following:
149     # c89 xlc acc
150     # and if successful, see if it compiles an ANSI C program.
151     # (Doing this in a loop would be ideal, but configure caches
152     # the result of AC_CHECK_PROG and uses the cached value for
153     # all but the first pass through the loop. This is also the
154     # reason we have to use a different variable asc_cc1, asc_cc2
155     # for each call to AC_CHECK_PROG.
156     #
157     # If we do not find an ANSI C compiler, print a warning and
158     # use the first value of CC we tried.
159     #--------------------------------------------------------------------
160    
161     AC_ARG_ENABLE(gcc,
162     [
163     ASCEND specific options
164    
165     Compiler options:
166     --enable-gcc allow use of gcc if avaiable],
167     [asc_gcc_ok=$enableval], [asc_gcc_ok=no])
168     if test ! "$asc_gcc_ok" = "yes"; then
169     CC=${CC-cc}
170     fi
171     asc_orig_cc=$CC
172    
173     if test "X$asc_gcc_ok" = "Xyes" ; then
174     asc_ansi_ok=yes
175     else
176     AC_MSG_CHECKING(
177     [whether $CC understands const, void*, and function prototypes])
178     AC_TRY_COMPILE( , [
179     int tstproto(int arg1, char * arg2);
180     int tstconst(const int arg1, const char *arg2);
181     int tstvoidp(const int arg1, const void *arg2); ],
182     [ asc_ansi_ok=yes ], [ asc_ansi_ok=no ])
183     AC_MSG_RESULT($asc_ansi_ok)
184     fi
185    
186     if test "$asc_ansi_ok" = no ; then
187     AC_CHECK_PROG(asc_cc1, c89, c89, NONE)
188     if test ! "$asc_cc1" = NONE ; then
189     CC=$asc_cc1
190     AC_MSG_CHECKING(
191     [whether $CC understands const, void*, and function prototypes])
192     AC_TRY_COMPILE( , [
193     int tstproto(int arg1, char * arg2);
194     int tstconst(const int arg1, const char *arg2);
195     int tstvoidp(const int arg1, const void *arg2); ],
196     [ asc_ansi_ok=yes ], [ asc_ansi_ok=no ])
197     AC_MSG_RESULT($asc_ansi_ok)
198     fi
199     fi
200    
201     if test "$asc_ansi_ok" = no ; then
202     AC_CHECK_PROG(asc_cc2, xlc, xlc, NONE)
203     if test ! "$asc_cc2" = NONE ; then
204     CC=$asc_cc2
205     AC_MSG_CHECKING(
206     [whether $CC understands const, void*, and function prototypes])
207     AC_TRY_COMPILE( , [
208     int tstproto(int arg1, char * arg2);
209     int tstconst(const int arg1, const char *arg2);
210     int tstvoidp(const int arg1, const void *arg2); ],
211     [ asc_ansi_ok=yes ], [ asc_ansi_ok=no ])
212     AC_MSG_RESULT($asc_ansi_ok)
213     fi
214     fi
215    
216     if test "$asc_ansi_ok" = no ; then
217     AC_CHECK_PROG(asc_cc3, acc, acc, NONE)
218     if test ! "$asc_cc3" = NONE ; then
219     CC=$asc_cc3
220     AC_MSG_CHECKING(
221     [whether $CC understands const, void*, and function prototypes])
222     AC_TRY_COMPILE( , [
223     int tstproto(int arg1, char * arg2);
224     int tstconst(const int arg1, const char *arg2);
225     int tstvoidp(const int arg1, const void *arg2); ],
226     [ asc_ansi_ok=yes ], [ asc_ansi_ok=no ])
227     AC_MSG_RESULT($asc_ansi_ok)
228     fi
229     fi
230    
231     AC_PROG_CC
232    
233     if test "$asc_ansi_ok" = no ; then
234     CC=$asc_orig_cc
235     AC_MSG_ERROR([Cannot find an ANSI C compiler. ASCEND will not build
236     without an ANSI compiler. If you have an ANSI compiler which
237     configure is not finding, set the CC environment variable to
238     the full path fo the compiler and rerun configure.])
239     fi
240    
241    
242     #--------------------------------------------------------------------
243     # Do other misc checks with CC and CFLAGS.
244     #
245     # Determine how to run the C preprocessor.
246     #
247     # If the user specifies --enable-optimization, remove `-g'
248     # from CFLAGS, add `-O' to CFLAGS, and define `NDEBUG'. If
249     # we are not building optimized, check for special libraries
250     # needed for building a debugging binary (currenly only
251     # /usr/lib/end.o under HPUX).
252     #
253     # Check if we're running on AIX; if so, add `-D_ALL_SOURCE'
254     # to CFLAGS.
255     #
256     # Check if we're running on HPUX; if so, add -D_HPUX_SOURCE'
257     # to CFLAGS unless the C preprocessor goes it for us.
258     #--------------------------------------------------------------------
259    
260     AC_PROG_CPP
261    
262     AC_ARG_ENABLE(optimization,
263     [ --enable-optimization optimize the C code while building ascend],
264     [asc_do_opt="$enableval"], [asc_do_opt=no])
265     if test "$asc_do_opt" = yes; then
266     CFLAGS=`echo "-O $CFLAGS " | sed 's/ -g / /g'`
267     AC_DEFINE(NDEBUG)
268     else
269     AC_PATH_PROG(DEBUG_LIBS, end.o, , /usr/lib)
270     fi
271    
272     AC_MSG_CHECKING([for AIX])
273     AC_EGREP_CPP(yes, [
274     #ifdef _AIX
275     yes
276     #endif
277     ], [ asc_aix=yes ; AC_DEFINE(_ALL_SOURCE) ], [asc_aix=no])
278     AC_MSG_RESULT($asc_aix)
279    
280     AC_MSG_CHECKING([whether -D_HPUX_SOURCE is needed])
281     AC_EGREP_CPP(yes, [
282     #ifdef __hpux
283     #ifndef _HPUX_SOURCE
284     yes
285     #endif
286     #endif
287     ], [ asc_hpux=yes ; AC_DEFINE(_HPUX_SOURCE) ], [asc_hpux=no])
288     AC_MSG_RESULT($asc_hpux)
289    
290     # Check the size of pointers; if cross compiling, assume 32 bit pointers
291     AC_CHECK_SIZEOF(void *, 4)
292    
293    
294     #--------------------------------------------------------------------
295     # Set YACC.
296     # See if we can find `yacc' ourselves; if not, call the
297     # autoconf macro which looks for `bison' and then for `yacc'
298     #--------------------------------------------------------------------
299     asc_found_yacc=0
300     AC_CHECK_PROG(YACC, yacc, yacc, [asc_found_yacc=no])
301     if test "$asc_found_yacc" = no ; then
302     AC_PROG_YACC
303     fi
304    
305    
306     #--------------------------------------------------------------------
307     # Set LEX.
308     # ASCEND requires a `flex' which understands -P (allows you to
309     # specify a prefix other than `yy'). The -P flag was added at
310     # the same time a -V (version) flag was added (version 2.4.1),
311     # so if `flex' understands -V, it'll understand -P (checking
312     # for -P directly requires a flex input file).
313     #
314     # 1. If `LEX' is not set, look for `flex' and set `LEX' to
315     # `flex' if found.
316     # 2. If `flex' was found, see if it understands -V. If so,
317     # set `scanner_src' and `typer_src' to have `flex' generate
318     # the C files from the flex input files
319     # ascend4/compiler/scanner.l & ascend4/interface/typelex.l
320     # We don't need to look for libfl.a since we define
321     # yywrap() ourselves.
322     # 3. If `flex' wasn't found or was found but isn't new enough:
323     # a. Print a warning message
324     # b. Set `scanner_src' and `typer_src' to use pre-generated
325     # C files for the flex files mentioned in (2).
326     # c. Set `LEX' to `lex'
327     # d. Search for the lex library `libl.a' and set LEXLIB to
328     # its location.
329     #--------------------------------------------------------------------
330     AC_CHECK_PROG(LEX, flex, flex)
331    
332     if test -n "$LEX" ; then
333     AC_MSG_CHECKING([whether $LEX is at least version 2.4.1])
334     echo "$LEX -V" 1>&5
335     if $LEX -V 1>&5 2>&5 ; then
336     AC_MSG_RESULT(yes)
337     scanner_src="scanner.c.from.flex"
338     typer_src="typelex.c.from.flex"
339     else
340     AC_MSG_RESULT(no)
341     LEX=''
342     fi
343     fi
344    
345     if test -z "$LEX" ; then
346     AC_MSG_WARN([Cannot find a flex lexer version 2.4.1 or greater.
347     Using pregenerated C files for ascend4/compiler/scanner.l
348     and ascend4/interface/typelex.l. If you have flex 2.4.1
349     or newer, set the LEX environment variable to its location
350     and run configure again.])
351     scanner_src="scanner.c.from.c"
352     typer_src="typelex.c.from.c"
353    
354     # let configure set LEX and LEXLIB even though we won't be using them
355     AC_PROG_LEX
356     fi
357    
358    
359     #--------------------------------------------------------------------
360     # Math libraries.
361     # On a few very rare systems, all of the libm.a stuff is
362     # already in libc.a. Set compiler flags accordingly.
363     # Also, Linux requires the "ieee" library for math to work
364     # right (and it must appear before "-lm").
365     #
366     # When building on HPUX with GCC, GCC cannot find `copysign'
367     # because it lives in an odd place; see if we need to add
368     # this odd place to MATH_LIBS.
369     #
370     # See if erf(), the error function, exists; if so, define
371     # HAVE_ERF.
372     #--------------------------------------------------------------------
373     AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
374    
375     AC_CHECK_LIB(ieee, printf, [MATH_LIBS="-lieee $MATH_LIBS"])
376    
377     if test -n "$MATH_LIBS" ; then
378     AC_CHECK_LIB(m, copysign, ,
379     AC_CHECK_LIB(m, drem, [MATH_LIBS="$MATH_LIBS /lib/pa1.1/libM.a"]
380     , , /lib/pa1.1/libM.a
381     ),
382     $MATH_LIBS)
383     fi
384    
385     # store the current list of libraries, add the math libraries to LIBS,
386     # check for erf(), then reset the value of LIBS.
387     asc_keep_LIBS="$LIBS"
388     LIBS="$LIBS $MATH_LIBS"
389     AC_CHECK_FUNCS(erf)
390     LIBS="$asc_keep_LIBS"
391    
392    
393     #--------------------------------------------------------------------
394     # Check for X11.
395     # We'll use the simple autoconf builtin macro for finding
396     # X11 until we find a reason not to.
397     #
398     # On Solaris and IRIX, add the path to the X library to the
399     # run-time shared-library-search-path so the ASCEND binary
400     # can find the X library without the user having to set
401     # LD_LIBRARY_PATH
402     #--------------------------------------------------------------------
403     AC_PATH_X
404     if test -n "$x_includes"; then
405     X11_INCLUDES="-I$x_includes"
406     fi
407     if test -n "$x_libraries"; then
408     X11_LIBRARIES="-L$x_libraries"
409     case "$host" in
410     sparc-sun-solaris*)
411     X11_RUN_PATH="-R$x_libraries"
412     ;;
413     mips-sgi-irix*)
414     X11_RUN_PATH="-rpath $x_libraries"
415     ;;
416     *)
417     X11_RUN_PATH=""
418     ;;
419     esac
420     fi
421    
422    
423     #--------------------------------------------------------------------
424     # Check for the existence of various libraries. The order here
425     # is important, so that then end up in the right order in the
426     # command line generated by make. The -lsocket and -lnsl
427     # libraries require a couple of special tricks:
428     # 1. Use "connect" and "accept" to check for -lsocket, and
429     # "gethostbyname" to check for -lnsl.
430     # 2. Use each function name only once: can't redo a check
431     # because autoconf caches the results of the last check
432     # and won't redo it.
433     # 3. Use -lnsl and -lsocket only if they supply procedures that
434     # aren't already present in the normal libraries. This is
435     # because IRIX 5.2 has libraries, but they aren't needed and
436     # they're bogus: they goof up name resolution if used.
437     # 4. On some SVR4 systems, can't use -lsocket without -lnsl
438     # too. To get around this problem, check for both libraries
439     # together if -lsocket doesn't work by itself.
440     #--------------------------------------------------------------------
441     dnl AC_CHECK_LIB(Xbsd, printf, [LIBS="$LIBS -lXbsd"])
442    
443     asc_checkBoth=0
444     AC_CHECK_FUNC(connect, [asc_checkSocket=0], [asc_checkSocket=1])
445     if test "$asc_checkSocket" = 1; then
446     AC_CHECK_LIB(socket, printf, [X11_EXTRA_LIBS="-lsocket"],[asc_checkBoth=1])
447     fi
448     if test "$asc_checkBoth" = 1; then
449     asc_oldLibs=$LIBS
450     X11_EXTRA_LIBS="-lsocket -lnsl"
451     LIBS="$LIBS $X11_EXTRA_LIBS"
452     AC_CHECK_FUNC(accept, asc_checkNsl=0, [X11_EXTRA_LIBS=""])
453     LIBS=$asc_oldLibs
454     fi
455     asc_oldLibs=$LIBS
456     LIBS="$LIBS $X11_EXTRA_LIBS"
457     AC_CHECK_FUNC(gethostbyname, ,
458     AC_CHECK_LIB(nsl, printf, [X11_EXTRA_LIBS="$X11_EXTRA_LIBS -lnsl"]))
459     LIBS=$asc_oldLibs
460    
461    
462     #--------------------------------------------------------------------
463     # The following comes directly from the configure.in file for
464     # Tcl8.0.
465     #
466     # The statements below define a collection of symbols related to
467     # dynamic loading and shared libraries:
468     #
469     # DL_OBJS - Name of the object file that implements dynamic
470     # loading for ASCEND on this system.
471     # DL_LIBS - Library file(s) to include in tclsh and other base
472     # applications in order for the "load" command to work.
473     # LD_FLAGS - Flags to pass to the compiler when linking object
474     # files into an executable application binary such
475     # as tclsh.
476     # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
477     # that tell the run-time dynamic linker where to look
478     # for shared libraries such as libtcl.so. Depends on
479     # the variable LIB_RUNTIME_DIR in the Makefile.
480     # MAKE_LIB - Command to execute to build the ASCEND library;
481     # differs depending on whether or not ASCEND is being
482     # compiled as a shared library.
483     # SHLIB_CFLAGS - Flags to pass to cc when compiling the components
484     # of a shared library (may request position-independent
485     # code, among other things).
486     # SHLIB_LD - Base command to use for combining object files
487     # into a shared library.
488     # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
489     # creating shared libraries. This symbol typically
490     # goes at the end of the "ld" commands that build
491     # shared libraries. The value of the symbol is
492     # "${LIBS}" if all of the dependent libraries should
493     # be specified when creating a shared library. If
494     # dependent libraries should not be specified (as on
495     # SunOS 4.x, where they cause the link to fail, or in
496     # general if ASCEND and Tk aren't themselves shared
497     # libraries), then this symbol has an empty string
498     # as its value.
499     # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
500     # extensions. An empty string means we don't know how
501     # to use shared libraries on this platform.
502     # ASC_LIB_FILE - Name of the file that contains the ASCEND library, such
503     # as libtcl7.8.so or libtcl7.8.a.
504     # ASC_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
505     # in the shared library name, using the $VERSION variable
506     # to put the version in the right place. This is used
507     # by platforms that need non-standard library names.
508     # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
509     # to have a version after the .so, and ${VERSION}.a
510     # on AIX, since the ASCEND shared library needs to have
511     # a .a extension whereas shared objects for loadable
512     # extensions have a .so extension. Defaults to
513     # ${VERSION}${SHLIB_SUFFIX}.
514     #--------------------------------------------------------------------
515    
516     # Step 1: set the variable "system" to hold the name and version number
517     # for the system. This can usually be done via the "uname" command, but
518     # there are a few systems, like Next, where this doesn't work.
519    
520     # Changed this to use the "$host" variable from AC_CANONICAL_HOST
521    
522     # Step 2: check for existence of -ldl library. This is needed because
523     # Linux can use either -ldl or -ldld for dynamic loading.
524    
525     AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
526    
527     # Step 3: set configuration options based on system name and version.
528    
529     ASC_SHARED_LIB_SUFFIX=""
530     ASC_UNSHARED_LIB_SUFFIX=""
531     ASC_LIB_VERSIONS_OK=ok
532     case $host in
533     *-aix*)
534     SHLIB_CFLAGS=""
535     SHLIB_LD="$fullpathsrcdir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512"
536     SHLIB_LD_LIBS='${LIBS}'
537     SHLIB_SUFFIX=".so"
538     DL_OBJS=""
539     DL_LIBS="-lld"
540     LD_FLAGS=""
541     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
542     ASC_SHARED_LIB_SUFFIX='${VERSION}.a'
543     ;;
544     *-bsdi*)
545     SHLIB_CFLAGS=""
546     SHLIB_LD="shlicc -r"
547     SHLIB_LD_LIBS='${LIBS}'
548     SHLIB_SUFFIX=".so"
549     DL_OBJS=""
550     DL_LIBS="-ldl"
551     LD_FLAGS=""
552     LD_SEARCH_FLAGS=""
553     ;;
554     *-dgux*)
555     SHLIB_CFLAGS="-K PIC"
556     SHLIB_LD="cc -G"
557     SHLIB_LD_LIBS=""
558     SHLIB_SUFFIX=".so"
559     DL_OBJS=""
560     DL_LIBS="-ldl"
561     LD_FLAGS=""
562     LD_SEARCH_FLAGS=""
563     ;;
564     *-hpux8*|*-hpux9*|*-hpux10*)
565     AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
566     if test "$tcl_ok" = yes; then
567     SHLIB_CFLAGS="+z"
568     SHLIB_LD="ld -b"
569     SHLIB_LD_LIBS=""
570     SHLIB_SUFFIX=".sl"
571     DL_OBJS=""
572     DL_LIBS="-ldld"
573     LD_FLAGS="-Wl,-E"
574     LD_SEARCH_FLAGS='-Wl,+b,${LIB_RUNTIME_DIR}:.'
575     fi
576     ;;
577     *-irix4*)
578     SHLIB_CFLAGS="-G 0"
579     SHLIB_SUFFIX=".a"
580     SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
581     SHLIB_LD_LIBS='${LIBS}'
582     DL_OBJS=""
583     DL_LIBS=""
584     LD_FLAGS="-Wl,-D,08000000"
585     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
586     ASC_SHARED_LIB_SUFFIX='${VERSION}.a'
587     ;;
588     *-irix5*|*-irix6.*)
589     SHLIB_CFLAGS=""
590     SHLIB_LD="ld -shared -rdata_shared"
591     SHLIB_LD_LIBS=""
592     SHLIB_SUFFIX=".so"
593     DL_OBJS=""
594     DL_LIBS=""
595     LD_FLAGS=""
596     LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
597     ;;
598     *-linux*)
599     SHLIB_CFLAGS="-fPIC"
600     SHLIB_LD_LIBS=""
601     SHLIB_SUFFIX=".so"
602     if test "$have_dl" = yes; then
603     SHLIB_LD="${CC} -shared"
604     DL_OBJS=""
605     DL_LIBS="-ldl"
606     LD_FLAGS="-rdynamic"
607     LD_SEARCH_FLAGS=""
608     else
609     AC_CHECK_HEADER(dld.h, [
610     SHLIB_LD="ld -shared"
611     DL_OBJS=""
612     DL_LIBS="-ldld"
613     LD_FLAGS=""
614     LD_SEARCH_FLAGS=""])
615     fi
616     ;;
617     MP-RAS-02*)
618     SHLIB_CFLAGS="-K PIC"
619     SHLIB_LD="cc -G"
620     SHLIB_LD_LIBS=""
621     SHLIB_SUFFIX=".so"
622     DL_OBJS=""
623     DL_LIBS="-ldl"
624     LD_FLAGS=""
625     LD_SEARCH_FLAGS=""
626     ;;
627     MP-RAS-*)
628     SHLIB_CFLAGS="-K PIC"
629     SHLIB_LD="cc -G"
630     SHLIB_LD_LIBS=""
631     SHLIB_SUFFIX=".so"
632     DL_OBJS=""
633     DL_LIBS="-ldl"
634     LD_FLAGS="-Wl,-Bexport"
635     LD_SEARCH_FLAGS=""
636     ;;
637     *-netbsd*|*-freebsd*|*-openbsd*)
638     # Not available on all versions: check for include file.
639     AC_CHECK_HEADER(dlfcn.h, [
640     SHLIB_CFLAGS="-fpic"
641     SHLIB_LD="ld -Bshareable -x"
642     SHLIB_LD_LIBS=""
643     SHLIB_SUFFIX=".so"
644     DL_OBJS=""
645     DL_LIBS=""
646     LD_FLAGS=""
647     LD_SEARCH_FLAGS=""
648     ASC_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0'
649     ], [
650     SHLIB_CFLAGS=""
651     SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
652     SHLIB_LD_LIBS='${LIBS}'
653     SHLIB_SUFFIX=".a"
654     DL_OBJS=""
655     DL_LIBS=""
656     LD_FLAGS=""
657     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
658     ASC_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
659     ])
660    
661     # FreeBSD doesn't handle version numbers with dots.
662    
663     ASC_UNSHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
664     ASC_LIB_VERSIONS_OK=nodots
665     ;;
666     *-nextstep*)
667     SHLIB_CFLAGS=""
668     SHLIB_LD="cc -nostdlib -r"
669     SHLIB_LD_LIBS=""
670     SHLIB_SUFFIX=".so"
671     DL_OBJS=""
672     DL_LIBS=""
673     LD_FLAGS=""
674     LD_SEARCH_FLAGS=""
675     ;;
676     alpha-dec-osf*)
677     # Digital OSF/1
678     SHLIB_CFLAGS=""
679     SHLIB_LD='ld -shared -expect_unresolved "*"'
680     SHLIB_LD_LIBS=""
681     SHLIB_SUFFIX=".so"
682     DL_OBJS=""
683     DL_LIBS=""
684     LD_FLAGS=""
685     LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
686     ;;
687     *-riscos*)
688     SHLIB_CFLAGS="-G 0"
689     SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
690     SHLIB_LD_LIBS='${LIBS}'
691     SHLIB_SUFFIX=".a"
692     DL_OBJS=""
693     DL_LIBS=""
694     LD_FLAGS="-Wl,-D,08000000"
695     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
696     ;;
697     SCO_SV-3.2*)
698     # Note, dlopen is available only on SCO 3.2.5 and greater. However,
699     # this test works, since "uname -s" was non-standard in 3.2.4 and
700     # below.
701     SHLIB_CFLAGS="-Kpic -belf"
702     SHLIB_LD="ld -G"
703     SHLIB_LD_LIBS=""
704     SHLIB_SUFFIX=".so"
705     DL_OBJS=""
706     DL_LIBS=""
707     LD_FLAGS="-belf -Wl,-Bexport"
708     LD_SEARCH_FLAGS=""
709     ;;
710     *-sni-sysv*)
711     SHLIB_CFLAGS="-K PIC"
712     SHLIB_LD="cc -G"
713     SHLIB_LD_LIBS=""
714     SHLIB_SUFFIX=".so"
715     DL_OBJS=""
716     DL_LIBS="-ldl"
717     LD_FLAGS=""
718     LD_SEARCH_FLAGS=""
719     ;;
720     *-sunos4*)
721     SHLIB_CFLAGS="-PIC"
722     SHLIB_LD="ld"
723     SHLIB_LD_LIBS=""
724     SHLIB_SUFFIX=".so"
725     DL_OBJS=""
726     DL_LIBS="-ldl"
727     LD_FLAGS=""
728     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
729    
730     # SunOS can't handle version numbers with dots in them in library
731     # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
732     # requires an extra version number at the end of .so file names.
733     # So, the library has to have a name like libtcl75.so.1.0
734    
735     ASC_SHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.so.1.0'
736     ASC_UNSHARED_LIB_SUFFIX='`echo ${VERSION} | tr -d .`.a'
737     ASC_LIB_VERSIONS_OK=nodots
738     ;;
739     *-solaris*)
740     SHLIB_CFLAGS="-KPIC"
741     SHLIB_LD="/usr/ccs/bin/ld -G -z text"
742    
743     # Note: need the LIBS below, otherwise Tk won't find ASCEND's
744     # symbols when dynamically loaded into tclsh.
745    
746     SHLIB_LD_LIBS='${LIBS}'
747     SHLIB_SUFFIX=".so"
748     DL_OBJS=""
749     DL_LIBS="-ldl"
750     LD_FLAGS=""
751     LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
752     ;;
753     *-ultrix4*)
754     SHLIB_CFLAGS="-G 0"
755     SHLIB_SUFFIX=".a"
756     SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
757     SHLIB_LD_LIBS='${LIBS}'
758     DL_OBJS=""
759     DL_LIBS=""
760     LD_FLAGS="-Wl,-D,08000000"
761     LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
762     ;;
763     mips-dde-sysv*)
764     SHLIB_CFLAGS="-KPIC"
765     SHLIB_LD="cc -G"
766     SHLIB_LD_LIBS=""
767     SHLIB_SUFFIX=".so"
768     DL_OBJS=""
769     DL_LIBS="-ldl"
770     # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
771     # that don't grok the -Bexport option. Test that it does.
772     hold_ldflags=$LDFLAGS
773     AC_MSG_CHECKING([for ld accepts -Bexport flag])
774     LDFLAGS="${LDFLAGS} -Wl,-Bexport"
775     AC_TRY_LINK(, [int i;], found=yes, found=no)
776     LDFLAGS=$hold_ldflags
777     AC_MSG_RESULT($found)
778     if test "$found" = yes; then
779     LD_FLAGS="-Wl,-Bexport"
780     else
781     LD_FLAGS=""
782     fi
783     LD_SEARCH_FLAGS=""
784     ;;
785     esac
786    
787     #--------------------------------------------------------------------
788     # TCL / TK / TK-TABLE
789     #
790     # The user can specify the location of the Tcl and/or Tk
791     # libraries using the --with-tcl and --with-tk configure
792     # options. Print a warning if the user tries to say
793     # --without-tcl since ASCEND requires Tcl/Tk.
794     #
795     # If the user does not specify the location, we need to search
796     # for either shared or static versions of the Tcl and Tk
797     # libraries, and they must be for version 8.x of Tcl/Tk.
798     #
799     # Check for the static Tcl library in a list of reasonable
800     # locations. If we find it, verify that it is from Tcl 8.0 by
801     # looking for the symbol `TclCompileCatchCmd'. Remember, we
802     # need the math library and the dynamic loader library (-ldl or
803     # -ldld) to avoid undefined symbols when we test the version of
804     # the Tcl library.
805     #
806     # If we can't find a static Tcl8.0 library, try to find a
807     # dynamic one by calling AC_CHECK_LIB and looking for the
808     # function `TclCompileCatchCmd'. If we fail, print an error
809     # message and exit configure.
810     #
811     # Search for a version of tcl.h that contains `8.' in the
812     # TCL_MAJOR_VERSION macro; we look in a list of reasonable
813     # locations, then call AC_EGREP_HEADER to look for us.
814     #
815     # Repeat the process for the Tk library; the symbol we want is
816     # `Tk_NameOfFont'; remember we need the X library---and all the
817     # libraries it needs---as well as the Tcl library to avoid
818     # undefined symbols when we test the version of the Tk library.
819     #
820     # The user can use --with-tktable to specify a location for a
821     # static version of the Tk-Table library. If a value is
822     # specified, assume it is good and define the cpp macro
823     # STATIC_TABLE.
824     #
825     # If a value is not specified, look for libTktable.a; if we
826     # find it, assume it works and define the cpp macro
827     # STATIC_TABLE. If we don't find it, assume ASCEND will be
828     # able to dynamically load it at run time and tell the user
829     # about our assumption.
830     #--------------------------------------------------------------------
831     #
832     # a list of directories to search for the Tcl/Tk libraries
833     asc_tcl_library_dirs="
834     /usr/local/lib/ascend/lib
835     $prefix/lib:$exec_prefix/lib
836     $ascpwd/tcl8.0
837     $ascpwd/tcl8.0/unix
838     $ascpwd/tk8.0
839     $ascpwd/tk8.0/unix
840     $ascpwd/ascend4/lib
841     /lib
842     /usr/lib
843     /usr/local/lib
844     /usr/contributed/lib
845     /afs/cs/project/ascend/depot/@sys/lib
846     "
847     # a list of directories to search for the Tcl/Tk include files
848     asc_tcl_include_dirs="
849     /usr/local/lib/ascend/include
850     $prefix/include
851     $fullpathsrcdir/tcl8.0
852     $fullpathsrcdir/tcl8.0/generic
853     $fullpathsrcdir/tk8.0
854     $fullpathsrcdir/tk8.0/generic
855     $fullpathsrcdir/ascend4/include
856     $ascpwd/ascend4/include
857     /usr/include
858     /usr/local/include
859     /usr/contributed/include
860     /afs/cs/project/ascend/depot/common/include
861     "
862     # a list of directories to search for the TkTable library
863     asc_tk_table_dirs="
864     /usr/local/lib/ascend/lib/Tktable
865     $prefix/lib/Tktable
866     $exec_prefix/lib/Tktable
867     $ascpwd/tkTable1.80
868     $ascpwd/ascend4/lib
869     $ascpwd/ascend4/lib/Tktable
870     /afs/cs/project/ascend/depot/@sys/lib/Tktable
871     "
872     # see if the user gave us the location of the Tcl8.0
873     # library and/or header file
874     #
875     AC_ARG_WITH(tcl,
876     [Location of Tcl, Tk, and tkTable:
877     --with-tcl=LIBRARY,HEADER
878     The location of the Tcl8.0 library and/or header
879     For a static Tcl8.0 library, give the full path:
880     --with-tcl='/usr/local/lib/libtcl8.0.a'
881     For a dynamic library, give any -L options required:
882     --with-tcl='-L/usr/local/lib -ltcl8.0'
883     To specify only the header, leave off the library:
884     --with-tcl=',/usr/local/include/tcl.h'] ,
885     , [with_tcl=yes])
886    
887     case "$with_tcl" in
888     no)
889     # User specified --without-tcl; this makes no sense,
890     # print a warning and search for it ourselves
891     AC_MSG_WARN([Bad option '--without-tcl'
892     ASCEND must be compiled with Tcl8.0.])
893     with_tcllib=_searching
894     with_tclhdr=_searching
895     ;;
896     yes|,|"")
897     # User didn't give the option or didn't give useful
898     # information, search for it ourselves
899     with_tcllib=_searching
900     with_tclhdr=_searching
901     ;;
902     ,*)
903     # Only the header was specified.
904     with_tcllib=_searching
905     TCL_HDR=`echo $with_tcl | sed 's/^,//'`
906     ;;
907     *,?*)
908     # Both the library and the header were specified
909     TCL_LIB=`echo $with_tcl | sed 's/,.*$//'`
910     TCL_HDR=`echo $with_tcl | sed 's/^.*,//'`
911     ;;
912     *)
913     # Only the library was specified
914     TCL_LIB=`echo $with_tcl | sed 's/,$//'`
915     with_tclhdr=_searching
916     ;;
917     esac
918    
919     # try to find a static version of the Tcl8.0 library
920     #
921     if test "X$with_tcllib" = X_searching ; then
922     AC_PATH_PROGS(TCL_LIB, libtcl8.0.a libtcl80.a libtcl8.3.a, , $asc_tcl_library_dirs)
923     if test -z "$TCL_LIB" ; then
924     TCL_LIB=_searching
925     fi
926     else
927     AC_MSG_RESULT([checking for tcl library... $TCL_LIB])
928     fi
929    
930     # verify the TCL_LIB
931     if test ! "X$TCL_LIB" = X_searching ; then
932     AC_MSG_CHECKING([whether $TCL_LIB is for Tcl8.3])
933     asc_libs_orig=$LIBS
934     LIBS="$TCL_LIB $X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS $LIBS"
935     AC_TRY_LINK( , [TclCompileCatchCmd()], , [TCL_LIB=_searching]);
936     if test "X$TCL_LIB" = X_searching ; then
937     AC_MSG_RESULT(no)
938     else
939     AC_MSG_RESULT(yes)
940     fi
941     LIBS=$asc_libs_orig
942     fi
943    
944     # see if the default LPATH can find the Tcl8.0 library
945     #
946     if test "X$TCL_LIB" = X_searching ; then
947     AC_CHECK_LIB(tcl83, TclCompileCatchCmd, [TCL_LIB="-ltcl83"] , ,
948     [$X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
949     fi
950     if test "X$TCL_LIB" = X_searching ; then
951     AC_CHECK_LIB(tcl8.3, TclCompileCatchCmd, [TCL_LIB="-ltcl8.3"] , ,
952     [$X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
953     fi
954     if test "X$TCL_LIB" = X_searching ; then
955     AC_CHECK_LIB(tcl8.0, TclCompileCatchCmd, [TCL_LIB="-ltcl8.0"] , ,
956     [$X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
957     fi
958     if test "X$TCL_LIB" = X_searching ; then
959     AC_CHECK_LIB(tcl80, TclCompileCatchCmd, [TCL_LIB="-ltcl80"] , ,
960     [$X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
961     fi
962     if test "X$TCL_LIB" = X_searching ; then
963     AC_CHECK_LIB(tcl, TclCompileCatchCmd, [TCL_LIB="-ltcl"] , ,
964     [$X11_LIBRARIES $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
965     fi
966    
967     # give up searching for the Tcl8.0 library
968     #
969     if test "X$TCL_LIB" = X_searching ; then
970     AC_MSG_ERROR([Cannot find a compatiable Tcl library.
971     You must build and install Tcl version 8.3 before you
972     can build ASCEND. If you have installed the correct version
973     of Tcl, run configure again with the argument:
974     --with-tcl=LIBRARY,HEADER
975     where LIBRARY and HEADER are the full paths to the Tcl8.3
976     library file and header file, respectively.])
977     fi
978    
979     # see if the user gave us the location of the Tcl8.0 header file
980     #
981     if test ! "X$with_tclhdr" = X_searching ; then
982     if test ! -f "$TCL_HDR" ; then
983     AC_MSG_WARN([user specified Tcl header file, $TCL_HDR, does not exist])
984     with_tclhdr=_searching
985     TCL_HDR=''
986     fi
987     fi
988     if test "X$with_tclhdr" = X_searching ; then
989     AC_PATH_PROG(TCL_HDR, tcl.h, , $asc_tcl_include_dirs)
990     if test -z "$TCL_HDR" ; then
991     AC_EGREP_HEADER([TCL_MAJOR_VERSION.*8], tcl.h, [TCL_HDR='tcl.h'], )
992     fi
993     else
994     AC_MSG_RESULT([checking for tcl header... $TCL_HDR])
995     fi
996     if test -f "$TCL_HDR" ; then
997     AC_MSG_CHECKING([whether $TCL_HDR is for version 8])
998     echo 'grep TCL_MAJOR_VERSION "$TCL_HDR" 2>&5' 1>&5
999     grep_tcl_h=`grep TCL_MAJOR_VERSION "$TCL_HDR" 2>&5`
1000     echo $grep_tcl_h 1>&5
1001     case "$grep_tcl_h" in
1002     *8)
1003     AC_MSG_RESULT(yes)
1004     ;;
1005     *)
1006     AC_MSG_RESULT(no)
1007     TCL_HDR=
1008     ;;
1009     esac
1010     fi
1011     if test -z "$TCL_HDR" ; then
1012     AC_MSG_ERROR([Cannot find a compatiable Tcl header file.
1013     You must build and install Tcl version 8.3 (but not yet 8.4) before you
1014     can build ASCEND. If you have installed the correct version
1015     of Tcl, run configure again with the argument:
1016     --with-tcl=LIBRARY,HEADER
1017     where LIBRARY and HEADER are the full paths to the Tcl8.3
1018     library file and header file, respectively.])
1019     fi
1020     TCL_HDR=`echo $TCL_HDR | sed 's,tcl\.h$,,'`
1021     if test -n "$TCL_HDR" ; then
1022     TCL_HDR="-I$TCL_HDR"
1023     fi
1024    
1025    
1026     ###### REPEAT FOR TK
1027     #
1028     # see if the user gave us the location of the Tk8.3
1029     # library and/or header file
1030     #
1031     AC_ARG_WITH(tk,
1032     [ --with-tk=LIBRARY,HEADER
1033     The location of the Tk8.0 library and/or header
1034     For a static Tk8.0 library, give the full path:
1035     --with-tk='/usr/local/lib/libtk8.3.a'
1036     For a dynamic library, give any -L options required:
1037     --with-tk='-L/usr/local/lib -ltk8.3'
1038     To specify only the header, leave off the library:
1039     --with-tk=',/usr/local/include/tk.h'] ,
1040     , [with_tk=yes])
1041    
1042     case "$with_tk" in
1043     no)
1044     # User specified --without-tk; this makes no sense,
1045     # print a warning and search for it ourselves
1046     AC_MSG_WARN([Bad option '--without-tk'
1047     ASCEND must be compiled with Tk8.0.])
1048     with_tklib=_searching
1049     with_tkhdr=_searching
1050     ;;
1051     yes|,|"")
1052     # User didn't give the option or didn't give useful
1053     # information, search for it ourselves
1054     with_tklib=_searching
1055     with_tkhdr=_searching
1056     ;;
1057     ,*)
1058     # Only the header was specified.
1059     with_tklib=_searching
1060     TK_HDR=`echo $with_tk | sed 's/^,//'`
1061     ;;
1062     *,?*)
1063     # Both the library and the header were specified
1064     TK_LIB=`echo $with_tk | sed 's/,.*$//'`
1065     TK_HDR=`echo $with_tk | sed 's/^.*,//'`
1066     ;;
1067     *)
1068     # Only the library was specified
1069     TK_LIB=`echo $with_tk | sed 's/,$//'`
1070     with_tkhdr=_searching
1071     ;;
1072     esac
1073    
1074     # try to find a static version of the Tk8.0 library
1075     #
1076     if test "X$with_tklib" = X_searching ; then
1077     AC_PATH_PROGS(TK_LIB, libtk8.0.a libtk80.a libtk.a libtk8.3.a, , $asc_tcl_library_dirs)
1078     if test -z "TK_LIB" ; then
1079     TK_LIB=_searching
1080     fi
1081     else
1082     AC_MSG_RESULT([checking for tk library... $TK_LIB])
1083     fi
1084    
1085     # verify the TK_LIB
1086     #
1087     if test ! "X$TK_LIB" = X_searching ; then
1088     AC_MSG_CHECKING([whether $TK_LIB is for Tk8.0])
1089     asc_libs_orig=$LIBS
1090     LIBS="$TK_LIB $TCL_LIB $X11_LIBRARIES -lX11 $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS $LIBS"
1091     AC_TRY_LINK( , [Tk_NameOfFont()], , [TK_LIB=_searching]);
1092     if test "X$TK_LIB" = X_searching ; then
1093     AC_MSG_RESULT(no)
1094     else
1095     AC_MSG_RESULT(yes)
1096     fi
1097     LIBS=$asc_libs_orig
1098     fi
1099    
1100     # see if the default LPATH can find the Tk8.0 library
1101     #
1102     if test "X$TK_LIB" = X_searching ; then
1103     AC_MSG_RESULT([checking for a dynamically loaded Tk8.0 library])
1104     AC_CHECK_LIB(tk8.0, Tk_NameOfFont, [TK_LIB="-ltk8.0"] , ,
1105     [$TCL_LIB $X11_LIBRARIES -lX11 $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
1106     fi
1107     if test "X$TK_LIB" = X_searching ; then
1108     AC_CHECK_LIB(tk80, Tk_NameOfFont, [TK_LIB="-ltk80"] , ,
1109     [$TCL_LIB $X11_LIBRARIES -lX11 $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
1110     fi
1111     if test "X$TK_LIB" = X_searching ; then
1112     AC_CHECK_LIB(tk, Tk_NameOfFont, [TK_LIB="-ltk"] , ,
1113     [$TCL_LIB $X11_LIBRARIES -lX11 $X11_EXTRA_LIBS $DL_LIBS $MATH_LIBS])
1114     fi
1115    
1116     # give up searching for the Tk8.0 library
1117     #
1118     if test "X$TK_LIB" = X_searching ; then
1119     AC_MSG_ERROR([Cannot find a compatiable Tk library.
1120     You must build and install Tk version 8.0 or newer before you
1121     can build ASCEND. If you have installed the correct version
1122     of Tk, run configure again with the argument:
1123     --with-tk=LIBRARY,HEADER
1124     where LIBRARY and HEADER are the full paths to the Tk8.0
1125     library file and header file, respectively.])
1126     fi
1127    
1128     # see if the user gave us the location of the Tk8.0 header file
1129     #
1130     if test ! "X$with_tkhdr" = X_searching ; then
1131     if test ! -f "$TK_HDR" ; then
1132     AC_MSG_WARN([user specified Tk header file, $TK_HDR, does not exist])
1133     with_tkhdr=_searching
1134     TK_HDR=''
1135     fi
1136     fi
1137     if test "X$with_tkhdr" = X_searching ; then
1138     AC_PATH_PROG(TK_HDR, tk.h, , $asc_tcl_include_dirs)
1139     if test -z "$TK_HDR" ; then
1140     AC_EGREP_HEADER([TK_MAJOR_VERSION.*8], tk.h, [TK_HDR='tk.h'], )
1141     fi
1142     else
1143     AC_MSG_RESULT([checking for tk header... $TK_HDR])
1144     fi
1145     if test -f "$TK_HDR" ; then
1146     AC_MSG_CHECKING([whether $TK_HDR is for version 8])
1147     echo 'grep TK_MAJOR_VERSION "$TK_HDR" 2>&5' 1>&5
1148     grep_tk_h=`grep TK_MAJOR_VERSION "$TK_HDR" 2>&5`
1149     echo $grep_tk_h 1>&5
1150     case "$grep_tk_h" in
1151     *8)
1152     AC_MSG_RESULT(yes)
1153     ;;
1154     *)
1155     AC_MSG_RESULT(no)
1156     TK_HDR=
1157     ;;
1158     esac
1159     fi
1160     if test -z "$TK_HDR" ; then
1161     AC_MSG_ERROR([Cannot find a compatiable Tk header file.
1162     You must build and install Tk version 8.0 or newer before you
1163     can build ASCEND. If you have installed the correct version
1164     of Tk, run configure again with the argument:
1165     --with-tk=LIBRARY,HEADER
1166     where LIBRARY and HEADER are the full paths to the Tk8.0
1167     library file and header file, respectively.])
1168     fi
1169     TK_HDR=`echo $TK_HDR | sed 's,tk\.h$,,'`
1170     if test -n "$TK_HDR" ; then
1171     TK_HDR="-I$TK_HDR"
1172     if test "X$TCL_HDR" = "X$TK_HDR" ; then
1173     TK_HDR=
1174     fi
1175     fi
1176    
1177    
1178     AC_ARG_WITH(tktable,
1179     [ --with-tktable=TKTABLE full path to a TkTable1.3 static library], , )
1180     case "$with_tktable" in
1181     yes|no|"")
1182     # search for the table
1183     AC_PATH_PROG(TKTABLE_LIB, libTktable.a, , $asc_tk_table_dirs)
1184     ;;
1185     *)
1186     # use the user's value
1187     TKTABLE_LIB="$with_tktable"
1188     ;;
1189     esac
1190     if test -n "$TKTABLE_LIB" ; then
1191     HAVE_TKTABLE='-DSTATIC_TKTABLE'
1192     else
1193     AC_MSG_RESULT(Assuming Tktable will be dynamically linked into ASCEND)
1194     fi
1195    
1196     AC_ARG_WITH(wish,
1197     [ --with-wish=/path/to/bin/wish
1198     The location of the wish shell executable matching
1199     the tcl/tk given by --with-tk and --with-tcl.
1200     X11 must be running during configure. ] ,
1201     , [with_wish=no])
1202     case "$with_wish" in
1203     yes|no|"")
1204     AC_MSG_RESULT([--with-wish not specified.
1205     Setting env vars TCL_LIBRARY, TK_LIBRARY may be needed to run.])
1206     ;;
1207     *)
1208     AC_MSG_CHECKING([wish for tcl_library,tklibrary])
1209     ASC_TK_LIBRARY=`config/wishvar tk_library $with_wish`
1210     ASC_TCL_LIBRARY=`config/wishvar tcl_library $with_wish`
1211     AC_MSG_RESULT([ $ASC_TCL_LIBRARY , $ASC_TK_LIBRARY])
1212     ;;
1213     esac
1214    
1215    
1216     #--------------------------------------------------------------------
1217     # FORTRAN
1218     #
1219     # ASCEND uses the LSOD integrator and is capable of working
1220     # with CONOPT and with MINOS. These libraries are written in
1221     # Fortran; to use them, configure needs to find a Fortran
1222     # compiler and the necessary Fortran libraries (e.g.,
1223     # libF77.a). LSOD, CONOPT, and MINOS also require the BLAS and
1224     # LINPACK libraries to avoid undefined symbols at link time.
1225     #
1226     # The builder can specify the location of
1227     # * the Fortran compiler and libraries using
1228     # --with-fortran=<compiler>,<libraries>
1229     # * the BLAS library using
1230     # --with-blas=<blas-library>
1231     # * the LINPACK library using
1232     # --with-linpack=<linpack-library>
1233     # * the LSOD library using
1234     # --with-blas=<lsod-library>
1235     # * the CONOPT library using
1236     # --with-conopt=<conopt-library>
1237     # * the MINOS library using
1238     # --with-minos=<minos-library> <===currently disabled
1239     # The builder can disable some parts of the fortran build using
1240     # the --without-<package> configure option.
1241     #
1242     # If the user does not specify the locations of the compiler
1243     # and the libraries and does not disable them, configure
1244     # attempts to find them.
1245     #
1246     # Building with LSOD, CONOPT, and/or MINOS is further
1247     # complicated by the dependencies between these libraries and
1248     # the BLAS and LINPACK libraries.
1249     #
1250     # If we cannot find a Fortran compiler, we disable all Fortran
1251     # code (LSOD, CONOPT, and MINOS). Otherwise, look for the
1252     # Fortran libraries (e.g., libF77.a) based on the type of
1253     # machine we are compiling on.
1254     #
1255     # If Fortran is enabled, we need to find a compiled BLAS
1256     # library or source code. Check for the machine's libblas.a
1257     # and ASCEND's libascblas.a; if those fail, check for the
1258     # libascblas.a source code; if that fails, we disable all
1259     # Fortran (LSOD, CONOPT, MINOS).
1260     #
1261     # If Fortran is enabled, we need to find a compiled LINPACK
1262     # library or source code. Check for the machine's liblpak.a
1263     # and ASCEND's libasclpak.a; if those fail, check for the
1264     # libasclpak.a source code; if that fails, we disable all
1265     # Fortran (LSOD, CONOPT, MINOS).
1266     #
1267     # If Fortran is enabled, we try to find a compiled LSOD library
1268     # or source code. Check for a libinteg.a; if that fails, check
1269     # for the libinteg.a source code; if that fails, we disable
1270     # LSOD. If we find LSOD, define STATIC_LSOD.
1271     #
1272     # If Fortran is enabled, we try to find a compiled OPTSQP
1273     # library or source code. Check for a librsqp.a; if that fails,
1274     # check for the librsqp.a source code; if that fails, we disable
1275     # OPTSQP. If we find RSQP, define STATIC_OPTSQP.
1276     #
1277     # If Fortran is enabled, we try to find a compiled CONOPT
1278     # library. Check for a libconsub.a; if that fails, we disable
1279     # CONOPT. If we find CONOPT, define STATIC_CONOPT; if not,
1280     # tell the user where to find CONOPT using the contact
1281     # information from the nonlinear programming FAQ:
1282     # http://www.mcs.anl.gov/home/otc/Guide/faq/nonlinear-programming-faq.html
1283     #
1284     # If Fortran is enabled, we try to find a compiled MINOS
1285     # library or source code. Check for a libminos54.a; if that
1286     # fails, check for the libminos54.a source code; if that fails,
1287     # we disable MINOS. If we find MINOS, define STATIC_MINOS; if
1288     # not, tell the user where to find MINOS using the contact
1289     # information from the nonlinear programming FAQ:
1290     # http://www.mcs.anl.gov/home/otc/Guide/faq/nonlinear-programming-faq.html
1291     #--------------------------------------------------------------------
1292     #
1293     # the list of directories to search for the fortran compiler
1294     asc_f77_prog_dirs="$PATH:/usr/lang:/opt/SUNWspro/bin"
1295     #
1296     # the list of directories to search for the required fortran libraries
1297     asc_f77_support_dirs="
1298     /lib
1299     /usr/lib
1300     /usr/local/lib
1301     /usr/contributed/lib
1302     /usr/local/lib/ascend/lib
1303     $ascpwd/blas
1304     $ascpwd/linpack
1305     $ascpwd/lsod
1306     #AWW20041113: $ascpwd/conopt
1307     #AWW20041113: $ascpwd/rsqp
1308     #AWW20041113: $ascpwd/minos
1309     #AWW20041113: $ascpwd/ascend4/archive
1310     $srcdir/generic/archive
1311     /afs/cs/project/ascend/depot/@sys/lib
1312     /afs/cs/project/ascend/depot/build/obj/conopt
1313     "
1314     #
1315     AC_ARG_WITH(fortran,
1316     [Fortran compiler and libraries:
1317     --with-fortran=F77,F77LIBS
1318     The location of your Fortran compiler and its
1319     library files. For example, under SunOS:
1320     --with-fortran='f77,-L/usr/lang/lib -lF77 -lM77'
1321     To specify only the compiler or libraries, leave off
1322     whatever is not needed:
1323     --with-fortran=',-L/usr/lang/lib -lF77 -lM77'
1324     Use '--without-fortran' to not link against
1325     any Fortran libraries],
1326     , [with_fortran=yes])
1327     case "$with_fortran" in
1328     no)
1329     # The user disabled all fortran using
1330     # the --without-fortran option.
1331     F77=
1332     F77LIBS=
1333     with_f77=no
1334     with_f77libs=no
1335     ;;
1336     yes|,|"")
1337     # The user didn't pass in the --with-fortran option
1338     # or didn't give us any useful information. We do
1339     # the search ourselves.
1340     with_f77=_searching
1341     with_f77libs=_searching
1342     ;;
1343     ,*)
1344     # The user passed in the libraries, search for the
1345     # compiler ourselves.
1346     with_f77=_searching
1347     F77LIBS=`echo $with_fortran | sed 's/^,//'`
1348     echo "user gave F77LIBS=$F77LIBS"
1349     ;;
1350     *,?*)
1351     # The user passed in both the compiler and the
1352     # libraries.
1353     F77=`echo $with_fortran | sed s'/,.*$//'`
1354     F77LIBS=`echo $with_fortran | sed 's/^.*,//'`
1355     echo "user gave F77=$F77"
1356     echo "user gave F77LIBS=$F77LIBS"
1357     ;;
1358     *)
1359     # The user passed in the compiler; search for the
1360     # libraries ourselves.
1361     F77=`echo $with_fortran | sed s'/,$//'`
1362     with_f77libs=_searching
1363     echo "user gave F77=$F77"
1364     ;;
1365     esac
1366    
1367     if test "X$with_f77" = X_searching ; then
1368     # Search for the fortran compiler; print a warning if we can't
1369     # find it and disable all fortran.
1370     AC_PATH_PROGS(F77, f77 xlf g77, , $asc_f77_prog_dirs)
1371     if test -z "$F77" ; then
1372     with_fortran=no
1373     with_f77libs=no
1374     AC_MSG_WARN([Cannot find your Fortran compiler. Building ASCEND
1375     without integration, MINOS, and CONOPT support. To bulid ASCEND with
1376     Fortran support, run configure with the option
1377     --with-fortran=F77,F77LIBS
1378     where F77 is the full path to your Fortran compiler and F77LIBS are
1379     its related libraries])
1380     fi
1381     fi
1382    
1383     if test "X$with_f77libs" = X_searching ; then
1384     # We found a compiler, now search for the fortran libraries
1385     # based on the system type.
1386     AC_MSG_RESULT([checking for fortran libraries based on system type])
1387     case "$host" in
1388     alpha-dec-osf*)
1389     AC_CHECK_LIB(for, for_lle, [F77LIBS="$F77LIBS -lfor"], , $F77LIBS)
1390     AC_CHECK_LIB(ots, _OtsFill, [F77LIBS="$F77LIBS -lots"], , $F77LIBS)
1391     AC_CHECK_LIB(Ufor, etime_, [F77LIBS="$F77LIBS -lUfor"], , $F77LIBS)
1392     ;;
1393     mips-dec-ultrix*)
1394     AC_CHECK_LIB(for, for_lle, [F77LIBS="$F77LIBS -lfor"], , $F77LIBS)
1395     ;;
1396     hppa1.1-hp-hpux*)
1397     AC_CHECK_LIB(cl, FTN_QATAN, [F77LIBS="$F77LIBS -lcl"], , $F77LIBS)
1398     ;;
1399     *-ibm-aix*)
1400     # need to add -lc before -lxlf on AIX to
1401     # avoid getting the wrong getenv
1402     F77LIBS="-lc $F77LIBS"
1403     AC_CHECK_LIB(xlf, _xldabs, [F77LIBS="$F77LIBS -lxlf"], , $F77LIBS)
1404     AC_CHECK_LIB(xlfutil, srand_, [F77LIBS="$F77LIBS -lxlfutil"], ,
1405     $F77LIBS)
1406     AC_CHECK_LIB(xlf90, printf,
1407     [F77LIBS="$F77LIBS -lxlf90"], , $F77LIBS)
1408     ;;
1409     *-linux-*)
1410     AC_CHECK_LIB(f2c, pow_dd, [F77LIBS="$F77LIBS -lf2c"], , $F77LIBS)
1411     AC_CHECK_LIB(g2c, pow_dd, [F77LIBS="$F77LIBS -lg2c"], , $F77LIBS)
1412     ;;
1413     sparc-sun-solaris*)
1414     if test -n "$GCC" ; then
1415     F77LIBS="-L/opt/SUNWspro/lib -R/opt/SUNWspro/lib"
1416     fi
1417     AC_CHECK_LIB(sunmath, d_sqrt_, [MATH_LIBS="-lsunmath $MATH_LIBS"])
1418     AC_CHECK_LIB(F77, f77_init,
1419     [F77LIBS="$F77LIBS -lF77"], , $F77LIBS $MATH_LIBS)
1420     AC_CHECK_LIB(M77, inmax_,
1421     [F77LIBS="$F77LIBS -lM77"], , $F77LIBS $MATH_LIBS)
1422     ;;
1423     sparc-sun-sunos4*)
1424     if test -n "$GCC" ; then
1425     F77LIBS="-L/usr/lang/lib"
1426     fi
1427     AC_CHECK_LIB(F77, f77_init, [F77LIBS="$F77LIBS -lF77"], , $F77LIBS)
1428     AC_CHECK_LIB(M77, inmax_, [F77LIBS="$F77LIBS -lM77"], , $F77LIBS)
1429     ;;
1430     mips-sgi-irix*)
1431     AC_CHECK_LIB(F77, s_copy, [F77LIBS="$F77LIBS -lF77"], , $F77LIBS)
1432     AC_CHECK_LIB(I77, f_exit, [F77LIBS="$F77LIBS -lI77"], , $F77LIBS)
1433     AC_CHECK_LIB(isam, mkidxname,
1434     [F77LIBS="$F77LIBS -lisam"], , $F77LIBS)
1435     ;;
1436     *)
1437     AC_CHECK_LIB(F77, printf, [F77LIBS="$F77LIBS -lF77"], , $F77LIBS)
1438     AC_CHECK_LIB(M77, printf, [F77LIBS="$F77LIBS -lM77"], , $F77LIBS)
1439     AC_CHECK_LIB(f2c, pow_dd, [F77LIBS="$F77LIBS -lf2c"], , $F77LIBS)
1440     AC_CHECK_LIB(f77, printf, [F77LIBS="$F77LIBS -lf77"], , $F77LIBS)
1441     AC_CHECK_LIB(for, printf, [F77LIBS="$F77LIBS -lfor"], , $F77LIBS)
1442     AC_CHECK_LIB(ots, printf, [F77LIBS="$F77LIBS -lots"], , $F77LIBS)
1443     AC_CHECK_LIB(Ufor, printf, [F77LIBS="$F77LIBS -lUfor"], , $F77LIBS)
1444     ;;
1445     esac
1446     fi
1447    
1448     # asc_subdirs are the extra fortran subdirectories we have to visit
1449     # to build the fortran libraries. Initialize it to empty here.
1450     asc_subdirs=''
1451    
1452     # Initialize the blas variables
1453     make_blaslib=''
1454    
1455     AC_ARG_WITH(blas,
1456     [ --with-blas=BLASLIB The full path to the blas library.
1457     Use '--with-blas=build' to build the blas library
1458     from the sources that come with the distribution.],
1459     , [with_blas=yes] )
1460     case "$with_fortran$with_blas" in
1461     no*)
1462     # Fortran is disabled; ignore this option (if present)
1463     BLASLIB=
1464     ;;
1465     *no)
1466     # It is an error if the user chooses to build without
1467     # the BLAS library if Fortran is enabled.
1468     AC_MSG_ERROR([Bad option '--without-blas'
1469     To support Fortran calls, ASCEND must be compiled with a blas library])
1470     ;;
1471     *build)
1472     # Fortran is enabled and the user specified --with-blas=build
1473     # For a search for BLAS source code and tell the Makefile
1474     # to build it; useful for testing configure.
1475     blas_src_file="$srcdir/blas/dcopy.f"
1476     AC_MSG_CHECKING([for blas source file $blas_src_file ])
1477     if test -f $blas_src_file ; then
1478     AC_MSG_RESULT(yes)
1479     BLASLIB="$ascpwd/ascend4/archive/libascblas.a"
1480     make_blaslib='make-blaslib'
1481     blaslib_makefile="blas/Makefile"
1482     asc_subdirs="$asc_subdirs ../blas"
1483     else
1484     AC_MSG_RESULT(no)
1485     AC_MSG_ERROR([User specified '--with-blas=build' but
1486     configure cannot find the blas source file $blas_src_file])
1487     fi
1488     ;;
1489     *yes)
1490     # Fortran in enabled and the user didn't give the --with-blas
1491     # option or didn't give the library's location.
1492     # Search for a compiled libblas.a or libascblas.a; if that
1493     # fails, look for BLAS source code; if that also fails,
1494     # disable all Fortran and print a warning.
1495     AC_PATH_PROGS(BLASLIB, libblas.a libascblas.a, , $asc_f77_support_dirs)
1496     blas_src_file="$srcdir/blas/dcopy.f"
1497     if test -z "$BLASLIB" -a -n "$blas_src_file" ; then
1498     AC_MSG_CHECKING([for blas source file $blas_src_file ])
1499     if test -f $blas_src_file ; then
1500     AC_MSG_RESULT(yes)
1501     BLASLIB="$ascpwd/ascend4/archive/libascblas.a"
1502     make_blaslib='make-blaslib'
1503     blaslib_makefile="blas/Makefile"
1504     asc_subdirs="$asc_subdirs ../blas"
1505     else
1506     AC_MSG_RESULT(no)
1507     fi
1508     fi
1509     if test -z "$BLASLIB" ; then
1510     with_fortran=no
1511     AC_MSG_WARN([Cannot find libblas.a, libascblas.a, nor blas
1512     source code. Building ASCEND without integration, MINOS, and CONOPT
1513     support. To specify a specific location for the blas library, run
1514     configure again with the argument:
1515     --with-blas=BLASLIB
1516     where BLASLIB is the full path to the blas library file.])
1517     fi
1518     ;;
1519     *)
1520     # The user gave us --with-blas=BLASLIB, use that as the
1521     # location of the BLAS library.
1522     BLASLIB="$with_blas"
1523     ;;
1524     esac
1525    
1526    
1527     # Initialize the linpack variables
1528     make_lpaklib=''
1529    
1530     AC_ARG_WITH(linpack,
1531     [ --with-linpack=LPAKLIB The full path to the linpack library.
1532     Use '--with-linpack=build' to build the library
1533     from the sources that come with the distribution.],
1534     , [with_linpack=yes] )
1535     case "$with_fortran$with_linpack" in
1536     no*)
1537     # Fortran is disabled; ignore this option (if present)
1538     LPAKLIB=
1539     ;;
1540     *no)
1541     # It is an error if the user chooses to build without
1542     # the LINPACK library if Fortran is enabled.
1543     AC_MSG_ERROR([Bad option '--without-linpack'
1544     To support Fortran calls, ASCEND must be compiled with a
1545     linpack library.])
1546     ;;
1547     *build)
1548     # Fortran is enabled and the user specified --with-linpack=build
1549     # For a search for LINPACK source code and tell the Makefile
1550     # to build it; useful for testing configure.
1551     lpak_src_file="$srcdir/linpack/d1mach.f"
1552     AC_MSG_CHECKING([for linpack source file $lpak_src_file ])
1553     if test -f $lpak_src_file ; then
1554     AC_MSG_RESULT(yes)
1555     LPAKLIB="$ascpwd/ascend4/archive/libasclpak.a"
1556     make_lpaklib='make-lpaklib'
1557     lpaklib_makefile="linpack/Makefile"
1558     asc_subdirs="$asc_subdirs ../linpack"
1559     else
1560     AC_MSG_RESULT(no)
1561     AC_MSG_ERROR([User specified '--with-linpack=build' but
1562     configure cannot find the linpack source file $lpak_src_file])
1563     fi
1564     ;;
1565     *yes)
1566     # Fortran in enabled and the user didn't give the --with-linpack
1567     # option or didn't give the library's location.
1568     # Search for a compiled liblpak.a or libasclpak.a; if that
1569     # fails, look for LINPACK source code; if that also fails,
1570     # disable all Fortran and print a warning.
1571     AC_PATH_PROGS(LPAKLIB, liblpak.a libasclpak.a, , $asc_f77_support_dirs)
1572     lpak_src_file="$srcdir/linpack/d1mach.f"
1573     if test -z "$LPAKLIB" -a -n "$lpak_src_file" ; then
1574     AC_MSG_CHECKING([for linpack source file $lpak_src_file ])
1575     if test -f $lpak_src_file ; then
1576     AC_MSG_RESULT(yes)
1577     LPAKLIB="$ascpwd/ascend4/archive/libasclpak.a"
1578     make_lpaklib='make-lpaklib'
1579     lpaklib_makefile="linpack/Makefile"
1580     asc_subdirs="$asc_subdirs ../linpack"
1581     else
1582     AC_MSG_RESULT(no)
1583     fi
1584     fi
1585     if test -z "$LPAKLIB" ; then
1586     with_fortran=no
1587     AC_MSG_WARN([Cannot find liblpak.a, libasclpak.a, nor linpack
1588     source code. Building ASCEND without integration, MINOS, and CONOPT
1589     support. To specify a specific location for the linpack library, run
1590     configure again with the argument:
1591     --with-linpack=LPAKLIB
1592     where LPAKLIB is the full path to the linpack library file.])
1593     fi
1594     ;;
1595     *)
1596     # The user gave us --with-linkpack=LINKPACKLIB, use that
1597     # as the location of the LINKPACK library.
1598     LPAKLIB="$with_linpack"
1599     ;;
1600     esac
1601    
1602    
1603     # Initialize the lsod variables
1604     make_lsodlib=''
1605     HAVE_LSOD=''
1606    
1607     AC_ARG_WITH(lsod,
1608     [ --with-lsod=LSODLIB The full path to the lsod library.
1609     Use '--with-lsod=build' to build the lsod library
1610     from the sources that come with the distribution.],
1611     , [with_lsod=yes] )
1612     case "$with_fortran$with_lsod" in
1613     no*)
1614     # Fortran is disabled; ignore this option (if present)
1615     LSODLIB=
1616     with_lsod=no
1617     ;;
1618     *no)
1619     # Fortran is enabled but the user specified --without-lsod
1620     LSODLIB=
1621     ;;
1622     *build)
1623     # Fortran is enabled and the user specified --with-lsod=build
1624     # For a search for LSOD source code and tell the Makefile
1625     # to build it; useful for testing configure.
1626     lsod_src_file="$srcdir/lsod/lsode.f"
1627     AC_MSG_CHECKING([for lsod source file $lsod_src_file ])
1628     if test -f $lsod_src_file ; then
1629     AC_MSG_RESULT(yes)
1630     LSODLIB="$ascpwd/ascend4/archive/libinteg.a"
1631     make_lsodlib='make-lsodlib'
1632     lsodlib_makefile="lsod/Makefile"
1633     asc_subdirs="$asc_subdirs ../lsod"
1634     HAVE_LSOD='-DSTATIC_LSOD'
1635     else
1636     AC_MSG_RESULT(no)
1637     AC_MSG_ERROR([User specified '--with-lsod=build' but
1638     configure cannot find the lsod source file $lsod_src_file])
1639     fi
1640     ;;
1641     *yes)
1642     # Fortran in enabled and the user didn't give the --with-lsod
1643     # option or didn't give the library's location.
1644     # Search for a compiled libinteg.a; if that fails, look
1645     # for LSOD source code; if that also fails, disable LSOD
1646     # and print a warning.
1647     AC_PATH_PROGS(LSODLIB, libinteg.a libasclsod.a, , $asc_f77_support_dirs)
1648     lsod_src_file="$srcdir/lsod/lsode.f"
1649     if test -z "$LSODLIB" -a -n "$lsod_src_file" ; then
1650     AC_MSG_CHECKING([for lsod source file $lsod_src_file ])
1651     if test -f $lsod_src_file ; then
1652     AC_MSG_RESULT(yes)
1653     LSODLIB="$ascpwd/ascend4/archive/libinteg.a"
1654     make_lsodlib='make-lsodlib'
1655     lsodlib_makefile="lsod/Makefile"
1656     asc_subdirs="$asc_subdirs ../lsod"
1657     else
1658     AC_MSG_RESULT(no)
1659     fi
1660     fi
1661     if test -z "$LSODLIB" ; then
1662     with_lsod=no
1663     AC_MSG_WARN([Cannot find libinteg.a nor the lsod
1664     source code. Building ASCEND without integration
1665     support. To specify a specific location for the lsod library, run
1666     configure again with the argument:
1667     --with-lsod=LSODLIB
1668     where LSODLIB is the full path to the lsod integration library file.])
1669     else
1670     HAVE_LSOD='-DSTATIC_LSOD'
1671     fi
1672     ;;
1673     *)
1674     # The user gave us --with-lsod=LSODLIB, use that as the
1675     # location of the LSOD library and define -DSTATIC_LSOD.
1676     LSODLIB="$with_lsod"
1677     HAVE_LSOD='-DSTATIC_LSOD'
1678     ;;
1679     esac
1680    
1681    
1682     #--------------------------------------------------------------------
1683     # Other trees which may or may not be present. If present,
1684     # generate the Makefiles in the tree unless the user passes in
1685     # a --without-<package> argument.
1686     #
1687     # Valid <package> values are: TK, models, help
1688     #
1689     # We could have `configure' do this for us via
1690     # AC_CONFIG_SUBDIRS, but `configure' scripts in the trees can
1691     # only be one directory removed from this configure script.
1692     # For example, it would be nice to have `models' under
1693     # `ascend4', but `configure' doesn't like `ascend4/models' as
1694     # an argument to AC_CONFIG_SUBDIRS.
1695     #
1696     # To get around this problem, we do things by hand. :-)
1697     #
1698     # If the user gives a --without-<package> argument, we have
1699     # nothing to do for that package.
1700     #
1701     # Otherwise,
1702     # * Set `subdir_file_exists' to a file that should exist in the
1703     # subtree---this is how we know that the subtree is really
1704     # there.
1705     # * Set `subdir_locations' to the list of locations, relative
1706     # to this configure script, where the subtree may live.
1707     # * Set `subdir_output' to the list of makefiles to generate;
1708     # the variable `subdir_root' in this list will be replaced
1709     # with the correct value from `subdir_locations'.
1710     #
1711     # To see which (if any) of the values in `subdir_locations' is
1712     # the correct one, we set `subdir_root' to each value in
1713     # `subdir_locations' and check for the existence of
1714     # $fullpathsrcdir/$subdir_root/$subdir_file_exists, where
1715     # $fullpathsrcdir is the full path to the source directory. If
1716     # that file exists, we
1717     # * Set <package>_dir_root to ../$subdir_root. The "../" is
1718     # needed since this value is used in the `ascend4' directory
1719     # and $subdir_root is relative to the parent of `ascend4'.
1720     # * Substitute the value of $subdir_root into `subdir_output'
1721     # and set the result to <package>_makefiles: the list of
1722     # Makefiles for configure to generate.
1723     # * Each package needs to be able to find its way back to
1724     # ascend4/ConfigAscend; it needs to go back up the tree
1725     # however many levels deep it is---i.e., `foo/bar/baz' should
1726     # become `../../..' and this does it: sed 's,[^/][^/]*,..,g'
1727     # but we need to quote the [] from m4, so we get this bizarre
1728     # thing: sed 's,[[^/][^/]]*,..,g' Set <package>_topbuilddir
1729     # to this result.
1730     # * Exit the loop.
1731     #--------------------------------------------------------------------
1732    
1733     # Initialize variables
1734     tkdir_root=''
1735     tkdir_topbuilddir=''
1736    
1737     AC_ARG_WITH(tkdir,
1738     [Generation of Makefiles:
1739     --without-tkdir do not generate Makefiles in the TK subdir],
1740     , [with_tkdir=yes])
1741     if test ! "X$with_tkdir" = "Xno" ; then
1742     subdir_file_exists='AscendRC'
1743     subdir_locations='ascend4/TK'
1744     subdir_output='
1745     $subdir_root/Makefile
1746     $subdir_root/Makefile.Rules:$subdir_root/Makefile.Rules.in
1747     $subdir_root/bitmaps/Makefile
1748     $subdir_root/templates/Makefile
1749     '
1750     for subdir_root in $subdir_locations ; do
1751     if test -f $fullpathsrcdir/$subdir_root/$subdir_file_exists ; then
1752     tkdir_root="../$subdir_root"
1753     tkdir_makefiles=`eval echo $subdir_output`
1754     tkdir_topbuilddir=`echo "$subdir_root" | sed 's,[[^/][^/]]*,..,g'`
1755     break
1756     fi
1757     done
1758     fi
1759    
1760     # Initialize variables
1761     models_dir_root=''
1762     models_topbuilddir=''
1763    
1764     AC_ARG_WITH(models,
1765     [ --without-models do not generate Makefiles in the models subdir],
1766     , [with_models=yes])
1767     if test ! "X$with_models" = "Xno" ; then
1768     subdir_file_exists='system.a4l'
1769     subdir_locations='models ascend4/models'
1770     subdir_output='
1771     $subdir_root/Makefile
1772     $subdir_root/Makefile.Rules:$subdir_root/Makefile.Rules.in
1773     $subdir_root/ben/Makefile
1774     '
1775     ## $subdir_root/examples/Makefile
1776     ## $subdir_root/examples/abbott/Makefile
1777     ## $subdir_root/examples/flexible_design/Makefile
1778     ## $subdir_root/libraries/Makefile
1779     ## $subdir_root/libraries/abbott/Makefile
1780     ## $subdir_root/pending/Makefile
1781     ## $subdir_root/pending/examples/Makefile
1782     ## $subdir_root/pending/libraries/Makefile
1783     for subdir_root in $subdir_locations ; do
1784     if test -f $fullpathsrcdir/$subdir_root/$subdir_file_exists ; then
1785     models_dir_root="../$subdir_root"
1786     models_makefiles=`eval echo $subdir_output`
1787     models_topbuilddir=`echo "$subdir_root" | sed 's,[[^/][^/]]*,..,g'`
1788     break
1789     fi
1790     done
1791     fi
1792    
1793    
1794     # Initialize variables
1795     help_dir_root=''
1796     help_topbuilddir=''
1797    
1798     dnl >>>>AC_ARG_WITH(help,
1799     dnl >>>> [ --without-help do not generate Makefiles in the help subdir],
1800     dnl >>>> , [with_help=yes])
1801     dnl >>>>if test ! "X$with_help" = "Xno" ; then
1802     dnl >>>> subdir_file_exists='ascend-helpTOC.htm'
1803     dnl >>>> subdir_locations='help ascend4/help'
1804     dnl >>>> subdir_output='
1805     dnl >>>> $subdir_root/Makefile
1806     dnl >>>> $subdir_root/Makefile.Rules:$subdir_root/Makefile.Rules.in
1807     dnl >>>> $subdir_root/Screenshots/Makefile
1808     dnl >>>> '
1809     dnl >>>> for subdir_root in $subdir_locations ; do
1810     dnl >>>> if test -f $fullpathsrcdir/$subdir_root/$subdir_file_exists ; then
1811     dnl >>>> help_dir_root="../$subdir_root"
1812     dnl >>>> help_makefiles=`eval echo $subdir_output`
1813     dnl >>>> help_topbuilddir=`echo "$subdir_root" | sed 's,[[^/][^/]]*,..,g'`
1814     dnl >>>> break
1815     dnl >>>> fi
1816     dnl >>>> done
1817     dnl >>>>fi
1818    
1819    
1820     #--------------------------------------------------------------------
1821     # The variables we substitute into the Makefile.in files
1822     # and the command to actually generate the Makefiles
1823     #--------------------------------------------------------------------
1824     AC_SUBST(ascpwd)
1825     AC_SUBST(fullpathsrcdir)
1826     AC_SUBST(asc_include)
1827     AC_SUBST(CC)
1828     AC_SUBST(CFLAGS)
1829     AC_SUBST(LEX)
1830     AC_SUBST(LEXLIB)
1831     AC_SUBST(scanner_src)
1832     AC_SUBST(typer_src)
1833     AC_SUBST(MATH_LIBS)
1834     AC_SUBST(DEBUG_LIBS)
1835     AC_SUBST(X11_INCLUDES)
1836     AC_SUBST(X11_LIBRARIES)
1837     AC_SUBST(X11_RUN_PATH)
1838     AC_SUBST(X11_EXTRA_LIBS)
1839     AC_SUBST(DL_LIBS)
1840     AC_SUBST(LD_FLAGS)
1841     AC_SUBST(LD_SEARCH_FLAGS)
1842     AC_SUBST(SHLIB_CFLAGS)
1843     AC_SUBST(SHLIB_LD)
1844     AC_SUBST(SHLIB_LD_LIBS)
1845     AC_SUBST(SHLIB_SUFFIX)
1846     AC_SUBST(ASC_LIB_SUFFIX)
1847     AC_SUBST(TCL_LIB)
1848     AC_SUBST(TCL_HDR)
1849     AC_SUBST(TK_LIB)
1850     AC_SUBST(TK_HDR)
1851     AC_SUBST(TKTABLE_LIB)
1852     AC_SUBST(ASC_TK_LIBRARY)
1853     AC_SUBST(ASC_TCL_LIBRARY)
1854     AC_SUBST(HAVE_TKTABLE)
1855     AC_SUBST(asc_subdirs)
1856     AC_SUBST(F77)
1857     AC_SUBST(F77LIBS)
1858     AC_SUBST(BLASLIB)
1859     AC_SUBST(make_blaslib)
1860     AC_SUBST(LPAKLIB)
1861     AC_SUBST(make_lpaklib)
1862     AC_SUBST(LSODLIB)
1863     AC_SUBST(make_lsodlib)
1864     AC_SUBST(HAVE_LSOD)
1865     AC_SUBST(OPTSQPLIB)
1866     AC_SUBST(make_rsqplib)
1867     AC_SUBST(HAVE_OPTSQP)
1868     dnl AC_SUBST(HARWELLLIB)
1869     dnl AC_SUBST(make_harwelllib)
1870     dnl AC_SUBST(HAVE_HARWELL)
1871     AC_SUBST(MINOSLIB)
1872     AC_SUBST(make_minoslib)
1873     AC_SUBST(HAVE_MINOS)
1874     AC_SUBST(CONOPTLIB)
1875     AC_SUBST(make_conoptlib)
1876     AC_SUBST(HAVE_CONOPT)
1877     AC_SUBST(tkdir_root)
1878     AC_SUBST(tkdir_topbuilddir)
1879     AC_SUBST(models_dir_root)
1880     AC_SUBST(models_topbuilddir)
1881     AC_SUBST(help_dir_root)
1882     AC_SUBST(help_topbuilddir)
1883    
1884     AC_OUTPUT(
1885     ascend4/ConfigAscend:ascend4/ConfigAscend.in
1886     ascend4/Makefile
1887     ascend4/bin/ascend4.sh
1888     ascend4/Makefile.Rules:ascend4/Makefile.Rules.in
1889     ascend4/archive/Makefile
1890     ascend4/bin/Makefile
1891     ascend4/compiler/Makefile
1892     ascend4/general/Makefile
1893     ascend4/interface/Makefile
1894     ascend4/lib/Makefile
1895     ascend4/packages/Makefile
1896     ascend4/solver/Makefile
1897     ascend4/utilities/Makefile
1898     $tkdir_makefiles
1899     $models_makefiles
1900     $help_makefiles
1901     $blaslib_makefile
1902     $lpaklib_makefile
1903     $lsodlib_makefile
1904     $rsqplib_makefile
1905     $conoptlib_makefile
1906     $minoslib_makefile
1907     )
1908    

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22