configure.ac 2.59 KB
Newer Older
Cosimo Cecchi's avatar
Cosimo Cecchi committed
1
dnl -*- mode: m4 -*-
2
AC_PREREQ([2.63])
Javier Jardón's avatar
Javier Jardón committed
3
AC_INIT([gnome-search-tool],
Matthias Clasen's avatar
Matthias Clasen committed
4
        [3.6.0],
Javier Jardón's avatar
Javier Jardón committed
5 6
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-search-tools],
        [gnome-search-tool])
Cosimo Cecchi's avatar
Cosimo Cecchi committed
7 8 9 10 11 12

AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])

AC_CANONICAL_TARGET

13
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
14
AM_MAINTAINER_MODE([enable])
Cosimo Cecchi's avatar
Cosimo Cecchi committed
15

16 17
AM_SILENT_RULES([yes])

Cosimo Cecchi's avatar
Cosimo Cecchi committed
18 19 20 21 22 23 24 25 26
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
IT_PROG_INTLTOOL(0.40.0)
PKG_PROG_PKG_CONFIG([0.22])

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])

27
# Check for programs
Cosimo Cecchi's avatar
Cosimo Cecchi committed
28 29 30 31 32 33
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_HEADER_STDC

# enable libtool
34 35
LT_PREREQ([2.2])
LT_INIT([disable-static])
Cosimo Cecchi's avatar
Cosimo Cecchi committed
36 37 38 39 40 41

## don't rerun to this point if we abort
AC_CACHE_SAVE

GLIB_GSETTINGS

42 43
# User documentation
YELP_HELP_INIT
Cosimo Cecchi's avatar
Cosimo Cecchi committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85

dnl strftime extension checks
msg_strftime=no

AC_RUN_IFELSE(
  [AC_LANG_SOURCE([[
  #include <time.h>
  int main (void) {
    char buf[100];
    struct tm tm = {0};
    tm.tm_year = 99;
    if (strftime(buf, 100, "%EY", &tm) == 4 && strcmp (buf, "1999")==0)
      return 0;
    return 1;
  }
  ]])],[
    AC_DEFINE([HAVE_STRFTIME_EXTENSION], [1],
              [Define if strftime supports %E and %O modifiers.])
    msg_strftime=yes
  ],
  [],[])

withval=""
AC_ARG_WITH([grep],
            AS_HELP_STRING([--with-grep=@<:@grep command@:>@],
                           [Specify where to find the grep binary]),
            [
              AS_IF([test x$withval != x],
                    [AC_MSG_RESULT(${withval} is used for gnome-search-tool.)],

                    [AC_MSG_RESULT(grep is used for gnome-search-tool.)]
              )
            ])

AS_IF([test x$withval != x],
      [GREP_COMMAND="$withval"],

      [GREP_COMMAND="grep"]
)

AC_SUBST(GREP_COMMAND)

86
GLIB_MIN_VERSION=2.30.0
87
GIO_MIN_VERSION=2.30.0
Cosimo Cecchi's avatar
Cosimo Cecchi committed
88 89 90
GTK_MIN_VERSION=3.0.0

PKG_CHECK_MODULES(GSEARCHTOOL,
91 92
                  gio-unix-2.0 >= $GIO_MIN_VERSION
                  gio-2.0 >= $GIO_MIN_VERSION
Cosimo Cecchi's avatar
Cosimo Cecchi committed
93
                  glib-2.0 >= $GLIB_MIN_VERSION
94
                  gtk+-3.0 >= $GTK_MIN_VERSION)
Cosimo Cecchi's avatar
Cosimo Cecchi committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

AC_CONFIG_FILES([
Makefile
data/Makefile
help/Makefile
libeggsmclient/Makefile
libgnomeui-deprecated/Makefile
src/Makefile
po/Makefile.in
])

AC_OUTPUT

dnl ==========================================================================
echo "

        GNOME Search Tool $VERSION
        ==========================

        prefix:    ${prefix}
        compiler:  ${CC}

        grep command: ${GREP_COMMAND}
        Use strftime extension: ${msg_strftime}

        Now type 'make' to build $PACKAGE
"