chiark / gitweb /
c73872e1ac46fe82b7204bb0404a8af433a5b548
[elogind.git] / configure.ac
1 AC_INIT([udev], [143], [linux-hotplug@vger.kernel.org])
2 AC_PREREQ(2.60)
3 AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2])
4 AC_DISABLE_STATIC
5 AC_USE_SYSTEM_EXTENSIONS
6 dnl AM_SILENT_RULES
7 AC_SYS_LARGEFILE
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_PROG_LIBTOOL
10 GTK_DOC_CHECK(1.10)
11 AC_PREFIX_DEFAULT([/usr])
12 AC_PATH_PROG([XSLTPROC], [xsltproc])
13
14 AC_ARG_WITH([rootlibdir],
15         AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
16         [], [with_rootlibdir=$libdir])
17 AC_SUBST([rootlibdir], [$with_rootlibdir])
18
19 AC_ARG_WITH([selinux],
20         AS_HELP_STRING([--with-selinux], [enable SELinux support]),
21         [], [with_selinux=no])
22 if test "x$with_selinux" = xyes; then
23         LIBS_save=$LIBS
24         AC_CHECK_LIB(selinux, getprevcon,
25                 [],
26                 AC_MSG_ERROR([SELinux selected but libselinux not found]))
27         LIBS=$LIBS_save
28         SELINUX_LIBS="-lselinux -lsepol"
29         AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
30 fi
31 AC_SUBST([SELINUX_LIBS])
32 AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = xyes])
33
34 AC_ARG_ENABLE([debug],
35         AS_HELP_STRING([--enable-debug], [enable debug messages]),
36         [], [enable_debug=no])
37 if test "x$enable_debug" = "xyes"; then
38         AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
39 fi
40
41 AC_ARG_ENABLE([logging],
42         AS_HELP_STRING([--disable-logging], [disable system logging]),
43         [], enable_logging=yes)
44 if test "x$enable_logging" = "xyes"; then
45         AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
46 fi
47
48 AC_ARG_ENABLE([extras],
49         AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]),
50         [], [enable_extras=yes])
51 if test "x$enable_extras" = xyes; then
52         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0])
53         AC_SUBST([GLIB_CFLAGS])
54         AC_SUBST([GLIB_LIBS])
55
56         AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
57         AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
58
59         PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
60         AC_SUBST(LIBUSB_CFLAGS)
61         AC_SUBST(LIBUSB_LIBS)
62
63         PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
64         AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
65
66         AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
67         AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
68         AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
69         AC_ARG_WITH(pci-ids-path,
70                 AS_HELP_STRING([--pci-ids-path=DIR], [Path to pci.ids file]),
71                 [PCI_DATABASE=${withval}],
72                 [if test -n "$pciids" ; then
73                         PCI_DATABASE="$pciids"
74                 else
75                         AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
76                 fi])
77         AC_SUBST(PCI_DATABASE)
78 fi
79 AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
80
81 AC_ARG_ENABLE([introspection],
82         AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
83         [], [enable_introspection=no])
84 if test "x$enable_introspection" = xyes; then
85         PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
86         AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
87         AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
88         AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
89         AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
90         AC_SUBST([GIRDIR], [$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)])
91         AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)])
92 fi
93 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
94
95 AC_CONFIG_HEADERS(config.h)
96 AC_CONFIG_FILES([
97         Makefile
98         libudev/Makefile
99         libudev/libudev.pc
100         libudev/docs/Makefile
101         libudev/docs/version.xml
102         udev/Makefile
103         rules/Makefile
104         extras/Makefile
105         extras/ata_id/Makefile
106         extras/cdrom_id/Makefile
107         extras/edd_id/Makefile
108         extras/path_id/Makefile
109         extras/firmware/Makefile
110         extras/collect/Makefile
111         extras/floppy/Makefile
112         extras/fstab_import/Makefile
113         extras/rule_generator/Makefile
114         extras/scsi_id/Makefile
115         extras/usb_id/Makefile
116         extras/v4l_id/Makefile
117         extras/hid2hci/Makefile
118         extras/udev-acl/Makefile
119         extras/usb-db/Makefile
120         extras/gudev/Makefile
121         extras/gudev/gudev-1.0.pc
122         extras/gudev/docs/Makefile
123         extras/gudev/docs/version.xml
124 ])
125
126 AC_OUTPUT
127 AC_MSG_RESULT([
128         udev $VERSION
129         ========
130
131         prefix:                 ${prefix}
132         sysconfdir:             ${sysconfdir}
133         sbindir:                ${sbindir}
134         libdir:                 ${libdir}
135         rootlibdir:             ${rootlibdir}
136         libexecdir:             ${libexecdir}
137
138         datarootdir:            ${datarootdir}
139         mandir:                 ${mandir}
140         includedir:             ${includedir}
141
142         logging:                ${enable_logging}
143         debug:                  ${enable_debug}
144         selinux:                ${with_selinux}
145
146         compiler:               ${CC}
147         cflags:                 ${CFLAGS}
148         ldflags:                ${LDFLAGS}
149
150         extras:                 ${enable_extras}
151         gintrospection:         ${enable_introspection}
152
153         usb.ids:                ${USB_DATABASE}
154         pci.ids:                ${PCI_DATABASE}
155
156         xsltproc:               ${XSLTPROC}
157 ])