File: configure.ac

package info (click to toggle)
gucharmap 1%3A9.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,960 kB
  • ctags: 1,428
  • sloc: ansic: 8,325; sh: 4,104; perl: 788; makefile: 423; xml: 126
file content (338 lines) | stat: -rw-r--r-- 10,838 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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# Copyright © 2003  Noah Levitt
# Copyright © 2007, 2008, 2009 Christian Persch
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02110-1301  USA

m4_define([gucharmap_version_major],[9])
m4_define([gucharmap_version_minor],[0])
m4_define([gucharmap_version_micro],[2])
m4_define([gucharmap_version_extra],[])
m4_define([gucharmap_version],[gucharmap_version_major.gucharmap_version_minor.gucharmap_version_micro()gucharmap_version_extra])

# Before making a release, the libtool version should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
m4_define([gucharmap_lt_current],[7])
m4_define([gucharmap_lt_revision],[0])
m4_define([gucharmap_lt_age],[0])
m4_define([gucharmap_lt_version_info],[gucharmap_lt_current:gucharmap_lt_revision:gucharmap_lt_age])
m4_define([gucharmap_lt_current_minus_age],[m4_eval(gucharmap_lt_current - gucharmap_lt_age)])

AC_PREREQ([2.56])

AC_INIT([GNOME Character Map],[gucharmap_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gucharmap],[gucharmap])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([gucharmap/gucharmap.h.in])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2 no-dist-gzip])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

# checks for progs

GNOME_DEBUG_CHECK

AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.40.0])

AM_PROG_CC_C_O

# User documentation
YELP_HELP_INIT([no-lc-media-links no-lc-dist])

GLIB_REQUIRED=2.32.0
GIO_REQUIRED=2.32.0

# check for win32
case "$host" in
  *-*-mingw*) os_win32="yes" ;; 
  *) os_win32="no" ;; 
esac

if test "x$os_win32" = "xyes"
then
    CFLAGS="$CFLAGS -mms-bitfields -mwindows"
fi
AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")

# Which gtk+ API version to compile against

AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
  [AS_HELP_STRING([--with-gtk=3.0],[which gtk+ version to compile against (default: 3.0)])],
  [case "$with_gtk" in
     3.0) ;;
     2.0) AC_MSG_ERROR([unsupported gtk version $with_gtk specified]) ;;
     *) AC_MSG_ERROR([invalid gtk version $with_gtk specified]) ;;
   esac],
  [with_gtk=3.0])
AC_MSG_RESULT([$with_gtk])

case "$with_gtk" in
  3.0) GTK_API_VERSION=3.0
       GTK_REQUIRED=3.4.0
       GUCHARMAP_API_VERSION=2.90
       GUCHARMAP_API_MAJOR_VERSION=2
       GUCHARMAP_API_MINOR_VERSION=90
       GUCHARMAP_API_PC_VERSION=2.90
       GUCHARMAP_LIBRARY_SUFFIX="-$GUCHARMAP_API_VERSION"
       ;;
esac

AC_SUBST([GTK_API_VERSION])
AC_SUBST([GUCHARMAP_API_VERSION])
AC_SUBST([GUCHARMAP_API_VERSION_U],[AS_TR_SH([$GUCHARMAP_API_VERSION])])
AC_SUBST([GUCHARMAP_API_MAJOR_VERSION])
AC_SUBST([GUCHARMAP_API_MINOR_VERSION])
AC_SUBST([GUCHARMAP_API_PC_VERSION])
AC_SUBST([GUCHARMAP_LIBRARY_SUFFIX_U],[AS_TR_SH([$GUCHARMAP_LIBRARY_SUFFIX])])

AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])


PKG_CHECK_MODULES([GTK],[
  glib-2.0 >= $GLIB_REQUIRED
  gio-2.0 >= $GIO_REQUIRED
  gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
])

GLIB_GENMARSHAL="$($PKG_CONFIG --variable=glib_genmarshal glib-2.0)"
AC_SUBST([GLIB_GENMARSHAL])
GLIB_MKENUMS="$($PKG_CONFIG --variable=glib_mkenums glib-2.0)"
AC_SUBST([GLIB_MKENUMS])

