~ubuntu-branches/ubuntu/wily/tk8.6/wily

« back to all changes in this revision

Viewing changes to unix/tcl.m4

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2013-10-05 11:59:47 UTC
  • mfrom: (8.1.5 experimental)
  • Revision ID: package-import@ubuntu.com-20131005115947-fuy2i0zetr6iuyn3
Added the libtk8.6-dbg package with libtk8.6 debug symbols in it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
678
678
 
679
679
        # Does the pthread-implementation provide
680
680
        # 'pthread_attr_setstacksize' ?
681
 
        AC_CHECK_FUNCS(pthread_attr_setstacksize)
 
681
 
 
682
        ac_saved_libs=$LIBS
 
683
        LIBS="$LIBS $THREADS_LIBS"
 
684
        AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
 
685
        LIBS=$ac_saved_libs
682
686
    else
683
687
        TCL_THREADS=0
684
688
    fi
1072
1076
            AC_DEFINE(MODULE_SCOPE,
1073
1077
                [extern __attribute__((__visibility__("hidden")))],
1074
1078
                [Compiler support for module scope symbols])
 
1079
            AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
1075
1080
        ])
1076
1081
    ])
1077
1082
 
1228
1233
            SHLIB_CFLAGS=""
1229
1234
            SHLIB_LD='${CC} -shared'
1230
1235
            SHLIB_SUFFIX=".dll"
1231
 
            DL_OBJS="tclLoadDl.o tclWinError.o"
 
1236
            DL_OBJS="tclLoadDl.o"
 
1237
            PLAT_OBJS='${CYGWIN_OBJS}'
 
1238
            PLAT_SRCS='${CYGWIN_SRCS}'
1232
1239
            DL_LIBS="-ldl"
1233
1240
            CC_SEARCH_FLAGS=""
1234
1241
            LD_SEARCH_FLAGS=""
1413
1420
            # get rid of the warnings.
1414
1421
            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
1415
1422
 
1416
 
            # following line added by CW for Debian GNU/Linux
1417
 
            TK_SHLIB_LD_EXTRAS="-Wl,-soname,\${TK_LIB_FILE}.0"
1418
 
 
1419
1423
            SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
1420
1424
            DL_OBJS="tclLoadDl.o"
1421
1425
            DL_LIBS="-ldl"
1444
1448
 
1445
1449
            AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
1446
1450
            ;;
1447
 
        GNU*)
1448
 
            SHLIB_CFLAGS="-fPIC"
1449
 
            SHLIB_SUFFIX=".so"
1450
 
 
1451
 
            SHLIB_LD='${CC} -shared'
1452
 
            DL_OBJS=""
1453
 
            DL_LIBS="-ldl"
1454
 
            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1455
 
            CC_SEARCH_FLAGS=""
1456
 
            LD_SEARCH_FLAGS=""
1457
 
            AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1458
 
            ;;
1459
1451
        Lynx*)
1460
1452
            SHLIB_CFLAGS="-fPIC"
1461
1453
            SHLIB_SUFFIX=".so"
1489
1481
            CC_SEARCH_FLAGS=""
1490
1482
            LD_SEARCH_FLAGS=""
1491
1483
            ;;
1492
 
        NetBSD-1.*|FreeBSD-[[1-2]].*)
1493
 
            SHLIB_CFLAGS="-fPIC"
1494
 
            SHLIB_LD="ld -Bshareable -x"
1495
 
            SHLIB_SUFFIX=".so"
1496
 
            DL_OBJS="tclLoadDl.o"
1497
 
            DL_LIBS=""
1498
 
            AS_IF([test $doRpath = yes], [
1499
 
                CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1500
 
                LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1501
 
            AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1502
 
                AC_EGREP_CPP(yes, [
1503
 
#ifdef __ELF__
1504
 
        yes
1505
 
#endif
1506
 
                ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1507
 
            AS_IF([test $tcl_cv_ld_elf = yes], [
1508
 
                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1509
 
            ], [
1510
 
                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
1511
 
            ])
1512
 
 
1513
 
            # Ancient FreeBSD doesn't handle version numbers with dots.
1514
 
 
1515
 
            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1516
 
            TCL_LIB_VERSIONS_OK=nodots
1517
 
            ;;
1518
1484
        OpenBSD-*)
1519
1485
            arch=`arch -s`
1520
1486
            case "$arch" in
1521
 
            m88k|vax)
 
1487
            vax)
1522
1488
                # Equivalent using configure option --disable-load
1523
1489
                # Step 4 will set the necessary variables
1524
1490
                DL_OBJS=""
1525
1491
                SHLIB_LD_LIBS=""
 
1492
                LDFLAGS=""
1526
1493
                ;;
1527
1494
            *)
