2
# Include the TEA standard macro set
5
builtin(include,tclconfig/tcl.m4)
8
# Add here whatever m4 macros you want to define for your package
12
AC_DEFUN([TEAX_LAPPEND], [$1="[$]{$1} $2"])
13
AC_DEFUN([TEAX_FOREACH], [for $1 in $2; do $3; done])
14
AC_DEFUN([TEAX_IFEQ], [AS_IF([test "x$1" = "x$2"], [$3])])
15
AC_DEFUN([TEAX_IFNEQ], [AS_IF([test "x$1" != "x$2"], [$3])])
16
AC_DEFUN([TEAX_SWITCH], [case "$1" in TEAX_SWITCH_Cases(m4_shift($@)) esac])
17
AC_DEFUN([TEAX_SWITCH_Cases], [m4_if([$#],0,,[$#],1,,[TEAX_SWITCH_OneCase($1,$2)TEAX_SWITCH_Cases(m4_shift(m4_shift($@)))])])
18
AC_DEFUN([TEAX_SWITCH_OneCase],[ $1) $2;;])
19
AC_DEFUN([CygPath],[`${CYGPATH} $1`])
21
dnl Interesting macros
22
AC_DEFUN([TEAX_SUBST_RESOURCE], [
23
AC_REQUIRE([TEA_CONFIG_CFLAGS])dnl
24
TEAX_IFEQ($TEA_PLATFORM, windows, [
25
AC_CHECK_PROGS(RC_, 'windres -o' 'rc -nologo -fo', none)
28
rcdef_inc="--include "
29
rcdef_start="--define "
31
AC_SUBST(RES_SUFFIX, [res.o])
32
TEAX_LAPPEND(PKG_OBJECTS, ${PACKAGE_NAME}.res.o)],
37
AC_SUBST(RES_SUFFIX, [res])
38
TEAX_LAPPEND(PKG_OBJECTS, ${PACKAGE_NAME}.res)],
40
AC_MSG_WARN([could not find resource compiler])
42
# This next line is because of the brokenness of TEA...
45
TEAX_LAPPEND(RES_DEFS, ${rcdef_inc}\"CygPath($i)\")])
47
TEAX_LAPPEND(RES_DEFS, ${rcdef_start}$i='${rcdef_q}\$($i)${rcdef_q}')])
49
AC_DEFUN([TEAX_ADD_PRIVATE_HEADERS], [
51
# check for existence, be strict because it should be present!
52
AS_IF([test ! -f "${srcdir}/$i"], [
53
AC_MSG_ERROR([could not find header file '${srcdir}/$i'])])
54
TEAX_LAPPEND(PKG_PRIVATE_HEADERS, $i)])
55
AC_SUBST(PKG_PRIVATE_HEADERS)])
57
dnl Extra magic to make things work with Vista and VC
58
AC_DEFUN([TEAX_VC_MANIFEST], [
60
AS_IF([test "$GCC" != yes \
61
-a ${TEA_PLATFORM} == "windows" \
62
-a "${SHARED_BUILD}" = "1"], [
63
# This refers to "Manifest Tool" not "Magnetic Tape utility"
64
AC_CHECK_PROGS(MT, mt, none)
65
AS_IF([test "$MT" != none], [
66
ADD_MANIFEST="${MT} -nologo -manifest [\$]@.manifest -outputresource:[\$]@\;2"
67
CLEANFILES="$CLEANFILES ${PKG_LIB_FILE}.manifest"])])
68
AC_SUBST(ADD_MANIFEST)])
70
AC_DEFUN([TEAX_SDX], [
71
AC_PATH_PROG(SDX, sdx, none)
72
TEAX_IFEQ($SDX, none, [
73
AC_PATH_PROG(SDX_KIT, sdx.kit, none)
74
TEAX_IFNEQ($SDX_KIT, none, [
75
# We assume that sdx.kit is on the path, and that the default
77
SDX="tclsh '${SDX_KIT}'"])])
78
TEAX_IFEQ($SDX, none, [
79
AC_MSG_WARN([cannot find sdx; building starkits will fail])
80
AC_MSG_NOTICE([building as a normal library still supported])])])
81
dnl TODO: Adapt this for OSX Frameworks...
82
dnl This next bit is a bit ugly, but it makes things for tclooConfig.sh...
83
AC_DEFUN([TEAX_PATH_LINE], [
84
eval "$1=\"[]CygPath($2)\""
86
AC_DEFUN([TEAX_INCLUDE_LINE], [
87
eval "$1=\"-I[]CygPath($2)\""
89
AC_DEFUN([TEAX_LINK_LINE], [
90
AS_IF([test ${TCL_LIB_VERSIONS_OK} = nodots], [
91
eval "$1=\"-L[]CygPath($2) -l$3${TCL_TRIM_DOTS}\""
93
eval "$1=\"-L[]CygPath($2) -l$3${PACKAGE_VERSION}\""