File: configure.in

package info (click to toggle)
katoob 0.5.9.1-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,492 kB
  • ctags: 1,961
  • sloc: cpp: 11,398; sh: 8,941; ansic: 4,298; makefile: 175
file content (267 lines) | stat: -rw-r--r-- 7,293 bytes parent folder | download
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
AC_PREREQ(2.52)

AC_INIT(src/main.cc)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(katoob, 0.5.9.1)
AC_PROG_INTLTOOL(0.18, "no-xml")

AC_PROG_CXX

ALL_LINGUAS="ar cz de fr he ja pl sv"
GETTEXT_PACKAGE=katoob

AM_GLIB_GNU_GETTEXT

AC_ARG_ENABLE(profile,
AC_HELP_STRING([--enable-profile], [Include profiling information. (default: no)]),
        profile=$enableval, profile=no)

AC_ARG_ENABLE(maemo,
AC_HELP_STRING([--enable-maemo], [Enable maemo support. (default: no)]),
        maemo=$enableval, maemo=no)

AC_ARG_ENABLE(bzip2,
AC_HELP_STRING([--enable-bzip2], [Enable bzip2 support. (default: yes)]),
        bzip2=$enableval, bzip2=yes)

AC_ARG_ENABLE(gzip,
AC_HELP_STRING([--enable-gzip], [Enable gzip support. (default: yes)]),
        gzip=$enableval, gzip=yes)

AC_ARG_ENABLE(multipress,
AC_HELP_STRING([--enable-multipress], [Enable multipress. (default: yes)]),
        multipress=$enableval, multipress=yes)

AC_ARG_ENABLE(emulator,
AC_HELP_STRING([--enable-emulator], [Enable emulator. (default: yes)]),
        emulator=$enableval, emulator=yes)

AC_ARG_ENABLE(highlight,
AC_HELP_STRING([--enable-highlight], [Enable source code highlighting. (default: no)]),
        highlight=$enableval,  highlight=no)

AC_ARG_ENABLE(release,
AC_HELP_STRING([--enable-release], [Don't include debugging symbols. (default: yes)]),
        release=$enableval, release=yes)

AC_ARG_ENABLE(spell,
AC_HELP_STRING([--enable-spell], [Enable the spell checker (default: no)]),
        spell=$enableval, spell=no)

AC_ARG_ENABLE(isocodes,
AC_HELP_STRING([--enable-isocodes], [Enable isocodes  (default: no)]),
        isocodes=$enableval, isocodes=no)

AC_ARG_ENABLE(print,
AC_HELP_STRING([--enable-print], [Enable printing support. (default: yes)]),
         print=$enableval, print=yes)

AC_ARG_ENABLE(dbus,
AC_HELP_STRING([--enable-dbus], [Enable D-BUS support. (default: no)]),
        dbus=$enableval, dbus=no)

AC_ARG_ENABLE(fribidi,
AC_HELP_STRING([--enable-fribidi], [Use fribidi. (default: no)]),
        fribidi=$enableval, fribidi=no)

AC_ARG_ENABLE(dict,
AC_HELP_STRING([--enable-dict], [Enable dict protocol support. (default: yes)]),
        dict=$enableval, dict=yes)

LIBCURL_CHECK_CONFIG([yes], , curl=yes, AC_MSG_ERROR(libcurl not found.))

if test "$CXX" = "g++" ; then
        CXXFLAGS="$CXXFLAGS -pipe -Wall"
fi
if test "$CCC" = "gcc" ; then
        CFLAGS="$CFLAGS -pipe -Wall"
fi
dnl Do we really need -fprofile-arcs ??
if test "$profile" = yes ; then
        CFLAGS="$CFLAGS -pg -fprofile-arcs"
fi

if test "x$dict" = "xyes"; then
if test "$libcurl_protocol_DICT" != "yes"; then
AC_MSG_ERROR(libcurl doesn't support DICT.)
else
AC_DEFINE(ENABLE_DICT,,[Enable dict..])
fi
fi

AM_CONDITIONAL(DICT, text "x$dict" = "xyes")

dnl Set PREFIX in config.h.
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PREFIX, "${ac_default_prefix}",[PREFIX])
else
  AC_DEFINE_UNQUOTED(PREFIX, "${prefix}",[PREFIX])
fi

dnl Set PACKAGE_LOCALE_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale",[PACKAGE_LOCALE_DIR])
else
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale",[PACKAGE_LOCALE_DIR])
fi

dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}",[PACKAGE_DATA_DIR])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}",[PACKAGE_DATA_DIR])
fi

dnl Checking for Gtkmm
PKG_CHECK_MODULES(KATOOB, gtkmm-2.4 >= 2.10.0)

