summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac82
1 files changed, 78 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 6737f6f..33f6151 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,45 @@ else
42 fi 42 fi
43fi 43fi
44 44
45AC_ARG_WITH([udevrulesdir],
46 AS_HELP_STRING([--with-udevrulesdir=DIR],
47 [Directory for udev rules]),
48 [],
49 [with_udevrulesdir=auto])
50if test "x$with_udevrulesdir" = "xauto"; then
51 udevdir=$($PKG_CONFIG --variable=udevdir udev)
52 if test "x$udevdir" != "x"; then
53 with_udevrulesdir=$udevdir"/rules.d"
54 else
55 with_udevrulesdir=$prefix/lib/udev/rules.d
56 fi
57fi
58AC_SUBST([udevrulesdir], [$with_udevrulesdir])
59
60AC_ARG_WITH([systemd],
61 [AS_HELP_STRING([--without-systemd],
62 [do not build with systemd support @<:@default=yes@:>@])],
63 [with_systemd=no],
64 [with_systemd=yes])
65
66AC_ARG_WITH([systemdsystemunitdir],
67 [AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
68 [directory for systemd service files])],
69 [with_systemdsystemunitdir=$withval],
70 [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
71
72if test "x$with_systemdsystemunitdir" != xno; then
73 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
74fi
75AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno -a "x$with_systemd" = "xyes" ])
76
77if test "x$with_systemd" = xyes; then
78 udev_activation_rule="TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"usbmuxd.service\""
79else
80 udev_activation_rule="RUN+=\"@sbindir@/usbmuxd -u -U usbmux\""
81fi
82AC_SUBST(udev_activation_rule)
83
45# Checks for header files. 84# Checks for header files.
46AC_HEADER_STDC 85AC_HEADER_STDC
47AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) 86AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
@@ -61,20 +100,40 @@ AC_CHECK_FUNCS([strcasecmp strdup strerror strndup stpcpy])
61 100
62# Check for operating system 101# Check for operating system
63AC_MSG_CHECKING([whether to enable WIN32 build settings]) 102AC_MSG_CHECKING([whether to enable WIN32 build settings])
103UDEV_SUB=
104SYSTEMD_SUB=
64case ${host_os} in 105case ${host_os} in
65 *mingw32*|*cygwin*) 106 *mingw32*|*cygwin*)
66 win32=true 107 win32=true
67 AC_MSG_RESULT([yes]) 108 AC_MSG_RESULT([yes])
68 AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found])) 109 AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
69 AC_SUBST(WINDRES) 110 AC_SUBST(WINDRES)
111 activation_method="manual"
112 ;;
113 darwin*)
114 win32=false
115 AC_MSG_RESULT([no])
116 activation_method="launchd"
70 ;; 117 ;;
71 *) 118 *)
72 win32=false 119 win32=false
73 AC_MSG_RESULT([no]) 120 AC_MSG_RESULT([no])
121 UDEV_SUB=udev
122 activation_method="systemd"
123 if test "x$with_systemd" != "xyes"; then
124 echo "*** Note: support for systemd activation has been disabled, using udev activation instead ***"
125 activation_method="udev"
126 else
127 AC_DEFINE(WITH_SYSTEMD, 1, [Define to enable systemd support])
128 SYSTEMD_SUB=systemd
129 fi
74 ;; 130 ;;
75esac 131esac
76AM_CONDITIONAL(WIN32, test x$win32 = xtrue) 132AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
77 133
134AC_SUBST([UDEV_SUB])
135AC_SUBST([SYSTEMD_SUB])
136
78AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-g -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") 137AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-g -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter")
79AC_SUBST(GLOBAL_CFLAGS) 138AC_SUBST(GLOBAL_CFLAGS)
80 139
@@ -83,15 +142,30 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
83AC_OUTPUT([ 142AC_OUTPUT([
84Makefile 143Makefile
85src/Makefile 144src/Makefile
86udev/39-usbmuxd.rules 145udev/Makefile
146systemd/Makefile
87]) 147])
88 148
89echo " 149echo -n "
90Configuration for $PACKAGE $VERSION: 150Configuration for $PACKAGE $VERSION:
91------------------------------------------- 151-------------------------------------------
92 152
93 Install prefix: ...........: $prefix 153 install prefix ............: $prefix
94 Preflight worker support ..: $have_limd 154 preflight worker support ..: $have_limd
155 activation method .........: $activation_method
156"
157
158if test "x$activation_method" = "xsystemd"; then
159 echo -n " systemd unit directory ....: ${systemdsystemunitdir}
160"
161fi
162
163if test -n "$udevrulesdir"; then
164 echo -n " udev rules directory ......: ${udevrulesdir}
165"
166fi
167
168echo " compiler ..................: ${CC}
95 169
96 Now type 'make' to build $PACKAGE $VERSION, 170 Now type 'make' to build $PACKAGE $VERSION,
97 and then 'make install' for installation. 171 and then 'make install' for installation.