1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(config.h)
6 [ --with-platform platform name, as detected by AppRun],
7 [AC_SUBST(with_platform)],
11 Please do not run 'configure' manually - instead, run the AppRun script with
12 the --compile option, like this:
13 $ ROX-Filer/AppRun --compile
19 dnl rox_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
20 dnl This macro does the same thing as AC_ARG_WITH, but it also defines
21 dnl with_PACKAGE_arg and with_PACKAGE_sign to avoid complicated logic later.
22 dnl Stolen from icewm's configure.in
23 AC_DEFUN(rox_ARG_WITH, [
24 AC_ARG_WITH([$1], [$2], [
25 case "[${with_]patsubst([$1], -, _)}" in
27 [with_]patsubst([$1], -, _)_sign=no
30 [with_]patsubst([$1], -, _)_sign=yes
33 [with_]patsubst([$1], -, _)_arg="[${with_]patsubst([$1], -, _)}"
34 [with_]patsubst([$1], -, _)_sign=yes
40 dnl rox_CHECK_EXISTS(PROGRAM, ERROR)
41 dnl Ensure that PROGRAM --version works.
42 dnl Stops and displays ERROR if it's missing.
43 AC_DEFUN(rox_CHECK_EXISTS, [
44 AC_MSG_CHECKING(that $1 runs)
45 if "$1" --version > /dev/null 2>&1 ; then
49 AC_MSG_ERROR([*** Missing program ***
51 $1 failed to run - make sure it is inside one of the
52 directories in your PATH environment variable!
58 dnl Checks for programs.
61 dnl Use -Wall if possible
63 if test "x$GCC" = "xyes"; then
65 *[\ \ ]-Wall[\ \ ]*) ;;
66 *) CFLAGS="$CFLAGS -Wall" ;;
71 if test -z "$PKG_CONFIG"; then
76 if test -z "$XML_CONFIG"; then
77 AC_CHECK_PROG(XML_CONFIG, xml2-config, xml2-config, xml-config)
81 if test -z "$GTK_CONFIG"; then
85 dnl See if we've got Gtk+ 2.0 (or 1.3 developement version)
86 AC_MSG_CHECKING(for Gtk+-2.0)
87 if $PKG_CONFIG "--atleast-version=1.3.11" "gtk+-2.0"; then
90 GTK_CFLAGS="$PKG_CONFIG gtk+-2.0 --cflags"
91 GTK_LIBS="$PKG_CONFIG gtk+-2.0 --libs"
92 GDK_PIXBUF_LIBS=`$PKG_CONFIG gdk-pixbuf-2.0 --libs`
93 GDK_PIXBUF_CFLAGS=`$PKG_CONFIG gdk-pixbuf-2.0 --cflags`
97 GTK_CFLAGS="$GTK_CONFIG --cflags"
98 GTK_LIBS="$GTK_CONFIG --libs"
100 dnl Warn the user if stuff is missing...
101 rox_CHECK_EXISTS([$GTK_CONFIG],
102 [You need to install the gtk-devel package before compiling:
105 dnl Make sure we have gdk-pixbuf
106 AC_MSG_CHECKING(for gdk-pixbuf library)
107 if test -z "$GDK_PIXBUF_CONFIG"; then
108 GDK_PIXBUF_CONFIG=gdk-pixbuf-config
110 GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG --cflags`
111 GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG --libs`
113 if [ -n "$GDK_PIXBUF_LIBS" ]; then
115 AC_MSG_RESULT(yes - use '$GDK_PIXBUF_LIBS')
117 AC_MSG_ERROR(can't run '$GDK_PIXBUF_CONFIG --libs' - make sure it is in your PATH)
122 AC_SUBST(GDK_PIXBUF_CFLAGS)
123 AC_SUBST(GDK_PIXBUF_LIBS)
125 rox_CHECK_EXISTS([$XML_CONFIG],
126 [You need to install the xml-devel package before compiling:
127 http://xmlsoft.org/])
129 dnl Does file(1) support '-b' ?
130 AC_MSG_CHECKING(whether file -b works)
131 if file -b / > /dev/null 2> /dev/null
133 AC_DEFINE(FILE_B_FLAG)
139 dnl Checks for header files.
144 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h mntent.h sys/ucred.h sys/mntent.h)
145 AC_CHECK_HEADERS(locale.h regex.h)
148 [ --with-vfs[=prefix] use libvfs for virtual file system [search it in prefix/include and prefix/lib]])
150 dnl Checks for typedefs, structures, and compiler characteristics.
155 dnl Checks for library functions.
156 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol getopt_long)
157 AC_CHECK_LIB(regex, re_compile_pattern)
158 AC_CHECK_FUNCS(re_compile_pattern re_search re_set_syntax)
160 AC_MSG_CHECKING(for vfs library)
163 if test x"$with_vfs_sign" = xyes; then
164 if test x"$with_vfs_arg" != x; then
165 vfs_includes="-I${with_vfs_arg}/include"
166 vfs_libs="-L${with_vfs_arg}/lib -R${with_vfs_arg}/lib"
167 AC_MSG_RESULT(yes - use '$vfs_libs')
173 CFLAGS="$CFLAGS $vfs_includes"
174 LDFLAGS="$LDFLAGS $vfs_libs"
175 VFS_CFLAGS=$vfs_includes
183 dnl Extract version info from AppInfo.xml
184 AC_MSG_CHECKING(extracting version information)
186 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' ../AppInfo.xml`
188 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
189 AC_MSG_RESULT(version $VERSION)
191 dnl Check for the Midnight Commander VFS library
192 AC_CHECK_LIB(vfs, mc_stat, , , `$GTK_CONFIG --libs`)