r4034: Use application_x_shellscript for scripts.
[rox-filer/translations.git] / ROX-Filer / src / configure.in
blobe1cef4b5efbfe8b55815867ad12ef978e3384c87
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   CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
28   AC_MSG_CHECKING(for GCC version 4)
29 [ if $CC --version | grep "(GCC) 4" > /dev/null; then ]
30     AC_MSG_RESULT(yes)
31     [ CFLAGS="$CFLAGS -Wno-pointer-sign" ]
32   else
33     AC_MSG_RESULT(no)
34   fi
37 if test -z "$PKG_CONFIG"; then
38   PKG_CONFIG=pkg-config
40 AC_SUBST(PKG_CONFIG)
42 AC_MSG_CHECKING(that pkg-config runs)
43 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
44   AC_MSG_RESULT(yes)
45 else
46   AC_MSG_RESULT(no)
47   AC_MSG_ERROR([*** $PKG_CONFIG missing ***
49 \'$PKG_CONFIG --version\' failed to run - make sure it is inside one of the
50 directories in your PATH environment variable!
52 pkg-config comes with the developement packages for GTK+-2.4, available at:
54     http://www.gtk.org])
57 AC_DEFUN(ROX_REQUIRE, [
58 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
59 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
60   AC_MSG_RESULT(yes)
61 else
62   AC_MSG_RESULT(no)
63   if "$PKG_CONFIG" --exists $1 ; then
64     AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" "$1" --modversion`)
65   else
66     AC_MSG_ERROR(Package is not installed)
67   fi
71 ROX_REQUIRE(gtk+-2.0, 2.4.0)
72 ROX_REQUIRE(libxml-2.0, 2.0.0)
74 GTK_VERSION=`"$PKG_CONFIG" --modversion gtk+-2.0`
75 AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
77 AC_MSG_CHECKING(if pango (version >= 1.1.2) is installed)
78 if "$PKG_CONFIG" --atleast-version=1.1.2 pango ; then
79   AC_DEFINE(USE_PANGO_WRAP_WORD_CHAR)
80   AC_MSG_RESULT(yes; enabling better wrapping)
81 else
82   AC_MSG_RESULT(no; better wrapping not enabled)
85 dnl Find the X libraries
86 AC_PATH_XTRA
87 if test x$no_x = xyes ; then
88   AC_MSG_ERROR([X development libraries not found])
90 LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
91 CFLAGS="$CFLAGS $X_CFLAGS"
93 dnl Does file(1) support '-b' ?
94 AC_MSG_CHECKING(whether file -b works)
95 if file -b / > /dev/null 2> /dev/null
96 then
97   AC_DEFINE(FILE_B_FLAG)
98   AC_MSG_RESULT(yes)
99 else
100   AC_MSG_RESULT(no)
103 AC_MSG_CHECKING(for large file support)
104 case "$with_platform" in
105 OpenBSD*)
106   AC_MSG_RESULT(yes)
107   AC_DEFINE(LARGE_FILE_SUPPORT)
108   ;;
109 FreeBSD*)
110   AC_MSG_RESULT(yes)
111   AC_DEFINE(LARGE_FILE_SUPPORT)
112   ;;
114   if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
115     AC_MSG_RESULT(yes)
116     LFS_CFLAGS="`getconf LFS_CFLAGS`"
117     LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
118     LFS_LIBS="`getconf LFS_LIBS`"
119     AC_DEFINE(LARGE_FILE_SUPPORT)
120   else
121     AC_MSG_RESULT(no)
122     LFS_CFLAGS=""
123     LFS_LDFLAGS=""
124     LFS_LIBS=""
125   fi
126   ;;
127 esac
129 AC_SUBST(LFS_CFLAGS)
130 AC_SUBST(LFS_LDFLAGS)
131 AC_SUBST(LFS_LIBS)
133 dnl Checks for header files.
134 AC_HEADER_DIRENT
135 AC_HEADER_STDC
136 AC_HEADER_SYS_WAIT
137 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)
139 AC_CHECK_HEADER([X11/SM/SMlib.h], [],
140   [AC_MSG_ERROR([Session management library (libsm) missing. It is part of the X server distribution. Try installing the libsm-dev package.])]
143 dnl Checks for typedefs, structures, and compiler characteristics.
144 AC_C_CONST
145 AC_TYPE_UID_T
146 AC_TYPE_SIZE_T
148 dnl Checks for library functions.
149 AC_CHECK_FUNCS(gethostname unsetenv mkdir rmdir strdup strtol statvfs statfs mbrtowc)
151 dnl getopt_long may be in an addtional library
152 AC_CHECK_LIB(gnugetopt, getopt_long)
153 AC_CHECK_FUNCS(getopt_long)
155 dnl Check for extended attribute support
156 AC_CHECK_FUNCS(attropen getxattr)
157 AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h)
159 dnl Extract version info from AppInfo.xml
160 AC_MSG_CHECKING(extracting version information)
162 VERSION=`sed -n 's/^.*<Version>\([.0-9]*\).*<\/Version>.*$/\1/p' $APP_DIR/AppInfo.xml`
164 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
165 AC_MSG_RESULT(version $VERSION)
167 AC_OUTPUT(Makefile)