784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
|
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
EXTRA_CFLAGS=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
if test "$GCC" = "yes" ; then
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
else
CFLAGS_WARNING=""
fi
TCL_NEEDS_EXP_FILE=0
TCL_BUILD_EXP_FILE=""
TCL_EXP_FILE=""
dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
dnl AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_PROG(AR, ar, ar)
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
case $system in
windows)
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
if test "$do64bit" = "yes" ; then
if test "x${MSSDK}x" = "xx" ; then
MSSDK="C:/Progra~1/Microsoft SDK"
fi
# In order to work in the tortured autoconf environment,
# we need to ensure that this path has no spaces
MSSDK=`cygpath -w -s "$MSSDK" | sed -e 's!\\\!/!g'`
if test ! -d "${MSSDK}/bin/win64" ; then
AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode")
do64bit="no"
else
do64bit_ok="yes"
fi
fi
if test "$doWince" != "no" ; then
if test "$do64bit" = "yes" ; then
AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
fi
if test "$GCC" = "yes" ; then
AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
fi
TEA_PATH_CELIB
# set defaults
# Currently Tcl requires 300+
CEVERSION=300; # could be 211 300 301 ...
TARGETCPU=ARM; # could be ARM MIPS SH3 X86 ...
PLATFORM="Pocket PC 2002"
if test "$doWince" = "yes"; then
doWince="300,ARM,ARM,Pocket PC 2002"
fi
eval `echo $doWince | awk -F "," '{ \
if (length([$]1)) { printf "CEVERSION=%s\n", [$]1 }; \
if (length([$]2)) { printf "TARGETCPU=%s\n", toupper([$]2) }; \
if (length([$]3)) { printf "ARCH=%s\n", toupper([$]3) }; \
if (length([$]4)) { printf "PLATFORM=%s\n", [$]4 }; \
}'`
OSVERSION=WCE$CEVERSION;
if test "x${ARCH}" = "x" ; then
ARCH=$TARGETCPU; # could be ARM MIPS SH3 X86 X86EM ...
fi
if test "x${WCEROOT}" = "x" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
fi
if test "x${SDKROOT}" = "x" ; then
SDKROOT="C:/Windows CE Tools"
fi
# In order to work in the tortured autoconf environment,
# we need to ensure that this path has no spaces
WCEROOT=`cygpath -w -s "$WCEROOT" | sed -e 's!\\\!/!g'`
SDKROOT=`cygpath -w -s "$SDKROOT" | sed -e 's!\\\!/!g'`
CELIB_DIR=`cygpath -w -s "$CELIB_DIR" | sed -e 's!\\\!/!g'`
if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
-o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
doWince="no"
else
CEINCLUDE=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/include" | sed -e 's!\\\!/!g'`
CELIBPATH=`cygpath -w -s "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" | sed -e 's!\\\!/!g'`
fi
fi
if test "$GCC" != "yes" ; then
if test "${SHARED_BUILD}" = "0" ; then
runtime=-MT
else
runtime=-MD
fi
if test "$do64bit" = "yes" ; then
# All this magic is necessary for the Win64 SDK RC1 - hobbs
export CC="${MSSDK}/Bin/Win64/cl.exe \
-I${MSSDK}/Include/prerelease \
-I${MSSDK}/Include/Win64/crt \
-I${MSSDK}/Include"
export RC="${MSSDK}/bin/rc.exe"
export lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
-LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
export STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
export LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -Gs -W2 ${runtime}"
elif test "$doWince" != "no" ; then
if test "${TARGETCPU}" = "X86"; then
CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
else
CC="${WCEROOT}/EVC/${OSVERSION}/bin/cl${TARGETCPU}.exe -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
fi
RC="${WCEROOT}/Common/EVC/bin/rc.exe"
cpulower=`echo ${TARGETCPU} | awk '{print tolower([$]0)}'`
defs="${TARGETCPU} _${TARGETCPU}_ ${cpulower} _${cpulower}_ POCKET_SIZE PALM_SIZE _MT _DLL _WINDOWS"
for i in $defs ; do
AC_DEFINE_UNQUOTED($i)
done
AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION)
AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION)
CFLAGS_DEBUG="-nologo -Zi -Od"
CFLAGS_OPTIMIZE="-nologo -Ox"
lflags="-MACHINE:${TARGETCPU} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,3.00"
STLIB_LD="${WCEROOT}/EVC/${OSVERSION}/bin/lib.exe -nologo ${lflags}"
LINKBIN="${WCEROOT}/EVC/${OSVERSION}/bin/link.exe ${lflags}"
else
RC="rc"
STLIB_LD="lib -nologo"
LINKBIN="link -link50compat"
CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD -W2 ${runtime}"
fi
fi
if test "$GCC" = "yes"; then
# mingw gcc mode
RC="windres"
CFLAGS_DEBUG="-g"
CFLAGS_OPTIMIZE="-O2"
SHLIB_LD="$CC -shared"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
else
SHLIB_LD="${LINKBIN} -dll -nologo"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.lib'
EXTRA_CFLAGS="-YX"
PATHTYPE=-w
# For information on what debugtype is most useful, see:
# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
# This essentially turns it all on.
LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
LDFLAGS_OPTIMIZE="-release"
if test "$doWince" != "no" ; then
LDFLAGS_CONSOLE="-link ${lflags}"
LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
else
LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.dll'
TCL_LIB_VERSIONS_OK=nodots
# Bogus to avoid getting this turned off
DL_OBJS="tclLoadNone.obj"
;;
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
AC_MSG_RESULT([Using $CC for compiling with threads])
fi
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_SUFFIX=".so"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadDl.o"
LDFLAGS=""
LD_LIBRARY_PATH_VAR="LIBPATH"
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
#LIBOBJS="$LIBOBJS tclLoadAix.o"
AC_LIBOBJ([tclLoadAix])
DL_LIBS="-lld"
fi
# Check to enable 64-bit flags for compiler/linker on AIX 4+
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN("64bit mode not supported with GCC on $system")
else
do64bit_ok=yes
EXTRA_CFLAGS="-q64"
LDFLAGS="-q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
fi
fi
if test "`uname -m`" = "ia64" ; then
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# AIX-5 has dl* in libc.so
DL_LIBS=""
if test "$GCC" = "yes" ; then
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
fi
else
SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}.exp'
fi
# On AIX <=v4 systems, libbsd.a has to be linked in to support
# non-blocking file IO. This library has to be linked in after
# the MATH_LIBS or it breaks the pow() function. The way to
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
# This library also supplies gettimeofday.
#
# AIX does not have a timezone field in struct tm. When the AIX
# bsd library is used, the timezone global and the gettimeofday
# methods are to be avoided for timezone deduction instead, we
# deduce the timezone by comparing the localtime result on a
# known GMT value.
AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
if test $libbsd = yes; then
MATH_LIBS="$MATH_LIBS -lbsd"
AC_DEFINE(USE_DELTA_FOR_TZ)
fi
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD="cc -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-export-dynamic"
LD_SEARCH_FLAGS=""
;;
dgux*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
HP-UX-*.11.*)
# Use updated header definitions where possible
AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="-Wl,-E"
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
fi
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
#EXTRA_CFLAGS="+DAportable"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
hpux_arch=`${CC} -dumpmachine`
case $hpux_arch in
hppa64*)
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS=""
LD_SEARCH_FLAGS=''
;;
*)
AC_MSG_WARN("64bit mode not supported with GCC on $system")
;;
esac
else
do64bit_ok=yes
if test "`uname -m`" = "ia64" ; then
EXTRA_CFLAGS="+DD64"
LDFLAGS="+DD64 $LDFLAGS"
else
EXTRA_CFLAGS="+DA2.0W"
LDFLAGS="+DA2.0W $LDFLAGS"
fi
fi
fi
;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS=""
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="-Wl,-E"
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
fi
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
;;
IRIX-4.*)
SHLIB_CFLAGS="-G 0"
SHLIB_SUFFIX=".a"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}\$\{DBGX\}.a'
;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
EXTRA_CFLAGS=""
LDFLAGS=""
;;
IRIX-6.*|IRIX64-6.5*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
EXTRA_CFLAGS="-mabi=n32"
LDFLAGS="-mabi=n32"
else
case $system in
IRIX-6.3)
# Use to build 6.2 compatible binaries on 6.3.
EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
;;
*)
EXTRA_CFLAGS="-n32"
;;
esac
LDFLAGS="-n32"
fi
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported by gcc])
else
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
EXTRA_CFLAGS="-64"
LDFLAGS="-64"
fi
fi
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
# when you inline the string and math operations. Turn this off to
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
if test "$have_dl" = yes; then
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-rdynamic"
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
else
AC_CHECK_HEADER(dld.h, [
SHLIB_LD="ld -shared"
DL_OBJS="tclLoadDld.o"
DL_LIBS="-ldld"
LDFLAGS=""
LD_SEARCH_FLAGS=""])
fi
if test "`uname -m`" = "alpha" ; then
EXTRA_CFLAGS="-mieee"
fi
# The combo of gcc + glibc has a bug related
# to inlining of functions like strtod(). The
# -fno-builtin flag should address this problem
# but it does not work. The -fno-inline flag
# is kind of overkill but it works.
# Disable inlining only when one of the
# files in compat/*.c is being linked in.
if test x"${USE_COMPAT}" != x ; then
EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
fi
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
if test "$have_dl" = yes; then
SHLIB_LD="${CC} -shared"
DL_OBJS=""
DL_LIBS="-ldl"
LDFLAGS="-rdynamic"
LD_SEARCH_FLAGS=""
else
AC_CHECK_HEADER(dld.h, [
SHLIB_LD="ld -shared"
DL_OBJS=""
DL_LIBS="-ldld"
LDFLAGS=""
LD_SEARCH_FLAGS=""])
fi
if test "`uname -m`" = "alpha" ; then
EXTRA_CFLAGS="-mieee"
fi
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-Wl,-Bexport"
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[[1-2]].*)
# Not available on all versions: check for include file.
AC_CHECK_HEADER(dlfcn.h, [
# NetBSD/SPARC needs -fPIC, -fpic will not do.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
AC_MSG_CHECKING([for ELF])
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
],
AC_MSG_RESULT([yes])
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so',
AC_MSG_RESULT([no])
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
)
], [
SHLIB_CFLAGS=""
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".a"
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
])
# FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS=""
AC_MSG_CHECKING(for ELF)
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
],
[AC_MSG_RESULT(yes)
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'],
[AC_MSG_RESULT(no)
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0']
)
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
FreeBSD-*)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="-export-dynamic"
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
if test "${TCL_THREADS}" = "1" ; then
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
EXTRA_CFLAGS="-pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
case $system in
FreeBSD-3.*)
# FreeBSD-3 doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
TCL_LIB_VERSIONS_OK=nodots
;;
esac
;;
Rhapsody-*|Darwin-*)
SHLIB_CFLAGS="-fno-common"
SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_MAJOR_VERSION} -current_version \${PACKAGE_VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
LDFLAGS="-prebind"
LD_SEARCH_FLAGS=""
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
CFLAGS_OPTIMIZE="-O3"
EXTRA_CFLAGS="-arch ppc -pipe"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
SHLIB_LD="cc -nostdlib -r"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
CFLAGS_OPTIMIZE="" # Optimizer is buggy
AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
;;
OSF1-1.0|OSF1-1.1|OSF1-1.2)
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
SHLIB_CFLAGS=""
# Hack: make package name same as library name
SHLIB_LD='ld -R -export $@:'
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD="ld -shared"
else
SHLIB_LD="ld -non_shared"
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD='ld -shared -expect_unresolved "*"'
else
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
LIBS=`echo $LIBS | sed s/-lpthreads//`
if test "$GCC" = "yes" ; then
LIBS="$LIBS -lpthread -lmach -lexc"
else
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
LDFLAGS="-pthread"
fi
fi
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
# dlopen is in -lc on QNX
DL_LIBS=""
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
RISCos-*)
SHLIB_CFLAGS="-G 0"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".a"
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
;;
SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="-melf -Wl,-Bexport"
else
SHLIB_CFLAGS="-Kpic -belf"
LDFLAGS="-belf -Wl,-Bexport"
fi
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
SHLIB_CFLAGS="-PIC"
SHLIB_LD="ld"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
# requires an extra version number at the end of .so file names.
# So, the library has to have a name like libtcl75.so.1.0
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[[0-6]]*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
SHLIB_CFLAGS="-KPIC"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
SunOS-5*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
SHLIB_CFLAGS="-KPIC"
LDFLAGS=""
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN("64bit mode not supported with GCC on $system")
else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
EXTRA_CFLAGS="-xarch=v9a"
LDFLAGS="-xarch=v9a"
else
EXTRA_CFLAGS="-xarch=v9"
LDFLAGS="-xarch=v9"
fi
fi
else
AC_MSG_WARN("64bit mode only supported sparcv9 system")
fi
fi
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
ULTRIX-4.*)
SHLIB_CFLAGS="-G 0"
SHLIB_SUFFIX=".a"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
;;
UNIX_SV* | UnixWare-5*)
SHLIB_CFLAGS="-KPIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
# that don't grok the -Bexport option. Test that it does.
hold_ldflags=$LDFLAGS
AC_MSG_CHECKING([for ld accepts -Bexport flag])
LDFLAGS="${LDFLAGS} -Wl,-Bexport"
AC_TRY_LINK(, [int i;], found=yes, found=no)
LDFLAGS=$hold_ldflags
AC_MSG_RESULT([$found])
if test $found = yes; then
LDFLAGS="-Wl,-Bexport"
else
LDFLAGS=""
fi
LD_SEARCH_FLAGS=""
;;
esac
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform")
fi
|
>
>
>
|
<
>
|
>
<
|
|
|
|
|
|
>
|
|
|
>
>
|
<
|
|
>
|
|
|
<
|
|
|
>
>
|
>
>
|
|
>
>
>
|
|
<
>
|
|
|
<
>
>
|
>
>
>
|
|
|
|
|
|
|
|
<
|
|
>
|
|
>
|
|
>
>
>
>
>
|
<
|
>
|
|
|
|
|
|
>
>
|
<
|
<
|
|
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
<
|
<
|
>
>
|
>
>
>
|
|
<
|
|
<
<
<
<
|
|
|
<
<
|
|
|
|
|
<
|
|
>
|
<
|
|
|
<
|
<
|
<
|
|
<
|
|
<
|
|
|
|
|
|
|
|
<
|
|
<
<
<
<
<
|
>
>
|
|
|
|
|
<
|
|
|
<
<
|
|
<
<
>
|
>
>
>
>
>
>
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
<
<
<
<
<
|
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
|
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Step 3: set configuration options based on system name and version.
# This is similar to Tcl's unix/tcl.m4 except that we've added a
# "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us
# (and we have no CC_SEARCH_FLAGS).
do64bit_ok=no
LDFLAGS_ORIG="$LDFLAGS"
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
if test "$GCC" = "yes" ; then
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall -Wno-implicit-int"
else
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
fi
TCL_NEEDS_EXP_FILE=0
TCL_BUILD_EXP_FILE=""
TCL_EXP_FILE=""
dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
dnl AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_PROG(AR, ar, ar)
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
case $system in
windows)
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
if test "$do64bit" = "yes" ; then
if test "x${MSSDK}x" = "xx" ; then
MSSDK="C:/Progra~1/Microsoft SDK"
fi
# Ensure that this path has no spaces to work in autoconf
TEA_PATH_NOSPACE(MSSDK, ${MSSDK})
if test ! -d "${MSSDK}/bin/win64" ; then
AC_MSG_WARN([could not find 64-bit SDK to enable 64bit mode])
do64bit="no"
else
do64bit_ok="yes"
fi
fi
if test "$doWince" != "no" ; then
if test "$do64bit" = "yes" ; then
AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
fi
if test "$GCC" = "yes" ; then
AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
fi
TEA_PATH_CELIB
# Set defaults for common evc4/PPC2003 setup
# Currently Tcl requires 300+, possibly 420+ for sockets
CEVERSION=420; # could be 211 300 301 400 420 ...
TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
ARCH=ARM; # could be ARM MIPS X86EM ...
PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
if test "$doWince" != "yes"; then
# If !yes then the user specified something
# Reset ARCH to allow user to skip specifying it
ARCH=
eval `echo $doWince | awk -F, '{ \
if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
}'`
if test "x${ARCH}" = "x" ; then
ARCH=$TARGETCPU;
fi
fi
OSVERSION=WCE$CEVERSION;
if test "x${WCEROOT}" = "x" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
if test ! -d "${WCEROOT}" ; then
WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
fi
fi
if test "x${SDKROOT}" = "x" ; then
SDKROOT="C:/Program Files/Windows CE Tools"
if test ! -d "${SDKROOT}" ; then
SDKROOT="C:/Windows CE Tools"
fi
fi
# Ensure that this path has no spaces to work in autoconf
TEA_PATH_NOSPACE(WCEROOT, ${WCEROOT})
TEA_PATH_NOSPACE(SDKROOT, ${SDKROOT})
if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
-o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
doWince="no"
else
# We could PATH_NOSPACE these, but that's not important,
# as long as we quote them when used.
CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
fi
CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
fi
fi
if test "$GCC" != "yes" ; then
if test "${SHARED_BUILD}" = "0" ; then
runtime=-MT
else
runtime=-MD
fi
if test "$do64bit" = "yes" ; then
# All this magic is necessary for the Win64 SDK RC1 - hobbs
CC="${MSSDK}/Bin/Win64/cl.exe"
CFLAGS="${CFLAGS} -I${MSSDK}/Include/prerelease \
-I${MSSDK}/Include/Win64/crt \
-I${MSSDK}/Include"
RC="${MSSDK}/bin/rc.exe"
lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
-LIBPATH:${MSSDK}/Lib/Prerelease/IA64 -nologo"
LINKBIN="${MSSDK}/bin/win64/link.exe"
CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
elif test "$doWince" != "no" ; then
CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
if test "${TARGETCPU}" = "X86"; then
CC="${CEBINROOT}/cl.exe"
else
CC="${CEBINROOT}/cl${ARCH}.exe"
fi
CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
RC="${WCEROOT}/Common/EVC/bin/rc.exe"
arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
if test "${SHARED_BUILD}" = "1" ; then
# Static CE builds require static celib as well
defs="${defs} _DLL"
fi
for i in $defs ; do
AC_DEFINE_UNQUOTED($i)
done
AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION)
AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION)
CFLAGS_DEBUG="-nologo -Zi -Od"
CFLAGS_OPTIMIZE="-nologo -Ox"
lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
LINKBIN="${CEBINROOT}/link.exe"
AC_SUBST(CELIB_DIR)
else
RC="rc"
lflags="-nologo"
LINKBIN="link"
CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
fi
fi
if test "$GCC" = "yes"; then
# mingw gcc mode
RC="windres"
CFLAGS_DEBUG="-g"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
SHLIB_LD="$CC -shared"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
else
SHLIB_LD="${LINKBIN} -dll ${lflags}"
# link -lib only works when -lib is the first arg
STLIB_LD="${LINKBIN} -lib ${lflags}"
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
PATHTYPE=-w
# For information on what debugtype is most useful, see:
# http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
# This essentially turns it all on.
LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
LDFLAGS_OPTIMIZE="-release"
if test "$doWince" != "no" ; then
LDFLAGS_CONSOLE="-link ${lflags}"
LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
else
LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
fi
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dll"
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
TCL_LIB_VERSIONS_OK=nodots
# Bogus to avoid getting this turned off
DL_OBJS="tclLoadNone.obj"
;;
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
AC_MSG_RESULT([Using $CC for compiling with threads])
fi
LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
SHLIB_SUFFIX=".so"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadDl.o"
LD_LIBRARY_PATH_VAR="LIBPATH"
# AIX v<=4.1 has some different flags than 4.2+
if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
#LIBOBJS="$LIBOBJS tclLoadAix.o"
AC_LIBOBJ([tclLoadAix])
DL_LIBS="-lld"
fi
# Check to enable 64-bit flags for compiler/linker on AIX 4+
if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN("64bit mode not supported with GCC on $system")
else
do64bit_ok=yes
CFLAGS="$CFLAGS -q64"
LDFLAGS="$LDFLAGS -q64"
RANLIB="${RANLIB} -X64"
AR="${AR} -X64"
SHLIB_LD_FLAGS="-b64"
fi
fi
if test "`uname -m`" = "ia64" ; then
# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# AIX-5 has dl* in libc.so
DL_LIBS=""
if test "$GCC" = "yes" ; then
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
fi
else
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
else
SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
fi
SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
fi
# On AIX <=v4 systems, libbsd.a has to be linked in to support
# non-blocking file IO. This library has to be linked in after
# the MATH_LIBS or it breaks the pow() function. The way to
# insure proper sequencing, is to add it to the tail of MATH_LIBS.
# This library also supplies gettimeofday.
#
# AIX does not have a timezone field in struct tm. When the AIX
# bsd library is used, the timezone global and the gettimeofday
# methods are to be avoided for timezone deduction instead, we
# deduce the timezone by comparing the localtime result on a
# known GMT value.
AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
if test $libbsd = yes; then
MATH_LIBS="$MATH_LIBS -lbsd"
AC_DEFINE(USE_DELTA_FOR_TZ)
fi
;;
BeOS*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -nostart"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
SHLIB_LD="shlicc -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
SHLIB_CFLAGS="-export-dynamic -fPIC"
SHLIB_LD="cc -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -export-dynamic"
LD_SEARCH_FLAGS=""
;;
dgux*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS=""
;;
HP-UX-*.11.*)
# Use updated header definitions where possible
AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
if test "$GCC" = "yes" ; then
SHLIB_LD="gcc -shared"
SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=''
fi
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
#CFLAGS="$CFLAGS +DAportable"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
hpux_arch=`${CC} -dumpmachine`
case $hpux_arch in
hppa64*)
# 64-bit gcc in use. Fix flags for GNU ld.
do64bit_ok=yes
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS='${LIBS}'
LD_SEARCH_FLAGS=''
;;
*)
AC_MSG_WARN("64bit mode not supported with GCC on $system")
;;
esac
else
do64bit_ok=yes
CFLAGS="$CFLAGS +DD64"
LDFLAGS="$LDFLAGS +DD64"
fi
fi
;;
HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
SHLIB_CFLAGS="+z"
SHLIB_LD="ld -b"
SHLIB_LD_LIBS=""
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="$LDFLAGS -Wl,-E"
LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
fi
LD_LIBRARY_PATH_VAR="SHLIB_PATH"
;;
IRIX-4.*)
SHLIB_CFLAGS="-G 0"
SHLIB_SUFFIX=".a"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
;;
IRIX-5.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
;;
IRIX-6.*|IRIX64-6.5*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mabi=n32"
LDFLAGS="$LDFLAGS -mabi=n32"
else
case $system in
IRIX-6.3)
# Use to build 6.2 compatible binaries on 6.3.
CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
;;
*)
CFLAGS="$CFLAGS -n32"
;;
esac
LDFLAGS="$LDFLAGS -n32"
fi
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
if test "$GCC" = "yes" ; then
AC_MSG_WARN([64bit mode not supported by gcc])
else
do64bit_ok=yes
SHLIB_LD="ld -64 -shared -rdata_shared"
CFLAGS="$CFLAGS -64"
LDFLAGS="$LDFLAGS -64"
fi
fi
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
# egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
# when you inline the string and math operations. Turn this off to
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
if test "$have_dl" = yes; then
SHLIB_LD="${CC} -shared"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
else
AC_CHECK_HEADER(dld.h, [
SHLIB_LD="ld -shared"
DL_OBJS="tclLoadDld.o"
DL_LIBS="-ldld"
LD_SEARCH_FLAGS=""])
fi
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
# The combo of gcc + glibc has a bug related
# to inlining of functions like strtod(). The
# -fno-builtin flag should address this problem
# but it does not work. The -fno-inline flag
# is kind of overkill but it works.
# Disable inlining only when one of the
# files in compat/*.c is being linked in.
if test x"${USE_COMPAT}" != x ; then
CFLAGS="$CFLAGS -fno-inline"
fi
;;
GNU*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
if test "$have_dl" = yes; then
SHLIB_LD="${CC} -shared"
DL_OBJS=""
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
LD_SEARCH_FLAGS=""
else
AC_CHECK_HEADER(dld.h, [
SHLIB_LD="ld -shared"
DL_OBJS=""
DL_LIBS="-ldld"
LD_SEARCH_FLAGS=""])
fi
if test "`uname -m`" = "alpha" ; then
CFLAGS="$CFLAGS -mieee"
fi
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,-Bexport"
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[[1-2]].*)
# Not available on all versions: check for include file.
AC_CHECK_HEADER(dlfcn.h, [
# NetBSD/SPARC needs -fPIC, -fpic will not do.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
AC_MSG_CHECKING([for ELF])
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
],
AC_MSG_RESULT([yes])
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so',
AC_MSG_RESULT([no])
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
)
], [
SHLIB_CFLAGS=""
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".a"
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
])
# FreeBSD doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
SHLIB_LD="${CC} -shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
AC_MSG_CHECKING(for ELF)
AC_EGREP_CPP(yes, [
#ifdef __ELF__
yes
#endif
],
[AC_MSG_RESULT(yes)
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'],
[AC_MSG_RESULT(no)
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0']
)
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
FreeBSD-*)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
if test "${TCL_THREADS}" = "1" ; then
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
case $system in
FreeBSD-3.*)
# FreeBSD-3 doesn't handle version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
TCL_LIB_VERSIONS_OK=nodots
;;
esac
;;
Darwin-*)
SHLIB_CFLAGS="-fno-common"
SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -prebind -Wl,-search_paths_first"
LD_SEARCH_FLAGS=""
LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
CFLAGS_OPTIMIZE="-Os"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
SHLIB_LD="cc -nostdlib -r"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
CFLAGS_OPTIMIZE="" # Optimizer is buggy
AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h
;;
OSF1-1.0|OSF1-1.1|OSF1-1.2)
# OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
SHLIB_CFLAGS=""
# Hack: make package name same as library name
SHLIB_LD='ld -R -export $@:'
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD="ld -shared"
else
SHLIB_LD="ld -non_shared"
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
if test "$SHARED_BUILD" = "1" ; then
SHLIB_LD='ld -shared -expect_unresolved "*"'
else
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -mieee"
else
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
LIBS=`echo $LIBS | sed s/-lpthreads//`
if test "$GCC" = "yes" ; then
LIBS="$LIBS -lpthread -lmach -lexc"
else
CFLAGS="$CFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
fi
fi
;;
QNX-6*)
# QNX RTP
# This may work for all QNX, but it was only reported for v6.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
# dlopen is in -lc on QNX
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
RISCos-*)
SHLIB_CFLAGS="-G 0"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".a"
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
;;
SCO_SV-3.2*)
# Note, dlopen is available only on SCO 3.2.5 and greater. However,
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
else
SHLIB_CFLAGS="-Kpic -belf"
LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
fi
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
SHLIB_CFLAGS="-PIC"
SHLIB_LD="ld"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
# requires an extra version number at the end of .so file names.
# So, the library has to have a name like libtcl75.so.1.0
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[[0-6]]*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
SHLIB_CFLAGS="-KPIC"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
SunOS-5*)
# Note: If _REENTRANT isn't defined, then Solaris
# won't define thread-safe library routines.
AC_DEFINE(_REENTRANT)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
SHLIB_CFLAGS="-KPIC"
# Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
if test "$GCC" = "yes" ; then
if test "`gcc -dumpversion` | awk -F. '{print $1}'" -lt "3" ; then
AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
else
do64bit_ok=yes
CFLAGS="$CFLAGS -m64 -mcpu=v9"
LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
SHLIB_CFLAGS="-fPIC"
fi
else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
CFLAGS="$CFLAGS -xarch=v9a"
LDFLAGS="$LDFLAGS -xarch=v9a"
else
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS="$LDFLAGS -xarch=v9"
fi
fi
else
AC_MSG_WARN("64bit mode only supported sparcv9 system")
fi
fi
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
if test "$GCC" = "yes" ; then
SHLIB_LD="$CC -shared"
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
if test "$do64bit" = "yes" ; then
# We need to specify -static-libgcc or we need to
# add the path to the sparv9 libgcc.
# JH: static-libgcc is necessary for core Tcl, but may
# not be necessary for extensions.
SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
# for finding sparcv9 libgcc, get the regular libgcc
# path, remove so name and append 'sparcv9'
#v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
#LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir"
fi
else
SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
ULTRIX-4.*)
SHLIB_CFLAGS="-G 0"
SHLIB_SUFFIX=".a"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
SHLIB_LD_LIBS='${LIBS}'
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -Wl,-D,08000000"
LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
if test "$GCC" != "yes" ; then
CFLAGS="$CFLAGS -DHAVE_TZSET -std1"
fi
;;
UNIX_SV* | UnixWare-5*)
SHLIB_CFLAGS="-KPIC"
SHLIB_LD="cc -G"
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
# Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
# that don't grok the -Bexport option. Test that it does.
hold_ldflags=$LDFLAGS
AC_MSG_CHECKING(for ld accepts -Bexport flag)
LDFLAGS="$LDFLAGS -Wl,-Bexport"
AC_TRY_LINK(, [int i;], [found=yes],
[LDFLAGS=$hold_ldflags found=no])
AC_MSG_RESULT([$found])
LD_SEARCH_FLAGS=""
;;
esac
if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform")
fi
|
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
|
AC_DEFINE(NO_DIRENT_H)
fi
AC_MSG_RESULT([$tcl_ok])
AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)])
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)])
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)])
AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)])
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
if test $tcl_ok = 0; then
AC_DEFINE(NO_STDLIB_H)
fi
|
|
>
|
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
|
AC_DEFINE(NO_DIRENT_H)
fi
AC_MSG_RESULT([$tcl_ok])
AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)])
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)])
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)])
AC_CHECK_HEADER(limits.h,
[AC_DEFINE(HAVE_LIMITS_H)], [AC_DEFINE(NO_LIMITS_H)])
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
if test $tcl_ok = 0; then
AC_DEFINE(NO_STDLIB_H)
fi
|