configure.ac 2.16 KB
Newer Older
Bastien Nocera's avatar
1.8  
Bastien Nocera committed
1
AC_INIT([shared-mime-info],[1.8],[https://bugs.freedesktop.org/enter_bug.cgi?product=shared-mime-info])
Thomas Leonard's avatar
Thomas Leonard committed
2

3
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-xz check-news])
4

5
AC_CONFIG_HEADERS([config.h])
6

Bastien Nocera's avatar
Bastien Nocera committed
7 8 9
# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

10 11 12 13 14 15 16
dnl Checks for programs.
AC_PROG_CC

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST


17 18
IT_PROG_INTLTOOL([0.35.0])

19 20 21 22
GETTEXT_PACKAGE=shared-mime-info
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT

23 24
AC_CHECK_FUNCS(fdatasync)

Hib Eris's avatar
Hib Eris committed
25 26 27
dnl Check for cross compiling
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)

28
dnl Check whether libxml and glib are present is installed
29 30
PKG_CHECK_MODULES(ALL, \
		  libxml-2.0 >= 2.4 \
31
                  glib-2.0 >= 2.6.0)
32 33
AC_SUBST(ALL_CFLAGS)
AC_SUBST(ALL_LIBS)
34

35 36 37 38 39
dnl Build the tree magic test if gio is present
PKG_CHECK_MODULES(GIO, gio-2.0, HAVE_GIO=yes, AC_MSG_RESULT(no))

AM_CONDITIONAL([HAVE_GIO], test "x$HAVE_GIO" = "xyes")

40 41 42 43 44 45 46 47 48
dnl Use -Wall, etc if possible
[
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings" ;;
  esac
fi
]
Bastien Nocera's avatar
0.90  
Bastien Nocera committed
49

50 51 52 53 54 55
AC_ARG_ENABLE(default-make-check,
   AC_HELP_STRING([--disable-default-make-check],
                   [run make check by default [default=yes]]),,
    enable_default_make_check=yes)
AM_CONDITIONAL(ENABLE_DEFAULT_MAKE_CHECK, test x$enable_default_make_check = xyes)

56 57 58 59
AC_ARG_ENABLE(update-mimedb,
   AC_HELP_STRING([--disable-update-mimedb],
                   [disable the update-mime-database after install [default=no]]),,
    enable_update_mimedb=yes)
60 61 62 63 64 65 66 67 68

if test $cross_compiling = yes && test x$enable_update_mimedb = xyes; then
  AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database, no)
  if test x$UPDATE_MIME_DATABASE = xno; then
    enable_update_mimedb=no
    AC_MSG_WARN(Could not find the update-mime-database program in your PATH. Your mime database will not be updated upon install.)
  fi
fi

69 70 71
AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes)

AC_PATH_PROG([XMLLINT],[xmllint])
72

73
AC_CONFIG_FILES([
74 75 76
Makefile
shared-mime-info.pc
po/Makefile.in
77 78 79
])

AC_OUTPUT