OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [tools/] [doconfig.tcl] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/sh
2
# the next line restarts using tclsh \
3
exec tclsh "$0" "$@"
4
 
5
source [file join [file dirname [info script]] doxx.tcl]
6
 
7
 
8
p {
9
dnl     This file is an input file used by the GNU "autoconf" program to
10
dnl     generate the file "configure", which is run to configure the
11
dnl     Makefile in this directory.
12
 
13
AC_INIT(../../generic/tixInit.c)
14
 
15
#--------------------------------------------------------------------
16
#       Remove the ./config.cache file and rerun configure if
17
#       the cache file belong to a different architecture
18
#----------------------------------------------------------------------
19
AC_CHECK_PROG(UNAME, uname -a, [uname -a], "")
20
if test "$UNAME" = ""; then
21
    AC_CHECK_PROG(UNAME, uname, [uname], "")
22
fi
23
 
24
if test "$UNAME" != ""; then
25
    uname=`$UNAME`
26
    AC_MSG_CHECKING([cached value of \$uname])
27
    AC_CACHE_VAL(ac_cv_prog_uname, [nocached=1 ac_cv_prog_uname=`$UNAME`])
28
    if test "$nocached" = "1"; then
29
        AC_MSG_RESULT(no)
30
    else
31
        AC_MSG_RESULT(yes)
32
    fi
33
 
34
    if test "$uname" != "$ac_cv_prog_uname"; then
35
        echo "Running on a different machine/architecture. Can't use cached values"
36
        echo "Removing config.cache and running configure again ..."
37
        rm -f config.cache
38
        CMDLINE="$0 $*"
39
        exec $CMDLINE
40
    fi
41
fi
42
 
43
#----------------------------------------------------------------------
44
# We don't want to use any relative path because we need to generate
45
# Makefile's in subdirectories
46
#----------------------------------------------------------------------
47
if test "$INSTALL" = "./install.sh"; then
48
    INSTALL=`pwd`/install.sh
49
fi
50
 
51
#--------------------------------------------------------------------
52
#       Version information about this TIX release.
53
#--------------------------------------------------------------------
54
 
55
TIX_VERSION=4.1
56
TIX_MAJOR_VERSION=4
57
TIX_MINOR_VERSION=1
58
}
59
 
60
if !$ITCL {
61
    p {
62
BIN_VERSION=${TIX_VERSION}.@@_V_TCL_VER_@@
63
    }
64
} else {
65
    p {
66
BIN_VERSION=${TIX_VERSION}.@@_V_TCL_VER_@@.1
67
    }
68
}
69
 
70
p {
71
 
72
VERSION=${BIN_VERSION}
73
 
74
#--------------------------------------------------------------------
75
#       See if user wants to use gcc to compile Tix. This option must
76
#       be used before any checking that uses the C compiler.
77
#--------------------------------------------------------------------
78
 
79
AC_ARG_ENABLE(gcc, [  --enable-gcc            allow use of gcc if available],
80
    [tix_ok=$enableval], [tix_ok=no])
81
if test "$tix_ok" = "yes"; then
82
    AC_PROG_CC
83
else
84
    CC=${CC-cc}
85
AC_SUBST(CC)
86
fi
87
 
88
AC_PROG_INSTALL
89
AC_PROG_RANLIB
90
AC_HAVE_HEADERS(unistd.h limits.h)
91
AC_PROG_MAKE_SET
92
 
93
#--------------------------------------------------------------------
94
#       unsigned char is not supported by some non-ANSI compilers.
95
#--------------------------------------------------------------------
96
 
97
AC_MSG_CHECKING([unsigned char])
98
AC_TRY_COMPILE([#include <stdio.h>],[
99
     unsigned char c = 'c';
100
], tcl_ok=supported, tcl_ok=not supported)
101
 
102
AC_MSG_RESULT($tcl_ok)
103
if test $tcl_ok = supported; then
104
    AC_DEFINE(UCHAR_SUPPORTED)
105
fi
106
 
107
#--------------------------------------------------------------------
108
#       Check whether there is an strcasecmp function on this system.
109
#       This is a bit tricky because under SCO it's in -lsocket and
110
#       under Sequent Dynix it's in -linet.
111
#--------------------------------------------------------------------
112
 
113
AC_CHECK_FUNC(strcasecmp, tcl_ok=1, tcl_ok=0)
114
if test "$tcl_ok" = 0; then
115
    AC_CHECK_LIB(socket, strcasecmp, tcl_ok=1, tcl_ok=0)
116
fi
117
if test "$tcl_ok" = 0; then
118
    AC_CHECK_LIB(inet, strcasecmp, tcl_ok=1, tcl_ok=0)
119
fi
120
if test "$tcl_ok" = 0; then
121
    AC_DEFINE(NO_STRCASECMP)
122
fi
123
}
124
 
