URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [insight/] [tk/] [unix/] [configure.in] - Rev 1770
Go to most recent revision | Compare with Previous | Blame | View Log
! /bin/bash -norc
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.
# CYGNUS LOCAL, autoconf 2.5 or higher to get --bindir et al
AC_PREREQ(2.5)
# END CYGNUS LOCAL
AC_INIT(../generic/tk.h)
# SCCS: @(#) configure.in 1.90 97/11/20 12:45:45
# CYGNUS LOCAL tromey - find config.guess/config.sub in our tree
AC_CONFIG_AUX_DIR($srcdir/../..)
AC_CANONICAL_SYSTEM
AC_PROG_CC
AC_PROG_INSTALL
# END CYGNUS LOCAL
TK_VERSION=8.0
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=0
TK_PATCH_LEVEL=".4"
VERSION=${TK_VERSION}
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
TK_SRC_DIR=`cd $srcdir/..; pwd`
AC_PROG_RANLIB
AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
[tk_ok=$enableval], [tkl_ok=no])
if test "$tk_ok" = "yes"; then
AC_PROG_CC
else
CC=${CC-cc}
AC_SUBST(CC)
fi
AC_HAVE_HEADERS(unistd.h limits.h)
# 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.
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
else
CFLAGS_WARNING=""
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.
#--------------------------------------------------------------------
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.0 binaries from DIR],
TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd ../../tcl/unix; pwd`)
if test -z "$TCL_BIN_DIR"; then
AC_MSG_ERROR(couldn't find Tcl build directory in ../../tcl/unix)
fi
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
#--------------------------------------------------------------------
# Read in configuration information generated by Tcl for shared
# libraries, and arrange for it to be substituted into our
# Makefile.
#--------------------------------------------------------------------
file=$TCL_BIN_DIR/tclConfig.sh
. $file
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
LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
# 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}"
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)
AC_HEADER_EGREP(strtol, stdlib.h, tk_ok=yes, tk_ok=no)
AC_HEADER_EGREP(strtoul, stdlib.h, , tk_ok=no)
AC_HEADER_EGREP(strtod, stdlib.h, , tk_ok=no)
if test $tk_ok = no; then
AC_DEFINE(NO_STDLIB_H)
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.
#--------------------------------------------------------------------
AC_MSG_CHECKING([fd_set and sys/select])
AC_TRY_COMPILE([#include <sys/types.h>],
[fd_set readMask, writeMask;], tk_ok=yes, tk_ok=no)
if test $tk_ok = no; then
AC_HEADER_EGREP(fd_mask, sys/select.h, tk_ok=yes)
if test $tk_ok = yes; then
AC_DEFINE(HAVE_SYS_SELECT_H)
fi
fi
AC_MSG_RESULT($tk_ok)
if test $tk_ok = no; then
AC_DEFINE(NO_FD_SET)
fi
#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
# they don't exist.
#--------------------------------------------------------------------
AC_MODE_T
AC_PID_T
AC_SIZE_T
AC_UID_T
#------------------------------------------------------------------------------
# Find out about time handling differences.
#------------------------------------------------------------------------------
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
#--------------------------------------------------------------------
# Locate the X11 header files and the X11 library archive. Try
# the ac_path_x macro first, but if it doesn't find the X stuff
# (e.g. because there's no xmkmf program) then check through
# a list of possible directories. Under some conditions the
# autoconf macro will return an include directory that contains
# 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
#--------------------------------------------------------------------
# Various manipulations on the search path used at runtime to
# find shared libraries:
# 1. If the X library binaries are in a non-standard directory,
# add the X library location into that search path.
# 2. On systems such as AIX and Ultrix that use "-L" as the
# search path option, colons cannot be used to separate
# directories from each other. Change colons to " -L".
# 3. Create two sets of search flags, one for use in cc lines
# and the other for when the linker is invoked directly. In
# the second case, '-Wl,' must be stripped off and commas must
# be replaced by spaces.
#--------------------------------------------------------------------
if test "x${x_libraries}" != "x"; then
LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}"
fi
if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
fi
# The statement below is very tricky! It actually *evaluates* the
# string in TCL_LD_SEARCH_FLAGS, which causes a substitution of the
# variable LIB_RUNTIME_DIR.
eval "TK_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`
# CYGNUS LOCAL: Don't hack TK_LD_SEARCH_FLAGS if SHLIB_LD is gcc.
case "${SHLIB_LD}" in
*gcc*) TK_LD_SEARCH_FLAGS="${TK_CC_SEARCH_FLAGS}" ;;
esac
#
# CYGNUS LOCAL: statically link on Solaris, HPUX & SunOS so that
# we don't have problems with people not having libraries
# installed or not having LD_LIBRARY_PATH set.
#
case "$host" in
#
# gdb linked statically w/ Solaris iff GCC and GNU ld are used,
# otherwise dynamic
#
*-*-solaris2*)
sol_xlibsw=
if test "x$GCC" = "xyes" ; then
# This is probably the simplest way to test for GNU ld.
# It only works with relatively recent versions of GNU
# ld.
gld_text=`$CC -Wl,--version 2>&1 | sed 1q`
case "$gld_text" in
GNU* | *BFD*)
# sol2.* has libX*.so files in /usr/lib,
# but not libX*.a files, so we need to force a
# -L/usr/openwin/lib option, sometimes.
# FIXME: this won't work right if someone has
# their own X libraries in say /usr/local/lib.
case "$XLIBSW" in
*-L*) ;;
*) if test ! -f /usr/lib/libXt.a; then
XLIBSW="-L/usr/openwin/lib $XLIBSW"
fi
;;
esac
# Why do we link against libX11 twice? Because the
# Openwin X11 and Xext libraries are seriously broken.
sol_xlibsw="-Wl,-Bstatic $XLIBSW -lXext -lX11 -Wl,-Bdynamic"
;;
esac
fi
if test -z "$sol_xlibsw"; then
if test "x$x_libraries" != "x"; then
XLIBSW="$XLIBSW -R$x_libraries"
fi
else
XLIBSW=$sol_xlibsw
suppress_enable_shared=yes
fi
;;
#
# gdb linked statically w/ SunOS or HPUX, but not hpux11 wide
#
hppa*64*-hp-hpux*)
;;
m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
if test "x$x_libraries" != "x" ;
then
XLIBSW="$x_libraries/libX11.a"
else
XLIBSW="/usr/lib/libX11.a"
fi
suppress_enable_shared=yes
;;
#
# default is to link dynamically
#
*)
;;
esac
#
# END CYGNUS LOCAL
#--------------------------------------------------------------------
# Check for the existence of various libraries. The order here
# is important, so that then end up in the right order in the
# command line generated by make. The -lsocket and -lnsl libraries
# require a couple of special tricks:
# 1. Use "connect" and "accept" to check for -lsocket, and
# "gethostbyname" to check for -lnsl.
# 2. Use each function name only once: can't redo a check because
# autoconf caches the results of the last check and won't redo it.
# 3. Use -lnsl and -lsocket only if they supply procedures that
# aren't already present in the normal libraries. This is because
# IRIX 5.2 has libraries, but they aren't needed and they're
# bogus: they goof up name resolution if used.
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
# To get around this problem, check for both libraries together
# if -lsocket doesn't work by itself.
#--------------------------------------------------------------------
AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
# CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
# mess up the cache values of the functions we check for.
AC_CACHE_CHECK([for socket libraries], tcl_cv_lib_sockets,
[tcl_cv_lib_sockets=
tk_checkBoth=0
unset ac_cv_func_connect
AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
if test "$tk_checkSocket" = 1; then
unset ac_cv_func_connect
AC_CHECK_LIB(socket, main, tcl_cv_lib_sockets="-lsocket",
tk_checkBoth=1)
fi
if test "$tk_checkBoth" = 1; then
tk_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
AC_CHECK_FUNC(accept,
[tcl_checkNsl=0
tcl_cv_lib_sockets="-lsocket -lnsl"])
unset ac_cv_func_accept
LIBS=$tk_oldLibs
fi
unset ac_cv_func_gethostbyname
tk_oldLibs=$LIBS
LIBS="$LIBS $tk_cv_lib_sockets"
AC_CHECK_FUNC(gethostbyname, ,
[AC_CHECK_LIB(nsl, main,
[tcl_cv_lib_sockets="$tcl_cv_lib_sockets -lnsl"])])
unset ac_cv_func_gethostbyname
LIBS=$tcl_oldLIBS
])
test -z "$tcl_cv_lib_sockets" || LIBS="$LIBS $tcl_cv_lib_sockets"
#--------------------------------------------------------------------
# One more check related to the X libraries. The standard releases
# of Ultrix don't support the "xauth" mechanism, so send won't work
# unless TK_NO_SECURITY is defined. However, there are usually copies
# of the MIT X server available as well, which do support xauth.
# Check for the MIT stuff and use it if it exists.
#
# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1)
# because it can't deal with the "-" in the library name.
#--------------------------------------------------------------------
if test -d /usr/include/mit ; then
AC_MSG_CHECKING([MIT X libraries])
tk_oldCFlags=$CFLAGS
CFLAGS="$CFLAGS -I/usr/include/mit"
tk_oldLibs=$LIBS
LIBS="$LIBS -lX11-mit"
AC_TRY_LINK([
#include <X11/Xlib.h>
], [
XOpenDisplay(0);
], [
AC_MSG_RESULT(yes)
XLIBSW="-lX11-mit"
XINCLUDES="-I/usr/include/mit"
], AC_MSG_RESULT(no))
CFLAGS=$tk_oldCFlags
LIBS=$tk_oldLibs
fi
#--------------------------------------------------------------------
# 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").
#--------------------------------------------------------------------
MATH_LIBS=""
AC_CHECK_FUNC(sin, , MATH_LIBS="-lm")
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
#--------------------------------------------------------------------
# Figure out whether "char" is unsigned. If so, set a
# #define for __CHAR_UNSIGNED__.
#--------------------------------------------------------------------
AC_C_CHAR_UNSIGNED
#--------------------------------------------------------------------
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
# "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
#--------------------------------------------------------------------
# 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],
[ok=$enableval], [ok=no])
# CYGNUS LOCAL: on machines where static linking of libX11 is important,
# it is also important to build a static libtk.
if test -n "$suppress_enable_shared"; then
ok=no
fi
# END CYGNUS LOCAL
TK_SHARED_LIB_FILE=
TK_UNSHARED_LIB_FILE=
if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
TK_SHARED_BUILD=1
TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
eval "TK_LIB_FILE=libtk${TCL_SHARED_LIB_SUFFIX}"
TK_SHARED_LIB_FILE="$TK_LIB_FILE"
MAKE_LIB="\${SHLIB_LD} -o ${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${SHLIB_LD_LIBS}"
RANLIB=":"
else
TK_SHARED_BUILD=0
TK_SHLIB_CFLAGS=""
eval "TK_LIB_FILE=libtk${TCL_UNSHARED_LIB_SUFFIX}"
TK_UNSHARED_LIB_FILE="$TK_LIB_FILE"
MAKE_LIB="ar cr ${TK_LIB_FILE} \${OBJS}"
fi
dnl CYGNUS LOCAL
TK_BUILD_INCLUDES="-I`cd $srcdir/../generic; pwd`"
dnl END CYGNUS LOCAL
# Note: in the following variable, it's important to use the absolute
# path name of the Tcl directory rather than "..": this is because
# AIX remembers this path and will attempt to use it at run-time to look
# up the Tcl library.
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
TK_BUILD_LIB_SPEC="-L`pwd` -ltk${VERSION}"
TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
else
TK_BUILD_LIB_SPEC="-L`pwd` -ltk`echo ${VERSION} | tr -d .`"
TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
fi
TK_LIB_FULL_PATH="`pwd`/${TK_LIB_FILE}"
AC_SUBST(DL_LIBS)
AC_SUBST(LD_FLAGS)
AC_SUBST(MATH_LIBS)
AC_SUBST(MAKE_LIB)
AC_SUBST(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_LIB_SPEC)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_VERSION)
dnl CYGNUS LOCAL
AC_SUBST(TK_BUILD_INCLUDES)
dnl END CYGNUS LOCAL
AC_SUBST(TK_BUILD_LIB_SPEC)
AC_SUBST(TK_CC_SEARCH_FLAGS)
AC_SUBST(TK_LD_SEARCH_FLAGS)
AC_SUBST(TK_LIB_FULL_PATH)
AC_SUBST(TK_LIB_FILE)
AC_SUBST(TK_LIB_FLAG)
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)
AC_SUBST(XLIBSW)
AC_SUBST(TK_SHARED_BUILD)
# CYGNUS LOCAL
# Need more variables to keep shared/static linking separate.
AC_SUBST(TCL_SHARED_LIB_SUFFIX)
AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
AC_SUBST(TK_SHARED_LIB_FILE)
AC_SUBST(TK_UNSHARED_LIB_FILE)
# END CYGNUS LOCAL
AC_OUTPUT(Makefile tkConfig.sh)
Go to most recent revision | Compare with Previous | Blame | View Log