File: configure.ac

package info (click to toggle)
granule 1.4.0-7-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,236 kB
  • ctags: 2,144
  • sloc: cpp: 16,030; makefile: 353
file content (289 lines) | stat: -rw-r--r-- 9,732 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
dnl ----------------------------------------------------------------------------
dnl configure.in 
dnl
dnl $Id: configure.in,v 1.59 2008/08/19 02:52:45 vlg Exp $
dnl ----------------------------------------------------------------------------

dnl Process this file with autoconf to produce a configure script.

dnl ----------------------------------------------------------------------------
dnl Package name and release number
dnl
dnl Legend:
dnl
dnl  +1 : ? : +1  == new interface that does not break old one
dnl  +1 : ? : 0   == new interface that breaks old one
dnl   ? : ? : 0   == no new interfaces, but breaks apps
dnl   ? :+1 : ?   == just some internal changes, nothing breaks but might work
dnl                  better
dnl ----------------------------------------------------------------------------

AC_INIT([granule],[1.4.0-7])

AC_SUBST([APP_VERSION],[$(echo ${VERSION}|cut --delimiter=- --field=1)])
AC_SUBST([APP_MAJOR_VERSION],[$(echo ${APP_VERSION}|cut --delimiter=. --field=1)])
AC_SUBST([APP_MINOR_VERSION],[$(echo ${APP_VERSION}|cut --delimiter=. --field=2)])
AC_SUBST([APP_MICRO_VERSION],[$(echo ${APP_VERSION}|cut --delimiter=. --field=3)])

AC_SUBST([APP_SUBVERSION],[$(echo ${APP_VERSION}|cut --delimiter=. --field=1,2)])
AC_SUBST([APP_RELEASE],[$(echo ${APP_VERSION}|cut --delimiter=. --field=1,2)])

AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_SRCDIR([src/Granule.h])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([-Wall])

dnl ----------------------------------------------------------------------------
dnl Check build environment
dnl ----------------------------------------------------------------------------
AC_CANONICAL_HOST
AC_SEARCH_LIBS([strerror],[cposix])
AC_HEADER_STDC

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_INSTALL
AC_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.23],[no-xml])
AM_SANITY_CHECK
AC_LANG([C++])

AX_CXXFLAGS_WARN_ALL

dnl ----------------------------------------------------------------------------
dnl Set PACKAGE_LOCALE_DIR in config.h.
dnl
dnl The po files are in format LL_CC.po, where LL is the language code,
dnl and CC is the coutry code. Both 'ru' and 'ru_RU' would be valid names, but
dnl the latter is more narrowly defined.
dnl
dnl To enable locale, run LANG=ru_RU appname
dnl ----------------------------------------------------------------------------
dnl
dnl

ALL_LINGUAS="ru bg de_DE ja_JP en_GB"
GETTEXT_PACKAGE=granule
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", "Gettext domain name")
AM_GLIB_GNU_GETTEXT()

dnl ----------------------------------------------------------------------------
dnl Pull in all necessary gtk2 libraries
dnl Replace with the current version number
dnl ----------------------------------------------------------------------------

PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.4.1)
AC_SUBST(GTKMM_CFLAGS)
AC_SUBST(GTKMM_LIBS)

dnl ----------------------------------------------------------------------------
dnl Pull in all necessary libxml++ libraries
dnl Replace with the current version number
dnl ----------------------------------------------------------------------------

PKG_CHECK_MODULES(XMLCPP, libxml-2.0 >= 2.6.10)
AC_SUBST(XMLCPP_CFLAGS)
AC_SUBST(XMLCPP_LIBS)

dnl ----------------------------------------------------------------------------
dnl Pick up ASSA library flags.
dnl Replace with the current version number
dnl ----------------------------------------------------------------------------

PKG_CHECK_MODULES(ASSA, assa-3.5 >= 3.5.0)
AC_SUBST(ASSA_CFLAGS)
AC_SUBST(ASSA_LIBS)

dnl ----------------------------------------------------------------------------
dnl Checks for header files.
dnl ----------------------------------------------------------------------------
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h unistd.h)

dnl ----------------------------------------------------------------------------
dnl Checks for library functions.
dnl ----------------------------------------------------------------------------
AC_CHECK_FUNCS(getcwd mkdir strerror strtol cuserid)

dnl ----------------------------------------------------------------------------
dnl Post-processing - make substitution
dnl ----------------------------------------------------------------------------

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LDFLAGS)

dnl ----------------------------------------------------------------------------
dnl We need 'prefix' variable defined - so we expedite the definition.
dnl
dnl 1) Variable `ac_default_prefix' is explicitly initialised,
dnl    as `ac_default_prefix=/usr/local'
dnl
dnl 2) Variable `prefix' is explicitly initialised, as `prefix=NONE'
dnl
dnl 3) Command line arguments are parsed; if `--prefix=value'
dnl    is specified, then variable `prefix' is redefined, as `prefix=value'
dnl 
dnl Then, at AC_OUTPUT phase, 
dnl
dnl   test "x$prefix" = xNONE && prefix=$ac_default_prefix
dnl 
dnl ----------------------------------------------------------------------------

test "x$prefix" = xNONE && prefix=$ac_default_prefix
runtime_root=$prefix

