summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 22 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index a1fc3b7..c51d53a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,30 +1,34 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.64)
-AC_INIT([usbmuxd], [1.1.2], [https://github.com/libimobiledevice/usbmuxd/issues],, [https://libimobiledevice.org])
+AC_PREREQ([2.68])
+AC_INIT([usbmuxd], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/usbmuxd/issues], [], [https://libimobiledevice.org])
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
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
+
# Checks for programs.
AC_PROG_CC
-AC_PROG_CXX
AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
+LT_INIT
# Checks for libraries.
PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.9)
-PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
+PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.3.0)
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0, have_limd=yes, have_limd=no)
-AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build usbmuxd])])
+PKG_CHECK_MODULES(limd_glue, libimobiledevice-glue-1.0 >= 1.0.0)
AC_ARG_WITH([preflight],
[AS_HELP_STRING([--without-preflight],
[do not build with preflight worker support @<:@default=yes@:>@])],
- [with_preflight=no],
+ [with_preflight=$withval],
[with_preflight=yes])
if test "x$have_limd" = "xyes"; then
@@ -38,11 +42,11 @@ if test "x$have_limd" = "xyes"; then
CACHED_CFLAGS="$CFLAGS"
CFLAGS+=" $libimobiledevice_CFLAGS"
AC_CACHE_CHECK(for enum idevice_connection_type, ac_cv_enum_idevice_connection_type,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <libimobiledevice/libimobiledevice.h>
], [
enum idevice_connection_type conn_type = CONNECTION_USBMUXD;
- ], ac_cv_enum_idevice_connection_type=yes, ac_cv_enum_idevice_connection_type=no))
+ ])], ac_cv_enum_idevice_connection_type=yes, ac_cv_enum_idevice_connection_type=no))
CFLAGS="$CACHED_CFLAGS"
if (test "$ac_cv_enum_idevice_connection_type" = "yes"); then
AC_DEFINE(HAVE_ENUM_IDEVICE_CONNECTION_TYPE, 1, [Define if enum idevice_connection_type is available])
@@ -71,7 +75,7 @@ fi
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--without-systemd],
[do not build with systemd support @<:@default=yes@:>@])],
- [],
+ [with_systemd=$withval],
[with_systemd=yes])
AC_ARG_WITH([systemdsystemunitdir],
@@ -93,7 +97,6 @@ fi
AC_SUBST(udev_activation_rule)
# Checks for header files.
-AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
@@ -108,7 +111,7 @@ AC_TYPE_UINT8_T
AC_SEARCH_LIBS([clock_gettime],[rt posix4])
# Checks for library functions.
-AC_CHECK_FUNCS([strcasecmp strdup strerror strndup stpcpy malloc realloc])
+AC_CHECK_FUNCS([strcasecmp strdup strerror strndup malloc realloc])
AC_CHECK_FUNCS([ppoll clock_gettime localtime_r])
# Check for operating system
@@ -155,13 +158,19 @@ AC_SUBST(GLOBAL_CFLAGS)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-AC_OUTPUT([
+# workaround for older autoconf versions
+if test "x$runstatedir" == "x"; then
+ runstatedir=$localstatedir/run
+fi
+
+AC_CONFIG_FILES([
Makefile
src/Makefile
udev/Makefile
systemd/Makefile
docs/Makefile
])
+AC_OUTPUT
echo "
Configuration for $PACKAGE $VERSION: