configure.ac 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.61)
  4. AC_INIT(libusbmuxd, 1.0.10, nospam@nowhere.com)
  5. AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
  6. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
  7. AC_CONFIG_SRCDIR([src/])
  8. AC_CONFIG_HEADERS([config.h])
  9. AC_CONFIG_MACRO_DIR([m4])
  10. dnl libtool versioning
  11. # +1 : 0 : +1 == adds new functions to the interface
  12. # +1 : 0 : 0 == changes or removes functions (changes include both
  13. # changes to the signature and the semantic)
  14. # ? :+1 : ? == just internal changes
  15. # CURRENT : REVISION : AGE
  16. LIBUSBMUXD_SO_VERSION=4:0:0
  17. AC_SUBST(LIBUSBMUXD_SO_VERSION)
  18. # Checks for programs.
  19. AC_PROG_CC
  20. AC_PROG_CXX
  21. AM_PROG_CC_C_O
  22. AC_PROG_LIBTOOL
  23. # Checks for libraries.
  24. PKG_CHECK_MODULES(libplist, libplist >= 1.11)
  25. AC_CHECK_HEADERS([sys/inotify.h], have_inotify=yes, have_inotify=no)
  26. AC_ARG_WITH([inotify],
  27. [AS_HELP_STRING([--without-inotify],
  28. [(Linux only) do not build with inotify support (default is yes)])],
  29. [with_inotify=no],
  30. [with_inotify=yes])
  31. if test "x$have_inotify" = "xyes"; then
  32. if test "x$with_inotify" != "xyes"; then
  33. have_inotify=no
  34. echo "*** Note: inotify support has been disabled ***"
  35. else
  36. AC_DEFINE(HAVE_INOTIFY, 1, [Define if you have inotify support (linux only)])
  37. fi
  38. fi
  39. # Checks for header files.
  40. AC_HEADER_STDC
  41. AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
  42. # Checks for typedefs, structures, and compiler characteristics.
  43. AC_C_CONST
  44. AC_TYPE_SIZE_T
  45. AC_TYPE_SSIZE_T
  46. AC_TYPE_UINT16_T
  47. AC_TYPE_UINT32_T
  48. AC_TYPE_UINT8_T
  49. # Checks for library functions.
  50. AC_FUNC_MALLOC
  51. AC_FUNC_REALLOC
  52. AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
  53. # Check for operating system
  54. AC_MSG_CHECKING([whether to enable WIN32 build settings])
  55. case ${host_os} in
  56. *mingw32*|*cygwin*)
  57. win32=true
  58. AC_MSG_RESULT([yes])
  59. AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
  60. AC_SUBST(WINDRES)
  61. ;;
  62. *)
  63. win32=false
  64. AC_MSG_RESULT([no])
  65. ;;
  66. esac
  67. AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
  68. if test "x$win32" != "xtrue"; then
  69. AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build libusbmuxd])])
  70. fi
  71. AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden")
  72. AC_SUBST(GLOBAL_CFLAGS)
  73. case "$GLOBAL_CFLAGS" in
  74. *-fvisibility=hidden*)
  75. AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden])
  76. esac
  77. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  78. AC_OUTPUT([
  79. Makefile
  80. common/Makefile
  81. src/Makefile
  82. include/Makefile
  83. tools/Makefile
  84. libusbmuxd.pc
  85. ])
  86. echo "
  87. Configuration for $PACKAGE $VERSION:
  88. -------------------------------------------
  89. Install prefix: .........: $prefix
  90. inotify support (Linux) .: $have_inotify
  91. Now type 'make' to build $PACKAGE $VERSION,
  92. and then 'make install' for installation.
  93. "