1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
dnl Checks for programs.
exec_tclprefix="NONE"
tclprefix="NONE"
AC_MSG_CHECKING([Tcl config. Ignore possible \"tclsh8.0: command not found\" message])
if test "${tclprefix}" = "NONE"; then
tclprefix=`echo 'puts [[file dirname [file dirname [lindex [set auto_path] 0]]]] ; exit' | tclsh8.0`
if test "${tclprefix}" = ""; then
tclprefix=`echo 'puts [[file dirname [file dirname [lindex [set auto_path] 0]]]] ; exit' | tclsh7.6`
if test "${tclprefix}" = ""; then
tclprefix=/usr/local
echo "no tclsh found - defaulting \"tclprefix\" to ${tclprefix}"
else
if test -d "${tclprefix}/lib"; then
echo "setting tclprefix to: ${tclprefix}"
else
tclprefix=`cd ${tclprefix}/..; pwd`
echo "hmm, nonstandard tcl setup, setting \"tclprefix\" to ${tclprefix}"
fi
fi
else
if test -d "${tclprefix}/lib"; then
echo "setting tclprefix to: ${tclprefix}"
else
tclprefix=`cd ${tclprefix}/..; pwd`
echo "hmm, nonstandard tcl setup, setting \"tclprefix\" to ${tclprefix}"
fi
fi
fi
if test "${exec_tclprefix}" = "NONE"; then
exec_tclprefix=$tclprefix
fi
file=${exec_tclprefix}/lib/tclConfig.sh
. $file
AC_MSG_RESULT([Found tclConfig.sh in ${exec_tclprefix}/lib])
AC_PROG_CXX()
AC_PROG_INSTALL()
#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# dynamic loading and shared libraries:
#
# DL_OBJS - Name of the object file that implements dynamic
# loading for Tcl on this system.
# DL_LIBS - Library file(s) to include in tclsh and other base
# applications in order for the "load" command to work.
# LD_FLAGS - Flags to pass to the compiler when linking object
# files into an executable application binary such
# as tclsh.
# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
# that tell the run-time dynamic linker where to look
# for shared libraries such as libtcl.so. Depends on
# the variable LIB_RUNTIME_DIR in the Makefile.
# MAKE_LIB - Command to execute to build the Tcl library;
# differs depending on whether or not Tcl is being
# compiled as a shared library.
# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
# of a shared library (may request position-independent
# code, among other things).
# SHLIB_LD - Base command to use for combining object files
# into a shared library.
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
# creating shared libraries. This symbol typically
# goes at the end of the "ld" commands that build
# shared libraries. The value of the symbol is
# "${LIBS}" if all of the dependent libraries should
# be specified when creating a shared library. If
# dependent libraries should not be specified (as on
# SunOS 4.x, where they cause the link to fail, or in
# general if Tcl and Tk aren't themselves shared
# libraries), then this symbol has an empty string
# as its value.
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
# extensions. An empty string means we don't know how
# to use shared libraries on this platform.
# TCL_LIB_FILE - Name of the file that contains the Tcl library, such
# as libtcl7.8.so or libtcl7.8.a.
# TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
# in the shared library name, using the $VERSION variable
# to put the version in the right place. This is used
# by platforms that need non-standard library names.
# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
# to have a version after the .so, and ${VERSION}.a
# on AIX, since the Tcl shared library needs to have
# a .a extension whereas shared objects for loadable
# extensions have a .so extension. Defaults to
# ${VERSION}${SHLIB_SUFFIX}.
#--------------------------------------------------------------------
# Step 1: set the variable "system" to hold the name and version number
# for the system. This can usually be done via the "uname" command, but
# there are a few systems, like Next, where this doesn't work.
AC_MSG_CHECKING([system version (for dynamic loading)])
if test -f /usr/lib/NextStep/software_version; then
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
system=`uname -s`-`uname -r`
if test "$?" -ne 0 ; then
AC_MSG_RESULT([unknown (can't find uname command)])
system=unknown
else
# Special check for weird MP-RAS system (uname returns weird
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
system=MP-RAS-`awk '{print $3}' /etc/.relid'`
fi
if test "`uname -s`" = "AIX" ; then
system=AIX-`uname -v`.`uname -r`
fi
AC_MSG_RESULT($system)
fi
fi
SYSTEMVERSION=$system
# 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.
case $system in
dgux*)
TCL_SHLIB_LD="${CXX} -G"
;;
Linux*)
if test "$have_dl" = yes; then
TCL_SHLIB_LD="$CXX -shared"
fi
;;
MP-RAS-02*)
TCL_SHLIB_LD="${CXX} -G"
;;
MP-RAS-*)
TCL_SHLIB_LD="${CXX} -G"
;;
NEXTSTEP-*)
TCL_SHLIB_LD="${CXX} -nostdlib -r"
;;
SINIX*5.4*)
TCL_SHLIB_LD="${CXX} -G"
;;
UNIX_SV*)
TCL_SHLIB_LD="${CXX} -G"
;;
esac
AC_PATH_PROG(LATEX,latex)
AC_PATH_PROG(MAKEINDEX,makeindex)
AC_PATH_PROG(BIBTEX,bibtex)
AC_PATH_PROG(DVIPS,dvips)
AC_PATH_PROG(DVIDVI,dvidvi)
AC_PATH_PROG(PS2PDF,ps2pdf)
AC_PATH_PROG(DOCXX,doc++)
AC_PATH_PROG(SWIG,swig)
dnl Checks for libraries.
dnl AC_MSG_CHECKING([Tcl library])
dnl LIBS="${TCL_LIB_SPEC} ${TCL_LIBS}"
dnl AC_TRY_LINK(,[Tcl_Exit(0);],AC_MSG_RESULT(ok),AC_MSG_RESULT([missing!]))
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
AC_MSG_CHECKING([bool])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,[bool x,y;
x = true;
y = false;],[AC_DEFINE(HAVE_BOOL)
AC_MSG_RESULT(yes)],AC_MSG_RESULT(no))
AC_LANG_RESTORE
dnl Checks for library functions.
dnl Substitutions...
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(TCL_DBGX)
AC_SUBST(TCL_SHLIB_CFLAGS)
AC_SUBST(TCL_SHLIB_SUFFIX)
AC_SUBST(TCL_SHLIB_LD)
AC_SUBST(TCL_PREFIX)
AC_SUBST(TCL_EXEC_PREFIX)
AC_SUBST(TCL_CFLAGS)
AC_SUBST(TCL_DEFS)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(INSTALL)
AC_SUBST(INSTALL_PROGRAM)
AC_SUBST(INSTALL_DATA)
AC_SUBST(SYSTEMVERSION)
AC_OUTPUT_COMMANDS([chmod +x Doc/Support/tcl2tex.sh])
AC_OUTPUT(Doc/Support/tcl2tex.sh Doc/Internals/Makefile Doc/User/Makefile \
Doc/Makefile C++/lib/Makefile C++/swig/Makefile C++/Makefile \
Scripts/Makefile Help/Makefile Makefile)
|