Imported Upstream version 0.20
[platform/upstream/desktop-file-utils.git] / configure.ac
1 AC_INIT([desktop-file-utils], [0.20],
2         [https://bugs.freedesktop.org/enter_bug.cgi?product=desktop-file-utils])
3 AC_CONFIG_SRCDIR(src/validate.h)
4
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)
9
10 AC_PROG_LN_S
11 AC_PROG_CC
12
13 if test "x$GCC" = "xyes"; then
14   changequote(,)dnl
15   case " $CFLAGS " in
16   *[\ \ ]-Wall[\ \      ]*) ;;
17   *) CFLAGS="$CFLAGS -Wall" ;;
18   esac
19
20   case " $CFLAGS " in
21   *[\ \ ]-Wchar-subscripts[\ \  ]*) ;;
22   *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
23   esac
24
25   case " $CFLAGS " in
26   *[\ \ ]-Wmissing-declarations[\ \     ]*) ;;
27   *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
28   esac
29
30   case " $CFLAGS " in
31   *[\ \ ]-Wmissing-prototypes[\ \       ]*) ;;
32   *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
33   esac
34
35   case " $CFLAGS " in
36   *[\ \ ]-Wnested-externs[\ \   ]*) ;;
37   *) CFLAGS="$CFLAGS -Wnested-externs" ;;
38   esac
39
40   case " $CFLAGS " in
41   *[\ \ ]-Wpointer-arith[\ \    ]*) ;;
42   *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
43   esac
44
45   case " $CFLAGS " in
46   *[\ \ ]-Wcast-align[\ \       ]*) ;;
47   *) CFLAGS="$CFLAGS -Wcast-align" ;;
48   esac
49
50   case " $CFLAGS " in
51   *[\ \ ]-Wsign-compare[\ \     ]*) ;;
52   *) CFLAGS="$CFLAGS -Wsign-compare" ;;
53   esac
54
55   if test "x$enable_ansi" = "xyes"; then
56     case " $CFLAGS " in
57     *[\ \       ]-ansi[\ \      ]*) ;;
58     *) CFLAGS="$CFLAGS -ansi" ;;
59     esac
60
61     case " $CFLAGS " in
62     *[\ \       ]-pedantic[\ \  ]*) ;;
63     *) CFLAGS="$CFLAGS -pedantic" ;;
64     esac
65   fi
66   if test x$enable_gcov = xyes; then
67     case " $CFLAGS " in
68     *[\ \       ]-fprofile-arcs[\ \     ]*) ;;
69     *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
70     esac
71     case " $CFLAGS " in
72     *[\ \       ]-ftest-coverage[\ \    ]*) ;;
73     *) CFLAGS="$CFLAGS -ftest-coverage" ;;
74     esac
75
76     ## remove optimization
77     CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
78   fi
79   changequote([,])dnl
80 else
81   if test x$enable_gcov = xyes; then
82     AC_MSG_ERROR([--enable-gcov can only be used with gcc])
83   fi
84 fi
85
86 changequote(,)dnl
87 # compress spaces in flags
88 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
89 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
90 changequote([,])dnl
91
92 PKG_CHECK_MODULES(DESKTOP_FILE_UTILS, glib-2.0 >= 2.8.0)
93
94 AM_PATH_LISPDIR
95
96 AC_CONFIG_FILES([
97 Makefile
98 man/Makefile
99 misc/Makefile
100 src/Makefile
101 ])
102
103 AC_OUTPUT