1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
AC_PREREQ(2.52)
AC_INIT(src/udevil.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(udevil, 0.4.4)
AC_PROG_INTLTOOL([0.21])
AM_MAINTAINER_MODE
AC_ISC_POSIX
AM_PROG_CC_C_O
AC_HEADER_STDC
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_DEFINE_UNQUOTED(UDEVIL_VERSION, "$VERSION", [udevil version])
# sysconfdir defaults to /usr/local/etc if this is not done:
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
dnl linker optimizations
AC_MSG_CHECKING([whether $LD accepts --as-needed])
case `$LD --as-needed -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,--as-needed"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_MSG_CHECKING([whether $LD accepts -O1])
case `$LD -O1 -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,-O1"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions])
case `$LD -Bsymbolic-functions -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
dnl advanced compiler tweaking
CPPFLAGS="$CPPFLAGS -fstrict-aliasing -fmessage-length=0"
# program paths
AC_ARG_WITH(mount-prog,
AC_HELP_STRING([--with-mount-prog=PATH], [Path to mount program (default: /bin/mount)]),
AC_DEFINE_UNQUOTED(MOUNTPROG, "$withval", [path to mount]),
AC_DEFINE_UNQUOTED(MOUNTPROG, "/bin/mount", [path to mount]))
mountprog="$withval"
AC_ARG_WITH(umount-prog,
AC_HELP_STRING([--with-umount-prog=PATH], [Path to umount program (default: /bin/umount)]),
AC_DEFINE_UNQUOTED(UMOUNTPROG, "$withval", [path to umount]),
AC_DEFINE_UNQUOTED(UMOUNTPROG, "/bin/umount", [path to umount]))
umountprog="$withval"
AC_ARG_WITH(losetup-prog,
AC_HELP_STRING([--with-losetup-prog=PATH], [Path to losetup program (default: /sbin/losetup)]),
AC_DEFINE_UNQUOTED(LOSETUPPROG, "$withval", [path to losetup]),
AC_DEFINE_UNQUOTED(LOSETUPPROG, "/sbin/losetup", [path to losetup]))
losetupprog="$withval"
AC_ARG_WITH(setfacl-prog,
AC_HELP_STRING([--with-setfacl-prog=PATH], [Path to setfacl program (default: /usr/bin/setfacl)]),
AC_DEFINE_UNQUOTED(SETFACLPROG, "$withval", [path to setfacl]),
AC_DEFINE_UNQUOTED(SETFACLPROG, "/usr/bin/setfacl", [path to setfacl]))
setfaclprog="$withval"
# options
AC_ARG_ENABLE(
[systemd],
AS_HELP_STRING([--disable-systemd],
[disable installation of devmon daemon files for systemd (default: enable)]),
use_systemd=$enableval, use_systemd="yes")
if test x"$use_systemd" = x"yes"; then
AC_DEFINE([ADD_SYSTEMD], [1], [Copy devmon daemon systemd files])
fi
AM_CONDITIONAL(ADD_SYSTEMD, test "$use_systemd" = "yes")
# check for libs gobject-2.0 gmodule-2.0 gthread-2.0
dnl Check for glib 2.0
PKG_CHECK_MODULES(GLIB, [glib-2.0], , [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
You must install GLib 2.0 development headers (eg libglib2.0-dev) to build.
If you have these installed already you may need to install pkg-config so
I can find them.
])])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
dnl Check udev support
PKG_CHECK_MODULES(LIBUDEV, [libudev >= 143], , [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
You must install libudev development headers (eg libudev-dev) to build.
If you have these installed already you may need to install pkg-config so
I can find them.
])])
AC_SUBST(LIBUDEV_CFLAGS)
AC_SUBST(LIBUDEV_LIBS)
#dnl Large file support
CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64"
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
AC_DEFINE(_LARGEFILE_SOURCE, 1, [Whether to enable large file support])
GETTEXT_PACKAGE="udevil"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
dnl Add the languages which your application supports here.
#ALL_LINGUAS="af ar da ca cs de es et eu fa fi fr gl he hr hu id it ja ko lt ml ms nb nl nn pl ps pt pt_BR ru sk sl sv tr uk ur ur_PK vi zh_CN zh_TW"
ALL_LINGUAS="ru"
AM_GLIB_GNU_GETTEXT
AC_OUTPUT([
Makefile
po/Makefile.in
man/Makefile
etc/Makefile
src/Makefile
])
echo
echo udevil....................................... : Version $VERSION
echo
echo Linux device support......................... : libudev
if test x"$mountprog" != x""; then
echo mount program................................ : $mountprog
else
echo mount program................................ : /bin/mount
fi
if test x"$umountprog" != x""; then
echo umount program............................... : $umountprog
else
echo umount program............................... : /bin/umount
fi
if test x"$losetupprog" != x""; then
echo losetup program.............................. : $losetupprog
else
echo losetup program.............................. : /sbin/losetup
fi
if test x"$setfaclprog" != x""; then
echo setfacl program.............................. : $setfaclprog
else
echo setfacl program.............................. : /usr/bin/setfacl
fi
echo Install devmon systemd service files ?....... : $use_systemd
echo Installation Prefix.......................... : $prefix
echo " The binary will be installed as $prefix/bin/udevil"
echo sysconfdir................................... : $sysconfdir
echo " The configuration will be installed in $sysconfdir/udevil"
echo
echo 'Homepage: http://ignorantguru.github.io/udevil/'
echo
|