forked from google/ios-webkit-debug-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
94 lines (79 loc) · 3.29 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
# Google BSD license https://developers.google.com/google-bsd-license
# Copyright 2012 Google Inc. wrightt@google.com
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([ios_webkit_debug_proxy], [1.9.0], [https://github.com/google/ios-webkit-debug-proxy/issues])
AM_INIT_AUTOMAKE([1.10 no-define])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
# Checks for libraries.
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0)
PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
PKG_CHECK_MODULES(libusbmuxd, libusbmuxd-2.0 >= 2.0.0)
PKG_CHECK_MODULES(openssl, openssl >= 1.1.0)
AC_CHECK_LIB([plist-2.0], [plist_to_xml],
[ ], [AC_MSG_FAILURE([*** Unable to link with libplist])],
[$libplist_LIBS])
AC_CHECK_LIB([m], [log10])
AC_CHECK_LIB([imobiledevice-1.0], [idevice_new],
[ ], [AC_MSG_FAILURE([*** Unable to link with libimobiledevice])],
[$libimobiledevice_LIBS])
LT_INIT
# Defines versions of required modules
libimobiledevice_version=`$PKG_CONFIG --modversion libimobiledevice-1.0`
libplist_version=`$PKG_CONFIG --modversion libplist-2.0`
libusbmuxd_version=`$PKG_CONFIG --modversion libusbmuxd-2.0`
AC_DEFINE_UNQUOTED([LIBIMOBILEDEVICE_VERSION], ["$libimobiledevice_version"], [ ])
AC_DEFINE_UNQUOTED([LIBPLIST_VERSION], ["$libplist_version"], [ ])
AC_DEFINE_UNQUOTED([LIBUSBMUXD_VERSION], ["$libusbmuxd_version"], [ ])
[libplist_version_major=`expr "$libplist_version" : '\([0-9]*\)'`]
[libplist_version_minor=`expr "$libplist_version" : '[0-9]*\.\([0-9]*\)'`]
AC_DEFINE_UNQUOTED([LIBPLIST_VERSION_MAJOR], [$libplist_version_major], [ ])
AC_DEFINE_UNQUOTED([LIBPLIST_VERSION_MINOR], [$libplist_version_minor], [ ])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_RESOLV
AC_CHECK_HEADERS([arpa/inet.h inttypes.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
# Check for operating system
AC_MSG_CHECKING([whether to enable WIN32 build settings])
case ${host_os} in
*mingw*|*msys*|*cygwin*)
win32=true
AC_MSG_RESULT([yes])
AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define to limit the scope of windows.h])
AC_DEFINE(__USE_MINGW_ANSI_STDIO, 1, [Define to use C99 printf/snprintf in MinGW])
;;
*)
win32=false
AC_MSG_RESULT([no])
;;
esac
AM_CONDITIONAL(WIN32, test "x$win32" = "xtrue")
# Check for pcre presence if regex.h is absent
AC_CHECK_HEADER(regex.h, [ac_have_regex_h="yes"], [ac_have_regex_h="no"])
if test "x$ac_have_regex_h" = "xno"; then
PKG_CHECK_MODULES(libpcreposix, libpcreposix, [], [AC_MSG_ERROR([Neither regex.h nor pcre headers were found])])
else
AC_DEFINE(HAVE_REGEX_H, 1, [regex.h is present])
fi
AC_CHECK_FUNCS([memmove memset regcomp select socket strcasecmp strncasecmp strchr strdup strndup strrchr strstr strtol strcasestr getline])
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile examples/Makefile])
CFLAGS="${CFLAGS} -Wall -Werror"
AC_OUTPUT