dnl iso-codes
if test "$isocodes" = yes; then
if test "$spell" = no; then
  AC_MSG_ERROR(You can't enable isocodes and disable spell.)
else
 PKG_CHECK_MODULES(ISOCODES, iso-codes)
 AC_DEFINE_UNQUOTED([ISOCODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
AC_DEFINE(ENABLE_ISOCODES,,[Enable isocodes.])
fi
fi
AM_CONDITIONAL(ISOCODES, test "x$isocodes" = "xyes")

dnl The spell checker
if test "$spell" = yes; then
PKG_CHECK_MODULES(SPELL, enchant >= 1.3.0)
AC_DEFINE(ENABLE_SPELL,,[Enable spell checking.])
fi
AM_CONDITIONAL(SPELL, test "x$spell" = "xyes")

if test "$release" = no ; then
        CFLAGS="$CFLAGS -ggdb"
else
        CFLAGS="$CFLAGS -DNDEBUG"
fi

if test "$fribidi" = yes; then
 AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config)
 if test "x$FRIBIDI_CONFIG" = x; then
  AC_MSG_ERROR(fribidi-config not found.)
 else
  FRIBIDI_CFLAGS=$($FRIBIDI_CONFIG --cflags)
  FRIBIDI_LIBS=$($FRIBIDI_CONFIG --libs)
  AC_DEFINE(HAVE_FRIBIDI,,[Enable fribidi support.])
 fi
fi
AM_CONDITIONAL(FRIBIDI, test "x$fribidi" = "xyes")

if test "$print" = yes; then
PKG_CHECK_MODULES(PRINT, gtk+-unix-print-2.0 >= 2.10.0)
AC_DEFINE(ENABLE_PRINT,,[Enable printing.])
fi
AM_CONDITIONAL(PRINT, test "x$print" = "xyes")

dnl bz2
if test "$bzip2" = yes; then
AC_CHECK_LIB(bz2, BZ2_bzopen, bzip_l=yes, bzip_l=no)
AC_CHECK_HEADER(bzlib.h, bzip_h=yes, bzip_h=no)
if test "$bzip_l" = yes && test "$bzip_h" = yes; then
AC_MSG_NOTICE([bzip2 support is enabled.])
AC_DEFINE(HAVE_BZIP2,,[Enable bzip2 support])
BZ2_LIBS="-lbz2"
else
AC_MSG_NOTICE([bzip2 support is disabled.])
fi
fi

dnl gz
if test "$gzip" = yes; then
AC_CHECK_LIB(z, gzopen, gzip_l=yes, gzip_l=no)
AC_CHECK_HEADER(zlib.h, gzip_h=yes, gzip_h=no)
if test "$gzip_l" = yes && test "$gzip_h" = yes; then
AC_MSG_NOTICE([gzip support is enabled.])
AC_DEFINE(HAVE_GZIP,,[Enable gzip support])
GZ_LIBS="-lz"
else
AC_MSG_NOTICE([gzip support is disabled.])
fi
fi


if test "$dbus" = yes; then
PKG_CHECK_MODULES(DBUS, dbus-glib-1)
AC_DEFINE(ENABLE_DBUS,,[Enable dbus.])
fi
AM_CONDITIONAL(DBUS, test "x$dbus" = "xyes")


if test "$emulator" = yes; then
AC_DEFINE(ENABLE_EMULATOR,,[Enable emulator.])
fi
AM_CONDITIONAL(EMULATOR, test "x$emulator" = "xyes")

if test "$multipress" = yes; then
AC_DEFINE(ENABLE_MULTIPRESS,,[Enable multipress.])
fi
AM_CONDITIONAL(MULTIPRESS, test "x$multipress" = "xyes")

if test "$maemo" = yes; then
PKG_CHECK_MODULES(MAEMO, libosso hildonmm hildon-fmmm gconfmm-2.6)
AC_DEFINE(ENABLE_MAEMO,,[Enable maemo.])

KATOOB_ICON=katoob-icon
X_OSSO_SERVICE=X-Osso-Service=org.foolab.katoob
AC_SUBST(X_OSSO_SERVICE)
else
KATOOB_ICON=katoob-icon.pmg
fi
AC_SUBST(KATOOB_ICON)

AM_CONDITIONAL(MAEMO, test "x$maemo" = "xyes")

if test "$highlight" = yes; then
PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview-2.0 >= 2.0)
AC_DEFINE(ENABLE_HIGHLIGHT,,[Enable syntax highlighting])
fi
AM_CONDITIONAL(HIGHLIGHT, test "x$highlight" = "xyes")

dnl win32
gcc_ver=$(gcc --version)

case $gcc_ver in
*mingw*)
KATOOB_CFLAGS="-mms-bitfields -mwindows $KATOOB_CFLAGS"
KATOOB_LIBS="$KATOOB_LIBS -lwsock32"
AM_CONDITIONAL(WIN32, test 1 = 1)
;;
 *)
AM_CONDITIONAL(WIN32, test 1 = 0)
;;
esac

if test "x$maemo" = "xyes" && test "x$dbus" != "xyes"; then
AC_MSG_ERROR(maemo support needss dbus.)
fi

AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)
AC_SUBST(BZ2_LIBS)

AC_OUTPUT([
katoob.desktop.in
Makefile
src/Makefile
src/pixmaps/Makefile
src/xdgmime/Makefile
po/Makefile.in
data/Makefile
data/emulator/Makefile
data/multipress/Makefile
m4/Makefile
maemo/Makefile
maemo/katoob.service
INSTALL
Doxyfile
])