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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [unix/] [tk8.0/] [configure.in] - Blame information for rev 1781

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

Line No. Rev Author Line
1 578 markom
dnl     This file is an input file used by the GNU "autoconf" program to
2
dnl     generate the file "configure", which is run to configure the
3
dnl     Makefile in this directory.
4
 
5
AC_INIT(../../generic/tixInit.c)
6
 
7
#--------------------------------------------------------------------
8
#       Remove the ./config.cache file and rerun configure if
9
#       the cache file belong to a different architecture
10
#
11
#       This doesn't seem to work in the Cygnus environment,
12
#       it causes an error message about having more than
13
#       one target, so I disabled it.   meissner@cygnus.com
14
#----------------------------------------------------------------------
15
#AC_CHECK_PROG(UNAME, uname -a, [uname -a], "")
16
#if test "$UNAME" = ""; then
17
#    AC_CHECK_PROG(UNAME, uname, [uname], "")
18
#fi
19
#
20
#if test "$UNAME" != ""; then
21
#    uname=`$UNAME`
22
#    AC_MSG_CHECKING([cached value of \$uname])
23
#    AC_CACHE_VAL(ac_cv_prog_uname, [nocached=1 ac_cv_prog_uname=`$UNAME`])
24
#    if test "$nocached" = "1"; then
25
#       AC_MSG_RESULT(no)
26
#    else
27
#       AC_MSG_RESULT(yes)
28
#    fi
29
#
30
#    if test "$uname" != "$ac_cv_prog_uname"; then
31
#        echo "Running on a different machine/architecture. Can't use cached values"
32
#       echo "Removing config.cache and running configure again ..."
33
#       rm -f config.cache
34
#        CMDLINE="$0 $*"
35
#       exec $CMDLINE
36
#    fi
37
#fi
38
 
39
#----------------------------------------------------------------------
40
# We don't want to use any relative path because we need to generate
41
# Makefile's in subdirectories
42
#----------------------------------------------------------------------
43
if test "$INSTALL" = "./install.sh"; then
44
    INSTALL=`pwd`/install.sh
45
fi
46
 
47
#--------------------------------------------------------------------
48
#       Version information about this TIX release.
49
#--------------------------------------------------------------------
50
 
51
TIX_VERSION=4.1
52
TIX_MAJOR_VERSION=4
53
TIX_MINOR_VERSION=1
54
 
55
BIN_VERSION=${TIX_VERSION}.8.0
56
 
57
 
58
VERSION=${BIN_VERSION}
59
 
60
#--------------------------------------------------------------------
61
#       See if user wants to use gcc to compile Tix. This option must
62
#       be used before any checking that uses the C compiler.
63
#--------------------------------------------------------------------
64
 
65
AC_ARG_ENABLE(gcc, [  --enable-gcc            allow use of gcc if available],
66
    [tix_ok=$enableval], [tix_ok=no])
67
if test "$tix_ok" = "yes"; then
68
    AC_PROG_CC
69
else
70
    CC=${CC-cc}
71
AC_SUBST(CC)
72
fi
73
 
74
AC_PROG_INSTALL
75
AC_PROG_RANLIB
76
AC_HAVE_HEADERS(unistd.h limits.h)
77
AC_PROG_MAKE_SET
78
 
79
#--------------------------------------------------------------------
80
#       unsigned char is not supported by some non-ANSI compilers.
81
#--------------------------------------------------------------------
82
 
83
AC_MSG_CHECKING([unsigned char])
84
AC_TRY_COMPILE([#include ],[
85
     unsigned char c = 'c';
86
], tcl_ok=supported, tcl_ok=notsupported)
87
 
88
AC_MSG_RESULT($tcl_ok)
89
if test $tcl_ok = supported; then
90
    AC_DEFINE(UCHAR_SUPPORTED)
91
fi
92
 
93
#--------------------------------------------------------------------
94
#       Check whether there is an strcasecmp function on this system.
95
#       This is a bit tricky because under SCO it's in -lsocket and
96
#       under Sequent Dynix it's in -linet.
97
#--------------------------------------------------------------------
98
 
99
AC_CHECK_FUNC(strcasecmp, tcl_ok=1, tcl_ok=0)
100
if test "$tcl_ok" = 0; then
101
    AC_CHECK_LIB(socket, strcasecmp, tcl_ok=1, tcl_ok=0)
