chiark / gitweb /
gudev: move from udev-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([--enable-extras], [enable extras with external dependencies]),
63         [], [enable_extras=no])
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 fi
69 AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
70
71 AC_ARG_ENABLE([introspection],
72         AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
73         [], [enable_introspection=no])
74 if test "$enable_introspection" = xyes; then
75         PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
76         AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
77         AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
78         AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
79         AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
80         AC_SUBST([GIRDIR], [$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)])
81         AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)])
82 fi
83 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
84
85 AC_CONFIG_HEADERS(config.h)
86 AC_CONFIG_FILES([
87         Makefile
88         libudev/Makefile
89         libudev/libudev.pc
90         libudev/docs/Makefile
91         libudev/docs/version.xml
92         udev/Makefile
93         rules/Makefile
94         extras/Makefile
95         extras/ata_id/Makefile
96         extras/cdrom_id/Makefile
97         extras/edd_id/Makefile
98         extras/path_id/Makefile
99         extras/firmware/Makefile
100         extras/collect/Makefile
101         extras/floppy/Makefile
102         extras/fstab_import/Makefile
103         extras/rule_generator/Makefile
104         extras/scsi_id/Makefile
105         extras/usb_id/Makefile
106         extras/udev-acl/Makefile
107         extras/gudev/Makefile
108         extras/gudev/gudev-1.0.pc
109         extras/gudev/docs/Makefile
110         extras/gudev/docs/version.xml
111 ])
112
113 AC_OUTPUT
114 AC_MSG_RESULT([
115         udev $VERSION
116         ========
117
118         prefix:                 ${prefix}
119         exec_prefix:            ${exec_prefix}
120         udev_prefix:            ${udev_prefix}
121         libdir:                 ${libdir}
122         libdir_name:            ${libdir_name}
123         datarootdir:            ${datarootdir}
124         mandir:                 ${mandir}
125         includedir:             ${includedir}
126
127         logging:                ${enable_logging}
128         debug:                  ${enable_debug}
129         selinux:                ${with_selinux}
130
131         compiler:               ${CC}
132         cflags:                 ${CFLAGS}
133         ldflags:                ${LDFLAGS}
134
135         extras:                 ${enable_extras}
136         gintrospection:         ${enable_introspection}
137
138         xsltproc:               ${XSLTPROC}
139 ])