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
15 dnl -fno-stack-protector must be used to avoid GLIBC2.4 dependency,
16 dnl but is only available from 4.1 onwards
18 if test "x$GCC" = "xyes"; then
19 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
21 AC_MSG_CHECKING(for GCC version)
22 if $CC --version | grep "(GCC) 4" > /dev/null; then
23 ver=`$CC --version | head -1 | cut -d" " -f 3`
24 major=`echo $ver | cut -d"." -f 1`
25 minor=`echo $ver | cut -d"." -f 2`
33 if test "$minor" -ge 1 ; then gcc_stack=yes; else gcc_stack=no; fi ;;
41 AC_MSG_CHECKING(whether to disable pointer sign warning)
42 if test "$gcc_pointer" = yes ; then
44 CFLAGS="$CFLAGS -Wno-pointer-sign"
48 AC_MSG_CHECKING(whether to disable stack protector)
49 if test "$gcc_stack" = yes ; then
51 CFLAGS="$CFLAGS -fno-stack-protector"
58 if test -z "$PKG_CONFIG"; then
63 AC_MSG_CHECKING(that pkg-config runs)
64 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
68 AC_MSG_ERROR([*** $PKG_CONFIG missing ***
70 \'$PKG_CONFIG --version\' failed to run - make sure it is inside one of the
71 directories in your PATH environment variable!
73 pkg-config comes with the developement packages for GTK+-2.4, available at:
78 AC_DEFUN(ROX_REQUIRE, [
79 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
80 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
84 if "$PKG_CONFIG" --exists $1 ; then
85 AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" "$1" --modversion`)
87 AC_MSG_ERROR(Package is not installed)
92 ROX_REQUIRE(gtk+-2.0, 2.4.0)
93 ROX_REQUIRE(libxml-2.0, 2.0.0)
94 ROX_REQUIRE(libglade-2.0, 2.0.0)
95 ROX_REQUIRE(shared-mime-info, 0.14)
97 GTK_VERSION=`"$PKG_CONFIG" --modversion gtk+-2.0`
98 AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
100 AC_MSG_CHECKING(if pango (version >= 1.1.2) is installed)
101 if "$PKG_CONFIG" --atleast-version=1.1.2 pango ; then
102 AC_DEFINE(USE_PANGO_WRAP_WORD_CHAR)
103 AC_MSG_RESULT(yes; enabling better wrapping)
105 AC_MSG_RESULT(no; better wrapping not enabled)
108 dnl Find the X libraries
110 if test x$no_x = xyes ; then
111 AC_MSG_ERROR([X development libraries not found])
113 LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
114 CFLAGS="$CFLAGS $X_CFLAGS"
116 dnl Does file(1) support '-b' ?
117 AC_MSG_CHECKING(whether file -b works)
118 if file -b / > /dev/null 2> /dev/null
120 AC_DEFINE(FILE_B_FLAG)
126 AC_MSG_CHECKING(for large file support)
127 case "$with_platform" in
130 AC_DEFINE(LARGE_FILE_SUPPORT)
134 AC_DEFINE(LARGE_FILE_SUPPORT)
137 if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
139 LFS_CFLAGS="`getconf LFS_CFLAGS`"
140 LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
141 LFS_LIBS="`getconf LFS_LIBS`"
142 AC_DEFINE(LARGE_FILE_SUPPORT)
153 AC_SUBST(LFS_LDFLAGS)
156 dnl Checks for header files.
160 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 libintl.h)
162 AC_CHECK_HEADER([X11/SM/SMlib.h], [],
163 [AC_MSG_ERROR([Session management library (libsm) missing. It is part of the X server distribution. Try installing the libsm-dev package.])]
166 dnl Checks for typedefs, structures, and compiler characteristics.
171 dnl Checks for library functions.
172 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol statvfs statfs mbrtowc)
173 dnl Since we're using libintl.h, check if libintl needs to be linked in
174 AC_CHECK_LIB(intl, gettext)
176 dnl getopt_long may be in an addtional library
177 AC_CHECK_LIB(gnugetopt, getopt_long)
178 AC_CHECK_FUNCS(getopt_long)
180 dnl Check for extended attribute support
181 AC_CHECK_FUNCS(attropen getxattr)
182 AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h)
184 dnl Extract version info from AppInfo.xml
185 AC_MSG_CHECKING(extracting version information)
187 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' ${srcdir}/../AppInfo.xml`
189 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
190 AC_MSG_RESULT(version $VERSION)