1528
1495
                SHLIB_CFLAGS="-fPIC"
1534
1501
                    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1535
1502
                LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1536
1503
                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
 
1504
                LDFLAGS="-Wl,-export-dynamic"
1537
1505
                ;;
1538
1506
            esac
1539
1507
            case "$arch" in
1540
 
            m88k|vax)
 
1508
            vax)
1541
1509
                CFLAGS_OPTIMIZE="-O1"
1542
1510
                ;;
1543
1511
            sh)
1547
1515
                CFLAGS_OPTIMIZE="-O2"
1548
1516
                ;;
1549
1517
            esac
1550
 
            AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1551
 
                AC_EGREP_CPP(yes, [
1552
 
#ifdef __ELF__
1553
 
        yes
1554
 
#endif
1555
 
                ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1556
 
            AS_IF([test $tcl_cv_ld_elf = yes], [
1557
 
                LDFLAGS=-Wl,-export-dynamic
1558
 
            ], [LDFLAGS=""])
1559
1518
            AS_IF([test "${TCL_THREADS}" = "1"], [
1560
1519
                # On OpenBSD:   Compile with -pthread
1561
1520
                #               Don't link with -lpthread
1566
1525
            UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1567
1526
            TCL_LIB_VERSIONS_OK=nodots
1568
1527
            ;;
1569
 
        NetBSD-*|FreeBSD-[[3-4]].*)
1570
 
            # FreeBSD 3.* and greater have ELF.
1571
 
            # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
 
1528
        NetBSD-*)
 
1529
            # NetBSD has ELF and can use 'cc -shared' to build shared libs
1572
1530
            SHLIB_CFLAGS="-fPIC"
1573
1531
            SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
1574
1532
            SHLIB_SUFFIX=".so"
1584
1542
                CFLAGS="$CFLAGS -pthread"
1585
1543
                LDFLAGS="$LDFLAGS -pthread"
1586
1544
            ])
1587
 
            case $system in
1588
 
            FreeBSD-3.*)
1589
 
                # FreeBSD-3 doesn't handle version numbers with dots.
1590
 
                UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1591
 
                SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1592
 
                TCL_LIB_VERSIONS_OK=nodots
1593
 
                ;;
1594
 
            esac
1595
1545
            ;;
1596
1546
        FreeBSD-*)
1597
1547
            # This configuration from FreeBSD Ports.
1598
1548
            SHLIB_CFLAGS="-fPIC"
1599
1549
            SHLIB_LD="${CC} -shared"
1600
 
            TCL_SHLIB_LD_EXTRAS="-soname \$[@]"
 
1550
            TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$[@]"
1601
1551
            SHLIB_SUFFIX=".so"
1602
1552
            DL_OBJS="tclLoadDl.o"
1603
1553
            DL_LIBS=""
1604
1554
            LDFLAGS=""
1605
1555
            AS_IF([test $doRpath = yes], [
1606
1556
                CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1607
 
                LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
 
1557
                LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1608
1558
            AS_IF([test "${TCL_THREADS}" = "1"], [
1609
1559
                # The -pthread needs to go in the LDFLAGS, not LIBS
1610
1560
                LIBS=`echo $LIBS | sed s/-pthread//`
2095
2045
    AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
2096
2046
        AC_DEFINE(MODULE_SCOPE, [extern],
2097
2047
            [No Compiler support for module scope symbols])
2098
 
        AC_DEFINE(NO_VIZ, [], [No visibility attribute])
2099
2048
    ])
2100
2049
 
2101
2050
    AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
2199
2148
])
2200
2149
 
2201
2150
#--------------------------------------------------------------------
2202
 
# SC_SERIAL_PORT
2203
 
#
2204
 
#       Determine which interface to use to talk to the serial port.
2205
 
#       Note that #include lines must begin in leftmost column for
2206
 
#       some compilers to recognize them as preprocessor directives,
2207
 
#       and some build environments have stdin not pointing at a
2208
 
#       pseudo-terminal (usually /dev/null instead.)
2209
 
#
2210
 
# Arguments:
2211
 
#       none
2212
 
#
2213
 
# Results:
2214
 
#
2215
 
#       Defines only one of the following vars:
2216
 
#               HAVE_SYS_MODEM_H
2217
 
#               USE_TERMIOS
2218
 
#               USE_TERMIO
2219
 
#               USE_SGTTY
2220
 
#
2221
 
#--------------------------------------------------------------------
2222
 
 
2223
 
