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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [itcl/] [win/] [configure.in] - Blame information for rev 1773

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

Line No. Rev Author Line
1 578 markom
dnl This whole file is CYGNUS LOCAL
2
dnl     This file is an input file used by the GNU "autoconf" program to
3
dnl     generate the file "configure", which is run during [incr Tcl]
4
dnl installation to configure the system for the local environment.
5
 
6
AC_PREREQ(2.5)
7
 
8
AC_INIT(../generic/itcl.h)
9
 
10
AC_CONFIG_AUX_DIR(../../../)
11
AC_CANONICAL_HOST
12
 
13
AC_PROG_RANLIB
14
 
15
AC_PROG_CC
16
AC_OBJEXT
17
NM=${NM-nm}
18
AC_SUBST(NM)
19
AS=${AS-as}
20
AC_SUBST(AS)
21
LD=${LD-ld}
22
AC_SUBST(LD)
23
DLLTOOL=${DLLTOOL-dlltool}
24
AC_SUBST(DLLTOOL)
25
WINDRES=${WINDRES-windres}
26
AC_SUBST(WINDRES)
27
 
28
AC_PROG_INSTALL
29
 
30
# needed for the subtle differences between cygwin and mingw32
31
case "${host}" in
32
*-*-cygwin*)
33
        TCL_ALLOC_OBJ=
34
        DLL_LDLIBS=-lcygwin
35
        DLL_LDFLAGS='-nostartfiles -Wl,--dll'
36
        ;;
37
*-*-mingw32*)
38
        TCL_ALLOC_OBJ='$(TMPDIR)/tclAlloc.o'
39
        DLL_LDLIBS=
40
        DLL_LDFLAGS='-mdll'
41
        ;;
42
esac
43
AC_SUBST(DLL_LDFLAGS)
44
AC_SUBST(DLL_LDLIBS)
45
 
46
ITCL_VERSION=3.0
47
ITCL_MAJOR_VERSION=3
48
ITCL_MINOR_VERSION=0
49
VERSION=${ITCL_MAJOR_VERSION}${ITCL_MINOR_VERSION}
50
 
51
 
52
if test "${prefix}" = "NONE"; then
53
    prefix=/usr/local
54
fi
55
if test "${exec_prefix}" = "NONE"; then
56
    exec_prefix=$prefix
57
fi
58
 
59
# -----------------------------------------------------------------------
60
#   Set up a new default --prefix.  If a previous installation of
61
#   [incr Tcl] can be found searching $PATH use that directory.
62
# -----------------------------------------------------------------------
63
 
64
AC_PREFIX_DEFAULT(/usr/local)
65
AC_PREFIX_PROGRAM(itkwish)
66
 
67
if test "${prefix}" = "NONE"; then
68
    prefix=/usr/local
69
fi
70
if test "${exec_prefix}" = "NONE"; then
71
    exec_prefix=$prefix
72
fi
73
 
74
# -----------------------------------------------------------------------
75
BUILD_DIR=`pwd`
76
ITCL_SRC_DIR=`cd $srcdir/..; pwd`
77
 
78
if ! test "$GCC" = yes; then
79
    tmp="`cygpath --windows $ITCL_SRC_DIR`"
80
    ITCL_SRC_DIR="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
81
fi
82
 
83
cd ${BUILD_DIR}
84
 
85
AC_ARG_ENABLE(gcc, [  --enable-gcc            allow use of gcc if available],
86
    [itcl_ok=$enableval], [itcl_ok=no])
87
if test "$itcl_ok" = "yes"; then
88
    AC_PROG_CC
89
else
90
    CC=${CC-cc}
91
AC_SUBST(CC)
92
fi
93
AC_HAVE_HEADERS(unistd.h limits.h)
94
 
