r3768: Updated years.
[rox-filer.git] / ROX-Filer / src / configure.in
blob48478768a3ecf67f08f32d2e7e21ee65c98ff5f3
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(main.c)
3 AC_CONFIG_HEADER(config.h)
5 AC_ARG_WITH(platform,
6 [  --with-platform        platform name, as detected by AppRun],
7 [AC_SUBST(with_platform)],
9 AC_MSG_ERROR([
11 Please do not run 'configure' manually - instead, run the AppRun script with
12 the --compile option, like this:
13         $ ROX-Filer/AppRun --compile
15 Thank you.
19 dnl Checks for programs.
20 AC_PROG_CC
22 dnl Use -Wall, etc if possible
23 dnl Note: GTK uses func(), so can't use -Wstrict-prototypes 
25 if test "x$GCC" = "xyes"; then
26   case " $CFLAGS " in
27   *[\ \ ]-Wall[\ \      ]*) ;;
28   *) CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" ;;
29   esac
33 if test -z "$PKG_CONFIG"; then
34   PKG_CONFIG=pkg-config
36 AC_SUBST(PKG_CONFIG)
38 AC_MSG_CHECKING(that pkg-config runs)
39 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
40   AC_MSG_RESULT(yes)
41 else
42   AC_MSG_RESULT(no)
43   AC_MSG_ERROR([*** $PKG_CONFIG missing ***
45 \'$PKG_CONFIG --version\' failed to run - make sure it is inside one of the
46 directories in your PATH environment variable!
48 pkg-config comes with the developement packages for GTK+-2.2, available at:
50     http://www.gtk.org])
53 AC_DEFUN(ROX_REQUIRE, [
54 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
55 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
56   AC_MSG_RESULT(yes)
57 else
58   AC_MSG_RESULT(no)
59   if "$PKG_CONFIG" --exists $1 ; then
60     AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" "$1" --modversion`)
61   else
62     AC_MSG_ERROR(Package is not installed)
63   fi
67 ROX_REQUIRE(gtk+-2.0, 2.2.0)
68 ROX_REQUIRE(libxml-2.0, 2.0.0)
70 AC_MSG_CHECKING(for GNOME VFS 2.8 or later)
71 if "$PKG_CONFIG" --atleast-version=2.8.0 "gnome-vfs-2.0" ; then
72   LIBS="$LIBS `$PKG_CONFIG --libs gnome-vfs-2.0`"
73   CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gnome-vfs-2.0`"
74   AC_DEFINE(HAVE_GNOME_VFS)
75   AC_MSG_RESULT(yes)
76 else
77   AC_MSG_RESULT(no)
80 GTK_VERSION=`"$PKG_CONFIG" --modversion gtk+-2.0`
81 AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
83 AC_MSG_CHECKING(if pango (version >= 1.1.2) is installed)
84 if "$PKG_CONFIG" --atleast-version=1.1.2 pango ; then
85   AC_DEFINE(USE_PANGO_WRAP_WORD_CHAR)
86   AC_MSG_RESULT(yes; enabling better wrapping)
87 else
88   AC_MSG_RESULT(no; better wrapping not enabled)
91 dnl Find the X libraries
92 AC_PATH_XTRA
93 if test x$no_x = xyes ; then
94   AC_MSG_ERROR([X development libraries not found])
96 LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
97 CFLAGS="$CFLAGS $X_CFLAGS"
99 dnl Does file(1) support '-b' ?
100 AC_MSG_CHECKING(whether file -b works)
101 if file -b / > /dev/null 2> /dev/null
102 then
103   AC_DEFINE(FILE_B_FLAG)
104   AC_MSG_RESULT(yes)
105 else
106   AC_MSG_RESULT(no)
109 AC_MSG_CHECKING(for large file support)
110 case "$with_platform" in
111 OpenBSD*)
112   AC_MSG_RESULT(yes)
113   AC_DEFINE(LARGE_FILE_SUPPORT)
114   ;;
115 FreeBSD*)
116   AC_MSG_RESULT(yes)
117   AC_DEFINE(LARGE_FILE_SUPPORT)
118   ;;
120   if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
121     AC_MSG_RESULT(yes)
122     LFS_CFLAGS="`getconf LFS_CFLAGS`"
123     LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
124     LFS_LIBS="`getconf LFS_LIBS`"
125     AC_DEFINE(LARGE_FILE_SUPPORT)
126   else
127     AC_MSG_RESULT(no)
128     LFS_CFLAGS=""
129     LFS_LDFLAGS=""
130     LFS_LIBS=""
131   fi
132   ;;
133 esac
135 AC_SUBST(LFS_CFLAGS)
136 AC_SUBST(LFS_LDFLAGS)
137 AC_SUBST(LFS_LIBS)
139 dnl Checks for header files.
140 AC_PATH_X
141 AC_HEADER_DIRENT
142 AC_HEADER_STDC
143 AC_HEADER_SYS_WAIT
144 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)
146 AC_CHECK_HEADER([X11/SM/SMlib.h], [],
147   [AC_MSG_ERROR([Session management library (libsm) missing. It is part of the X server distribution. Try installing the libsm-dev package.])]
150 dnl Checks for typedefs, structures, and compiler characteristics.
151 AC_C_CONST
152 AC_TYPE_UID_T
153 AC_TYPE_SIZE_T
155 dnl Checks for library functions.
156 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol getopt_long statvfs statfs)
158 dnl Check for extended attribute support
159 AC_CHECK_FUNCS(attropen getxattr)
160 AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h)
162 dnl Extract version info from AppInfo.xml
163 AC_MSG_CHECKING(extracting version information)
165 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' $APP_DIR/AppInfo.xml`
167 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
168 AC_MSG_RESULT(version $VERSION)
170 AC_OUTPUT(Makefile)