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 AC_DEFUN([TEAX_SDX], [
58 AC_PATH_PROG(SDX, sdx, none)
59 TEAX_IFEQ($SDX, none, [
60 AC_PATH_PROG(SDX_KIT, sdx.kit, none)
61 TEAX_IFNEQ($SDX_KIT, none, [
62 # We assume that sdx.kit is on the path, and that the default
64 SDX="tclsh '${SDX_KIT}'"])])
65 TEAX_IFEQ($SDX, none, [
66 AC_MSG_WARN([cannot find sdx; building starkits will fail])
67 AC_MSG_NOTICE([building as a normal library still supported])])])
68 dnl TODO: Adapt this for OSX Frameworks...
69 dnl This next bit is a bit ugly, but it makes things for tclooConfig.sh...
70 AC_DEFUN([TEAX_PATH_LINE], [
71 eval "$1=\"[]CygPath($2)\""
73 AC_DEFUN([TEAX_INCLUDE_LINE], [
74 eval "$1=\"-I[]CygPath($2)\""
76 AC_DEFUN([TEAX_LINK_LINE], [
77 AS_IF([test ${TCL_LIB_VERSIONS_OK} = nodots], [
78 eval "$1=\"-L[]CygPath($2) -l$3${TCL_TRIM_DOTS}\""
80 eval "$1=\"-L[]CygPath($2) -l$3${PACKAGE_VERSION}\""