s/an file/a file/
[platform/upstream/dbus.git] / configure.in
1 dnl -*- mode: m4 -*-
2 AC_PREREQ(2.52)
3
4 AC_INIT(dbus/dbus.h)
5
6 AM_INIT_AUTOMAKE(dbus, 0.1)
7
8 AM_CONFIG_HEADER(config.h)
9
10 # Honor aclocal flags
11 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
12
13 GETTEXT_PACKAGE=dbus-1
14 AC_SUBST(GETTEXT_PACKAGE)
15 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
16
17 AM_MAINTAINER_MODE
18
19 AC_PROG_CC
20 AC_ISC_POSIX
21 AC_HEADER_STDC
22 AM_PROG_LIBTOOL
23
24 AC_ARG_ENABLE(qt,      [  --disable-qt      disable Qt-friendly client library],enable_qt=no,enable_qt=yes)
25 AC_ARG_ENABLE(glib,    [  --disable-glib    disable GLib-friendly client library],enable_glib=no,enable_glib=yes)
26 AC_ARG_ENABLE(tests,   [  --enable-tests enable unit test code],enable_tests=yes,enable_tests=no)
27 AC_ARG_ENABLE(ansi,    [  --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=yes,enable_ansi=no)
28
29 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files 
30 dnl and also some stuff in the test/ subdir
31 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
32 if test x$enable_tests = xyes; then
33     AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
34 fi
35
36 changequote(,)dnl
37 if test "x$GCC" = "xyes"; then
38   case " $CFLAGS " in
39   *[\ \ ]-Wall[\ \      ]*) ;;
40   *) CFLAGS="$CFLAGS -Wall" ;;
41   esac
42
43   case " $CFLAGS " in
44   *[\ \ ]-Wchar-subscripts[\ \  ]*) ;;
45   *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
46   esac
47
48   case " $CFLAGS " in
49   *[\ \ ]-Wmissing-declarations[\ \     ]*) ;;
50   *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
51   esac
52
53   case " $CFLAGS " in
54   *[\ \ ]-Wmissing-prototypes[\ \       ]*) ;;
55   *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
56   esac
57
58   case " $CFLAGS " in
59   *[\ \ ]-Wnested-externs[\ \   ]*) ;;
60   *) CFLAGS="$CFLAGS -Wnested-externs" ;;
61   esac
62
63   case " $CFLAGS " in
64   *[\ \ ]-Wpointer-arith[\ \    ]*) ;;
65   *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
66   esac
67
68   case " $CFLAGS " in
69   *[\ \ ]-Wcast-align[\ \       ]*) ;;
70   *) CFLAGS="$CFLAGS -Wcast-align" ;;
71   esac
72
73   case " $CFLAGS " in
74   *[\ \ ]-Wsign-compare[\ \     ]*) ;;
75   *) CFLAGS="$CFLAGS -Wsign-compare" ;;
76   esac
77
78   if test "x$enable_ansi" = "xyes"; then
79     case " $CFLAGS " in
80     *[\ \       ]-ansi[\ \      ]*) ;;
81     *) CFLAGS="$CFLAGS -ansi" ;;
82     esac
83
84     case " $CFLAGS " in
85     *[\ \       ]-pedantic[\ \  ]*) ;;
86     *) CFLAGS="$CFLAGS -pedantic" ;;
87     esac
88   fi
89 fi
90 changequote([,])dnl
91
92 AC_CHECK_SIZEOF(char)
93 AC_CHECK_SIZEOF(short)
94 AC_CHECK_SIZEOF(long)
95 AC_CHECK_SIZEOF(int)
96 AC_CHECK_SIZEOF(void *)
97 AC_CHECK_SIZEOF(long long)
98 AC_CHECK_SIZEOF(__int64)
99
100 ## byte order
101 AC_C_BIGENDIAN
102
103 AC_CHECK_FUNCS(vsnprintf vasprintf)
104
105 dnl check for writev header and writev function so we're 
106 dnl good to go if HAVE_WRITEV gets defined.
107 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
108
109 DBUS_CLIENT_CFLAGS=
110 DBUS_CLIENT_LIBS=
111 AC_SUBST(DBUS_CLIENT_CFLAGS)
112 AC_SUBST(DBUS_CLIENT_LIBS)
113
114 DBUS_BUS_CFLAGS=
115 DBUS_BUS_LIBS=
116 AC_SUBST(DBUS_BUS_CFLAGS)
117 AC_SUBST(DBUS_BUS_LIBS)
118
119 DBUS_TEST_CFLAGS=
120 DBUS_TEST_LIBS=
121 AC_SUBST(DBUS_TEST_CFLAGS)
122 AC_SUBST(DBUS_TEST_LIBS)
123
124 AC_OUTPUT([
125 Makefile
126 Doxyfile
127 dbus/Makefile
128 bus/Makefile
129 test/Makefile
130 doc/Makefile
131 dbus-1.0.pc
132 ])
133
134 dnl ==========================================================================
135 echo "
136                     D-BUS $VERSION
137                   ==============
138
139         prefix:                 ${prefix}
140         source code location:   ${srcdir}
141         compiler:               ${CC}
142
143         Building unit tests:    ${enable_tests}
144         Building Qt bindings:   ${enable_qt}
145         Building GLib bindings: ${enable_glib}
146 "
147
148 if test x$enable_tests = xyes; then
149         echo "NOTE: building with unit tests increases the size of the installed library"
150 fi
151 if test x$enable_qt = xyes; then
152         echo "NOTE: Qt bindings don't actually exist yet"
153 fi
154 if test x$enable_glib = xyes; then
155         echo "NOTE: GLib bindings don't actually exist yet"
156 fi
157