-
Notifications
You must be signed in to change notification settings - Fork 45
/
configure.ac
98 lines (84 loc) · 2.24 KB
/
configure.ac
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
AC_PREREQ([2.69])
AC_INIT([simple-mtpfs],[0.4.0],[[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2 -Wall])
AC_CONFIG_SRCDIR([src/simple-mtpfs-fuse.cpp])
AC_CONFIG_HEADERS([config.h])
AC_LANG([C++])
AC_PROG_CXX
AC_PROG_INSTALL
AX_CXX_COMPILE_STDCXX_17([noext])
AX_CXXFLAGS_WARN_ALL
AC_CHECK_LIB([mtp], [LIBMTP_Init], [], [AC_MSG_ERROR([libmtp not found])])
AC_CHECK_LIB([mtp], [LIBMTP_Check_Capability],
[AC_DEFINE([HAVE_LIBMTP_CHECK_CAPABILITY], [1], [Check device capabilities])],
[])
AC_CHECK_HEADERS([libmtp.h])
dnl Enable fdatasync, but not on OSX
os_name=$(uname -s)
test "x$os_name" == "xDarwin" || AC_CHECK_FUNCS([fdatasync])
PKG_CHECK_MODULES([FUSE], [fuse >= 2.7.3])
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
PKG_CHECK_MODULES(
[LIBUSB1],
[libusb-1.0 >= 1.0.0],
[AC_DEFINE([HAVE_LIBUSB1], [], [Have libusb 1.0])]
)
dnl Configurable temporary directory
AC_ARG_WITH(
[tmpdir],
[AS_HELP_STRING([--with-tmpdir=DIR],
[Directory for temporary files, defaults to /tmp])],
[tmpdir="$withval"],
[tmpdir="/tmp"]
)
AC_DEFINE_UNQUOTED(
[TMPDIR],
["${tmpdir}"],
[Directory for temporary files]
)
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
AC_CONFIG_FILES([
makefile
src/makefile
man/makefile
])
AC_OUTPUT
AC_MSG_NOTICE([
simple-mtpfs $VERSION
==================
prefix: ${prefix}
tmpdir: ${tmpdir}
usbdev: ${usb_devpath}
Now type 'make' to build $PACKAGE
])