1 AC_INIT([desktop-file-utils], [0.22],
2 [https://bugs.freedesktop.org/enter_bug.cgi?product=desktop-file-utils])
3 AC_CONFIG_SRCDIR(src/validate.h)
5 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz tar-ustar])
6 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
7 AC_CONFIG_MACRO_DIR([m4])
8 AM_CONFIG_HEADER(config.h)
13 if test "x$GCC" = "xyes"; then
16 *[\ \ ]-Wall[\ \ ]*) ;;
17 *) CFLAGS="$CFLAGS -Wall" ;;
21 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
22 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
26 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
27 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
31 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
32 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
36 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
37 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
41 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
42 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
46 *[\ \ ]-Wcast-align[\ \ ]*) ;;
47 *) CFLAGS="$CFLAGS -Wcast-align" ;;
51 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
52 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
55 if test "x$enable_ansi" = "xyes"; then
57 *[\ \ ]-ansi[\ \ ]*) ;;
58 *) CFLAGS="$CFLAGS -ansi" ;;
62 *[\ \ ]-pedantic[\ \ ]*) ;;
63 *) CFLAGS="$CFLAGS -pedantic" ;;
66 if test x$enable_gcov = xyes; then
68 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
69 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
72 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
73 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
76 ## remove optimization
77 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
81 if test x$enable_gcov = xyes; then
82 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
87 # compress spaces in flags
88 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
89 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
92 PKG_CHECK_MODULES(DESKTOP_FILE_UTILS, glib-2.0 >= 2.8.0)