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