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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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