|
Packit |
f228a3 |
# -*- Autoconf -*-
|
|
Packit |
f228a3 |
# Process this file with autoconf to produce a configure script.
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
AC_PREREQ(2.61)
|
|
Packit |
f228a3 |
AC_INIT(libusbmuxd, 1.0.10, nospam@nowhere.com)
|
|
Packit |
f228a3 |
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
|
|
Packit |
f228a3 |
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
|
Packit |
f228a3 |
AC_CONFIG_SRCDIR([src/])
|
|
Packit |
f228a3 |
AC_CONFIG_HEADERS([config.h])
|
|
Packit |
f228a3 |
AC_CONFIG_MACRO_DIR([m4])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
dnl libtool versioning
|
|
Packit |
f228a3 |
# +1 : 0 : +1 == adds new functions to the interface
|
|
Packit |
f228a3 |
# +1 : 0 : 0 == changes or removes functions (changes include both
|
|
Packit |
f228a3 |
# changes to the signature and the semantic)
|
|
Packit |
f228a3 |
# ? :+1 : ? == just internal changes
|
|
Packit |
f228a3 |
# CURRENT : REVISION : AGE
|
|
Packit |
f228a3 |
LIBUSBMUXD_SO_VERSION=4:0:0
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
AC_SUBST(LIBUSBMUXD_SO_VERSION)
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Checks for programs.
|
|
Packit |
f228a3 |
AC_PROG_CC
|
|
Packit |
f228a3 |
AC_PROG_CXX
|
|
Packit |
f228a3 |
AM_PROG_CC_C_O
|
|
Packit |
f228a3 |
AC_PROG_LIBTOOL
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Checks for libraries.
|
|
Packit |
f228a3 |
PKG_CHECK_MODULES(libplist, libplist >= 1.11)
|
|
Packit |
f228a3 |
AC_CHECK_HEADERS([sys/inotify.h], have_inotify=yes, have_inotify=no)
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
AC_ARG_WITH([inotify],
|
|
Packit |
f228a3 |
[AS_HELP_STRING([--without-inotify],
|
|
Packit |
f228a3 |
[(Linux only) do not build with inotify support (default is yes)])],
|
|
Packit |
f228a3 |
[with_inotify=no],
|
|
Packit |
f228a3 |
[with_inotify=yes])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
if test "x$have_inotify" = "xyes"; then
|
|
Packit |
f228a3 |
if test "x$with_inotify" != "xyes"; then
|
|
Packit |
f228a3 |
have_inotify=no
|
|
Packit |
f228a3 |
echo "*** Note: inotify support has been disabled ***"
|
|
Packit |
f228a3 |
else
|
|
Packit |
f228a3 |
AC_DEFINE(HAVE_INOTIFY, 1, [Define if you have inotify support (linux only)])
|
|
Packit |
f228a3 |
fi
|
|
Packit |
f228a3 |
fi
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Checks for header files.
|
|
Packit |
f228a3 |
AC_HEADER_STDC
|
|
Packit |
f228a3 |
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Checks for typedefs, structures, and compiler characteristics.
|
|
Packit |
f228a3 |
AC_C_CONST
|
|
Packit |
f228a3 |
AC_TYPE_SIZE_T
|
|
Packit |
f228a3 |
AC_TYPE_SSIZE_T
|
|
Packit |
f228a3 |
AC_TYPE_UINT16_T
|
|
Packit |
f228a3 |
AC_TYPE_UINT32_T
|
|
Packit |
f228a3 |
AC_TYPE_UINT8_T
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Checks for library functions.
|
|
Packit |
f228a3 |
AC_FUNC_MALLOC
|
|
Packit |
f228a3 |
AC_FUNC_REALLOC
|
|
Packit |
f228a3 |
AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
# Check for operating system
|
|
Packit |
f228a3 |
AC_MSG_CHECKING([whether to enable WIN32 build settings])
|
|
Packit |
f228a3 |
case ${host_os} in
|
|
Packit |
f228a3 |
*mingw32*|*cygwin*)
|
|
Packit |
f228a3 |
win32=true
|
|
Packit |
f228a3 |
AC_MSG_RESULT([yes])
|
|
Packit |
f228a3 |
AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
|
|
Packit |
f228a3 |
AC_SUBST(WINDRES)
|
|
Packit |
f228a3 |
;;
|
|
Packit |
f228a3 |
*)
|
|
Packit |
f228a3 |
win32=false
|
|
Packit |
f228a3 |
AC_MSG_RESULT([no])
|
|
Packit |
f228a3 |
;;
|
|
Packit |
f228a3 |
esac
|
|
Packit |
f228a3 |
AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
if test "x$win32" != "xtrue"; then
|
|
Packit |
f228a3 |
AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build libusbmuxd])])
|
|
Packit |
f228a3 |
fi
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden")
|
|
Packit |
f228a3 |
AC_SUBST(GLOBAL_CFLAGS)
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
case "$GLOBAL_CFLAGS" in
|
|
Packit |
f228a3 |
*-fvisibility=hidden*)
|
|
Packit |
f228a3 |
AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden])
|
|
Packit |
f228a3 |
esac
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
AC_OUTPUT([
|
|
Packit |
f228a3 |
Makefile
|
|
Packit |
f228a3 |
common/Makefile
|
|
Packit |
f228a3 |
src/Makefile
|
|
Packit |
f228a3 |
include/Makefile
|
|
Packit |
f228a3 |
tools/Makefile
|
|
Packit |
f228a3 |
libusbmuxd.pc
|
|
Packit |
f228a3 |
])
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
echo "
|
|
Packit |
f228a3 |
Configuration for $PACKAGE $VERSION:
|
|
Packit |
f228a3 |
-------------------------------------------
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
Install prefix: .........: $prefix
|
|
Packit |
f228a3 |
inotify support (Linux) .: $have_inotify
|
|
Packit |
f228a3 |
|
|
Packit |
f228a3 |
Now type 'make' to build $PACKAGE $VERSION,
|
|
Packit |
f228a3 |
and then 'make install' for installation.
|
|
Packit |
f228a3 |
"
|