1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(config.h)
5 [ if [ -f configure ]; then ]
6 AC_MSG_ERROR([Please run configure from the build directory (try ../AppRun --compile)])
10 dnl Checks for programs.
13 dnl Use -Wall, etc if possible
14 dnl Note: GTK uses func(), so can't use -Wstrict-prototypes
16 if test "x$GCC" = "xyes"; then
17 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
19 AC_MSG_CHECKING(for GCC version 4)
20 [ if $CC --version | grep "(GCC) 4" > /dev/null; then ]
22 [ CFLAGS="$CFLAGS -Wno-pointer-sign" ]
28 if test -z "$PKG_CONFIG"; then
33 AC_MSG_CHECKING(that pkg-config runs)
34 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
38 AC_MSG_ERROR([*** $PKG_CONFIG missing ***
40 \'$PKG_CONFIG --version\' failed to run - make sure it is inside one of the
41 directories in your PATH environment variable!
43 pkg-config comes with the developement packages for GTK+-2.4, available at:
48 AC_DEFUN(ROX_REQUIRE, [
49 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
50 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
54 if "$PKG_CONFIG" --exists $1 ; then
55 AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" "$1" --modversion`)
57 AC_MSG_ERROR(Package is not installed)
62 ROX_REQUIRE(gtk+-2.0, 2.4.0)
63 ROX_REQUIRE(libxml-2.0, 2.0.0)
64 ROX_REQUIRE(libglade-2.0, 2.0.0)
65 ROX_REQUIRE(shared-mime-info, 0.14)
67 GTK_VERSION=`"$PKG_CONFIG" --modversion gtk+-2.0`
68 AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
70 AC_MSG_CHECKING(if pango (version >= 1.1.2) is installed)
71 if "$PKG_CONFIG" --atleast-version=1.1.2 pango ; then
72 AC_DEFINE(USE_PANGO_WRAP_WORD_CHAR)
73 AC_MSG_RESULT(yes; enabling better wrapping)
75 AC_MSG_RESULT(no; better wrapping not enabled)
78 dnl Find the X libraries
80 if test x$no_x = xyes ; then
81 AC_MSG_ERROR([X development libraries not found])
83 LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
84 CFLAGS="$CFLAGS $X_CFLAGS"
86 dnl Does file(1) support '-b' ?
87 AC_MSG_CHECKING(whether file -b works)
88 if file -b / > /dev/null 2> /dev/null
90 AC_DEFINE(FILE_B_FLAG)
96 AC_MSG_CHECKING(for large file support)
97 case "$with_platform" in
100 AC_DEFINE(LARGE_FILE_SUPPORT)
104 AC_DEFINE(LARGE_FILE_SUPPORT)
107 if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
109 LFS_CFLAGS="`getconf LFS_CFLAGS`"
110 LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
111 LFS_LIBS="`getconf LFS_LIBS`"
112 AC_DEFINE(LARGE_FILE_SUPPORT)
123 AC_SUBST(LFS_LDFLAGS)
126 dnl Checks for header files.
130 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h mntent.h sys/ucred.h sys/mntent.h apsymbols.h apbuild/apsymbols.h sys/statvfs.h sys/vfs.h wctype.h)
132 AC_CHECK_HEADER([X11/SM/SMlib.h], [],
133 [AC_MSG_ERROR([Session management library (libsm) missing. It is part of the X server distribution. Try installing the libsm-dev package.])]
136 dnl Checks for typedefs, structures, and compiler characteristics.
141 dnl Checks for library functions.
142 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol statvfs statfs mbrtowc)
144 dnl getopt_long may be in an addtional library
145 AC_CHECK_LIB(gnugetopt, getopt_long)
146 AC_CHECK_FUNCS(getopt_long)
148 dnl Check for extended attribute support
149 AC_CHECK_FUNCS(attropen getxattr)
150 AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h)
152 dnl Extract version info from AppInfo.xml
153 AC_MSG_CHECKING(extracting version information)
155 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' ${srcdir}/../AppInfo.xml`
157 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
158 AC_MSG_RESULT(version $VERSION)