125
# LocatePkg75 --
126
#
127
#       This procedure is used to locate Tcl, Tk and ITcl packages for
128
#       tcl versions 7.5, 7.6, 7.7 and 8.0 and itcl 2.1, 2.2. It should be
129
#       able to work with a higher version of Tcl if its directory structure
130
#       is similar to Tcl 7.5~8.0
131
#
132
proc LocatePkg75 {} {
133
    global ITCL
134
 
135
set template {
136
#--------------------------------------------------------------------
137
#       See if there was a command-line option for where Pkg is;  if
138
#       not, assume that its top-level directory is a sibling of ours.
139
#--------------------------------------------------------------------
140
 
141
AC_ARG_WITH(pkg, [  --with-pkg=DIR           use Pkg @@_V_PKG_VER_@@ source from DIR],
142
   val=$withval, val="")
143
 
144
AC_MSG_CHECKING([Pkg source directory])
145
 
146
if test "$val" != ""; then
147
    PKG_SRC_DIR=$val
148
    if test ! -d $PKG_SRC_DIR; then
149
        AC_MSG_ERROR(Directory $PKG_SRC_DIR doesn't exist)
150
        AC_MSG_ERROR(Please install the source code of Pkg @@_V_PKG_VER_@@)
151
        exit 1
152
    fi
153
else
154
    dirs="../../../pkg@@_V_PKG_VER_@@*"
155
    PKG_SRC_DIR="no-no"
156
    for i in $dirs; do
157
        if test -d $i; then
158
            PKG_SRC_DIR=`cd $i; pwd`
159
        fi
160
    done
161
 
162
    if test ! -d $PKG_SRC_DIR; then
163
        AC_MSG_ERROR(Cannot locate Pkg source directory in $dirs)
164
        AC_MSG_ERROR(Please install the source code of Pkg @@_V_PKG_VER_@@)
165
        exit 1
166
    fi
167
fi
168
AC_MSG_RESULT($PKG_SRC_DIR)
169
 
170
PKG_BIN_DIR=$PKG_SRC_DIR/unix
171
}
172
 
173
if !$ITCL {
174
    #
175
    # Do Tcl
176
    #
177
    set str $template
178
    regsub -all PKG $str TCL str
179
    regsub -all Pkg $str Tcl str
180
    regsub -all pkg $str tcl str
181
    p $str
182
 
183
    #
184
    # Do Tk
185
    #
186
    set str $template
187
    regsub -all PKG $str TK str
188
    regsub -all Pkg $str Tk str
189
    regsub -all pkg $str tk str
190
    p $str
191
} else {
192
    #
193
    # Do ITcl
194
    #
195
    set str $template
196
    regsub -all PKG $str ITCL str
197
    regsub -all Pkg $str ITcl str
198
    regsub -all pkg $str itcl str
199
    p $str
200
    p {
201
ITCL_ROOT_DIR=$ITCL_SRC_DIR
202
 
203
TCL_SRC_DIR=$ITCL_ROOT_DIR/tcl@@_V_TCL_VER_@@
204
TK_SRC_DIR=$ITCL_ROOT_DIR/tk@@_V_TK_VER_@@
205
 
206
TCL_BIN_DIR=$TCL_SRC_DIR/unix
207
TK_BIN_DIR=$TK_SRC_DIR/unix
208
    }
209
}
210
 
211
}
212
 
213
LocatePkg75
214
 
215
p {
216
#--------------------------------------------------------------------
217
#       Find out the top level source directory of the Tix package.
218
#--------------------------------------------------------------------
219
TIX_SRC_DIR=`cd ../..; pwd`
220
}
221
 
222
p_sam {
223
#--------------------------------------------------------------------
224
#       See if we should compile SAM
225
#--------------------------------------------------------------------
226
 
227
AC_ARG_ENABLE(sam,
228
    [  --enable-sam            build stand-alone modules],
229
    [ok=$enableval], [ok=no])
230
 
231
if test "$ok" = "yes"; then
232
    TIX_BUILD_SAM="yes"
233
    TIX_SAM_TARGETS='$(SAM_TARGETS)'
234
else
235
    TIX_BUILD_SAM="no"
236
fi
237
}
238
 
239
if $ENABLE_SAM {
240
    if $SAM_EXE {
241
        p {
242
            TIX_SAM_INSTALL="_install_sam_exe_ _install_sam_lib_"
243
        }
244
    } else {
245
        p {
246
            TIX_SAM_INSTALL=_install_sam_lib_
247
        }
248
    }
249
}
250
 
251
##
252
## Tcl 7.4 --> we need to find the location of the X libs, etc.
253
##
254
 
255
p74 {
256
#--------------------------------------------------------------------
257
#       Supply a substitute for stdlib.h if it doesn't define strtol,
258
#       strtoul, or strtod (which it doesn't in some versions of SunOS).
259
#--------------------------------------------------------------------
260
 
261
AC_MSG_CHECKING(stdlib.h)
262
AC_HEADER_EGREP(strtol, stdlib.h, tk_ok=yes, tk_ok=no)
263
AC_HEADER_EGREP(strtoul, stdlib.h, , tk_ok=no)
264
AC_HEADER_EGREP(strtod, stdlib.h, , tk_ok=no)
265
if test $tk_ok = no; then
266
    AC_DEFINE(NO_STDLIB_H)
267
fi
268
AC_MSG_RESULT($tk_ok)
269
 
270
#--------------------------------------------------------------------
271
#       Check for various typedefs and provide substitutes if
272
#       they don't exist.
273
#--------------------------------------------------------------------
274
 
275
AC_MODE_T
276
AC_PID_T
277
AC_SIZE_T
278
AC_UID_T
279
 
280
#--------------------------------------------------------------------
281
#       Locate the X11 header files and the X11 library archive.  Try
282
#       the ac_path_x macro first, but if it doesn't find the X stuff
283
#       (e.g. because there's no xmkmf program) then check through
284
#       a list of possible directories.  Under some conditions the
285
#       autoconf macro will return an include directory that contains
286
#       no include files, so double-check its result just to be safe.
287
#--------------------------------------------------------------------
288
 
289
AC_PATH_X
290
not_really_there=""
291
if test "$no_x" = ""; then
292
    if test "$x_includes" = ""; then
293
        AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
294
    else
295
        if test ! -r $x_includes/X11/Intrinsic.h; then
296
            not_really_there="yes"
297
        fi
298
    fi
299
fi
300
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
301
    echo checking for X11 header files
302
    XINCLUDES="# no special path needed"
303
    AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
304
    if test "$XINCLUDES" = nope; then
305
        dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include"
306
        for i in $dirs ; do
307
            if test -r $i/X11/Intrinsic.h; then
308
                XINCLUDES=" -I$i"
309
            fi
310
        done
311
    fi
312
else
313
    if test "$x_includes" != ""; then
314
        XINCLUDES=-I$x_includes
315
    else
316
        XINCLUDES="# no special path needed"
317
    fi
318
fi
319
if test "$XINCLUDES" = nope; then
320
  echo "Warning:  couldn't find any X11 include files."
321
  XINCLUDES="# no include files found"
322
fi
323
AC_SUBST(XINCLUDES)
324
 
325
if test "$no_x" = yes; then
326
    XLIBSW=nope
327
    if test "$XLIBSW" = nope; then
328
        dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
329
        for i in $dirs ; do
330
            if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
331
                XLIBSW="-L$i -lX11"
332
            fi
333
        done
334
    fi
335
else
336
    if test "$x_libraries" = ""; then
337
        XLIBSW=-lX11
338
    else
339
        XLIBSW="-L$x_libraries -lX11"
340
    fi
341
fi
342
if test "$XLIBSW" = nope ; then
343
    AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
344
fi
345
if test "$XLIBSW" = nope ; then
346
    echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
347
    XLIBSW=-lX11
348
fi
349
AC_SUBST(XLIBSW)
350
 
351
#--------------------------------------------------------------------
352
#       Check for the existence of various libraries.  The order here
353
#       is important, so that then end up in the right order in the
354
#       command line generated by make.  The -lsocket and -lnsl libraries
355
#       require a couple of special tricks:
356
#       1. Use "connect" and "accept" to check for -lsocket, and
357
#          "gethostbyname" to check for -lnsl.
358
#       2. Use each function name only once:  can't redo a check because
359
#          autoconf caches the results of the last check and won't redo it.
360
#       3. Use -lnsl and -lsocket only if they supply procedures that
361
#          aren't already present in the normal libraries.  This is because
362
#          IRIX 5.2 has libraries, but they aren't needed and they're
363
#          bogus:  they goof up name resolution if used.
364
#       4. On some SVR4 systems, can't use -lsocket without -lnsl too.
365
#          To get around this problem, check for both libraries together
366
#          if -lsocket doesn't work by itself.
367
#--------------------------------------------------------------------
368
 
369
AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
370
 
371
tk_checkBoth=0
372
AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
373
if test "$tk_checkSocket" = 1; then
374
    AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tk_checkBoth=1)
375
fi
376
if test "$tk_checkBoth" = 1; then
377
    tk_oldLibs=$LIBS
378
    LIBS="$LIBS -lsocket -lnsl"
379
    AC_CHECK_FUNC(accept, tk_checkNsl=0, [LIBS=$tk_oldLibs])
380
fi
381
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
382
 
383
#--------------------------------------------------------------------
384
# One more check related to the X libraries.  The standard releases
385
# of Ultrix don't support the "xauth" mechanism, so send won't work
386
# unless TK_NO_SECURITY is defined.  However, there are usually copies
387
# of the MIT X server available as well, which do support xauth.
388
# Check for the MIT stuff and use it if it exists.
389
#
390
# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1)
391
# because it can't deal with the "-" in the library name.
392
#--------------------------------------------------------------------
393
 
394
if test -d /usr/include/mit ; then
395
    AC_MSG_CHECKING([MIT X libraries])
396
    tk_oldCFlags=$CFLAGS
397
    CFLAGS="$CFLAGS -I/usr/include/mit"
398
    tk_oldLibs=$LIBS
399
    LIBS="$LIBS -lX11-mit"
400
    AC_TRY_LINK([
401
        #include <X11/Xlib.h>
402
    ], [
403
        XOpenDisplay(0);
404
    ], [
405
        AC_MSG_RESULT(yes)
406
        XLIBSW="-lX11-mit"
407
        XINCLUDES="-I/usr/include/mit"
408
    ], AC_MSG_RESULT(no))
409
    CFLAGS=$tk_oldCFlags
410
    LIBS=$tk_oldLibs
411
fi
412
 
413
#--------------------------------------------------------------------
414
#       On a few very rare systems, all of the libm.a stuff is
415
#       already in libc.a.  Set compiler flags accordingly.
416
#       Also, Linux requires the "ieee" library for math to
417
#       work right (and it must appear before "-lm").
418
#--------------------------------------------------------------------
419
 
420
MATH_LIBS=""
421
AC_CHECK_FUNC(sin, , MATH_LIBS="-lm")
422
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
423
AC_SUBST(MATH_LIBS)
424
 
425
#--------------------------------------------------------------------
426
#       If this system doesn't have a memmove procedure, use memcpy
427
#       instead.
428
#--------------------------------------------------------------------
429
 
430
AC_CHECK_FUNC(memmove, , [AC_DEFINE(memmove, memcpy)])
431
}
432
 