95
#--------------------------------------------------------------------
96
#   See if there was a command-line option for where Tcl is;  if
97
#   not, assume that its top-level directory is a sibling of ours.
98
# CYGNUS LOCAL - Actually, tcl is one level higher - a sibling of the
99
# itcl directory that contains itcl proper, itk & iwidgets.
100
#--------------------------------------------------------------------
101
 
102
AC_ARG_WITH(tcl, [  --with-tcl=DIR          use Tcl 8.0 binaries from DIR],
103
        TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd ../../../tcl/win; pwd`)
104
 
105
if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
106
    TCL_BIN_DIR=`cd ../../../tcl8.1/win;pwd`
107
fi
108
 
109
if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
110
    AC_MSG_ERROR(There's no tclConfig.sh in $TCL_BIN_DIR;  perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
111
fi
112
 
113
#--------------------------------------------------------------------
114
#   Read in configuration information generated by Tcl for shared
115
#   libraries, and arrange for it to be substituted into our
116
#   Makefile.
117
#--------------------------------------------------------------------
118
 
119
file=$TCL_BIN_DIR/../unix/tclConfig.sh
120
. $file
121
 
122
dnl CFLAGS=$TCL_CFLAGS
123
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
124
SHLIB_LD=$TCL_SHLIB_LD
125
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
126
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
127
SHLIB_VERSION=$TCL_SHLIB_VERSION
128
DL_LIBS=$TCL_DL_LIBS
129
LD_FLAGS=$TCL_LD_FLAGS
130
ITCL_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
131
 
132
AC_MSG_CHECKING([whether C compiler is gcc])
133
AC_CACHE_VAL(itcl_cv_prog_gcc, [
134
    AC_EGREP_CPP(_cc_is_gcc_, [
135
#ifdef __GNUC__
136
_cc_is_gcc_
137
#endif
138
],      [itcl_cv_prog_gcc=yes], [itcl_cv_prog_gcc=no])])
139
AC_MSG_RESULT([$itcl_cv_prog_gcc])
140
 
141
if test -z "$CFLAGS" ; then
142
    CFLAGS="-O"
143
fi
144
if test "$itcl_cv_prog_gcc" = "yes" ; then
145
    CFLAGS="$CFLAGS -Wshadow -Wtraditional -Wall"
146
fi
147
 
148
AC_MSG_CHECKING([default compiler flags])
149
AC_ARG_WITH(cflags, [  --with-cflags=FLAGS     set compiler flags to FLAGS],
150
    [CFLAGS="$with_cflags"])
151
 
152
AC_MSG_RESULT([$CFLAGS])
153
 
154
#--------------------------------------------------------------------
155
#   Supply a substitute for stdlib.h if it doesn't define strtol,
156
#   strtoul, or strtod (which it doesn't in some versions of SunOS).
157
#--------------------------------------------------------------------
158
 
159
AC_MSG_CHECKING(stdlib.h)
160
AC_HEADER_EGREP(strtol, stdlib.h, itcl_ok=yes, itcl_ok=no)
161
AC_HEADER_EGREP(strtoul, stdlib.h, , itcl_ok=no)
162
AC_HEADER_EGREP(strtod, stdlib.h, , itcl_ok=no)
163
if test $itcl_ok = no; then
164
    AC_DEFINE(NO_STDLIB_H)
165
fi
166
AC_MSG_RESULT($itcl_ok)
167
 
168
#--------------------------------------------------------------------
169
#   Check for various typedefs and provide substitutes if
170
#   they don't exist.
171
#--------------------------------------------------------------------
172
 
173
AC_MODE_T
174
AC_PID_T
175
AC_SIZE_T
176
AC_UID_T
177
 
178
#--------------------------------------------------------------------
179
#   Check for the existence of various libraries.  The order here
180
#   is important, so that then end up in the right order in the
181
#   command line generated by make.  The -lsocket and -lnsl libraries
182
#   require a couple of special tricks:
183
#   1. Use "connect" and "accept" to check for -lsocket, and
184
#      "gethostbyname" to check for -lnsl.
185
#   2. Use each function name only once:  can't redo a check because
186
#      autoconf caches the results of the last check and won't redo it.
187
#   3. Use -lnsl and -lsocket only if they supply procedures that
188
#      aren't already present in the normal libraries.  This is because
189
#      IRIX 5.2 has libraries, but they aren't needed and they're
190
#      bogus:  they goof up name resolution if used.
191
#   4. On some SVR4 systems, can't use -lsocket without -lnsl too.
192
#      To get around this problem, check for both libraries together
193
#      if -lsocket doesn't work by itself.
194
#--------------------------------------------------------------------
195
 
196
itcl_checkBoth=0
197
AC_CHECK_FUNC(connect, itcl_checkSocket=0, itcl_checkSocket=1)
198
if test "$itcl_checkSocket" = 1; then
199
    AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", itcl_checkBoth=1)
200
fi
201
if test "$itcl_checkBoth" = 1; then
202
    itcl_oldLibs=$LIBS
203
    LIBS="$LIBS -lsocket -lnsl"
204
    AC_CHECK_FUNC(accept, itcl_checkNsl=0, [LIBS=$itcl_oldLibs])
205
fi
206
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
207
 
208
#--------------------------------------------------------------------
209
#   On a few very rare systems, all of the libm.a stuff is
210
#   already in libc.a.  Set compiler flags accordingly.
211
#   Also, Linux requires the "ieee" library for math to
212
#   work right (and it must appear before "-lm").
213
#--------------------------------------------------------------------
214
 
215
MATH_LIBS=""
216
AC_CHECK_FUNC(sin, , MATH_LIBS="-lm")
217
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
218
 
219
#--------------------------------------------------------------------
220
#   If this system doesn't have a memmove procedure, use memcpy
221
#   instead.
222
#--------------------------------------------------------------------
223
 
224
AC_CHECK_FUNC(memmove, , [AC_DEFINE(memmove, memcpy)])
225
 
226
#--------------------------------------------------------------------
227
#   Figure out whether "char" is unsigned.  If so, set a
228
#   #define for __CHAR_UNSIGNED__.
229
#--------------------------------------------------------------------
230
 
231
#AC_C_CHAR_UNSIGNED
232
 
233
#--------------------------------------------------------------------
234
#   Under Solaris 2.4, strtod returns the wrong value for the
235
#   terminating character under some conditions.  Check for this
236
#   and if the problem exists use a substitute procedure
237
#   "fixstrtod" (provided by Tcl) that corrects the error.
238
#--------------------------------------------------------------------
239
 
240
AC_CHECK_FUNC(strtod, itcl_strtod=1, itcl_strtod=0)
241
if test "$itcl_strtod" = 1; then
242
    AC_MSG_CHECKING([for Solaris 2.4 strtod bug])
243
    AC_TRY_RUN([
244
        extern double strtod();
245
        int main()
246
        {
247
            char *string = "NaN";
248
            char *term;
249
            strtod(string, &term);
250
            if ((term != string) && (term[-1] == 0)) {
251
                exit(1);
252
            }
253
            exit(0);
254
        }], itcl_ok=1, itcl_ok=0, itcl_ok=0)
255
    if test "$itcl_ok" = 1; then
256
        AC_MSG_RESULT(ok)
257
    else
258
        AC_MSG_RESULT(buggy)
259
        AC_DEFINE(strtod, fixstrtod)
260
    fi
261
fi
262
 
263
#--------------------------------------------------------------------
264
# If we are building with cygwin, we need one set of library names,
265
# otherwise, we need the Source-Navigator set.
266
#--------------------------------------------------------------------
267
 
268
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
269
    CYGITCLLIBSPEC=itcl${VERSION}
270
else
271
    CYGITCLLIBSPEC="itcl`echo ${VERSION} | tr -d .`"
272
fi
273
CYGITCLLIB=lib${CYGITCLLIBSPEC}.a
274
CYGITCLDLL=cygitcl${VERSION}.dll
275
CYGITCLSH=cygitclsh${VERSION}.exe
276
CYGITCLDEF=itclcyg.def
277
CYGITCLTEST=cygitcltest.exe
278
CYGIMPORTLIB=cygitcl${VERSION}.lib
279
CYGITCLRES=cygitcl.o
280
CYGITCLSHRES=cygitclsh.o
281
 
282
SNITCLLIBSPEC=itcl30.lib
283
SNITCLLIB=${SNITCLLIBSPEC}
284
SNITCLDLL=snitcl30.dll
285
SNITCLSH=snitclsh30.exe
286
SNITCLDEF=itclsn.def
287
SNITCLTEST=snitcltest.exe
288
SNIMPORTLIB=snitcl30.lib
289
SNITCLRES=snitcl.obj
290
SNITCLSHRES=snitclsh.obj
291
 
292
if test "$GCC" = yes; then
293
ITCLLIBSPEC=${CYGITCLLIBSPEC}
294
ITCLLIB=${CYGITCLLIB}
295
ITCLDLL=${CYGITCLDLL}
296
ITCLSH=${CYGITCLSH}
297
ITCLDEF=${CYGITCLDEF}
298
ITCLTEST=${CYGITCLTEST}
299
ITCLIMPORTLIB=${CYGIMPORTLIB}
300
ITCLRES=${CYGITCLRES}
301
ITCLSHRES=${CYGITCLSHRES}
302
else
303
ITCLLIBSPEC=${SNITCLLIBSPEC}
304
ITCLLIB=${SNITCLLIB}
305
ITCLDLL=${SNITCLDLL}
306
ITCLSH=${SNITCLSH}
307
ITCLDEF=${SNITCLDEF}
308
ITCLTEST=${SNITCLTEST}
309
ITCLIMPORTLIB=${SNIMPORTLIB}
310
ITCLRES=${SNITCLRES}
311
ITCLSHRES=${SNITCLSHRES}
312
fi
313
 
314
ITCL_SH="`pwd`/${ITCLSH}"
315
if ! test "$GCC" = yes; then
316
    tmp="`cygpath --windows $ITCL_SH`"
317
    ITCL_SH="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
318
fi
319
 
320
 
321
#--------------------------------------------------------------------
322
#   The statements below define a collection of symbols related to
323
#   building libitcl as a shared library instead of a static library.
324
#--------------------------------------------------------------------
325
 
326
AC_ARG_ENABLE(shared,
327
    [  --enable-shared         build libitcl as a shared library],
328
    [ok=$enableval], [ok=no])
329
if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
330
    ITCL_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
331
    eval "ITCL_LIB_FILE=libitcl${VERSION}${SHLIB_SUFFIX}"
332
    ITCL_PKG_FILE="[[file join [file dirname \$dir] ${ITCL_LIB_FILE}]]"
333
    MAKE_LIB="\${SHLIB_LD} -o ${ITCL_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
334
    RANLIB=":"
335
else
336
    ITCL_SHLIB_CFLAGS=""
337
    eval "ITCL_LIB_FILE=libitcl${VERSION}.a"
338
    ITCL_PKG_FILE=""
339
    MAKE_LIB="ar cr ${ITCL_LIB_FILE} \${OBJS}"
340
fi
341
 
342
# Note:  in the following variable, it's important to use the absolute
343
# path name of the Tcl directory rather than "..":  this is because
344
# AIX remembers this path and will attempt to use it at run-time to look
345
# up the Tcl library.
346
 
347
if test "$GCC" = yes; then
348
    ITCL_BUILD_LIB_SPEC="-L`pwd` -l${ITCLLIBSPEC}"
349
    ITCL_LIB_SPEC="-L${exec_prefix}/lib/itcl -l{ITCLLIBSPEC}"
350
    ITCL_LIB_FULL_PATH="`pwd`/${ITCLLIB}"
351
else
352
    tmp="`pwd`/${ITCLLIB}"
353
    tmp2="`cygpath --windows $tmp`"
354
    ITCL_BUILD_LIB_SPEC="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
355
    ITCL_LIB_FULL_PATH=${ITCL_BUILD_LIB_SPEC}
356
    tmp="${exec_prefix}/lib/itcl/${ITCLLIB}"
357
    tmp2="`cygpath --windows $tmp`"
358
    ITCL_LIB_SPEC="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
359
fi
360
 
361
#-------------------------------------------------------------------
362
# Set up the libraries to link with.
363
#-------------------------------------------------------------------
364
if test "$GCC" = yes; then
365
    BASELIBS="-lkernel32 $(optlibs) -ladvapi32 -luser32"
366
    WINLIBS="-lgdi32 -lcomdlg32 -lwinspool"
367
    LIBCDLL=
368
else
369
    BASELIBS="kernel32.lib advapi32.lib user32.lib"
370
    WINLIBS="gdi32.lib comdlg32.lib winspool.lib"
371
    LIBCDLL="msvcrt.lib oldnames.lib"
372
fi
373
 
374
AC_SUBST(CFLAGS)
375
AC_SUBST(DL_LIBS)
376
AC_SUBST(LD_FLAGS)
377
AC_SUBST(MATH_LIBS)
378
AC_SUBST(MAKE_LIB)
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(TCL_BIN_DIR)
385
AC_SUBST(TCL_BUILD_LIB_SPEC)
386
AC_SUBST(TCL_SRC_DIR)
387
AC_SUBST(TCL_VERSION)
388
AC_SUBST(TCL_LIB_FILE)
389
AC_SUBST(TCL_LIB_FULL_PATH)
390
AC_SUBST(ITCL_BUILD_LIB_SPEC)
391
AC_SUBST(ITCL_LD_SEARCH_FLAGS)
392
AC_SUBST(ITCL_LIB_FILE)
393
AC_SUBST(ITCL_LIB_FULL_PATH)
394
AC_SUBST(ITCL_LIB_SPEC)
395
AC_SUBST(ITCL_MAJOR_VERSION)
396
AC_SUBST(ITCL_MINOR_VERSION)
397
AC_SUBST(ITCL_PKG_FILE)
398
AC_SUBST(ITCL_SHLIB_CFLAGS)
399
AC_SUBST(ITCL_SRC_DIR)
400
AC_SUBST(ITCL_VERSION)
401
AC_SUBST(CYGITCLLIB)
402
AC_SUBST(CYGITCLDLL)
403
AC_SUBST(CYGITCLSH)
404
AC_SUBST(CYGITCLDEF)
405
AC_SUBST(CYGITCLTEST)
406
AC_SUBST(CYGIMPORTLIB)
407
AC_SUBST(CYGITCLRES)
408
AC_SUBST(CYGITCLSHRES)
409
AC_SUBST(SNITCLLIB)
410
AC_SUBST(SNITCLDLL)
411
AC_SUBST(SNITCLSH)
412
AC_SUBST(SNITCLDEF)
413
AC_SUBST(SNITCLTEST)
414
AC_SUBST(SNIMPORTLIB)
415
AC_SUBST(SNITCLRES)
416
AC_SUBST(SNITCLSHRES)
417
AC_SUBST(ITCLLIB)
418
AC_SUBST(ITCLDLL)
419
AC_SUBST(ITCLSH)
420
AC_SUBST(ITCLDEF)
421
AC_SUBST(ITCLTEST)
422
AC_SUBST(ITCLIMPORTLIB)
423
AC_SUBST(ITCLRES)
424
AC_SUBST(ITCL_SH)
425
AC_SUBST(BASELIBS)
426
AC_SUBST(WINLIBS)
427
AC_SUBST(LIBCDLL)
428
 
429
AC_OUTPUT(Makefile ../unix/pkgIndex.tcl ../itclConfig.sh)

powered by: WebSVN 2.1.0

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