diff options
author | wart <wart> | 1999-06-15 22:23:19 (GMT) |
---|---|---|
committer | wart <wart> | 1999-06-15 22:23:19 (GMT) |
commit | c47400cd87802c8afb44aec792b4429b5e16164d (patch) | |
tree | b77815876bb356083d8bf93e99c83fd5d30fda32 /unix/configure.in | |
parent | b253da25a1f7bf2cd0220f84f7fb54ef64d3d94c (diff) | |
download | tk-c47400cd87802c8afb44aec792b4429b5e16164d.zip tk-c47400cd87802c8afb44aec792b4429b5e16164d.tar.gz tk-c47400cd87802c8afb44aec792b4429b5e16164d.tar.bz2 |
Changes to make the Tk configure and Makefile.in files TEA compliant.
Diffstat (limited to 'unix/configure.in')
-rw-r--r-- | unix/configure.in | 307 |
1 files changed, 105 insertions, 202 deletions
diff --git a/unix/configure.in b/unix/configure.in index 74a8eed..9ca62e1 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. AC_INIT(../generic/tk.h) -# RCS: @(#) $Id: configure.in,v 1.34 1999/05/26 02:39:14 stanton Exp $ +# RCS: @(#) $Id: configure.in,v 1.35 1999/06/15 22:23:19 wart Exp $ TK_VERSION=8.1 TK_MAJOR_VERSION=8 @@ -20,46 +20,27 @@ if test "${exec_prefix}" = "NONE"; then fi TK_SRC_DIR=`cd $srcdir/..; pwd` -# Most of the checks here are duplicated from Tcl's configure.in -# and should not be redone but rather simply used from the definitions -# found in tclConfig.sh - AC_PROG_RANLIB -AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available], - [tk_ok=$enableval], [tk_ok=no]) -if test "$tk_ok" = "yes"; then - AC_PROG_CC -else - CC=${CC-cc} -AC_SUBST(CC) -fi -AC_C_CROSS +SC_ENABLE_GCC +AC_PROG_CC + +#------------------------------------------------------------------------ +# I'm not sure why these need to come before all of the other tests +#------------------------------------------------------------------------ + AC_HAVE_HEADERS(unistd.h limits.h) +#------------------------------------------------------------------------ # Threads support -AC_ARG_ENABLE(threads,[ --enable-threads enable Threads support],,enableval="no") - -if test "$enableval" = "yes"; then - AC_MSG_RESULT(Will compile with Threads support) - AC_DEFINE(TCL_THREADS) - AC_DEFINE(_REENTRANT) - - AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "yes"; then - # The space is needed - THREADS_LIBS=" -lpthread" - else - AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") - fi -else - AC_MSG_RESULT(Will compile without Threads support (normal)) -fi +#------------------------------------------------------------------------ -# set the warning flags depending on whether or not we are using gcc -if test "${GCC}" = "yes" ; then - # leave -Wimplicit-int out, the X libs generate so many of these warnings - # that they obscure everything else. +SC_ENABLE_THREADS + +#------------------------------------------------------------------------ +# Set the warning flags depending on whether or not we are using gcc +#------------------------------------------------------------------------ +if test "${GCC}" = "yes" ; then CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" else CFLAGS_WARNING="" @@ -83,71 +64,62 @@ fi fi #-------------------------------------------------------------------- -# See if there was a command-line option for where Tcl is; if -# not, assume that its top-level directory is a sibling of ours. -# Try the patch-level-specific directory first, then the general one. +# Find and load the tclConfig.sh file #-------------------------------------------------------------------- - -if test -d ../../tcl8.1$TK_PATCH_LEVEL/unix; then - TCL_BIN_DEFAULT=../../tcl8.1$TK_PATCH_LEVEL/unix -else - TCL_BIN_DEFAULT=../../tcl8.1/unix -fi - -AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.1 binaries from DIR], - TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) -if test ! -d $TCL_BIN_DIR; then - AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR doesn't exist) -fi -if test ! -f $TCL_BIN_DIR/Makefile; then - AC_MSG_ERROR(There's no Makefile in $TCL_BIN_DIR; perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) -fi +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG #-------------------------------------------------------------------- -# Read in configuration information generated by Tcl for shared -# libraries, and arrange for it to be substituted into our -# Makefile. +# Recompute the necessary flags to run the compiler #-------------------------------------------------------------------- -file=$TCL_BIN_DIR/tclConfig.sh -. $file +SC_CONFIG_CFLAGS -# Set the default compiler switches based on the --enable-symbols option - -AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols], - [tcl_ok=$enableval], [tcl_ok=no]) -if test "$tcl_ok" = "yes"; then - CFLAGS_DEFAULT=CFLAGS_DEBUG - TK_DBGX=g -else - CFLAGS_DEFAULT=CFLAGS_OPTIMIZE - TK_DBGX="" -fi - -SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS -SHLIB_LD=$TCL_SHLIB_LD -SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS -SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX -SHLIB_VERSION=$TCL_SHLIB_VERSION -DL_LIBS=$TCL_DL_LIBS -LD_FLAGS=$TCL_LD_FLAGS -CFLAGS_DEBUG=$TCL_CFLAGS_DEBUG -CFLAGS_OPTIMIZE=$TCL_CFLAGS_OPTIMIZE -EXTRA_CFLAGS=$TCL_EXTRA_CFLAGS +SC_ENABLE_SYMBOLS LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}' +CFLAGS=${CFLAGS_DEFAULT} +TK_DBGX=${DBGX} + +#------------------------------------------------------------------------ # If Tcl and Tk are installed in different places, adjust the library # search path to reflect this. +#------------------------------------------------------------------------ if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib" fi #-------------------------------------------------------------------- -# Supply a substitute for stdlib.h if it doesn't define strtol, -# strtoul, or strtod (which it doesn't in some versions of SunOS). +# On a few very rare systems, all of the libm.a stuff is +# already in libc.a. Set compiler flags accordingly. +# Also, Linux requires the "ieee" library for math to work +# right (and it must appear before "-lm"). +#-------------------------------------------------------------------- + +AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") +AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) + +#-------------------------------------------------------------------- +# On AIX 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. +#-------------------------------------------------------------------- +libbsd=no +if test "`uname -s`" = "AIX" ; then + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + fi +fi + +#-------------------------------------------------------------------- +# Supply a substitute for stdlib.h if it doesn't define strtol, +# strtoul, or strtod (which it doesn't in some versions of SunOS). #-------------------------------------------------------------------- AC_MSG_CHECKING(stdlib.h) @@ -160,13 +132,13 @@ fi AC_MSG_RESULT($tk_ok) #-------------------------------------------------------------------- -# Include sys/select.h if it exists and if it supplies things -# that appear to be useful and aren't already in sys/types.h. -# This appears to be true only on the RS/6000 under AIX. Some -# systems like OSF/1 have a sys/select.h that's of no use, and -# other systems like SCO UNIX have a sys/select.h that's -# pernicious. If "fd_set" isn't defined anywhere then set a -# special flag. +# Include sys/select.h if it exists and if it supplies things +# that appear to be useful and aren't already in sys/types.h. +# This appears to be true only on the RS/6000 under AIX. Some +# systems like OSF/1 have a sys/select.h that's of no use, and +# other systems like SCO UNIX have a sys/select.h that's +# pernicious. If "fd_set" isn't defined anywhere then set a +# special flag. #-------------------------------------------------------------------- AC_MSG_CHECKING([fd_set and sys/select]) @@ -184,14 +156,14 @@ if test $tk_ok = no; then fi #-------------------------------------------------------------------- -# Check for various typedefs and provide substitutes if -# they don't exist. +# Check for various typedefs and provide substitutes if +# they don't exist. #-------------------------------------------------------------------- -AC_MODE_T -AC_PID_T -AC_SIZE_T -AC_UID_T +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_UID_T #------------------------------------------------------------------------------ # Find out about time handling differences. @@ -221,69 +193,7 @@ fi # no include files, so double-check its result just to be safe. #-------------------------------------------------------------------- -AC_PATH_X -not_really_there="" -if test "$no_x" = ""; then - if test "$x_includes" = ""; then - AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes") - else - if test ! -r $x_includes/X11/Intrinsic.h; then - not_really_there="yes" - fi - fi -fi -if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING(for X11 header files) - XINCLUDES="# no special path needed" - AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope") - if test "$XINCLUDES" = nope; then - 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" - for i in $dirs ; do - if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT($i) - XINCLUDES=" -I$i" - break - fi - done - fi -else - if test "$x_includes" != ""; then - XINCLUDES=-I$x_includes - else - XINCLUDES="# no special path needed" - fi -fi -if test "$XINCLUDES" = nope; then - AC_MSG_RESULT(couldn't find any!) - XINCLUDES="# no include files found" -fi - -if test "$no_x" = yes; then - AC_MSG_CHECKING(for X11 libraries) - XLIBSW=nope - dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" - for i in $dirs ; do - if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT($i) - XLIBSW="-L$i -lX11" - x_libraries="$i" - break - fi - done -else - if test "$x_libraries" = ""; then - XLIBSW=-lX11 - else - XLIBSW="-L$x_libraries -lX11" - fi -fi -if test "$XLIBSW" = nope ; then - AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) -fi -if test "$XLIBSW" = nope ; then - AC_MSG_RESULT(couldn't find any! Using -lX11.) - XLIBSW=-lX11 -fi +SC_PATH_X #-------------------------------------------------------------------- # Various manipulations on the search path used at runtime to @@ -415,55 +325,41 @@ AC_C_CHAR_UNSIGNED # "fixstrtod" (provided by Tcl) that corrects the error. #-------------------------------------------------------------------- -AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0) -if test "$tk_strtod" = 1; then - AC_MSG_CHECKING([for Solaris 2.4 strtod bug]) - AC_TRY_RUN([ - extern double strtod(); - int main() - { - char *string = "NaN"; - char *term; - strtod(string, &term); - if ((term != string) && (term[-1] == 0)) { - exit(1); - } - exit(0); - }], tk_ok=1, tk_ok=0, tk_ok=0) - if test "$tk_ok" = 1; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT(buggy) - AC_DEFINE(strtod, fixstrtod) - fi -fi +SC_BUGGY_STRTOD #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtk as a shared library instead of a static library. #-------------------------------------------------------------------- -AC_ARG_ENABLE(shared, - [ --enable-shared build libtk as a shared library (on by default)], - [ok=$enableval], [ok=yes]) -if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then - TK_SHARED_BUILD=1 +SC_ENABLE_SHARED + +if test "$TK_SHARED_LIB_SUFFIX" = "" ; then + TK_SHARED_LIB_SUFFIX='${VERSION}\$\{TK_DBGX\}${SHLIB_SUFFIX}' +fi +if test "$TK_UNSHARED_LIB_SUFFIX" = "" ; then + TK_UNSHARED_LIB_SUFFIX='${VERSION}\$\{TK_DBGX\}.a' +fi + +TCL_LIB_SPEC='-L$(TCL_BIN_DIR) $(TCL_LIB_FLAG)' +TCL_STUB_LIB_SPEC='-L$(TCL_BIN_DIR) $(TCL_STUB_LIB_FLAG)' + +if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}" - TK_LIB_FILE=libtk${TCL_SHARED_LIB_SUFFIX} - MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_BUILD_STUB_LIB_SPEC} \${LIBS}" + TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX} + MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}" RANLIB=":" - TCL_STUB_FLAGS="-DUSE_TCL_STUBS" +# TCL_STUB_FLAGS="-DUSE_TCL_STUBS" + TCL_STUB_FLAGS="" else - TK_SHARED_BUILD=0 TK_SHLIB_CFLAGS="" - TK_LIB_FILE=libtk${TCL_UNSHARED_LIB_SUFFIX} + TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX} MAKE_LIB="ar cr \${TK_LIB_FILE} \${OBJS}" TCL_STUB_FLAGS="" fi -DBGX='${TK_DBGX}' eval "TK_LIB_FILE=${TK_LIB_FILE}" # Note: in the following variable, it's important to use the absolute @@ -471,7 +367,7 @@ eval "TK_LIB_FILE=${TK_LIB_FILE}" # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test $TK_SHARED_BUILD = 0 -o $TCL_NEEDS_EXP_FILE = 0; then +if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}" else @@ -490,23 +386,22 @@ else fi #-------------------------------------------------------------------- -# The statements below define various symbols relating to Tk -# using tcl stub support. -#-------------------------------------------------------------------- - +# The statements below define various symbols relating to creating +# the stub'd version of the Tk library +# # For now, linking to Tcl stubs is not supported with Tk. It causes # too many problems with linking. When Tk is a fully loadable # extension, linking the the Tcl stubs will be supported. - +#-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} -eval "STUB_LIB_FILE=libtkstub${TCL_UNSHARED_LIB_SUFFIX}" +eval "STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" MAKE_STUB_LIB="ar cr \${STUB_LIB_FILE} \${STUB_LIB_OBJS}" TK_STUB_LIB_FILE=${STUB_LIB_FILE} -if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then +if test "${TK_LIB_VERSIONS_OK}" = "ok"; then TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}" else TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`\${TK_DBGX}" @@ -526,6 +421,12 @@ AC_SUBST(TK_STUB_LIB_SPEC) AC_SUBST(TK_BUILD_STUB_LIB_PATH) AC_SUBST(TK_STUB_LIB_PATH) AC_SUBST(MAKE_STUB_LIB) +AC_SUBST(TK_STUB_FLAGS) +AC_SUBST(TK_BUILD_EXP_FILE) +AC_SUBST(TK_EXP_FILE) + +eval "TK_LIB_FILE=${TK_LIB_FILE}" + AC_SUBST(TCL_STUB_FLAGS) AC_SUBST(TK_BUILD_EXP_FILE) AC_SUBST(TK_EXP_FILE) @@ -541,13 +442,16 @@ AC_SUBST(LD_FLAGS) AC_SUBST(MATH_LIBS) AC_SUBST(MAKE_LIB) AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(TK_SHLIB_CFLAGS) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_SUFFIX) AC_SUBST(SHLIB_VERSION) AC_SUBST(TCL_BIN_DIR) -AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) -AC_SUBST(TCL_BUILD_LIB_SPEC) +AC_SUBST(TCL_LIB_SPEC) +AC_SUBST(TCL_LIB_FLAG) +#AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) +#AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_DBGX) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_SRC_DIR) @@ -561,7 +465,6 @@ AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_MAJOR_VERSION) AC_SUBST(TK_MINOR_VERSION) AC_SUBST(TK_PATCH_LEVEL) -AC_SUBST(TK_SHLIB_CFLAGS) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_VERSION) AC_SUBST(XINCLUDES) |