433
ptcl {
434
IS_ITCL=0
435
ITCL_BUILD_LIB_SPEC=""
436
ITK_BUILD_LIB_SPEC=""
437
TIX_EXE_FILE=tixwish
438
TCL_SAMEXE_FILE=satclsh
439
TK_SAMEXE_FILE=sawish
440
TIX_SAMEXE_FILE=satixwish
441
}
442
 
443
pitcl {
444
AC_DEFINE(ITCL_2)
445
IS_ITCL=1
446
TIX_EXE_FILE=tixwish
447
TCL_SAMEXE_FILE=satclsh_not_supported
448
TK_SAMEXE_FILE=sawish_not_supported
449
TIX_SAMEXE_FILE=satixwish_not_supported
450
}
451
 
452
p74 {
453
TIX_LIB_FILE=lib@@_V_LNAME_@@4140@@_V_BVEREXT_@@.a
454
TIX_MAKE_LIB="ar cr ${TIX_LIB_FILE} \${OBJS}"
455
TIX_BUILD_LIB_SPEC="\$(TIX_LIB_FILE)"
456
TCL_SAM_FILE=libtclsam74.a
457
TK_SAM_FILE=libtksam40.a
458
TIX_SAM_FILE=lib@@_V_LNAME_@@sam4140@@_V_BVEREXT_@@.a
459
TCL_MAKE_SAM="ar cr ${TCL_SAM_FILE} \${TCL_SAM_OBJS}"
460
TK_MAKE_SAM="ar cr ${TK_SAM_FILE} \${TK_SAM_OBJS}"
461
TIX_MAKE_SAM="ar cr ${TIX_SAM_FILE} \${TIX_SAM_OBJS}"
462
TCL_BUILD_SAM_SPEC="\$(TCL_SAM_FILE)"
463
TK_BUILD_SAM_SPEC="\$(TK_SAM_FILE)"
464
TIX_BUILD_SAM_SPEC="\$(TIX_SAM_FILE)"
465
}
466
 
