File: configure.in

package info (click to toggle)
libgsf 1.14.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,644 kB
  • ctags: 3,140
  • sloc: ansic: 16,511; sh: 9,076; xml: 6,155; makefile: 454; perl: 35; python: 13
file content (418 lines) | stat: -rw-r--r-- 12,150 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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
-*- mode: m4 -*-
dnl We require Automake 1.7.1, which requires Autoconf 2.54.
AC_PREREQ(2.54)

m4_define([libgsf_version_major], [1])
m4_define([libgsf_version_minor], [14])
m4_define([libgsf_version_micro], [3])
m4_define([libgsf_version_extra], [])
m4_define([libgsf_full_version],
    [libgsf_version_major.libgsf_version_minor.libgsf_version_micro[]libgsf_version_extra])

AC_INIT(libgsf, [libgsf_full_version],
	[http://bugzilla.gnome.org/enter_bug.cgi?product=libgsf])
AC_CONFIG_SRCDIR(gsf/gsf.h)
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")

AC_SUBST(LIBGSF_MAJOR_VERSION, libgsf_version_major)
AC_SUBST(LIBGSF_MINOR_VERSION, libgsf_version_minor)
AC_SUBST(LIBGSF_MICRO_VERSION, libgsf_version_micro)

dnl Version info for libraries = CURRENT:REVISION:AGE
dnl
dnl Within each x.y.*, ABI is maintained backward and _forward_ compatible.
dnl (As a consequence, no exported function may be added.)
dnl So it's enough to have one interface number per each x.y.* branch.
dnl
dnl OTOH, we are not able to keep ABI strictly backward compatible throughout
dnl the whole x.*.*.
dnl The easiest way is to declare no ABI compatibility, ie. AGE is always 0.
dnl
m4_define([version_iface],
	m4_eval(100 * libgsf_version_major + libgsf_version_minor))

AC_SUBST([VERSION_INFO], [version_iface:libgsf_version_micro:0])
AC_SUBST([CURRENT_MINUS_AGE], m4_eval(version_iface - 0))

AM_INIT_AUTOMAKE(dist-bzip2)

AC_CONFIG_HEADERS(gsf-config.h)
AM_MAINTAINER_MODE

dnl Propagate Gnome-specific variable ACLOCAL_FLAGS to Makefile.
AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL

AC_FUNC_FSEEKO
AC_SYS_LARGEFILE
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

dnl Gettext/i18n stuff

AC_PROG_INTLTOOL

ALL_LINGUAS="es sv"

AM_GLIB_GNU_GETTEXT

GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])

dnl Checks for libraries.
ifelse([
  If we defined the module lists on the M4 level, we could have problems
  with PKG_CHECK_MODULES from pkgconfig 0.16.0, which double quotes its
  second argument (the module list).
  As a handy workaround, we use shell variables.
])
dnl Modules common to libgsf and libgsf-gnome
libgsf_reqs="
    gobject-2.0 >= 2.6.0
    glib-2.0 >= 2.6.0
    libxml-2.0 >= 2.4.16
"
dnl Modules required for libgsf-gnome
libgsf_gnome_reqs="
    $libgsf_reqs
    libbonobo-2.0 >= 2.0.0
    gnome-vfs-2.0 >= 2.2.0
    gnome-vfs-module-2.0 >= 2.2.0
"
PKG_CHECK_MODULES(LIBGSF, $libgsf_reqs)

## this should come after `AC_PROG_CC'
ifdef([GNOME_COMPILE_WARNINGS],[GNOME_COMPILE_WARNINGS],)
CFLAGS="$CFLAGS $WARN_CFLAGS -DG_DISABLE_DEPRECATED"
if test "$GCC" = "yes"; then
	for option in -Wno-system-headers -Wfloat-equal -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wformat -Wnested-externs -Winline -Wdeclaration-after-statement -Wundef -W -Wmissing-noreturn -Wmissing-format-attribute -Wno-pointer-sign; do
		SAVE_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS $option"
		AC_MSG_CHECKING([whether gcc understands $option])
		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
			has_option=yes,
			has_option=no)
		if test $has_option = no; then
		  CFLAGS="$SAVE_CFLAGS"
		fi
		AC_MSG_RESULT($has_option)
		unset has_option
		unset SAVE_CFLAGS
	done
	unset option
fi

AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
if test $fdopen_works = no ; then
	unset ac_cv_have_decl_fdopen
	CFLAGS="$CFLAGS -D_POSIX_SOURCE"
	AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
	AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
	if test $fdopen_works = no ; then
		AC_MSG_ERROR([fdopen is not available])
	fi
fi

# Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
AC_MSG_CHECKING([whether struct timeval is available])
for try in 1 2; do
	AC_COMPILE_IFELSE(
		[AC_LANG_PROGRAM(
			[[#include <sys/time.h>]],
			[[struct timeval tv;]])],
		struct_timeval_works=yes,
		struct_timeval_works=no)
	test $struct_timeval_works = yes && break
	# Try this for the second attempt:
	test $try = 1 && CFLAGS="$CFLAGS -D__EXTENSIONS__"
done
AC_MSG_RESULT($struct_timeval_works)
if test $struct_timeval_works = no ; then
	AC_MSG_ERROR([struct timeval is not available])
fi

AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for caddr_t])
AC_COMPILE_IFELSE(
	[AC_LANG_PROGRAM([[#include <sys/types.h>]], [[caddr_t ca]])],
	need_bsd1=no,
	need_bsd1=yes)
AC_MSG_RESULT($need_bsd1)

AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for lstat])
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>]],
[[void *ptr = &lstat]])],
need_bsd2=no, need_bsd2=yes)
AC_MSG_RESULT($need_bsd2)
if test $need_bsd1 = yes -o $need_bsd2 = yes; then
	CFLAGS="$CFLAGS -D_BSD_SOURCE"
fi

AC_TYPE_MODE_T
AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h io.h)
AC_FUNC_MMAP

AC_CHECK_FUNCS(chown)

AC_CHECK_FUNCS(gmtime_r, [],
	       [AC_CHECK_FUNCS(gmtime,
	       		       [AC_MSG_WARN(*** Please note that gmtime_r() is missing and I will use gmtime() which is not thread safe ***)],
			       [AC_MSG_ERROR([Neither gmtime_r or gmtime is available])])])

AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,,
[#include <time.h>])

SAVE_CFLAGS=$CFLAGS
SAVE_LIBS=$LIBS
CFLAGS="$CFLAGS $LIBGSF_CFLAGS"
LIBS="$LIBGSF_LIBS $LIBS"
AC_MSG_CHECKING([for g_chmod])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <glib/gstdio.h>]], [[(void)g_chmod("/xxx",0777);]])],
               [AC_DEFINE(HAVE_G_CHMOD, 1, [Define if g_chmod is available as macro or function])
		AC_MSG_RESULT(yes)],
	       [AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for g_access])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <glib/gstdio.h>]], [[(void)g_access("/xxx",0777);]])],
               [AC_DEFINE(HAVE_G_ACCESS, 1, [Define if g_access is available as macro or function])
		AC_MSG_RESULT(yes)],
	       [AC_MSG_RESULT(no)])
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS

AC_MSG_CHECKING([whether macro S_ISREG is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/stat.h>]],
[[S_ISREG(S_IFMT);]])],
	[macro_s_isreg=yes],
	[AH_TEMPLATE([S_ISREG], [Define S_ISREG if stat.h doesn't])
	 AC_DEFINE([S_ISREG(m)], [(((m) & S_IFMT) == S_IFREG)])
	 macro_s_isreg=no])
AC_MSG_RESULT($macro_s_isreg)

AC_MSG_CHECKING([for Win32 platform])
with_win32=no
case $host_os in
  mingw* | pw32* | cygwin*)
    with_win32=yes
    AC_ARG_VAR(WINDRES, [The windres executable (used by win32 builds only).])
    AC_CHECK_TOOL(WINDRES, windres)
    AC_ARG_VAR(LIBEXE, [The lib.exe executable (used by win32 builds only).])
    AC_CHECK_PROG(LIBEXE, lib.exe, yes, no)
    ;;
esac
AC_MSG_RESULT($with_win32)
AM_CONDITIONAL(WITH_WIN32, test $with_win32 = yes)
AM_CONDITIONAL(HAVE_LIBEXE, test x$LIBEXE = xyes)
AM_CONDITIONAL(CROSS_COMPILING, test x"$cross_compiling" != "xno")

##################################################
# Checks for gtk-doc and docbook-tools
##################################################
gtk_doc_installed=true
#ifdef([GTK_DOC_CHECK],[GTK_DOC_CHECK([1.0])],[gtk_doc_installed=false])
# I would have liked to conditionalize this, but 
# that appears to break other things http://bugzilla.gnome.org/show_bug.cgi?id=156399
GTK_DOC_CHECK([1.0])
AM_CONDITIONAL(GTK_DOC_INSTALLED, $gtk_doc_installed)

dnl ***********************************************************************************
# Check for zlib.
_cppflags=$CPPFLAGS
_ldflags=$LDFLAGS

Z_DIR= Z_LIBS= Z_CPPFLAGS=

AC_ARG_WITH(zlib,
        [[  --with-zlib=DIR       use libz in DIR]],
        [case $withval in
         yes|no) ;;
         *)     Z_DIR=$withval
                CPPFLAGS="${CPPFLAGS} -I$withval/include"
                LDFLAGS="${LDFLAGS} -L$withval/lib"
                ;;
         esac])

if test "x$with_zlib" != xno; then
        with_zlib=no
        AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzread, [with_zlib=yes])])
fi
if test "$with_zlib" = no; then
        AC_MSG_ERROR([*** zlib is required])
fi
if test "x$Z_DIR" != "x"; then
        Z_CPPFLAGS="-I$Z_DIR/include"
        case $host in
        *-*-solaris*)   Z_LIBS="-L$Z_DIR/lib -R$Z_DIR/lib -lz" ;;
        *)              Z_LIBS="-L$Z_DIR/lib -lz" ;;
        esac
else
        Z_LIBS="-lz"
