-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
120 lines (103 loc) · 3.4 KB
/
configure.ac
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.68])
AC_INIT([htmlview], [0.7.0], [[email protected]])
AC_CONFIG_SRCDIR([src/htmlview.c])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
if test "$CC" = "clang"; then
CLANG=yes
else
CLANG=no
fi
AC_DEFINE([SYLPF_ID], [PACKAGE_NAME], [""])
AC_DEFINE([SYLPF_OPTION], [htmlview_option], [""])
# Checks for libraries.
AM_PATH_GLIB_2_0(2.8.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.))
AM_PATH_GTK_2_0(2.8.0,, AC_MSG_ERROR(Test for Gtk failed. See the 'INSTALL' for help.))
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES([GLIB], [glib-2.0])
PKG_CHECK_MODULES([GTK], [gtk+-2.0])
PKG_CHECK_MODULES([SYLPF], [sylplugin-factory])
AC_ARG_ENABLE([webkitgtk],
[AS_HELP_STRING([--enable-webkitgtk],
[use WebKitGTK as HTML rendering engine. [default=auto]])],
[enable_webkitgtk="$enableval"],
[enable_webkitgtk=no]
)
AC_MSG_CHECKING([whether enable WebKitGTK])
if test "x$enable_webkitgtk" != "xyes"; then
enable_webkitgtk="no"
fi
AC_MSG_RESULT($enable_webkitgtk)
AC_ARG_ENABLE([gtkhtml],
[AS_HELP_STRING([--enable-gtkhtml],
[use GtkHTML as HTML rendering engine. [default=no]])],
[enable_gtkhtml="$enableval"],
[enable_gtkhtml=no]
)
AC_MSG_CHECKING([whether enable GtkHTML])
if test "x$enable_gtkhtml" != "xyes"; then
enable_gtkhtml="no"
fi
AC_MSG_RESULT($enable_gtkhtml)
AS_IF([test "x$enable_webkitgtk" != xno && test "x$enable_gtkhtml" != xno],
[
AC_DEFINE([USE_GTKHTML], [1], [GtkHTML support])
PKG_CHECK_MODULES([GTKHTML], [libgtkhtml-3.14])
],
[test "x$enable_webkitgtk" != xno && test "x$enable_gtkhtml" != xyes],
[
AC_DEFINE([USE_WEBKITGTK], [1], [WebKitGTK support])
PKG_CHECK_MODULES([WEBKITGTK], [webkit-1.0])
],
[test "x$enable_webkitgtk" != xyes && test "x$enable_gtkhtml" != xno],
[
AC_DEFINE([USE_GTKHTML], [1], [GtkHTML support])
PKG_CHECK_MODULES([GTKHTML], [libgtkhtml-3.14])
],
[AC_MSG_ERROR(use WebKitGTK or GtkHTML exclusively.)]
)
AM_CONDITIONAL([USE_GTKHTML],
[test "${enable_gtkhtml}" = "yes"])
AM_CONDITIONAL([USE_WEBKITGTK],
[test "${enable_webkitgtk}" = "yes"])
# For debug
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[use debug flags (default=no)])],
[plugin_debug="$enableval"],
[plugin_debug="no"])
if test "x$plugin_debug" != "xno"; then
plugin_debug="yes"
if test "$CLANG" = "yes"; then
CFLAGS="$CFLAGS -O0 -g"
CXXFLAGS="$CXXFLAGS -O0 -g"
elif test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -O0 -ggdb3"
CXXFLAGS="$CXXFLAGS -O0 -ggdb3"
fi
fi
AC_SUBST(plugin_debug)
m4_include(macros/sylplugin_factory.m4)
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
echo ""
echo " For HTML Preview..."
echo ""
echo " WebKitGTK: ${enable_webkitgtk}"
echo " GtkHTML: ${enable_gtkhtml}"
echo " Sylpheed plugin factory source directory: ${sylplugin_factory_source_dir}"
echo ""