467
if {$ITCL && $subs(@@_V_ITCL_VER_@@) == "2.0"} {
468
    p {
469
ITCL_BUILD_LIB_SPEC="\$(ITCL_ROOT_DIR)/itcl/libitcl.a"
470
ITK_BUILD_LIB_SPEC="\$(ITCL_ROOT_DIR)/itk/libitk.a"
471
    }
472
}
473
 
474
p75+ {
475
#--------------------------------------------------------------------
476
#       Read in configuration information generated by Tcl for shared
477
#       libraries, and arrange for it to be substituted into our
478
#       Makefile.
479
#--------------------------------------------------------------------
480
 
481
file=$TCL_BIN_DIR/tclConfig.sh
482
. $file
483
CC=$TCL_CC
484
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
485
SHLIB_LD=$TCL_SHLIB_LD
486
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
487
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
488
SHLIB_VERSION=$TCL_SHLIB_VERSION
489
 
490
DL_LIBS=$TCL_DL_LIBS
491
LD_FLAGS=$TCL_LD_FLAGS
492
TIX_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
493
 
494
#--------------------------------------------------------------------
495
#       Read in configuration information generated by Tk and arrange
496
#       for it to be substituted into our Makefile.
497
#--------------------------------------------------------------------
498
file=$TK_BIN_DIR/tkConfig.sh
499
. $file
500
 
501
TIX_DEFS="$TK_DEFS $TCL_DEFS"
502
 
503
# Note:  in the following variable, it's important to use the absolute
504
# path name of the Tcl directory rather than "..":  this is because
505
# AIX remembers this path and will attempt to use it at run-time to look
506
# up the Tcl library.
507
 
508
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
509
    TIX_BUILD_LIB_SPEC="-L`pwd` -l@@_V_LNAME_@@${VERSION}"
510
    TIX_BUILD_SAM_SPEC="-L`pwd` -l@@_V_LNAME_@@sam${VERSION}"
511
    TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam${TCL_VERSION}"
512
    TK_BUILD_SAM_SPEC="-L`pwd` -ltksam${TK_VERSION}"
513
    TIX_LIB_SPEC="-L${exec_prefix}/lib -l@@_V_LNAME_@@${VERSION}"
514
else
515
    TIX_BUILD_LIB_SPEC="-L`pwd` -l@@_V_LNAME_@@`echo ${VERSION} | tr -d .`"
516
    TIX_BUILD_SAM_SPEC="-L`pwd` -l@@_V_LNAME_@@sam`echo ${VERSION} | tr -d .`"
517
    TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam`echo ${TCL_VERSION} | tr -d .`"
518
    TK_BUILD_SAM_SPEC="-L`pwd` -ltksam`echo ${TK_VERSION} | tr -d .`"
519
    TIX_LIB_SPEC="-L${exec_prefix}/lib -l@@_V_LNAME_@@`echo ${VERSION} | tr -d .`"
520
fi
521
 
522
#--------------------------------------------------------------------
523
#       See if we should compile shared library.
524
#--------------------------------------------------------------------
525
 
526
AC_ARG_ENABLE(shared,
527
    [  --enable-shared         build lib@@_V_LNAME_@@ as a shared library],
528
    [ok=$enableval], [ok=no])
529
 
530
if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
531
    TIX_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
532
    RANLIB=":"
533
 
534
    # The main Tix library
535
    #
536
    eval "TIX_LIB_FILE=lib@@_V_LNAME_@@${TCL_SHARED_LIB_SUFFIX}"
537
    TIX_MAKE_LIB="\${SHLIB_LD} -o ${TIX_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
538
 
539
    # The Tcl SAM library
540
    #
541
    VERSION=@@_V_TCL_VER_@@
542
    eval "TCL_SAM_FILE=libtclsam${TCL_SHARED_LIB_SUFFIX}"
543
    TCL_MAKE_SAM="\${SHLIB_LD} -o ${TCL_SAM_FILE} \${TCL_SAM_OBJS} ${SHLIB_LD_LIBS}"
544
 
545
    # The Tk SAM library
546
    #
547
    VERSION=@@_V_TK_VER_@@
548
    eval "TK_SAM_FILE=libtksam${TCL_SHARED_LIB_SUFFIX}"
549
    TK_MAKE_SAM="\${SHLIB_LD} -o ${TK_SAM_FILE} \${TK_SAM_OBJS} ${SHLIB_LD_LIBS}"
550
 
551
    # The Tix SAM library
552
    #
553
    VERSION=${BIN_VERSION}
554
    eval "TIX_SAM_FILE=lib@@_V_LNAME_@@sam${TCL_SHARED_LIB_SUFFIX}"
555
    TIX_MAKE_SAM="\${SHLIB_LD} -o ${TIX_SAM_FILE} \${TIX_SAM_OBJS} ${SHLIB_LD_LIBS}"
556
 
557
else
558
    TIX_SHLIB_CFLAGS=""
559
 
560
    # The main Tix library
561
    #
562
    eval "TIX_LIB_FILE=lib@@_V_LNAME_@@${TCL_UNSHARED_LIB_SUFFIX}"
563
    TIX_MAKE_LIB="ar cr ${TIX_LIB_FILE} \${OBJS}"
564
 
565
    # The Tcl SAM library
566
 
567
    VERSION=@@_V_TCL_VER_@@
568
    eval "TCL_SAM_FILE=libtclsam${TCL_UNSHARED_LIB_SUFFIX}"
569
    TCL_MAKE_SAM="ar cr ${TCL_SAM_FILE} \${TCL_SAM_OBJS}"
570
 
571
    # The Tk SAM library
572
    #
573
    VERSION=@@_V_TK_VER_@@
574
    eval "TK_SAM_FILE=libtksam${TCL_UNSHARED_LIB_SUFFIX}"
575
    TK_MAKE_SAM="ar cr ${TK_SAM_FILE} \${TK_SAM_OBJS}"
576
 
577
    # The Tix SAM library
578
    #
579
    VERSION=${BIN_VERSION}
580
    eval "TIX_SAM_FILE=lib@@_V_LNAME_@@sam${TCL_UNSHARED_LIB_SUFFIX}"
581
    TIX_MAKE_SAM="ar cr ${TIX_SAM_FILE} \${TIX_SAM_OBJS}"
582
fi
583
}
584
 