GLIB_GSETTINGS

AC_MSG_CHECKING([whether to build the charmap programme])
AC_ARG_ENABLE([charmap],
  [AS_HELP_STRING([--disable-charmap],[disable building the charmap programme])],
  [],[enable_charmap=yes])
AC_MSG_RESULT([$enable_charmap])

AM_CONDITIONAL([ENABLE_CHARMAP],[test "$enable_charmap" = "yes"])

# checks for funcs 
AC_CHECK_FUNCS([bind_textdomain_codeset])

AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

# Some utilities
AC_PROG_LN_S
AC_PROG_SED

AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[the glib-compile-resources programme])
if test -z "$GLIB_COMPILE_RESOURCES"; then
  AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[false])
  if test "$GLIB_COMPILE_RESOURCES" = "false"; then
      AC_MSG_ERROR([glib-compile-resources not found])
  fi
fi

AC_ARG_VAR([XMLLINT],[the xmllint programme])
if test -z "$XMLLINT"; then
  AC_PATH_PROG([XMLLINT],[xmllint],[false])
  if test "$XMLLINT" = "false"; then
    AC_MSG_ERROR([xmllint not found])
  fi
fi

AC_ARG_VAR([DESKTOP_FILE_VALIDATE],[the desktop-file-validate programme])
if test -z "$DESKTOP_FILE_VALIDATE"; then
  AC_PATH_PROG([DESKTOP_FILE_VALIDATE],[desktop-file-validate],[])
  if test -z "$DESKTOP_FILE_VALIDATE"; then
    AC_MSG_ERROR([desktop-file-validate not found])
  fi
fi

# Unicode data

AC_MSG_CHECKING([for Unicode data])
AC_ARG_WITH([unicode-data],
        [AS_HELP_STRING([--with-unicode-data=PATH],[Specify absolute directory where the Unicode data files reside. If 'download', downloads the files to the build directory.])],
        [case "$withval" in
           download) unicodedatadir='${builddir}'
                     with_provided_unicode_data="download"
                     ;;
	   yes|no) AC_MSG_ERROR([You need to specify the path to the unicode data files with --with-unicode-data=PATH, or use
--with-unicode-data=download to download the data files during the build process.])
                   ;;
           *) unicodedatadir="$(readlink -f $withval)"
              with_provided_unicode_data="yes (from $unicodedatadir)"
              ;;
         esac],
        [AC_MSG_ERROR([You need to specify the path to the unicode data files with --with-unicode-data=PATH, or use
--with-unicode-data=download to download the data files during the build process.])])
AC_MSG_RESULT([$with_provided_unicode_data])

AM_CONDITIONAL([WITH_UNICODE_DATA],[test "$with_provided_unicode_data" != "download"])
AC_SUBST([unicodedatadir])

# If we don't have a directory where we can find Unicode data in, we need to download it.
# For that, we need some utilities

# Note! Not using UNZIP as variable name here since unzip itself
# uses the UNZIP env var and interprets it as its options.
AC_ARG_VAR([PROG_UNZIP],[the unzip programme])
if test -z "$PROG_UNZIP"; then
  AC_PATH_PROG([PROG_UNZIP],[unzip],[false])
  if test "$PROG_UNZIP" = "false"; then
      AC_MSG_ERROR([unzip not found])
  fi
fi

AC_ARG_VAR([WGET],[the wget programme])
if test -z "$WGET"; then
  AC_PATH_PROG([WGET],[wget],[false])
  if test "$with_provided_unicode_data" = "download" -a "$WGET" = "false"; then
      AC_MSG_ERROR([wget not found])
  fi
fi

AC_ARG_VAR([SHA512SUM],[the sha512sum programme])
if test -z "$SHA512SUM"; then
  AC_PATH_PROGS([SHA512SUM],[gsha512sum sha512sum],[false])
  if test "$with_provided_unicode_data" = "download" -a "$WGET" = "false"; then
    AC_MSG_ERROR([sha512sum not found])
  fi
fi

# ****
# i18n
# ****

GETTEXT_PACKAGE=gucharmap
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gucharmap gettext domain])
AM_GLIB_GNU_GETTEXT

