archie/tcl-dp/unix/configure.in

197 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

2024-05-27 16:13:40 +02:00
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run to configure the
dnl Makefile in this directory.
AC_INIT(../generic/dpInit.c)
#--------------------------------------------------------------------
# Version information about this DP release.
#--------------------------------------------------------------------
DP_VERSION=4.0
DP_MAJOR_VERSION=4
DP_MINOR_VERSION=0
VERSION=${DP_VERSION}
AC_PROG_RANLIB
AC_HAVE_HEADERS(unistd.h limits.h)
AC_PROG_MAKE_SET
#--------------------------------------------------------------------
# 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 Tcl source is in DIR],
TCL_BIN_DIR=$withval, TCL_BIN_DIR=UNDEF)
#-------------------------------------------------------------------
# If the Tcl dir was not specified, assume it is a sibling to the top
# Tcl-DP directory and search for the versions we support.
#-------------------------------------------------------------------
if test $TCL_BIN_DIR = "UNDEF" ; then
if test -d ../../tcl8.0/unix ; then
REQ_TCL_VER=8.0
TCL_VER_DEF=-D_TCL80
elif test -d ../../tcl7.6/unix ; then
REQ_TCL_VER=7.6
TCL_VER_DEF=-D_TCL76
else
echo "Could not find Tcl source directory. Please install"
echo "the Tcl source code or specify the directory with the"
echo " --with-tcl=<path_to_unix_dir> switch."
exit 1
fi
TCL_BIN_DIR=`cd ../../tcl${REQ_TCL_VER}/unix; pwd`
echo "Found Tcl $REQ_TCL_VER in $TCL_BIN_DIR"
else
# Check for Tcl 8 by grepping the directory string for an 8
if test `echo $TCL_BIN_DIR | grep 8` ; then
REQ_TCL_VER=8.0
TCL_VER_DEF=-D_TCL80
echo "Found Tcl 8.0 in $TCL_BIN_DIR"
else
# Assume the directory string is for Tcl 7.6
REQ_TCL_VER=7.6
TCL_VER_DEF=-D_TCL76
echo "Defaulting to Tcl 7.6 in $TCL_BIN_DIR"
fi
fi
if test ! -d $TCL_BIN_DIR; then
echo "Tcl source directory $TCL_BIN_DIR doesn't exist"
echo "Please install the Tcl source code."
exit 1
fi
TCL_SRC_DIR=`cd $TCL_BIN_DIR; make topDirName`
#--------------------------------------------------------------------
# Find out the top level source directory of this package.
#--------------------------------------------------------------------
SRC_DIR=`cd ..; pwd`
AC_SUBST(SRC_DIR)
#--------------------------------------------------------------------
# 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
CC=$TCL_CC
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
TCL_LIBS=$TCL_LIBS
TCL_VERSION=$TCL_VERSION
####################################################
# This code is necessary because Tcl 7.6 uses
# DP's generic socket code while Tcl 8.x uses
# the socket code in the OS dir
#
if test $TCL_VERSION -eq 7 ; then
IPM=\$\(GENERIC_DIR\)/dpIPM.c
TCP=\$\(GENERIC_DIR\)/dpTcp.c
UDP=\$\(GENERIC_DIR\)/dpUdp.c
else
IPM=\$\(UNIX_DIR\)/dpUnixIpm.c
TCP=\$\(UNIX_DIR\)/dpUnixTcp.c
UDP=\$\(UNIX_DIR\)/dpUnixUdp.c
fi
AC_SUBST(IPM)
AC_SUBST(TCP)
AC_SUBST(UDP)
####################################################
AC_SUBST(CC)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(SHLIB_VERSION)
AC_SUBST(TCL_BUILD_LIB_SPEC)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_BIN_DIR)
#-------------------------------------------
# Export OS name in a define
#-------------------------------------------
OS_DEF=""
AC_PROGRAM_CHECK(uname_found, uname, 1, 0)
[ if test $uname_found -eq 1 ; then
system=`uname -s`-`uname -r`
case $system in
SunOS-4*)
OS_DEF="-D__SUNOS__"
;;
SunOS-5*)
OS_DEF="-D__SOLARIS__"
;;
Linux*)
OS_DEF="-D__LINUX__"
;;
HP-UX*)
OS_DEF="-D__HPUX__"
;;
FreeBSD*)
OS_DEF="-D__FREEBSD__"
;;
esac
fi ]
eval "DP_LIB_FILE=libdp40${TCL_SHLIB_SUFFIX}"
DP_MAKE_LIB="\${SHLIB_LD} -o ${DP_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
DP_PKG_FILE="[[file join [file dirname \$dir] ${DP_LIB_FILE}]]"
#----------------------------------------------------------------------
# Substitution strings exported by DP
#----------------------------------------------------------------------
AC_SUBST(DP_MAJOR_VERSION)
AC_SUBST(DP_MINOR_VERSION)
AC_SUBST(DP_VERSION)
AC_SUBST(DP_MAKE_LIB)
AC_SUBST(DP_LIB_FILE)
AC_SUBST(DP_PKG_FILE)
AC_SUBST(OS_DEF)
AC_SUBST(TCL_VER_DEF)
#----------------------------------------------------------------------
# Do all checking AFTER this line because most checkings depend
# of the value of CC, which is defined only after we read in
# the Tcl config info.
#----------------------------------------------------------------------
AC_MSG_CHECKING(checking for ip multicast)
AC_TRY_COMPILE([#include "sys/types.h"
#include "netinet/in.h"],
[int f1=IP_ADD_MEMBERSHIP;
int f2=IP_MULTICAST_TTL;
int f3=IP_MULTICAST_LOOP;], ip_ok=1, ip_ok=0)
if test $ip_ok = 1; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_DEFINE(NO_MULTICAST_DEF)
fi
AC_OUTPUT(Makefile)