dnl ----------------------------------------------------------------------------
dnl Figure out which system we are on
dnl ----------------------------------------------------------------------------
desktop=true
hildon=false
pda=false
mingw32=false

dnl ----------------------------------------------------------------------------
dnl Check for win32 support
dnl ----------------------------------------------------------------------------

AC_ARG_ENABLE(mingw32,
    AS_HELP_STRING([--enable-mingw32],[Compile with mingw32]),[
    if test "x$enableval" = "xyes"; then
        mingw32=true
		desktop=false
		runtime_root=..
    fi
])

dnl ----------------------------------------------------------------------------
dnl Check for Hildon support (nokia 770 Internet Tablet, ARM processor)
dnl ----------------------------------------------------------------------------

HILDON_CFLAGS=""
HILDON_LIBS=""
                                                                                
AC_ARG_ENABLE(hildon,
    AS_HELP_STRING([--enable-hildon],[Compile with hildon support]),[
    if test "x$enableval" = "xyes"; then
        hildon=true
		desktop=false
		runtime_root=$prefix
    fi
])

if test "$hildon" = true ; then
	PKG_CHECK_MODULES(HILDON, [hildonmm hildon-fmmm])
	PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.23.4)
	PKG_CHECK_MODULES(OSSO, osso-af-settings >= 0.8.5 libosso >= 0.9.17 gnome-vfs-2.0 >= 2.8.4.11 gnome-vfs-module-2.0 >= 2.8.4.11)
	PKG_CHECK_MODULES(GCONF, gconf-2.0)
fi

AC_SUBST(HILDON_CFLAGS)
AC_SUBST(HILDON_LIBS)
AC_SUBST(DBUS_LIBS)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(OSSO_LIBS)
AC_SUBST(OSSO_CFLAGS)
AC_SUBST(GCONF_LIBS)
AC_SUBST(GCONF_CFLAGS)

dnl ----------------------------------------------------------------------------
dnl Check for OpenEmbedded (GPE-based 320x240 PDAs)
dnl ----------------------------------------------------------------------------

AC_ARG_ENABLE(pda,
    AS_HELP_STRING([--enable-pda],[Compile with OpenEmbedded PDA support]),[
    if test "x$enableval" = "xyes"; then
        pda=true
		desktop=false
    fi
])
                                                 
AM_CONDITIONAL(USE_DESKTOP, $desktop)
AM_CONDITIONAL(USE_WIN32,   $mingw32)
AM_CONDITIONAL(USE_HILDON,  $hildon)
AM_CONDITIONAL(USE_PDA,     $pda)

dnl ----------------------------------------------------------------------------
dnl These definitions are used by hildon/Makefile.am
dnl ----------------------------------------------------------------------------

dnl desktopentrydir: /usr/share/applications/hildon
desktopentrydir=`$PKG_CONFIG osso-af-settings --variable=desktopentrydir`

dnl DBUS-1
serviceentrydir=/usr/share/dbus-1/services

icon_26x26dir=$datadir/icons/hicolor/26x26/hildon
icon_34x34dir=$datadir/icons/hicolor/34x34/hildon
icon_40x40dir=$datadir/icons/hicolor/40x40/hildon
icon_50x50dir=$datadir/icons/hicolor/50x50/hildon
icon_scalabledir=$datadir/icons/hicolor/scalable/hildon

AC_SUBST(desktopentrydir)
AC_SUBST(serviceentrydir)
AC_SUBST(icon_26x26dir)
AC_SUBST(icon_34x34dir)
AC_SUBST(icon_40x40dir)
AC_SUBST(icon_50x50dir)
AC_SUBST(icon_scalabledir)

dnl-----------------------------------------------------------------------------
dnl runtime_{}dir is where the executable looks for the data files at runtime.
dnl pkg_{}dir is where the data files are installed.
dnl-----------------------------------------------------------------------------

AC_SUBST(runtime_root)                                

dnl Points to where executable shall look for data files at runtime

runtime_datadir=$runtime_root/share/$PACKAGE/
runtime_xmldir=$runtime_root/share/$PACKAGE/xml

AC_SUBST(runtime_datadir)
AC_SUBST(runtime_xmldir)

dnl Points to where data files are installed, relative to --prefix=PATH

dnl This breaks for some reason RPM packaging (???)
dnl
dnl pkg_datadir=$prefix/share/$PACKAGE/
dnl pkg_xmldir=$prefix/share/$PACKAGE/xml

pkg_datadir=${datadir}/$PACKAGE/
pkg_xmldir=${datadir}/$PACKAGE/xml

AC_SUBST(pkg_datadir)
AC_SUBST(pkg_xmldir)

dnl ----------------------------------------------------------------------------
dnl Add OS-specific libraries
dnl ----------------------------------------------------------------------------
case "$host_os" in
	*mingw*)
		WIN32_EXTRA_LIBADD="-lwinmm -mwindows"
		AC_MSG_RESULT(detected mingw32 env: added -lwinmm -mwindows to LDFLAGS)
		;;
esac

AC_SUBST(WIN32_EXTRA_LIBADD)

dnl ----------------------------------------------------------------------------
dnl Generate Make files
dnl ----------------------------------------------------------------------------

AC_CONFIG_FILES([
Makefile 
granule.spec
granule.desktop
src/Makefile 
pixmaps/Makefile
po/Makefile.in
hildon/Makefile
])
AC_OUTPUT