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