102
fi
103
if test "$tcl_ok" = 0; then
104
    AC_CHECK_LIB(inet, strcasecmp, tcl_ok=1, tcl_ok=0)
105
fi
106
if test "$tcl_ok" = 0; then
107
    AC_DEFINE(NO_STRCASECMP)
108
fi
109
 
110
#--------------------------------------------------------------------
111
#       See if there was a command-line option for where Tcl is;  if
112
#       not, assume that its top-level directory is a sibling of ours.
113
#--------------------------------------------------------------------
114
 
115
AC_ARG_WITH(tcl, [  --with-tcl=DIR           use Tcl 8.0 source from DIR],
116
   val=$withval, val="")
117
 
118
AC_MSG_CHECKING([Tcl source directory])
119
 
120
if test "$val" != ""; then
121
    TCL_SRC_DIR=$val
122
    if test ! -d $TCL_SRC_DIR; then
123
        AC_MSG_ERROR(Directory $TCL_SRC_DIR doesn't exist)
124
        AC_MSG_ERROR(Please install the source code of Tcl 8.0)
125
        exit 1
126
    fi
127
else
128
    # CYGNUS LOCAL: Just use tcl.
129
    dirs="${srcdir}/../../../tcl8.0* ${srcdir}/../../../tcl"
130
    TCL_SRC_DIR="no-no"
131
    for i in $dirs; do
132
        if test -d $i; then
133
            TCL_SRC_DIR=`cd $i; pwd`
134
        fi
135
    done
136
 
137
    if test ! -d $TCL_SRC_DIR; then
138
        AC_MSG_ERROR(Cannot locate Tcl source directory in $dirs)
139
        AC_MSG_ERROR(Please install the source code of Tcl 8.0)
140
        exit 1
141
    fi
142
fi
143
AC_MSG_RESULT($TCL_SRC_DIR)
144
 
145
# CYGNUS LOCAL: This used to get TCL_BIN_DIR from TCL_SRC_DIR, which
146
# only works when srcdir == objdir
147
TCL_BIN_DIR=../../../tcl/unix
148
 
149
#--------------------------------------------------------------------
150
#       See if there was a command-line option for where Tk is;  if
151
#       not, assume that its top-level directory is a sibling of ours.
152
#--------------------------------------------------------------------
153
 
154
AC_ARG_WITH(tk, [  --with-tk=DIR           use Tk 8.0 source from DIR],
155
   val=$withval, val="")
156
 
157
AC_MSG_CHECKING([Tk source directory])
158
 
159
if test "$val" != ""; then
160
    TK_SRC_DIR=$val
161
    if test ! -d $TK_SRC_DIR; then
162
        AC_MSG_ERROR(Directory $TK_SRC_DIR doesn't exist)
163
        AC_MSG_ERROR(Please install the source code of Tk 8.0)
164
        exit 1
165
    fi
166
else
167
    # CYGNUS LOCAL: Just use tk
168
    dirs="${srcdir}/../../../tk8.0* ${srcdir}/../../../tk"
169
    TK_SRC_DIR="no-no"
170
    for i in $dirs; do
171
        if test -d $i; then
172
            TK_SRC_DIR=`cd $i; pwd`
173
        fi
174
    done
175
 
176
    if test ! -d $TK_SRC_DIR; then
177
        AC_MSG_ERROR(Cannot locate Tk source directory in $dirs)
178
        AC_MSG_ERROR(Please install the source code of Tk 8.0)
179
        exit 1
180
    fi
181
fi
182
AC_MSG_RESULT($TK_SRC_DIR)
183
 
184
# CYGNUS LOCAL: This used to get TK_BIN_DIR from TK_SRC_DIR, which
185
# only works when srcdir == objdir
186
TK_BIN_DIR=../../../tk/unix
187
 
188
#--------------------------------------------------------------------
189
#       Find out the top level source directory of the Tix package.
190
#--------------------------------------------------------------------
191
TIX_SRC_DIR=`cd ${srcdir}/../..; pwd`
192
 
193
#--------------------------------------------------------------------
194
#       See if we should compile SAM
195
#--------------------------------------------------------------------
196
 
197
AC_ARG_ENABLE(sam,
198
    [  --enable-sam            build stand-alone modules],
199
    [ok=$enableval], [ok=no])
200
 
201
if test "$ok" = "yes"; then
202
    TIX_BUILD_SAM="yes"
203
    TIX_SAM_TARGETS='$(SAM_TARGETS)'
204
else
205
    TIX_BUILD_SAM="no"
206
fi
207
 
208
            TIX_SAM_INSTALL=_install_sam_lib_
209
 
210
IS_ITCL=0
211
ITCL_BUILD_LIB_SPEC=""
212
ITK_BUILD_LIB_SPEC=""
213
TIX_EXE_FILE=tixwish
214
TCL_SAMEXE_FILE=satclsh
215
TK_SAMEXE_FILE=sawish
216
TIX_SAMEXE_FILE=satixwish
217
 
218
#--------------------------------------------------------------------
219
#       Read in configuration information generated by Tcl for shared
220
#       libraries, and arrange for it to be substituted into our
221
#       Makefile.
222
#--------------------------------------------------------------------
223
 
224
file=$TCL_BIN_DIR/tclConfig.sh
225
. $file
226
CC=$TCL_CC
227
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
228
SHLIB_LD=$TCL_SHLIB_LD
229
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
230
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
231
SHLIB_VERSION=$TCL_SHLIB_VERSION
232
 
233
DL_LIBS=$TCL_DL_LIBS
234
LD_FLAGS=$TCL_LD_FLAGS
235
TIX_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
236
 
237
#--------------------------------------------------------------------
238
#       Read in configuration information generated by Tk and arrange
239
#       for it to be substituted into our Makefile.
240
#--------------------------------------------------------------------
241
file=$TK_BIN_DIR/tkConfig.sh
242
. $file
243
 
244
TIX_DEFS="$TK_DEFS $TCL_DEFS"
245
 
246
# Note:  in the following variable, it's important to use the absolute
247
# path name of the Tcl directory rather than "..":  this is because
248
# AIX remembers this path and will attempt to use it at run-time to look
249
# up the Tcl library.
250
 
251
TIX_BUILD_LOCATION="`pwd`"
252
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
253
    TIX_BUILD_LIB_SPEC="-L`pwd` -ltix${VERSION}"
254
    TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam${VERSION}"
255
    TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam${TCL_VERSION}"
256
    TK_BUILD_SAM_SPEC="-L`pwd` -ltksam${TK_VERSION}"
257
    TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix${VERSION}"
258
else
259
    TIX_BUILD_LIB_SPEC="-L`pwd` -ltix`echo ${VERSION} | tr -d .`"
260
    TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam`echo ${VERSION} | tr -d .`"
261
    TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam`echo ${TCL_VERSION} | tr -d .`"
262
    TK_BUILD_SAM_SPEC="-L`pwd` -ltksam`echo ${TK_VERSION} | tr -d .`"
263
    TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix`echo ${VERSION} | tr -d .`"
264
fi
265
 
266
#--------------------------------------------------------------------
267
#       See if we should compile shared library.
268
#--------------------------------------------------------------------
269
 
270
AC_ARG_ENABLE(shared,
271
    [  --enable-shared         build libtix as a shared library],
272
    [ok=$enableval], [ok=no])
273
 
274
if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
275
    TIX_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
276
    TIX_RANLIB=":"
277
 
278
    # The main Tix library
279
    #
280
    eval "TIX_LIB_FILE=libtix${TCL_SHARED_LIB_SUFFIX}"
281
    TIX_MAKE_LIB="\${SHLIB_LD} -o ${TIX_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
282
 
283
    # The Tcl SAM library
284
    #
285
    VERSION=8.0
286
    eval "TCL_SAM_FILE=libtclsam${TCL_SHARED_LIB_SUFFIX}"
287
    TCL_MAKE_SAM="\${SHLIB_LD} -o ${TCL_SAM_FILE} \${TCL_SAM_OBJS} ${SHLIB_LD_LIBS}"
288
 
289
    # The Tk SAM library
290
    #
291
    VERSION=8.0
292
    eval "TK_SAM_FILE=libtksam${TCL_SHARED_LIB_SUFFIX}"
293
    TK_MAKE_SAM="\${SHLIB_LD} -o ${TK_SAM_FILE} \${TK_SAM_OBJS} ${SHLIB_LD_LIBS}"
294
 
295
    # The Tix SAM library
296
    #
297
    VERSION=${BIN_VERSION}
298
    eval "TIX_SAM_FILE=libtixsam${TCL_SHARED_LIB_SUFFIX}"
299
    TIX_MAKE_SAM="\${SHLIB_LD} -o ${TIX_SAM_FILE} \${TIX_SAM_OBJS} ${SHLIB_LD_LIBS}"
300
 
301
else
302
    TIX_SHLIB_CFLAGS=""
303
    TIX_RANLIB='$(RANLIB)'
304
 
305
    # The main Tix library
306
    #
307
    eval "TIX_LIB_FILE=libtix${TCL_UNSHARED_LIB_SUFFIX}"
308
    TIX_MAKE_LIB="ar cr ${TIX_LIB_FILE} \${OBJS}"
309
 
310
    # The Tcl SAM library
311
 
312
    VERSION=8.0
313
    eval "TCL_SAM_FILE=libtclsam${TCL_UNSHARED_LIB_SUFFIX}"
314
    TCL_MAKE_SAM="ar cr ${TCL_SAM_FILE} \${TCL_SAM_OBJS}"
315
 
316
    # The Tk SAM library
317
    #
318
    VERSION=8.0
319
    eval "TK_SAM_FILE=libtksam${TCL_UNSHARED_LIB_SUFFIX}"
320
    TK_MAKE_SAM="ar cr ${TK_SAM_FILE} \${TK_SAM_OBJS}"
321
 
322
    # The Tix SAM library
323
    #
324
    VERSION=${BIN_VERSION}
325
    eval "TIX_SAM_FILE=libtixsam${TCL_UNSHARED_LIB_SUFFIX}"
326
    TIX_MAKE_SAM="ar cr ${TIX_SAM_FILE} \${TIX_SAM_OBJS}"
327
fi
328
 
329
 
330
#--------------------------------------------------------------------
331
#       Check for the existence of the -lsocket and -lnsl libraries.
332
#       The order here is important, so that they end up in the right
333
#       order in the command line generated by make.  Here are some
334
#       special considerations:
335
#       1. Use "connect" and "accept" to check for -lsocket, and
336
#          "gethostbyname" to check for -lnsl.
337
#       2. Use each function name only once:  can't redo a check because
338
#          autoconf caches the results of the last check and won't redo it.
339
#       3. Use -lnsl and -lsocket only if they supply procedures that
340
#          aren't already present in the normal libraries.  This is because
341
#          IRIX 5.2 has libraries, but they aren't needed and they're
342
#          bogus:  they goof up name resolution if used.
343
#       4. On some SVR4 systems, can't use -lsocket without -lnsl too.
344
#          To get around this problem, check for both libraries together
345
#          if -lsocket doesn't work by itself.
346
#--------------------------------------------------------------------
347
 
348
checked=0
349
for i in $TK_LIBS; do
350
    if test "$i" = "-lsocket"; then
351
        checked=1
352
    fi
353
done
354
 
355
if test "$checked" = "0"; then
356
    tcl_checkBoth=0
357
    AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
358
    if test "$tcl_checkSocket" = 1; then
359
        AC_CHECK_LIB(socket, main, TK_LIBS="$TK_LIBS -lsocket",
360
            tcl_checkBoth=1)
361
    fi
362
    if test "$tcl_checkBoth" = 1; then
363
        tk_oldLibs=$TK_LIBS
364
        TK_LIBS="$TK_LIBS -lsocket -lnsl"
365
        AC_CHECK_FUNC(accept, tcl_checkNsl=0, [TK_LIBS=$tk_oldLibs])
366
    fi
367
    AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main,
368
        [TK_LIBS="$TK_LIBS -lnsl"]))
