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

Annotation of /trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


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

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