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(shared-mime-info, 0.14)
66 GTK_VERSION=`"$PKG_CONFIG" --modversion gtk+-2.0`
67 AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
69 AC_MSG_CHECKING(if pango (version >= 1.1.2) is installed)
70 if "$PKG_CONFIG" --atleast-version=1.1.2 pango ; then
71 AC_DEFINE(USE_PANGO_WRAP_WORD_CHAR)
72 AC_MSG_RESULT(yes; enabling better wrapping)
74 AC_MSG_RESULT(no; better wrapping not enabled)
77 dnl Find the X libraries
79 if test x$no_x = xyes ; then
80 AC_MSG_ERROR([X development libraries not found])
82 LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
83 CFLAGS="$CFLAGS $X_CFLAGS"
85 dnl Does file(1) support '-b' ?
86 AC_MSG_CHECKING(whether file -b works)
87 if file -b / > /dev/null 2> /dev/null
89 AC_DEFINE(FILE_B_FLAG)
95 AC_MSG_CHECKING(for large file support)
96 case "$with_platform" in
99 AC_DEFINE(LARGE_FILE_SUPPORT)
103 AC_DEFINE(LARGE_FILE_SUPPORT)
106 if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
108 LFS_CFLAGS="`getconf LFS_CFLAGS`"
109 LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
110 LFS_LIBS="`getconf LFS_LIBS`"
111 AC_DEFINE(LARGE_FILE_SUPPORT)
122 AC_SUBST(LFS_LDFLAGS)
125 dnl Checks for header files.
129 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)
131 AC_CHECK_HEADER([X11/SM/SMlib.h], [],
132 [AC_MSG_ERROR([Session management library (libsm) missing. It is part of the X server distribution. Try installing the libsm-dev package.])]
135 dnl Checks for typedefs, structures, and compiler characteristics.
140 dnl Checks for library functions.
141 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol statvfs statfs mbrtowc)
143 dnl getopt_long may be in an addtional library
144 AC_CHECK_LIB(gnugetopt, getopt_long)
145 AC_CHECK_FUNCS(getopt_long)
147 dnl Check for extended attribute support
148 AC_CHECK_FUNCS(attropen getxattr)
149 AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h)
151 dnl Extract version info from AppInfo.xml
152 AC_MSG_CHECKING(extracting version information)
154 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' ${srcdir}/../AppInfo.xml`
156 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
157 AC_MSG_RESULT(version $VERSION)