Added missing release notes to Changes file.
[rox-filer.git] / ROX-Filer / src / configure.in
blob12a31f7c22e7931d33c8d9f4e7b6f6e922325029
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(main.c)
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)])
7         exit 1
8 fi
10 dnl Checks for programs.
11 AC_PROG_CC
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`
26     AC_MSG_RESULT($ver)
27     case $major in
28       [1-3]) 
29         gcc_pointer=no
30         gcc_stack=no;;
31       4)
32         gcc_pointer=yes
33         if test "$minor" -ge 1 ; then gcc_stack=yes; else gcc_stack=no; fi ;;
34       [5-9])
35         gcc_pointer=yes
36         gcc_stack=yes;;
37       *)
38         gcc_pointer=no
39         gcc_stack=no;;
40     esac
41     AC_MSG_CHECKING(whether to disable pointer sign warning)
42     if test "$gcc_pointer" = yes ; then
43       AC_MSG_RESULT(yes)
44       CFLAGS="$CFLAGS -Wno-pointer-sign"
45     else
46       AC_MSG_RESULT(no)
47     fi
48     AC_MSG_CHECKING(whether to disable stack protector)
49     if test "$gcc_stack" = yes ; then
50       AC_MSG_RESULT(yes)
51       CFLAGS="$CFLAGS -fno-stack-protector"
52     else
53       AC_MSG_RESULT(no)
54     fi
55   fi
58 if test -z "$PKG_CONFIG"; then
59   PKG_CONFIG=pkg-config
61 AC_SUBST(PKG_CONFIG)
63 AC_MSG_CHECKING(that pkg-config runs)
64 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
65   AC_MSG_RESULT(yes)
66 else
67   AC_MSG_RESULT(no)
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:
75     http://www.gtk.org])
78 AC_DEFUN(ROX_REQUIRE, [
79 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
80 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
81   AC_MSG_RESULT(yes)
82 else
83   AC_MSG_RESULT(no)
84   if "$PKG_CONFIG" --exists $1 ; then
85     AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" "$1" --modversion`)
86   else
87     AC_MSG_ERROR(Package is not installed)
88   fi
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)
104 else
105   AC_MSG_RESULT(no; better wrapping not enabled)
108 dnl Find the X libraries
109 AC_PATH_XTRA
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
119 then
120   AC_DEFINE(FILE_B_FLAG)
121   AC_MSG_RESULT(yes)
122 else
123   AC_MSG_RESULT(no)
126 AC_MSG_CHECKING(for large file support)
127 case "$with_platform" in
128 OpenBSD*)
129   AC_MSG_RESULT(yes)
130   AC_DEFINE(LARGE_FILE_SUPPORT)
131   ;;
132 FreeBSD*)
133   AC_MSG_RESULT(yes)
134   AC_DEFINE(LARGE_FILE_SUPPORT)
135   ;;
137   if getconf LFS64_CFLAGS > /dev/null 2> /dev/null; then
138     AC_MSG_RESULT(yes)
139     LFS_CFLAGS="`getconf LFS_CFLAGS`"
140     LFS_LDFLAGS="`getconf LFS_LDFLAGS`"
141     LFS_LIBS="`getconf LFS_LIBS`"
142     AC_DEFINE(LARGE_FILE_SUPPORT)
143   else
144     AC_MSG_RESULT(no)
145     LFS_CFLAGS=""
146     LFS_LDFLAGS=""
147     LFS_LIBS=""
148   fi
149   ;;
150 esac
152 AC_SUBST(LFS_CFLAGS)
153 AC_SUBST(LFS_LDFLAGS)
154 AC_SUBST(LFS_LIBS)
156 dnl Checks for header files.
157 AC_HEADER_DIRENT
158 AC_HEADER_STDC
159 AC_HEADER_SYS_WAIT
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.
167 AC_C_CONST
168 AC_TYPE_UID_T
169 AC_TYPE_SIZE_T
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)
192 AC_OUTPUT(Makefile)