~ubuntu-branches/ubuntu/trusty/tdbcpostgres/trusty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Massimo Manghi
  • Date: 2013-08-22 12:24:05 UTC
  • Revision ID: package-import@ubuntu.com-20130822122405-doqecqb9fl6gr1k4
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Include the TEA standard macro set
 
3
#
 
4
 
 
5
builtin(include,tclconfig/tcl.m4)
 
6
 
 
7
#
 
8
# Add here whatever m4 macros you want to define for your package
 
9
#
 
10
 
 
11
dnl Helper macros
 
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`])
 
20
 
 
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)
 
26
        TEAX_SWITCH($RC_,
 
27
            windres*, [
 
28
                rcdef_inc="--include "
 
29
                rcdef_start="--define "
 
30
                rcdef_q='\"'
 
31
                AC_SUBST(RES_SUFFIX, [res.o])
 
32
                TEAX_LAPPEND(PKG_OBJECTS, ${PACKAGE_NAME}.res.o)],
 
33
            rc*, [
 
34
                rcdef_inc="-i "
 
35
                rcdef_start="-d "
 
36
                rcdef_q='"'
 
37
                AC_SUBST(RES_SUFFIX, [res])
 
38
                TEAX_LAPPEND(PKG_OBJECTS, ${PACKAGE_NAME}.res)],
 
39
            *, [
 
40
                AC_MSG_WARN([could not find resource compiler])
 
41
                RC_=: ])])
 
42
    # This next line is because of the brokenness of TEA...
 
43
    AC_SUBST(RC, $RC_)
 
44
    TEAX_FOREACH(i, $1, [
 
45
        TEAX_LAPPEND(RES_DEFS, ${rcdef_inc}\"CygPath($i)\")])
 
46
    TEAX_FOREACH(i, $2, [
 
47
        TEAX_LAPPEND(RES_DEFS, ${rcdef_start}$i='${rcdef_q}\$($i)${rcdef_q}')])
 
48
    AC_SUBST(RES_DEFS)])
 
49
AC_DEFUN([TEAX_ADD_PRIVATE_HEADERS], [
 
50
    TEAX_FOREACH(i, $@, [
 
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)])
 
56
 
 
57
dnl Extra magic to make things work with Vista and VC
 
58
AC_DEFUN([TEAX_VC_MANIFEST], [
 
59
    ADD_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)])
 
69
 
 
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
 
76
            # tclsh is activetcl
 
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)\""
 
85
    AC_SUBST($1)])
 
86
AC_DEFUN([TEAX_INCLUDE_LINE], [
 
87
    eval "$1=\"-I[]CygPath($2)\""
 
88
    AC_SUBST($1)])
 
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}\""
 
92
    ], [
 
93
        eval "$1=\"-L[]CygPath($2) -l$3${PACKAGE_VERSION}\""
 
94
    ])
 
95
    AC_SUBST($1)])
 
96
 
 
97
dnl Local Variables:
 
98
dnl mode: autoconf
 
99
dnl End: