Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 283 lines (249 sloc) 8.844 kb
2c43f4ec »
2011-12-27 Initial commit
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.62)
fc860aa4 »
2012-06-15 Bump version to 0.3
3 AC_INIT([liblangtag], 0.3, [http://github.com/tagoh/liblangtag/issues])
2c43f4ec »
2011-12-27 Initial commit
4
5 . `dirname $0`/requires
6
7 AM_INIT_AUTOMAKE([1.11 -Wno-portability])
2a0ff17e »
2012-02-28 Enable the silent build rules by default
8 dnl Support silent build rules, requires at least automake-1.11.
9 dnl Enable by either passing --enable-silent-rules to configure or
10 dnl passing V=0 to make.
11 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12
2c43f4ec »
2011-12-27 Initial commit
13 AM_MAINTAINER_MODE
14 AM_CONFIG_HEADER([config.h])
15 AC_CONFIG_MACRO_DIR([m4macros])
16
17 AC_PROG_LIBTOOL
18 AC_PROG_CC
19
20 GNOME_COMPILE_WARNINGS
21
22 GNOME_COMMON_INIT
23 GNOME_DEBUG_CHECK
24 GNOME_MAINTAINER_MODE_DEFINES
25
26 CFLAGS="$CFLAGS $WARN_CFLAGS"
27
28 dnl ======================================================================
29 dnl Libraries versioning
30 dnl ======================================================================
31 dnl Quote from Updating library version information at libtool.info
32 dnl and renumbering
33 dnl
34 dnl 1. Update the version information only immediately before a public
35 dnl release of your software. More frequent updates are unnecessary,
36 dnl and only guarantee that the current interface number gets larger
37 dnl faster.
38 dnl 2. If the library source code has changed at all since the last
39 dnl update, then increment REVISION (`C:R:A' becomes `C:r+1:A')
40 dnl 3. If any interfaces have been added, removed, or changed since the
41 dnl last update, increment CURRENT, and set REVISION to 0.
42 dnl 4. If any interfaces have been added since the last public release,
43 dnl then increment AGE.
44 dnl 5. If any interfaces have been removed since the last public release,
cdd35c2d »
2012-02-02 missing changes for extension support
45 dnl then set CURRENT to the so number +1 and set AGE to 0.
2c43f4ec »
2011-12-27 Initial commit
46 dnl
47
6c5fdca7 »
2012-01-11 Add gobject-introspection support
48 dnl for liblangtag.la
a6de293e »
2012-06-15 Bump the libtool revision
49 LT_CURRENT=2
2c43f4ec »
2011-12-27 Initial commit
50 LT_REVISION=0
a6de293e »
2012-06-15 Bump the libtool revision
51 LT_AGE=2
2c43f4ec »
2011-12-27 Initial commit
52
53 AC_SUBST(LT_CURRENT)
54 AC_SUBST(LT_REVISION)
55 AC_SUBST(LT_AGE)
56
6c5fdca7 »
2012-01-11 Add gobject-introspection support
57 dnl for liblangtag-gobject.la
a6de293e »
2012-06-15 Bump the libtool revision
58 LT_G_CURRENT=2
2c43f4ec »
2011-12-27 Initial commit
59 LT_G_REVISION=0
a6de293e »
2012-06-15 Bump the libtool revision
60 LT_G_AGE=2
2c43f4ec »
2011-12-27 Initial commit
61
62 AC_SUBST(LT_G_CURRENT)
63 AC_SUBST(LT_G_REVISION)
64 AC_SUBST(LT_G_AGE)
65
66 dnl ======================================================================
67 dnl define variables
68 dnl ======================================================================
cdd35c2d »
2012-02-02 missing changes for extension support
69 LANGTAG_MODULEDIR="${libdir}/liblangtag"
70 AC_SUBST(LANGTAG_MODULEDIR)
2c43f4ec »
2011-12-27 Initial commit
71
0a1d171e »
2012-10-05 another try to clean up glib dependencies
72 dnl check for flavours of varargs macros
73 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
74 _save_cflags=$CFLAGS
75 CFLAGS=$(sed -e 's/\-Werror//g')
76 AC_TRY_COMPILE([],[
77 int a(int p1, int p2, int p3);
78 #define call_a(...) a(1,__VA_ARGS__)
79 call_a(2,3);
80 ],[have_iso_c_varargs=yes;AC_DEFINE(LT_HAVE_ISO_VARARGS, 1, [Use ISO C99 varargs])],[have_iso_c_varargs=no])
81 CFLAGS=$_save_cflags
82 AC_MSG_RESULT($have_iso_c_varargs)
83
84 AC_MSG_CHECKING(for GNUC varargs macros)
85 _save_cflags=$CFLAGS
86 CFLAGS=$(sed -e 's/\-Werror//g')
87 AC_TRY_COMPILE([],[
88 int a(int p1, int p2, int p3);
89 #define call_a(params...) a(1,params)
90 call_a(2,3);
91 ],[have_gnuc_varargs=yes;AC_DEFINE(LT_HAVE_GNUC_VARARGS, 1, [Use GNUC varargs macro])],[have_gnuc_varargs=no])
92 CFLAGS=$_save_cflags
93 AC_MSG_RESULT($have_gnuc_varargs)
94
95 dnl inline
96 AC_CACHE_CHECK([for __inline],lt_cv_has__inline,[
97 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
98 __inline int foo(void);
99 __inline int foo() {return 0;}
100 int main() {return foo();}
101 ]])],
102 lt_cv_has__inline=yes,
103 lt_cv_has__inline=no,)
104 ])
105 case x$lt_cv_has__inline in
106 xyes)
107 AC_DEFINE(LT_HAVE___INLINE,1,[Have __inline keyword])
108 esac
109 AC_CACHE_CHECK([for __inline__],lt_cv_has__inline__,[
110 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
111 __inline__ int foo(void);
112 __inline__ int foo() {return 0;}
113 int main() {return foo();}
114 ]])],
115 lt_cv_has__inline__=yes,
116 lt_cv_has__inline__=no,)
117 ])
118 case x$lt_cv_has__inline__ in
119 xyes)
120 AC_DEFINE(LT_HAVE___INLINE__,1,[Have __inline__ keyword])
121 esac
122 AC_CACHE_CHECK([for inline],lt_cv_hasinline,[
123 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
124 #undef inline
125 inline int foo(void);
126 inline int foo() {return 0;}
127 int main() {return foo();}
128 ]])],
129 lt_cv_hasinline=yes,
130 lt_cv_hasinline=no,)
131 ])
132 case x$lt_cv_hasinline in
133 xyes)
134 AC_DEFINE(LT_HAVE_INLINE,1,[Have inline keyword])
135 esac
136 AC_MSG_CHECKING(if inline functions in headers work)
137 AC_LINK_IFELSE([AC_LANG_SOURCE([[
138 #if defined (LT_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
139 #undef inline
140 #define inline __inline__
141 #elif !defined (LT_HAVE_INLINE)
142 #undef inline
143 #if defined (LT_HAVE___INLINE__)
144 #define inline __inline__
145 #elif defined (LT_HAVE___INLINE)
146 #define inline __inline
147 #endif
148 #endif
149
150 int lt_test_func2(int);
151
152 static inline int
153 lt_test_func1(void) {
154 return lt_test_func2(1);
155 }
156 int main(void) {int i = 1; return --i;}]])],[lt_can_inline=yes;AC_DEFINE(LT_CAN_INLINE, 1, [Wheter inline statement can be used])],[lt_can_inline=no])
157 AC_MSG_RESULT($lt_can_inline)
158
159 dnl ---alignment---
160 AC_CHECK_ALIGNOF(void *)
161
2c43f4ec »
2011-12-27 Initial commit
162 dnl ======================================================================
163 dnl functions testing
164 dnl ======================================================================
165
166 dnl ======================================================================
167 dnl gettext stuff
168 dnl ======================================================================
169 GETTEXT_PACKAGE=$PACKAGE
170 AC_SUBST(GETTEXT_PACKAGE)
171 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
172
173 AM_GLIB_GNU_GETTEXT
174
175 dnl ======================================================================
176 dnl options
177 dnl ======================================================================
a40168c8 »
2012-09-05 Add --disable-test configure option
178 AC_ARG_WITH([locale-alias],
179 [AC_HELP_STRING([--with-locale-alias], [set the path to licale.alias])],
180 [with_locale_alias="$withval"],
181 [with_locale_alias="${localedir}/locale.alias"])
182 AC_ARG_ENABLE([rebuild-locale-alias],
183 [AC_HELP_STRING([--disable-rebuild-locale-alias],
184 [disable rebuilding the locale.alias mapping table])],
185 [enable_rebuild_locale_alias="$enableval"],
186 [enable_rebuild_locale_alias=yes])
187 AC_ARG_ENABLE([test],
188 [AC_HELP_STRING([--disable-test], [Disable tests])],
189 [enable_test="$enableval"],
190 [enable_test=yes])
b2981ba8 »
2012-03-16 Deal with the locale alias in lt_tag_convert_from_locale()
191
192 dnl ======================================================================
193 dnl options - locale-alias
194 dnl ======================================================================
195 AC_MSG_CHECKING(existence of locale.alias)
8f6b3815 »
2012-09-21 Fix failing of locale.alias file detection
196 if test "x$with_locale_alias" = xyes; then
b2981ba8 »
2012-03-16 Deal with the locale alias in lt_tag_convert_from_locale()
197 with_locale_alias="${localedir}/locale.alias"
198 fi
8f6b3815 »
2012-09-21 Fix failing of locale.alias file detection
199 ac_lt_file="$with_locale_alias"
200 ac_lt_file_old=""
201
202 while test "$ac_lt_file_old" != "$ac_lt_file"; do
203 ac_lt_file_old="$ac_lt_file"
204 eval ac_lt_file="\"$ac_lt_file\""
205 done
206 if [[ -f "$ac_lt_file" ]]; then
b2981ba8 »
2012-03-16 Deal with the locale alias in lt_tag_convert_from_locale()
207 AC_MSG_RESULT($with_locale_alias)
208 LOCALE_ALIAS=$with_locale_alias
209 AC_SUBST(LOCALE_ALIAS)
210 else
211 AC_MSG_RESULT([Using the prebuilt table])
212 fi
213
214 dnl ======================================================================
215 dnl options - rebuild-locale-alias
216 dnl ======================================================================
217 BUILD_LOCALEALIAS=\#
8faf54b2 »
2012-06-15 Fix distcheck fail
218 if test "x$enable_rebuild_locale_alias" = "xyes" -a "x$LOCALE_ALIAS" != "x"; then
b2981ba8 »
2012-03-16 Deal with the locale alias in lt_tag_convert_from_locale()
219 BUILD_LOCALEALIAS=
220 fi
221 AC_SUBST(BUILD_LOCALEALIAS)
2c43f4ec »
2011-12-27 Initial commit
222
223 dnl ======================================================================
a40168c8 »
2012-09-05 Add --disable-test configure option
224 dnl check pkg-config stuff
225 dnl ======================================================================
226 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
227 PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= $GOBJECT_REQUIRED, has_gobject=yes, has_gobject=no)
228 PKG_CHECK_MODULES(GMODULE, gmodule-2.0, has_gmodule=yes, has_gmodule=no)
229
230 if test x$enable_test != xno; then
231 PKG_CHECK_MODULES(CHECK, check >= $CHECK_REQUIRED,
232 [use_check="yes"],
233 [use_check="no"])
234 else
235 use_check=no
236 fi
237
238 if test x$has_gmodule != xno; then
239 AC_DEFINE(ENABLE_GMODULE,, [Using gmodule])
240 fi
241 AM_CONDITIONAL(ENABLE_GMODULE, test x$has_gmodule != xno)
242 AM_CONDITIONAL(ENABLE_GOBJECT, test x$has_gobject != xno)
243 AM_CONDITIONAL(ENABLE_UNIT_TEST, test x$use_check != xno)
244
245 dnl ======================================================================
246 dnl check another libraries
247 dnl ======================================================================
248 AM_PATH_GLIB_2_0($GLIB_REQUIRED, :,
249 AC_MSG_ERROR([
250 *** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
251 *** GLIB is always available from ftp://ftp.gtk.org/.]),
252 glib)
253
254 GOBJECT_INTROSPECTION_CHECK([1.30.0])
255 GTK_DOC_CHECK(1.0)
256
257 dnl ======================================================================
2c43f4ec »
2011-12-27 Initial commit
258 dnl output
259 dnl ======================================================================
260 AC_CONFIG_FILES([
261 Makefile
0a78793f »
2012-01-06 Add extlang database handler
262 data/Makefile
f0e15856 »
2012-01-18 Generate document from gtk-doc
263 docs/Makefile
264 docs/version.xml
6c5fdca7 »
2012-01-11 Add gobject-introspection support
265 liblangtag/Makefile
cdd35c2d »
2012-02-02 missing changes for extension support
266 liblangtag/extensions/Makefile
6c5fdca7 »
2012-01-11 Add gobject-introspection support
267 liblangtag-gobject/Makefile
2c43f4ec »
2011-12-27 Initial commit
268 liblangtag.pc
269 liblangtag-uninstalled.pc
270 liblangtag-gobject.pc
271 liblangtag-gobject-uninstalled.pc
272 tests/Makefile
273 ])
274 AC_OUTPUT
275
276 dnl ======================================================================
277 dnl result
278 dnl ======================================================================
279 echo ""
280 echo "========== Build Information =========="
281 echo " CFLAGS: $CFLAGS"
282 echo " LDFLAGS: $LDFLAGS"
Something went wrong with that request. Please try again.