585
if {$ITCL && $subs(@@_V_ITCL_VER_@@) != "2.0"} {
586
    p {
587
#--------------------------------------------------------------------
588
#       Read in configuration information generated by ITcl
589
#       and arrange for it to be substituted into our Makefile.
590
#--------------------------------------------------------------------
591
file=$ITCL_ROOT_DIR/itcl/unix/itclConfig.sh
592
. $file
593
    }
594
    if {$subs(@@_V_ITCL_VER_@@) > 2.1} {
595
        p {
596
#--------------------------------------------------------------------
597
#       Read in configuration information generated by ITk
598
#       and arrange for it to be substituted into our Makefile.
599
#--------------------------------------------------------------------
600
file=$ITCL_ROOT_DIR/itk/unix/itkConfig.sh
601
. $file
602
        }
603
    } else {
604
        p {
605
#----------------------------------------------------------------------
606
#       The ITK_BUILD_LIB_SPEC is incorrect in Itcl 2.1
607
#----------------------------------------------------------------------
608
ITK_BUILD_LIB_SPEC="-L\$(ITCL_ROOT_DIR)/itk/unix ${ITK_BUILD_LIB_SPEC}"
609
        }
610
    }
611
}
612
 
613
p75+ {
614
 
615
#--------------------------------------------------------------------
616
#       Check for the existence of the -lsocket and -lnsl libraries.
617
#       The order here is important, so that they end up in the right
618
#       order in the command line generated by make.  Here are some
619
#       special considerations:
620
#       1. Use "connect" and "accept" to check for -lsocket, and
621
#          "gethostbyname" to check for -lnsl.
622
#       2. Use each function name only once:  can't redo a check because
623
#          autoconf caches the results of the last check and won't redo it.
624
#       3. Use -lnsl and -lsocket only if they supply procedures that
625
#          aren't already present in the normal libraries.  This is because
626
#          IRIX 5.2 has libraries, but they aren't needed and they're
627
#          bogus:  they goof up name resolution if used.
628
#       4. On some SVR4 systems, can't use -lsocket without -lnsl too.
629
#          To get around this problem, check for both libraries together
630
#          if -lsocket doesn't work by itself.
631
#--------------------------------------------------------------------
632
 
633
checked=0
634
for i in $TK_LIBS; do
635
    if test "$i" = "-lsocket"; then
636
        checked=1
637
    fi
638
done
639
 
640
if test "$checked" = "0"; then
641
    tcl_checkBoth=0
642
    AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
643
    if test "$tcl_checkSocket" = 1; then
644
        AC_CHECK_LIB(socket, main, TK_LIBS="$TK_LIBS -lsocket",
645
            tcl_checkBoth=1)
646
    fi
647
    if test "$tcl_checkBoth" = 1; then
648
        tk_oldLibs=$TK_LIBS
649
        TK_LIBS="$TK_LIBS -lsocket -lnsl"
650
        AC_CHECK_FUNC(accept, tcl_checkNsl=0, [TK_LIBS=$tk_oldLibs])
651
    fi
652
    AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main,
653
        [TK_LIBS="$TK_LIBS -lnsl"]))
