summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac96
1 files changed, 96 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a874692
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,96 @@
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.61)
5AC_INIT(usbmuxd, 1.0.8, nospam@nowhere.com)
6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
8AC_CONFIG_SRCDIR([src/])
9AC_CONFIG_HEADERS([config.h])
10AC_CONFIG_MACRO_DIR([m4])
11
12# Checks for programs.
13AC_PROG_CC
14AC_PROG_CXX
15AM_PROG_CC_C_O
16AC_PROG_LIBTOOL
17
18# Checks for libraries.
19PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.3)
20PKG_CHECK_MODULES(libplist, libplist >= 1.9, have_plist=yes, have_plist=no)
21
22AC_ARG_WITH([protov1],
23 [AS_HELP_STRING([--without-protov1],
24 [do not build with protocol v1 support (default is yes)])],
25 [with_protov1=no],
26 [with_protov1=yes])
27
28if test "x$have_plist" = "xyes"; then
29 if test "x$with_protov1" != "xyes"; then
30 have_plist=no
31 echo "*** Note: Protocol V1 support has been disabled ***"
32 else
33 AC_DEFINE(HAVE_PLIST, 1, [Define if you have libplist support])
34 AC_SUBST(libplist_CFLAGS)
35 AC_SUBST(libplist_LIBS)
36 fi
37else
38 if test "x$with_protov1" == "xyes"; then
39 AC_MSG_ERROR([protocol V1 support requested but libplist could not be found])
40 fi
41fi
42
43# Checks for header files.
44AC_HEADER_STDC
45AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
46
47# Checks for typedefs, structures, and compiler characteristics.
48AC_C_CONST
49AC_TYPE_SIZE_T
50AC_TYPE_SSIZE_T
51AC_TYPE_UINT16_T
52AC_TYPE_UINT32_T
53AC_TYPE_UINT8_T
54
55# Checks for library functions.
56AC_FUNC_MALLOC
57AC_FUNC_REALLOC
58AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
59
60# Check for operating system
61AC_MSG_CHECKING([whether to enable WIN32 build settings])
62case ${host_os} in
63 *mingw32*|*cygwin*)
64 win32=true
65 AC_MSG_RESULT([yes])
66 AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
67 AC_SUBST(WINDRES)
68 ;;
69 *)
70 win32=false
71 AC_MSG_RESULT([no])
72 ;;
73esac
74AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
75
76AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter")
77AC_SUBST(GLOBAL_CFLAGS)
78
79m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
80
81AC_OUTPUT([
82Makefile
83src/Makefile
84udev/85-usbmuxd.rules
85])
86
87echo "
88Configuration for $PACKAGE $VERSION:
89-------------------------------------------
90
91 Install prefix: .........: $prefix
92 Protocol v1 support: ....: $have_plist
93
94 Now type 'make' to build $PACKAGE $VERSION,
95 and then 'make install' for installation.
96"