summaryrefslogtreecommitdiff
path: root/tikzit/configure.ac
blob: c00c749b4e40e3e658c08b6c5b82e10064fbb78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.60])
AC_INIT([TikZiT], [0.7],
	[http://sourceforge.net/apps/trac/tikzit],
	[tikzit],
	[http://tikzit.sourceforge.net])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
AM_SILENT_RULES([yes])
AC_OUTPUT(Makefile
          src/Makefile
          share/Makefile
)
AC_CONFIG_SRCDIR([src/linux/main.m])

m4_include([m4/objc.m4])

# Checks for programs.
AC_PROG_OBJC([gcc clang objc objcc])
AC_LANG([Objective C])

AC_PROG_LEX
AM_PROG_LEX
AC_PROG_YACC

# Checks for libraries.
PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.16.0])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])

PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.16.0])
AC_SUBST([GDK_PIXBUF_CFLAGS])
AC_SUBST([GDK_PIXBUF_LIBS])

PKG_CHECK_MODULES([PANGO], [pango >= 1.16])
AC_SUBST([PANGO_CFLAGS])
AC_SUBST([PANGO_LIBS])

PKG_CHECK_MODULES([CAIRO], [cairo >= 1.4])
AC_SUBST([CAIRO_CFLAGS])
AC_SUBST([CAIRO_LIBS])

GNUSTEPOBJCFLAGS=`eval "gnustep-config --objc-flags"`
AS_IF([test "x$GNUSTEPOBJCFLAGS" = ""],
  [AC_MSG_ERROR([GNUstep not found])])
GNUSTEPLIBS=`eval "gnustep-config --base-libs"`
AS_IF([test "x$GNUSTEPLIBS" = ""],
  [AC_MSG_ERROR([GNUstep not found])])
AC_SUBST([GNUSTEPOBJCFLAGS])
AC_SUBST([GNUSTEPLIBS])

AC_ARG_WITH([poppler], AS_HELP_STRING([--without-poppler], [Ignore presence of poppler, disabling preview support]))

AS_IF([test "x$with_poppler" != "xno"],
  [PKG_CHECK_MODULES([POPPLER],
                     [poppler-glib],
                     [have_poppler=yes],
                     [have_poppler=no])],
  [have_poppler=no])

AS_IF([test "x$have_poppler" = "xyes"],
  [
   AC_SUBST([POPPLER_CFLAGS])
   AC_SUBST([POPPLER_LIBS])
   AC_DEFINE(HAVE_POPPLER, 1)
  ],
  [AS_IF([test "x$with_poppler" = "xyes"],
         [AC_MSG_ERROR([foo requested but not found])]
        )
  ])
AM_CONDITIONAL([HAVE_POPPLER],[test "x$have_poppler" = "xyes"])

# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_HEADER_STDBOOL
AC_HEADER_STAT
AC_CHECK_HEADERS([stdint.h inttypes.h unistd.h sys/time.h time.h])

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([floor gettimeofday memset mkdtemp sqrt strdup])

TZ_OBJC2_FEATURES
AS_IF([test "x$tz_cv_objc_properties$tz_cv_objc_fast_enumeration$tz_cv_objc_optional_keyword" != "xyesyesyes"],
  [AC_MSG_ERROR([Your Objective C compiler does not support the required Objective C 2 features])])

dnl ----------------------------------------------------------------------------
dnl
dnl  platform-specific stuff.

AC_CANONICAL_HOST
have_msw="no"
case $host_os in

   *mingw32*)
     have_msw="yes"
     OBJCFLAGS="$OBJCFLAGS -mwindows"
     AC_SUBST([WINDOWS])
     AC_SUBST([WIN32])
     AC_SUBST([_WIN32])
     ;;

esac

AM_CONDITIONAL([WINDOWS],[test "x$have_msw" = "xyes"])

AC_OUTPUT