369
fi
370
 
371
TIX_LIB_FULL_PATH="`pwd`/${TIX_LIB_FILE}"
372
 
373
#----------------------------------------------------------------------
374
#       Substitution strings exported by TIX
375
#----------------------------------------------------------------------
376
AC_SUBST(CC)
377
AC_SUBST(RANLIB)
378
AC_SUBST(TIX_RANLIB)
379
AC_SUBST(SHLIB_CFLAGS)
380
AC_SUBST(SHLIB_LD)
381
AC_SUBST(SHLIB_LD_LIBS)
382
AC_SUBST(SHLIB_SUFFIX)
383
AC_SUBST(SHLIB_VERSION)
384
AC_SUBST(DL_LIBS)
385
AC_SUBST(LD_FLAGS)
386
AC_SUBST(TCL_BUILD_LIB_SPEC)
387
AC_SUBST(TCL_LIBS)
388
AC_SUBST(TCL_VERSION)
389
AC_SUBST(TCL_SRC_DIR)
390
AC_SUBST(TCL_BIN_DIR)
391
AC_SUBST(TCL_LIB_FULL_PATH)
392
AC_SUBST(TK_BUILD_LIB_SPEC)
393
AC_SUBST(TK_LIBS)
394
AC_SUBST(TK_VERSION)
395
AC_SUBST(TK_SRC_DIR)
396
AC_SUBST(TK_BIN_DIR)
397
AC_SUBST(TK_XINCLUDES)
398
AC_SUBST(TK_LIB_FULL_PATH)
399
AC_SUBST(TIX_LD_SEARCH_FLAGS)
400
AC_SUBST(TIX_MAJOR_VERSION)
401
AC_SUBST(TIX_MINOR_VERSION)
402
AC_SUBST(TIX_VERSION)
403
AC_SUBST(TIX_SRC_DIR)
404
AC_SUBST(TIX_SHLIB_CFLAGS)
405
AC_SUBST(TIX_MAKE_LIB)
406
AC_SUBST(TIX_LIB_FILE)
407
AC_SUBST(TIX_BUILD_LIB_SPEC)
408
AC_SUBST(TIX_LIB_SPEC)
409
AC_SUBST(TIX_EXE_FILE)
410
AC_SUBST(TIX_SAM_TARGETS)
411
AC_SUBST(TIX_SAM_INSTALL)
412
AC_SUBST(TIX_LIB_FULL_PATH)
413
AC_SUBST(TCL_SAM_FILE)
414
AC_SUBST(TCL_MAKE_SAM)
415
AC_SUBST(TK_SAM_FILE)
416
AC_SUBST(TK_MAKE_SAM)
417
AC_SUBST(TIX_SAM_FILE)
418
AC_SUBST(TIX_MAKE_SAM)
419
AC_SUBST(TIX_DEFS)
420
AC_SUBST(ITCL_BUILD_LIB_SPEC)
421
AC_SUBST(ITCL_LIB_FULL_PATH)
422
AC_SUBST(ITK_BUILD_LIB_SPEC)
423
AC_SUBST(TCL_SAMEXE_FILE)
424
AC_SUBST(TK_SAMEXE_FILE)
425
AC_SUBST(TIX_SAMEXE_FILE)
426
AC_SUBST(TCL_BUILD_SAM_SPEC)
427
AC_SUBST(TK_BUILD_SAM_SPEC)
428
AC_SUBST(TIX_BUILD_SAM_SPEC)
429
AC_SUBST(TIX_BUILD_LOCATION)
430
# The "binary version" of Tix (see docs/Pkg.txt)
431
TIX_VERSION_PKG=${BIN_VERSION}
432
AC_SUBST(TIX_VERSION_PKG)
433
 
434
TIXSAM_PKG_FILE="[[file join [file dirname \$dir] ${TIX_SAM_FILE}]]"
435
if test "$TIX_BUILD_SAM" = "yes"; then
436
    TIX_SAM_PACKAGE_IFNEEDED="package ifneeded Tixsam ${TIX_VERSION_PKG} [[list load \"${TIXSAM_PKG_FILE}\" Tixsam]]"
437
fi
438
 
439
# The package file, usually a shared library
440
TIX_PKG_FILE="[[file join [file dirname \$dir] ${TIX_LIB_FILE}]]"
441
AC_SUBST(TIX_PKG_FILE)
442
AC_SUBST(TIX_SAM_PACKAGE_IFNEEDED)
443
 
444
AC_OUTPUT(Makefile pkgIndex.tcl ../../tixConfig.sh)
445
 

powered by: WebSVN 2.1.0

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