Initial check-in to git.
[XDGStart.git] / src / configure.in
blobc59ee7fa3b11dd60fffca8c9d5d4737bd4658ab9
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 if test -z "$PKG_CONFIG"; then
11   PKG_CONFIG=pkg-config
13 AC_SUBST(PKG_CONFIG)
15 AC_MSG_CHECKING(that pkg-config runs)
16 if "$PKG_CONFIG" --version > /dev/null 2>&1 ; then
17   AC_MSG_RESULT(yes)
18 else
19   AC_MSG_RESULT(no)
20   AC_MSG_ERROR([*** pkg-config missing ***
22 \'$PKG_CONFIG --version\' failed to run - make sure it is inside one of the
23 directories in your PATH environment variable!
25 pkg-config comes with the developement packages for GTK+-2.0, available at:
27     http://www.gtk.org])
30 AC_DEFUN(ROX_REQUIRE, [
31 AC_MSG_CHECKING(that $1 (version >= $2) is installed)
32 if "$PKG_CONFIG" --atleast-version=$2 $1 ; then
33   AC_MSG_RESULT(yes)
34 else
35   AC_MSG_RESULT(no)
36   if "$PKG_CONFIG" --exists $1 ; then
37     AC_MSG_ERROR(Current version is only `"$PKG_CONFIG" $1 --modversion`)
38   else
39     AC_MSG_ERROR(Package is not installed)
40   fi
44 ROX_REQUIRE(gtk+-2.0, 2.6.0)
46 dnl Checks for programs.
47 AC_PROG_CC
48 AC_PROG_MAKE_SET
50 # Compiler characteristics
51 AC_C_CONST
52 AC_C_INLINE
54 dnl Use -Wall, etc if possible
55 dnl Note: GTK uses func(), so can't use -Wstrict-prototypes 
57 if test "x$GCC" = "xyes"; then
58   CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
60   AC_MSG_CHECKING(for GCC version 4)
61 [ if $CC --version | grep "(GCC) 4" > /dev/null; then ]
62     AC_MSG_RESULT(yes)
63     [ CFLAGS="$CFLAGS -Wno-pointer-sign" ]
64   else
65     AC_MSG_RESULT(no)
66   fi
69 dnl Extract version info from AppInfo.xml
70 AC_MSG_CHECKING(AppInfo version information)
72 VERSION=`sed -n 's/^.*<Version>\(@<:@.0-9@:>@*\).*<\/Version>.*$/\1/p' ../AppInfo.xml`
74 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
75 AC_MSG_RESULT($VERSION)
77 AC_ARG_ENABLE(new-tooltips,
78   AC_HELP_STRING([--enable-new-tooltips],
79         [Use Gtk 2.12's new tooltip API if possible]))
81 dnl Checks for header files.
83 dnl Checks for typedefs, structures, and compiler characteristics.
85 dnl Checks for library functions.
86 if test x$enable_new_tooltips = xyes
87 then
88         AC_CHECK_FUNC(gtk_widget_set_tooltip_text,
89                 [HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT=1],
90                 [HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT=0])
91 else
92         HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT=0
94 AC_DEFINE_UNQUOTED(HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT,
95         $HAVE_GTK_WIDGET_SET_TOOLTIP_TEXT)
97 AC_OUTPUT(Makefile)