AC_DEFUN([SC_SERIAL_PORT], [
2224
 
    AC_CHECK_HEADERS(sys/modem.h)
2225
 
    AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
2226
 
    AC_TRY_RUN([
2227
 
#include <termios.h>
2228
 
 
2229
 
int main() {
2230
 
    struct termios t;
2231
 
    if (tcgetattr(0, &t) == 0) {
2232
 
        cfsetospeed(&t, 0);
2233
 
        t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2234
 
        return 0;
2235
 
    }
2236
 
    return 1;
2237
 
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2238
 
    if test $tcl_cv_api_serial = no ; then
2239
 
        AC_TRY_RUN([
2240
 
#include <termio.h>
2241
 
 
2242
 
int main() {
2243
 
    struct termio t;
2244
 
    if (ioctl(0, TCGETA, &t) == 0) {
2245
 
        t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2246
 
        return 0;
2247
 
    }
2248
 
    return 1;
2249
 
}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2250
 
    fi
2251
 
    if test $tcl_cv_api_serial = no ; then
2252
 
        AC_TRY_RUN([
2253
 
#include <sgtty.h>
2254
 
 
2255
 
int main() {
2256
 
    struct sgttyb t;
2257
 
    if (ioctl(0, TIOCGETP, &t) == 0) {
2258
 
        t.sg_ospeed = 0;
2259
 
        t.sg_flags |= ODDP | EVENP | RAW;
2260
 
        return 0;
2261
 
    }
2262
 
    return 1;
2263
 
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2264
 
    fi
2265
 
    if test $tcl_cv_api_serial = no ; then
2266
 
        AC_TRY_RUN([
2267
 
#include <termios.h>
2268
 
#include <errno.h>
2269
 
 
2270
 
int main() {
2271
 
    struct termios t;
2272
 
    if (tcgetattr(0, &t) == 0
2273
 
        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2274
 
        cfsetospeed(&t, 0);
2275
 
        t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2276
 
        return 0;
2277
 
    }
2278
 
    return 1;
2279
 
}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2280
 
    fi
2281
 
    if test $tcl_cv_api_serial = no; then
2282
 
        AC_TRY_RUN([
2283
 
#include <termio.h>
2284
 
#include <errno.h>
2285
 
 
2286
 
int main() {
2287
 
    struct termio t;
2288
 
    if (ioctl(0, TCGETA, &t) == 0
2289
 
        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2290
 
        t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2291
 
        return 0;
2292
 
    }
2293
 
    return 1;
2294
 
    }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2295
 
    fi
2296
 
    if test $tcl_cv_api_serial = no; then
2297
 
        AC_TRY_RUN([
2298
 
#include <sgtty.h>
2299
 
#include <errno.h>
2300
 
 
2301
 
int main() {
2302
 
    struct sgttyb t;
2303
 
    if (ioctl(0, TIOCGETP, &t) == 0
2304
 
        || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2305
 
        t.sg_ospeed = 0;
2306
 
        t.sg_flags |= ODDP | EVENP | RAW;
2307
 
        return 0;
2308
 
    }
2309
 
    return 1;
2310
 
}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
2311
 
    fi])
2312
 
    case $tcl_cv_api_serial in
2313
 
        termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
2314
 
        termio)  AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
2315
 
        sgtty)   AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
2316
 
    esac
2317
 
])
2318
 
 
2319
 
#--------------------------------------------------------------------
2320
2151
# SC_MISSING_POSIX_HEADERS
2321
2152
#
2322
2153
#       Supply substitutes for missing POSIX header files.  Special
2428
2259
    not_really_there=""
2429
2260
    if test "$no_x" = ""; then
2430
2261
        if test "$x_includes" = ""; then
2431
 
            AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
 
2262
            AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
2432
2263
        else
2433
 
            if test ! -r $x_includes/X11/Intrinsic.h; then
 
2264
            if test ! -r $x_includes/X11/Xlib.h; then
2434
2265
                not_really_there="yes"
2435
2266
            fi
2436
2267
        fi
2438
2269
    if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
2439
2270
        AC_MSG_CHECKING([for X11 header files])
2440
2271
        found_xincludes="no"
2441
 
        AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
 
2272
        AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
2442
2273
        if test "$found_xincludes" = "no"; then
2443
2274
            dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
2444
2275
            for i in $dirs ; do
2445
 
                if test -r $i/X11/Intrinsic.h; then
 
2276
                if test -r $i/X11/Xlib.h; then
2446
2277
                    AC_MSG_RESULT([$i])
2447
2278
                    XINCLUDES=" -I$i"
2448
2279
                    found_xincludes="yes"
2813
2644
        # Now check for auxiliary declarations
2814
2645
        AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
2815
2646
            AC_TRY_COMPILE([#include <sys/types.h>
2816
 
#include <sys/dirent.h>],[struct dirent64 p;],
 
2647
#include <dirent.h>],[struct dirent64 p;],
2817
2648
                tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
2818
2649
        if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
2819
2650
            AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])