summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac95
1 files changed, 44 insertions, 51 deletions
diff --git a/configure.ac b/configure.ac
index ed81dde..d0a052f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,34 +2,36 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([idevicerestore],[1.0.1],[https://github.com/libimobiledevice/idevicerestore/issues],[],[https://libimobiledevice.org])
-
-AC_CANONICAL_TARGET
+AC_INIT([idevicerestore], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/idevicerestore/issues], [], [https://libimobiledevice.org])
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
-
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
-
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
+# Check if we have a version defined
+if test -z $PACKAGE_VERSION; then
+ AC_MSG_ERROR([PACKAGE_VERSION is not defined. Make sure to configure a source tree checked out from git or that .tarball-version is present.])
+fi
# Minimum package versions
-LIBIRECOVERY_VERSION=1.0.1
+LIBIRECOVERY_VERSION=1.2.0
LIBIMOBILEDEVICE_VERSION=1.3.0
-LIBPLIST_VERSION=2.2.0
-LIMD_GLUE_VERSION=1.0.0
+LIBUSBMUXD_VERSION=2.0.2
+LIBPLIST_VERSION=2.6.0
+LIMD_GLUE_VERSION=1.3.0
+LIBTATSU_VERSION=1.0.3
LIBZIP_VERSION=1.0
LIBCURL_VERSION=7.0
-OPENSSL_VERSION=0.9.8
AC_SUBST(LIBIRECOVERY_VERSION)
AC_SUBST(LIBIMOBILEDEVICE_VERSION)
+AC_SUBST(LIBUSBMUXD_VERSION)
AC_SUBST(LIBPLIST_VERSION)
AC_SUBST(LIMD_GLUE_VERSION)
+AC_SUBST(LIBTATSU_VERSION)
AC_SUBST(LIBZIP_VERSION)
AC_SUBST(LIBCURL_VERSION)
-AC_SUBST(OPENSSL_VERSION)
# Checks for programs.
AC_PROG_CC
@@ -39,46 +41,63 @@ LT_INIT
# Checks for libraries.
PKG_CHECK_MODULES(libirecovery, libirecovery-1.0 >= $LIBIRECOVERY_VERSION)
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= $LIBIMOBILEDEVICE_VERSION)
+PKG_CHECK_MODULES(libusbmuxd, libusbmuxd-2.0 >= $LIBUSBMUXD_VERSION)
PKG_CHECK_MODULES(libplist, libplist-2.0 >= $LIBPLIST_VERSION)
PKG_CHECK_MODULES(limd_glue, libimobiledevice-glue-1.0 >= $LIMD_GLUE_VERSION)
+PKG_CHECK_MODULES(libtatsu, libtatsu-1.0 >= $LIBTATSU_VERSION)
PKG_CHECK_MODULES(libzip, libzip >= $LIBZIP_VERSION)
PKG_CHECK_MODULES(libcurl, libcurl >= $LIBCURL_VERSION)
PKG_CHECK_MODULES(zlib, zlib)
-# optional
-PKG_CHECK_MODULES(openssl, openssl >= $OPENSSL_VERSION, have_openssl=yes, have_openssl=no)
+AC_CHECK_FUNCS([strsep strcspn mkstemp realpath])
+if test x$ac_cv_func_strsep != xyes; then
+ if test x$ac_cv_func_strcspn != xyes; then
+ AC_MSG_ERROR([You need either strsep or strcspn to build $PACKAGE])
+ fi
+fi
-# Checking endianness
-AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])],
- [AC_DEFINE([__LITTLE_ENDIAN__], [1], [little endian])])
+
+AC_CHECK_HEADER(endian.h, [ac_cv_have_endian_h="yes"], [ac_cv_have_endian_h="no"])
+if test "x$ac_cv_have_endian_h" = "xno"; then
+ AC_DEFINE(__LITTLE_ENDIAN,1234,[little endian])
+ AC_DEFINE(__BIG_ENDIAN,4321,[big endian])
+ AC_C_BIGENDIAN([ac_cv_c_bigendian="yes"], [ac_cv_c_bigendian="no"], [], [])
+ if test "x$ac_cv_c_bigendian" = "xyes"; then
+ AC_DEFINE(__BYTE_ORDER,4321,[big endian byte order])
+ else
+ AC_DEFINE(__BYTE_ORDER,1234,[little endian byte order])
+ fi
+fi
GLOBAL_CFLAGS="-Wno-multichar -O2"
AC_LDADD=""
AC_LDFLAGS=""
-AC_MSG_CHECKING([whether we need platform-specific build settings])
+
+CFLAGS="$CFLAGS $libplist_CFLAGS"
+AC_CHECK_DECL([plist_from_json], [], [AC_MSG_ERROR([libplist with JSON format support required to build $PACKAGE_NAME])], [[#include <plist/plist.h>]])
+
+# Check for operating system
+AC_MSG_CHECKING([for platform-specific build settings])
case ${host_os} in
*mingw32*|*cygwin*)
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([${host_os}])
win32=true
GLOBAL_CFLAGS+=" -DWIN32 -D__LITTLE_ENDIAN__=1"
AC_LDFLAGS+=" -static-libgcc"
;;
darwin*)
- AC_MSG_RESULT([yes])
+ AC_MSG_RESULT([${host_os}])
AC_DEFINE([_DARWIN_BETTER_REALPATH], [1], [Use better method for realpath])
- AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE])])
;;
*)
- AC_MSG_RESULT([yes])
- AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE])])
+ AC_MSG_RESULT([${host_os}])
;;
esac
AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
-AC_CHECK_FUNCS([strsep strcspn mkstemp realpath])
-if test x$ac_cv_func_strsep != xyes; then
- if test x$ac_cv_func_strcspn != xyes; then
- AC_MSG_ERROR([You need either strsep or strcspn to build $PACKAGE])
+if test x$win32 != xtrue; then
+ if test "x$ac_cv_func_mkstemp" != xyes; then
+ AC_CHECK_LIB(pthread, [pthread_self], [], [AC_MSG_ERROR([pthread is required to build $PACKAGE])])
fi
fi
@@ -132,32 +151,6 @@ fi
CFLAGS="$CACHED_CFLAGS"
-AC_ARG_WITH([openssl],
- [AS_HELP_STRING([--without-openssl],
- [Do not use OpenSSL])],
- [use_openssl=$withval],
- [use_openssl=$have_openssl])
-
-if test "x$use_openssl" == "xyes"; then
- if test "x$have_openssl" != "xyes"; then
- echo "*** NOTE: --with-openssl passed but OpenSSL is not available ***"
- use_openssl=no
- fi
-fi
-if test "x$use_openssl" != "xyes"; then
- echo "*** NOTE: Using internal SHA1 implementation ***"
- have_openssl=no
- openssl_CFLAGS=
- openssl_LIBS=
-fi
-if test "x$have_openssl" == "xyes"; then
- AC_DEFINE(HAVE_OPENSSL, [1], [Define if you have OpenSSL])
-fi
-AC_SUBST(openssl_CFLAGS)
-AC_SUBST(openssl_LIBS)
-
-AM_CONDITIONAL(USE_INTERNAL_SHA, test x$use_openssl != xyes)
-
AC_SUBST(GLOBAL_CFLAGS)
AC_SUBST(AC_LDFLAGS)
AC_SUBST(AC_LDADD)