2012-09-22 10:42:50 +00:00
|
|
|
AC_PREREQ([2.60])
|
2016-12-25 12:24:04 +00:00
|
|
|
AC_INIT([simple-mtpfs], [0.3.0], [phatina@gmail.com])
|
2012-09-22 10:42:50 +00:00
|
|
|
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
2013-12-03 20:14:11 +00:00
|
|
|
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
2012-09-22 10:42:50 +00:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
|
|
|
|
AC_LANG([C++])
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
m4_include([m4/cxx11.m4])
|
|
|
|
AX_CXX_COMPILE_STDCXX_11([noext])
|
|
|
|
AC_CHECK_LIB([mtp], [LIBMTP_Init], [], [AC_MSG_ERROR([libmtp not found])])
|
2014-11-12 08:29:34 +00:00
|
|
|
AC_CHECK_LIB([mtp], [LIBMTP_Check_Capability],
|
|
|
|
[AC_DEFINE([HAVE_LIBMTP_CHECK_CAPABILITY], [1], [Check device capabilities])],
|
|
|
|
[])
|
2012-09-22 10:42:50 +00:00
|
|
|
AC_CHECK_HEADERS([libmtp.h])
|
2013-11-23 12:19:34 +00:00
|
|
|
|
|
|
|
dnl Enable fdatasync, but not on OSX
|
2015-05-04 06:53:07 +00:00
|
|
|
os_name=$(uname -s)
|
|
|
|
test "x$os_name" == "xDarwin" || AC_CHECK_FUNCS([fdatasync])
|
2012-09-22 10:42:50 +00:00
|
|
|
|
2013-11-23 11:59:13 +00:00
|
|
|
PKG_CHECK_MODULES([FUSE], [fuse >= 2.7.3])
|
2015-05-04 06:53:07 +00:00
|
|
|
if test "x$os_name" == "xDarwin"; then
|
|
|
|
AC_SUBST([FUSE_CFLAGS],["-D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse"])
|
|
|
|
AC_SUBST([FUSE_LIBS],["-L/usr/local/lib -losxfuse -pthread -liconv"])
|
|
|
|
fi
|
2012-09-22 10:42:50 +00:00
|
|
|
|
2013-09-17 19:43:36 +00:00
|
|
|
PKG_CHECK_MODULES(
|
|
|
|
[LIBUSB1],
|
|
|
|
[libusb-1.0 >= 1.0.0],
|
|
|
|
[AC_DEFINE([HAVE_LIBUSB1], [], [Have libusb 1.0])]
|
|
|
|
)
|
|
|
|
|
2013-11-18 19:11:10 +00:00
|
|
|
dnl Configurable temporary directory
|
|
|
|
AC_ARG_WITH(
|
|
|
|
[tmpdir],
|
2015-08-23 09:32:24 +00:00
|
|
|
[AS_HELP_STRING([--with-tmpdir=DIR],
|
2013-11-18 19:11:10 +00:00
|
|
|
[Directory for temporary files, defaults to /tmp])],
|
|
|
|
[tmpdir="$withval"],
|
|
|
|
[tmpdir="/tmp"]
|
|
|
|
)
|
|
|
|
AC_DEFINE_UNQUOTED(
|
|
|
|
[TMPDIR],
|
|
|
|
["${tmpdir}"],
|
|
|
|
[Directory for temporary files]
|
|
|
|
)
|
|
|
|
|
2015-08-23 09:11:10 +00:00
|
|
|
dnl Configurable USB device path
|
|
|
|
case $os_name in
|
|
|
|
Linux)
|
|
|
|
usb_devpath="/dev/bus/usb/%u/%u"
|
|
|
|
;;
|
|
|
|
FreeBSD)
|
|
|
|
usb_devpath="/dev/usb/%u.%u.0"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usb_devpath="%u/%u"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_ARG_WITH(
|
|
|
|
[usbdev],
|
|
|
|
[AS_HELP_STRING([--with-usbdev=FILE],
|
|
|
|
[USB device path. String in sscanf() format])],
|
|
|
|
[usb_devpath="$withval"],
|
|
|
|
[]
|
|
|
|
)
|
|
|
|
if test "x$usb_devpath" != "x%u/%u"; then
|
|
|
|
AC_DEFINE_UNQUOTED(
|
|
|
|
[USB_DEVPATH],
|
|
|
|
["$usb_devpath"],
|
|
|
|
[USB device path format string]
|
|
|
|
)
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([Mounting by real device path is not supported. Fallback to <bus>/<device> notation]);
|
|
|
|
fi
|
|
|
|
|
2012-09-22 10:42:50 +00:00
|
|
|
AC_OUTPUT([
|
|
|
|
makefile
|
|
|
|
src/makefile
|
|
|
|
man/makefile
|
|
|
|
])
|
2013-11-18 19:12:26 +00:00
|
|
|
|
|
|
|
AC_MSG_NOTICE([
|
|
|
|
|
|
|
|
simple-mtpfs $VERSION
|
2016-11-27 15:12:57 +00:00
|
|
|
==================
|
2013-11-18 19:12:26 +00:00
|
|
|
|
|
|
|
prefix: ${prefix}
|
|
|
|
tmpdir: ${tmpdir}
|
2015-08-23 09:11:10 +00:00
|
|
|
usbdev: ${usb_devpath}
|
2013-11-18 19:12:26 +00:00
|
|
|
|
|
|
|
Now type 'make' to build $PACKAGE
|
|
|
|
])
|