654
fi
655
}
656
 
657
p {
658
#----------------------------------------------------------------------
659
#       Substitution strings exported by TIX
660
#----------------------------------------------------------------------
661
AC_SUBST(CC)
662
AC_SUBST(RANLIB)
663
AC_SUBST(SHLIB_CFLAGS)
664
AC_SUBST(SHLIB_LD)
665
AC_SUBST(SHLIB_LD_LIBS)
666
AC_SUBST(SHLIB_SUFFIX)
667
AC_SUBST(SHLIB_VERSION)
668
AC_SUBST(DL_LIBS)
669
AC_SUBST(LD_FLAGS)
670
AC_SUBST(TCL_BUILD_LIB_SPEC)
671
AC_SUBST(TCL_LIBS)
672
AC_SUBST(TCL_VERSION)
673
AC_SUBST(TCL_SRC_DIR)
674
AC_SUBST(TCL_BIN_DIR)
675
AC_SUBST(TK_BUILD_LIB_SPEC)
676
AC_SUBST(TK_LIBS)
677
AC_SUBST(TK_VERSION)
678
AC_SUBST(TK_SRC_DIR)
679
AC_SUBST(TK_BIN_DIR)
680
AC_SUBST(TK_XINCLUDES)
681
AC_SUBST(TIX_LD_SEARCH_FLAGS)
682
AC_SUBST(TIX_MAJOR_VERSION)
683
AC_SUBST(TIX_MINOR_VERSION)
684
AC_SUBST(TIX_VERSION)
685
AC_SUBST(TIX_SRC_DIR)
686
AC_SUBST(TIX_SHLIB_CFLAGS)
687
AC_SUBST(TIX_MAKE_LIB)
688
AC_SUBST(TIX_LIB_FILE)
689
AC_SUBST(TIX_BUILD_LIB_SPEC)
690
AC_SUBST(TIX_LIB_SPEC)
691
AC_SUBST(TIX_EXE_FILE)
692
AC_SUBST(TIX_SAM_TARGETS)
693
AC_SUBST(TIX_SAM_INSTALL)
694
AC_SUBST(TCL_SAM_FILE)
695
AC_SUBST(TCL_MAKE_SAM)
696
AC_SUBST(TK_SAM_FILE)
697
AC_SUBST(TK_MAKE_SAM)
698
AC_SUBST(TIX_SAM_FILE)
699
AC_SUBST(TIX_MAKE_SAM)
700
AC_SUBST(TIX_DEFS)
701
AC_SUBST(ITCL_BUILD_LIB_SPEC)
702
AC_SUBST(ITK_BUILD_LIB_SPEC)
703
AC_SUBST(TCL_SAMEXE_FILE)
704
AC_SUBST(TK_SAMEXE_FILE)
705
AC_SUBST(TIX_SAMEXE_FILE)
706
AC_SUBST(TCL_BUILD_SAM_SPEC)
707
AC_SUBST(TK_BUILD_SAM_SPEC)
708
AC_SUBST(TIX_BUILD_SAM_SPEC)
709
}
710
 
