diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 96 |
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 | |||
| 4 | AC_PREREQ(2.61) | ||
| 5 | AC_INIT(usbmuxd, 1.0.8, nospam@nowhere.com) | ||
| 6 | AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) | ||
| 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) | ||
| 8 | AC_CONFIG_SRCDIR([src/]) | ||
| 9 | AC_CONFIG_HEADERS([config.h]) | ||
| 10 | AC_CONFIG_MACRO_DIR([m4]) | ||
| 11 | |||
| 12 | # Checks for programs. | ||
| 13 | AC_PROG_CC | ||
| 14 | AC_PROG_CXX | ||
| 15 | AM_PROG_CC_C_O | ||
| 16 | AC_PROG_LIBTOOL | ||
| 17 | |||
| 18 | # Checks for libraries. | ||
| 19 | PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.3) | ||
| 20 | PKG_CHECK_MODULES(libplist, libplist >= 1.9, have_plist=yes, have_plist=no) | ||
| 21 | |||
| 22 | AC_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 | |||
| 28 | if 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 | ||
| 37 | else | ||
| 38 | if test "x$with_protov1" == "xyes"; then | ||
| 39 | AC_MSG_ERROR([protocol V1 support requested but libplist could not be found]) | ||
| 40 | fi | ||
| 41 | fi | ||
| 42 | |||
| 43 | # Checks for header files. | ||
| 44 | AC_HEADER_STDC | ||
| 45 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | ||
| 46 | |||
| 47 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 48 | AC_C_CONST | ||
| 49 | AC_TYPE_SIZE_T | ||
| 50 | AC_TYPE_SSIZE_T | ||
| 51 | AC_TYPE_UINT16_T | ||
| 52 | AC_TYPE_UINT32_T | ||
| 53 | AC_TYPE_UINT8_T | ||
| 54 | |||
| 55 | # Checks for library functions. | ||
| 56 | AC_FUNC_MALLOC | ||
| 57 | AC_FUNC_REALLOC | ||
| 58 | AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) | ||
| 59 | |||
| 60 | # Check for operating system | ||
| 61 | AC_MSG_CHECKING([whether to enable WIN32 build settings]) | ||
| 62 | case ${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 | ;; | ||
| 73 | esac | ||
| 74 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) | ||
| 75 | |||
| 76 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") | ||
| 77 | AC_SUBST(GLOBAL_CFLAGS) | ||
| 78 | |||
| 79 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | ||
| 80 | |||
| 81 | AC_OUTPUT([ | ||
| 82 | Makefile | ||
| 83 | src/Makefile | ||
| 84 | udev/85-usbmuxd.rules | ||
| 85 | ]) | ||
| 86 | |||
| 87 | echo " | ||
| 88 | Configuration 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 | " | ||