fi
AC_SUBST(Z_CPPFLAGS)
AC_SUBST(Z_LIBS)

CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}

dnl ***********************************************************************************

test_python=true
AC_ARG_WITH(python,
	[--{with,without}-python   Build with the python support],
	if test "x$withval" = xno; then
		test_python=false
	fi
)

if test "x$test_python" = xtrue ; then
    pygobject_msg=test
    AM_PATH_PYTHON

    AM_CHECK_PYTHON_HEADERS(,[pygobject_msg="NO.  Missing python headers"])

    dnl check for pygtk
    if test "$pygobject_msg" = test; then
	PKG_CHECK_MODULES(PYGTK, pygobject-2.0 >= 2.10.0,
		  [],
		  [pygobject_msg="NO.  pygtk problem"])
	AC_SUBST(PYGTK_CFLAGS)
    fi
    if test "$pygobject_msg" = test; then
	AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
	if test "$PYGTK_CODEGEN" = no; then
	    pygobject_msg="NO.  Missing pygtk-codegen-2.0"
	fi
    fi

    if test "$pygobject_msg" = test; then
	pygobject_msg=yes
    fi
else
    pygobject_msg=no
fi

AM_CONDITIONAL(WITH_PYTHON, [test "$pygobject_msg" = yes])

dnl ***********************************************************************************

dnl bz2
dnl
BZ2_LIBS=
test_bz2=true
AC_ARG_WITH(bz2,
	[--{with,without}-bz2   Build additional wrappers for BZ2],
	if test "x$withval" = xno; then
		test_bz2=false
	fi
)

with_bz2=false
if test "x$test_bz2" = xtrue ; then
   AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, 
		bz2_ok=yes,
		bz2_ok=no
		AC_MSG_WARN(*** BZ2 support disabled (BZ2 library not found) ***))

   if test "$bz2_ok" = yes; then
      AC_MSG_CHECKING([for bzlib.h])
      AC_PREPROC_IFELSE(
	[AC_LANG_SOURCE(
	[[#include <stdio.h>
	#undef PACKAGE
	#undef VERSION
	#undef HAVE_STDLIB_H
	#include <bzlib.h>]])],
        bz2_ok=yes,
        bz2_ok=no)
      AC_MSG_RESULT($bz2_ok)
   fi

   if test "$bz2_ok" = yes; then
	AC_DEFINE(HAVE_BZ2, 1, [Is bzip2 available and enabled])
	BZ2_LIBS="-lbz2"
   else
	AC_MSG_WARN(*** BZ2 support disabled (BZ2 header not found) ***)
   fi
else
   AC_MSG_WARN([BZ2 support disabled, as requested (Use --with-bz2 to enable)])
fi

AC_SUBST(BZ2_LIBS)

dnl ***********************************************************************************

dnl gnome
dnl
want_gnome=auto
AC_ARG_WITH(gnome,
	[--{with,without}-gnome   Build additional wrappers for GNOME-VFS and BONOBO],
	[case $withval in
	yes) want_gnome=yes;;
	no) want_gnome=no;;
	esac[]dnl
])
have_gnome=no
if  test $want_gnome = no ; then 
    AC_MSG_WARN([GNOME support disabled, as requested (Use --with-gnome to enable)])
else
    PKG_CHECK_MODULES(LIBGSF_GNOME, $libgsf_gnome_reqs,
	[have_gnome=yes],
	[if test $want_gnome = yes; then
	    AC_MSG_ERROR([GNOME support requested, but not available.])
	 else
	    AC_MSG_WARN([GNOME support disabled, unable to find required version of VFS and/or Bonobo])
	 fi])
fi
AM_CONDITIONAL(WITH_LIBGSF_GNOME, test $have_gnome = yes)

# ===================
# GConf configuration

dnl The following conditional is set in AM_GCONF_SOURCE_2.
dnl Because we may skip its execution, we have to set a default here.
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])

dnl Don't publish the GCONFTOOL variable, AM_GCONF_SOURCE_2 has ``gconftool-2'' hardwired.
GCONFTOOL=
AC_CHECK_PROG([GCONFTOOL], [gconftool-2], [gconftool-2], [no])
if test "x$GCONFTOOL" = "xno"; then
    AC_MSG_WARN([thumbnailer will not be built, unable to find gconftool-2])
else
    AM_GCONF_SOURCE_2
fi
AM_CONDITIONAL(WITH_GCONF, test "x$GCONFTOOL" != "xno")

LDFLAGS="-no-undefined $LDFLAGS"

AC_CONFIG_FILES([
Makefile
doc/Makefile
gsf/Makefile
gsf-gnome/Makefile
gsf-win32/Makefile
tests/Makefile
tools/Makefile
python/Makefile
thumbnailer/Makefile
po/Makefile.in
gsf/version.c
doc/version.xml
libgsf-1.pc
libgsf-1.spec
libgsf-gnome-1.pc
libgsf-gnome-1.spec
libgsf-win32-1.pc
libgsf-zip
])
AC_OUTPUT

AC_MSG_RESULT([Configured $PACKAGE $VERSION])