711
p75+ {
712
# The "binary version" of Tix (see docs/Pkg.txt)
713
TIX_VERSION_PKG=${BIN_VERSION}
714
AC_SUBST(TIX_VERSION_PKG)
715
}
716
 
717
if !$TCL74 {
718
    p_sam {
719
TIXSAM_PKG_FILE="[[file join [file dirname \$dir] ${TIX_SAM_FILE}]]"
720
if test "$TIX_BUILD_SAM" = "yes"; then
721
    TIX_SAM_PACKAGE_IFNEEDED="package ifneeded Tixsam ${TIX_VERSION_PKG} [[list load \"${TIXSAM_PKG_FILE}\" Tixsam]]"
722
fi
723
    }
724
}
725
 
726
p75+ {
727
# The package file, usually a shared library
728
TIX_PKG_FILE="[[file join [file dirname \$dir] ${TIX_LIB_FILE}]]"
729
AC_SUBST(TIX_PKG_FILE)
730
AC_SUBST(TIX_SAM_PACKAGE_IFNEEDED)
731
}
732
 
733
 
734
 
735
 
736
pitcl {
737
AC_SUBST(ITCL_ROOT_DIR)
738
}
739
 
740
p74 {
741
AC_OUTPUT(Makefile)
742
}
743
 
744
p75+ {
745
AC_OUTPUT(Makefile pkgIndex.tcl)
746
}

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.