source: trunk/third/libgsf/configure.in @ 22006

Revision 22006, 7.5 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r22005, which included commits to RCS files with non-trunk default branches.
Line 
1AC_PREREQ(2.52)
2AC_INIT(gsf/gsf.h)
3
4dnl Set release number
5dnl This is derived from "Versioning" chapter of info libtool documentation.
6PACKAGE=libgsf
7dnl     4a) Increment when removing or changing interfaces.
8LIBGSF_MAJOR_VERSION=1
9dnl     4a) 5) Increment when adding interfaces.
10dnl     6) Set to zero when removing or changing interfaces.
11LIBGSF_MINOR_VERSION=10
12dnl     3) Increment when interfaces not changed at all,
13dnl               only bug fixes or internal changes made.
14dnl     4b) Set to zero when adding, removing or changing interfaces.
15LIBGSF_MICRO_VERSION=1
16dnl
17dnl     Set this too
18MAJOR_VERSION_PLUS_MINOR_VERSION=`expr $LIBGSF_MAJOR_VERSION + $LIBGSF_MINOR_VERSION`
19dnl
20VERSION=$LIBGSF_MAJOR_VERSION.$LIBGSF_MINOR_VERSION.$LIBGSF_MICRO_VERSION
21dnl Version info for libraries = CURRENT:REVISION:AGE
22VERSION_INFO=$MAJOR_VERSION_PLUS_MINOR_VERSION:$LIBGSF_MICRO_VERSION:$LIBGSF_MINOR_VERSION
23AC_SUBST(VERSION_INFO)
24AC_SUBST(LIBGSF_MAJOR_VERSION)
25AC_SUBST(LIBGSF_MINOR_VERSION)
26AC_SUBST(LIBGSF_MICRO_VERSION)
27
28dnl Start automake
29AM_CONFIG_HEADER(gsf-config.h)
30AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
31AM_MAINTAINER_MODE
32
33dnl Checks for programs.
34AC_PROG_CC
35AC_PROG_MAKE_SET
36AC_LIBTOOL_WIN32_DLL
37AM_PROG_LIBTOOL
38
39AC_FUNC_FSEEKO
40AC_SYS_LARGEFILE
41AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
42
43dnl Checks for libraries.
44dnl Modules common to libgsf and libgsf-gnome
45m4_define(LIBGSF_MODULES,[gobject-2.0 >= 2.0.0
46    glib-2.0 >= 2.0.0
47    libxml-2.0 >= 2.4.16])
48PKG_CHECK_MODULES(LIBGSF,LIBGSF_MODULES)
49
50## this should come after `AC_PROG_CC'
51ifdef([GNOME_COMPILE_WARNINGS],[GNOME_COMPILE_WARNINGS],)
52CFLAGS="$CFLAGS $WARN_CFLAGS -DG_DISABLE_DEPRECATED"
53if test "$GCC" = "yes"; then
54        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; do
55                SAVE_CFLAGS="$CFLAGS"
56                CFLAGS="$CFLAGS $option"
57                AC_MSG_CHECKING([whether gcc understands $option])
58                AC_TRY_COMPILE([], [],
59                        has_option=yes,
60                        has_option=no,)
61                if test $has_option = no; then
62                  CFLAGS="$SAVE_CFLAGS"
63                fi
64                AC_MSG_RESULT($has_option)
65                unset has_option
66                unset SAVE_CFLAGS
67        done
68        unset option
69fi
70
71AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
72if test $fdopen_works = no ; then
73        unset ac_cv_have_decl_fdopen
74        CFLAGS="$CFLAGS -D_POSIX_SOURCE"
75        AC_MSG_NOTICE([adding -D_POSIX_SOURCE to CFLAGS])
76        AC_CHECK_DECL(fdopen, fdopen_works=yes, fdopen_works=no)
77        if test $fdopen_works = no ; then
78                AC_MSG_ERROR([fdopen is not available])
79        fi
80fi
81
82# Unfortunately, -D_POSIX_SOURCE turns off struct timeval on Solaris
83AC_MSG_CHECKING([whether struct timeval is available])
84AC_TRY_COMPILE([#include <sys/time.h>], [struct timeval tv;], struct_timeval_works=yes, struct_timeval_works=no)
85AC_MSG_RESULT($struct_timeval_works)
86
87if test $struct_timeval_works = no ; then
88        CFLAGS="$CFLAGS -D__EXTENSIONS__"
89        AC_MSG_CHECKING([whether struct timeval is available with -D__EXTENSIONS__])
90        AC_TRY_COMPILE([#include <sys/time.h>], [struct timeval tv;], struct_timeval_works=yes, struct_timeval_works=no)
91        AC_MSG_RESULT($struct_timeval_works)
92        if test $struct_timeval_works = no ; then
93                AC_MSG_ERROR([struct timeval is not available])
94        fi
95fi
96
97AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for caddr_t])
98AC_TRY_COMPILE([#include <sys/types.h>], [caddr_t ca], need_bsd1=no, need_bsd1=yes)
99AC_MSG_RESULT($need_bsd1)
100
101AC_MSG_CHECKING([whether -D_BSD_SOURCE is needed for lstat])
102AC_TRY_LINK([#include <sys/types.h>
103             #include <sys/stat.h>
104             #include <unistd.h>
105            ], [void *ptr = &lstat], need_bsd2=no, need_bsd2=yes)
106AC_MSG_RESULT($need_bsd2)
107if test $need_bsd1 = yes -o $need_bsd2 = yes; then
108        CFLAGS="$CFLAGS -D_BSD_SOURCE"
109fi
110
111AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h io.h)
112AC_FUNC_MMAP
113
114AC_CHECK_FUNCS(lstat readlink)
115
116AC_MSG_CHECKING([for native Win32])
117case "$host" in
118  *-*-mingw*)
119    native_win32=yes
120    ;;
121  *)
122    native_win32=no
123    ;;
124esac
125AC_MSG_RESULT([$native_win32])
126AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
127
128AC_MSG_CHECKING([for Win32 platform in general])
129case "$host" in
130  *-*-mingw*|*-*-cygwin*)
131    platform_win32=yes
132    ;;
133  *)
134    platform_win32=no
135    ;;
136esac
137AC_MSG_RESULT($platform_win32)
138AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
139
140##################################################
141# Checks for gtk-doc and docbook-tools
142##################################################
143GTK_DOC_CHECK([1.0])
144
145dnl ***********************************************************************************
146dnl libxml
147dnl
148AC_CHECK_LIB(z, zlibVersion,
149    [Z_LIBS=-lz AC_SUBST(Z_LIBS)],
150    AC_MSG_ERROR([*** zlib is required]))
151
152dnl ***********************************************************************************
153dnl
154dnl Uncomment to enable Python bindings. automake1.5 or later is required.
155dnl
156dnl AM_PATH_PYTHON
157dnl AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
158dnl check for pygtk
159dnl PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 1.99.10,
160dnl               [pygtk_msg="yes"],
161dnl               [pygtk_msg="NO.  pygtk problem"])
162dnl AC_SUBST(PYGTK_CFLAGS)
163dnl AC_PATH_PROG(PYGTK_CODEGEN, pygtk-codegen-2.0, no)
164dnl if test "x$PYGTK_CODEGEN" = xno; then
165dnl    AC_MSG_ERROR(could not find pygtk-codegen-2.0 script)
166dnl fi
167
168dnl if test "x$pygtk_msg" = "xyes"; then
169dnl   AM_CONDITIONAL(WITH_PYTHON, true)
170dnl else
171  AM_CONDITIONAL(WITH_PYTHON, false)
172dnl fi
173
174dnl ***********************************************************************************
175
176dnl bz2
177dnl
178BZ2_LIBS=
179test_bz2=true
180AC_ARG_WITH(bz2,
181        [--{with,without}-bz2   Build additional wrappers for BZ2],
182        if test "x$withval" = xno; then
183                test_bz2=false
184        fi
185)
186
187with_bz2=false
188if test "x$test_bz2" = xtrue ; then
189   AC_CHECK_LIB(bz2, BZ2_bzDecompressInit,
190                bz2_ok=yes,
191                bz2_ok=no
192                AC_MSG_WARN(*** BZ2 support disabled (BZ2 library not found) ***))
193
194   if test "$bz2_ok" = yes; then
195      AC_MSG_CHECKING([for bzlib.h])
196      AC_TRY_CPP(
197        [#include <stdio.h>
198        #undef PACKAGE
199        #undef VERSION
200        #undef HAVE_STDLIB_H
201        #include <bzlib.h>],
202        bz2_ok=yes,
203        bz2_ok=no)
204      AC_MSG_RESULT($bz2_ok)
205   fi
206
207   if test "$bz2_ok" = yes; then
208        AC_DEFINE(HAVE_BZ2, 1, [Is bzip2 available and enabled])
209        BZ2_LIBS="-lbz2"
210   else
211        AC_MSG_WARN(*** BZ2 support disabled (BZ2 header not found) ***)
212   fi
213else
214   AC_MSG_WARN([BZ2 support disabled, as requested (Use --with-bz2 to enable)])
215fi
216
217AC_SUBST(BZ2_LIBS)
218
219dnl ***********************************************************************************
220
221dnl gnome
222dnl
223test_gnome=true
224AC_ARG_WITH(gnome,
225        [--{with,without}-gnome   Build additional wrappers for GNOME-VFS and BONOBO],
226        if test "x$withval" = xno; then
227                test_gnome=false
228        fi
229)
230with_gnome=false
231if  test "x$test_gnome" = xtrue ; then
232    PKG_CHECK_MODULES(LIBGSF_GNOME,[
233    LIBGSF_MODULES
234    libbonobo-2.0 >= 2.0.0
235    gnome-vfs-2.0 >= 1.9.16
236    gnome-vfs-module-2.0 >= 1.9.16
237    ],[with_gnome=true], [AC_MSG_WARN([GNOME support disabled, unable to find required version of VFS and/or Bonobo])])
238else
239    AC_MSG_WARN([GNOME support disabled, as requested (Use --with-gnome to enable)])
240fi
241
242AC_SUBST(LIBGSF_GNOME_CFLAGS)
243AC_SUBST(LIBGSF_GNOME_LIBS)
244AM_CONDITIONAL(WITH_LIBGSF_GNOME, $with_gnome)
245
246AC_SUBST(LIBGSF_CFLAGS)
247AC_SUBST(LIBGSF_LIBS)
248
249AC_SUBST(ACLOCAL_FLAGS)
250
251AC_OUTPUT([
252Makefile
253doc/Makefile
254gsf/Makefile
255gsf-gnome/Makefile
256gsf-win32/Makefile
257tests/Makefile
258python/Makefile
259gsf/version.c
260libgsf-1.pc
261libgsf-1.spec
262libgsf-gnome-1.pc
263libgsf-gnome-1.spec
264libgsf-win32-1.pc
265libgsf-zip
266doc/version.xml
267])
268
269AC_MSG_RESULT([Configured $PACKAGE $VERSION])
270
271rm -f po/po2tbl.sed
Note: See TracBrowser for help on using the repository browser.