##########################################################
# Check for -Bsymbolic-functions linker flag used to avoid
# intra-library PLT jumps, if available.
##########################################################

AC_ARG_ENABLE([Bsymbolic],
  [AS_HELP_STRING([--disable-Bsymbolic],
                  [disable linking with -Bsymbolic])],
  [],[enable_Bsymbolic=yes])

BSYMBOLIC_LDFLAG=
if test "$enable_Bsymbolic" != "no"; then
  CC_CHECK_LDFLAGS(["-Wl,-Bsymbolic-functions"],
    [BSYMBOLIC_LDFLAG="-Wl,-Bsymbolic-functions"],
    [if test "$enable_Bsymbolic" = "auto"; then
       AC_MSG_WARN([-Bsymbolic not supported by ld; disabling])
       enable_Bsymbolic=no
     else
       AC_MSG_ERROR([-Bsymbolic requested but not supported by ld. Use --disable-Bsymbolic to disable])
     fi])
fi

AC_SUBST([BSYMBOLIC_LDFLAG])

# ***********
# Compilation
# ***********

CC_CHECK_CFLAGS_APPEND([ \
  -Wall -Wextra \
  -Wformat-nonliteral -Werror=format-security \
  -Wsign-compare -Werror=implicit-function-declaration \
  -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
  -Waggregate-return -Wcast-align -Wimplicit -Wuninitialized \
  -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
  -Wpacked -Wmissing-format-attribute -Wshadow \
  -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
  -Wdeclaration-after-statement -Wold-style-definition \
  -Wno-missing-field-initializers -Wno-unused-parameter \
  -Wformat-signedness \
  -fno-common -fno-strict-aliasing -Wno-switch-enum])

# ********
# Bindings
# ********

# No automagic please!
if test -z "$enable_introspection"; then
  enable_introspection=yes
fi

GOBJECT_INTROSPECTION_CHECK([0.9.0])

# No automagic please!
if test -z "$enable_vala"; then
  enable_vala=no
fi
m4_ifdef([VAPIGEN_CHECK],
  [VAPIGEN_CHECK([0.16])],
  [AM_CONDITIONAL([ENABLE_VAPIGEN],[false])])

case "$with_gtk" in
  3.0) GUCHARMAP_GIR_VERSION=$GUCHARMAP_API_VERSION
       GUCHARMAP_VAPI_VERSION=$GUCHARMAP_API_VERSION
       ;;
esac

AC_SUBST([GUCHARMAP_GIR_VERSION])
AC_SUBST([GUCHARMAP_GIR_VERSION_U],[AS_TR_SH([$GUCHARMAP_GIR_VERSION])])
AC_SUBST([GUCHARMAP_VAPI_VERSION])
AC_SUBST([GUCHARMAP_VAPI_VERSION_U],[AS_TR_SH([$GUCHARMAP_VAPI_VERSION])])

# ***************
# API & User Docs
# ***************

GTK_DOC_CHECK([1.0])

# *****************************************************************************

AC_SUBST([GUCHARMAP_VERSION_MAJOR],[gucharmap_version_major])
AC_SUBST([GUCHARMAP_VERSION_MINOR],[gucharmap_version_minor])
AC_SUBST([GUCHARMAP_VERSION_MICRO],[gucharmap_version_micro])
AC_SUBST([LIBGUCHARMAP_LT_VERSION],[gucharmap_lt_version_info])
AC_SUBST([LIBGUCHARMAP_LT_CURRENT_MINUS_AGE],[gucharmap_lt_current_minus_age])

AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])

AC_CONFIG_FILES([
Makefile
gucharmap.desktop.in
gucharmap.nsi
gucharmap.spec
data/Makefile
docs/Makefile
docs/reference/Makefile
gucharmap/Makefile
gucharmap/gucharmap.gresource.xml
gucharmap/gucharmap.h
help/Makefile
pixmaps/Makefile
po/Makefile.in
])

AC_CONFIG_FILES([gucharmap-${GUCHARMAP_API_PC_VERSION}.pc:gucharmap.pc.in],[GUCHARMAP_API_PC_VERSION=$GUCHARMAP_API_PC_VERSION])

AC_OUTPUT