1 dnl Tcl M4 Routines 2 3 dnl Must call AC_CANONICAL_HOST before calling us 4 AC_DEFUN(TCLEXT_FIND_TCLCONFIG, [ 5 AC_MSG_CHECKING([for path to tclConfig.sh]) 6 7 TCLCONFIGPATH="" 8 AC_ARG_WITH([tcl], AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [ 9 if test "x$withval" = "xno"; then 10 AC_MSG_ERROR([cant build without tcl]) 11 fi 12 13 TCLCONFIGPATH="$withval" 14 ], [ 15 for dir in "/usr/$host_alias/lib" /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64; do 16 if test -f "$dir/tclConfig.sh"; then 17 TCLCONFIGPATH="$dir" 18 19 break 20 fi 21 done 22 ]) 23 24 if test -z "$TCLCONFIGPATH"; then 25 AC_MSG_ERROR([unable to locate tclConfig.sh. Try --with-tcl.]) 26 fi 27 28 AC_SUBST(TCLCONFIGPATH) 29 30 AC_MSG_RESULT([$TCLCONFIGPATH]) 31 ]) 32 33 dnl Must define TCLCONFIGPATH before calling us (i.e., by TCLEXT_FIND_TCLCONFIG) 34 AC_DEFUN(TCLEXT_LOAD_TCLCONFIG, [ 35 AC_MSG_CHECKING([for working tclConfig.sh]) 36 37 if test -f "$TCLCONFIGPATH/tclConfig.sh"; then 38 . "$TCLCONFIGPATH/tclConfig.sh" 39 else 40 AC_MSG_ERROR([unable to load tclConfig.sh]) 41 fi 42 43 44 AC_MSG_RESULT([found]) 45 ]) 46 47 AC_DEFUN(TCLEXT_INIT, [ 48 AC_CANONICAL_HOST 49 50 TCLEXT_FIND_TCLCONFIG 51 TCLEXT_LOAD_TCLCONFIG 52 53 54 AC_DEFINE_UNQUOTED([MODULE_SCOPE], [static], [Define how to declare a function should only be visible to the current module]) 55 56 if test "$TCL_SUPPORTS_STUBS" = "1"; then 57 AC_DEFINE([USE_TCL_STUBS], [1], [Define if you are using the Tcl Stubs Mechanism]) 58 59 TCL_STUB_LIB_SPEC="`eval echo "${TCL_STUB_LIB_SPEC}"`" 60 LIBS="${LIBS} ${TCL_STUB_LIB_SPEC}" 61 else 62 TCL_LIB_SPEC="`eval echo "${TCL_LIB_SPEC}"`" 63 LIBS="${LIBS} ${TCL_LIB_SPEC}" 64 fi 65 66 TCL_INCLUDE_SPEC="`eval echo "${TCL_INCLUDE_SPEC}"`" 67 68 CFLAGS="${CFLAGS} ${TCL_INCLUDE_SPEC}" 69 CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC}" 70 DEFS="${DEFS} ${TCL_DEFS}" 71 72 dnl Needed for package installation 73 TCL_PACKAGE_PATH="`echo "${TCL_PACKAGE_PATH}" | sed 's@ *$''@@'`" 74 AC_SUBST(TCL_PACKAGE_PATH) 75 76 AC_SUBST(LIBS) 77 ]) |