diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..d59f8a7 --- /dev/null +++ b/configure.ac | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | # -*- Autoconf -*- | ||
| 2 | # Process this file with autoconf to produce a configure script. | ||
| 3 | |||
| 4 | AC_PREREQ(2.61) | ||
| 5 | AC_INIT(libplist, 1.11, 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 | dnl libtool versioning | ||
| 13 | # +1 : 0 : +1 == adds new functions to the interface | ||
| 14 | # +1 : 0 : 0 == changes or removes functions (changes include both | ||
| 15 | # changes to the signature and the semantic) | ||
| 16 | # ? :+1 : ? == just internal changes | ||
| 17 | # CURRENT : REVISION : AGE | ||
| 18 | LIBPLIST_SO_VERSION=2:0:0 | ||
| 19 | |||
| 20 | AC_SUBST(LIBPLIST_SO_VERSION) | ||
| 21 | |||
| 22 | dnl Minimum package versions | ||
| 23 | LIBXML2_VERSION=2.8.0 | ||
| 24 | |||
| 25 | AC_SUBST(LIBXML2_VERSION) | ||
| 26 | |||
| 27 | # Checks for programs. | ||
| 28 | AC_PROG_CC | ||
| 29 | AC_PROG_CXX | ||
| 30 | AM_PROG_CC_C_O | ||
| 31 | AC_PROG_LIBTOOL | ||
| 32 | |||
| 33 | # Checks for libraries. | ||
| 34 | PKG_CHECK_MODULES(libxml2, libxml-2.0 >= $LIBXML2_VERSION) | ||
| 35 | |||
| 36 | # Checks for header files. | ||
| 37 | AC_HEADER_STDC | ||
| 38 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | ||
| 39 | |||
| 40 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 41 | AC_C_CONST | ||
| 42 | AC_TYPE_SIZE_T | ||
| 43 | AC_TYPE_SSIZE_T | ||
| 44 | AC_TYPE_UINT16_T | ||
| 45 | AC_TYPE_UINT32_T | ||
| 46 | AC_TYPE_UINT8_T | ||
| 47 | |||
| 48 | # Checks for library functions. | ||
| 49 | AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf]) | ||
| 50 | |||
| 51 | AC_CHECK_HEADER(endian.h, [ac_cv_have_endian_h="yes"], [ac_cv_have_endian_h="no"]) | ||
| 52 | if test "x$ac_cv_have_endian_h" = "xno"; then | ||
| 53 | AC_DEFINE(__LITTLE_ENDIAN,1234,[little endian]) | ||
| 54 | AC_DEFINE(__BIG_ENDIAN,4321,[big endian]) | ||
| 55 | AC_C_BIGENDIAN([ac_cv_c_bigendian="yes"], [ac_cv_c_bigendian="no"], [], []) | ||
| 56 | if test "x$ac_cv_c_bigendian" = "xyes"; then | ||
| 57 | AC_DEFINE(__BYTE_ORDER,4321,[big endian byte order]) | ||
| 58 | else | ||
| 59 | AC_DEFINE(__BYTE_ORDER,1234,[little endian byte order]) | ||
| 60 | fi | ||
| 61 | fi | ||
| 62 | |||
| 63 | # Check for operating system | ||
| 64 | AC_MSG_CHECKING([whether to enable WIN32 build settings]) | ||
| 65 | case ${host_os} in | ||
| 66 | *mingw32*|*cygwin*) | ||
| 67 | win32=true | ||
| 68 | AC_MSG_RESULT([yes]) | ||
| 69 | AC_SUBST(WINDRES) | ||
| 70 | ;; | ||
| 71 | *) | ||
| 72 | win32=false | ||
| 73 | AC_MSG_RESULT([no]) | ||
| 74 | ;; | ||
| 75 | esac | ||
| 76 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) | ||
| 77 | |||
| 78 | # Cython Python Bindings | ||
| 79 | AC_ARG_WITH([cython], | ||
| 80 | [AS_HELP_STRING([--without-cython], | ||
| 81 | [build Python bindings using Cython (default is yes)])], | ||
| 82 | [build_cython=false], | ||
| 83 | [build_cython=true]) | ||
| 84 | if test "$build_cython" = "true"; then | ||
| 85 | AM_PATH_PYTHON(2.3) | ||
| 86 | AC_PROG_CYTHON(0.17.0) | ||
| 87 | CYTHON_PYTHON | ||
| 88 | else | ||
| 89 | CYTHON=false | ||
| 90 | fi | ||
| 91 | if [test "x$CYTHON" != "xfalse"]; then | ||
| 92 | AC_MSG_CHECKING([for libplist Cython bindings]) | ||
| 93 | CYTHON_PLIST_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir libplist)/plist/cython | ||
| 94 | if [test ! -d "$CYTHON_PLIST_INCLUDE_DIR"]; then | ||
| 95 | CYTHON=false | ||
| 96 | CYTHON_SUB= | ||
| 97 | cython_python_bindings=no | ||
| 98 | AC_MSG_RESULT([no]) | ||
| 99 | AC_MSG_WARN([cannot find libplist Cython bindings. You should install your distribution specific libplist Cython bindings package.]) | ||
| 100 | else | ||
| 101 | AC_SUBST([CYTHON_PLIST_INCLUDE_DIR]) | ||
| 102 | AC_MSG_RESULT([$CYTHON_PLIST_INCLUDE_DIR]) | ||
| 103 | CYTHON_SUB=cython | ||
| 104 | cython_python_bindings=yes | ||
| 105 | fi | ||
| 106 | else | ||
| 107 | CYTHON_SUB= | ||
| 108 | cython_python_bindings=no | ||
| 109 | fi | ||
| 110 | AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"]) | ||
| 111 | AC_SUBST([CYTHON_SUB]) | ||
| 112 | |||
| 113 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") | ||
| 114 | AC_SUBST(GLOBAL_CFLAGS) | ||
| 115 | |||
| 116 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | ||
| 117 | |||
| 118 | AC_OUTPUT([ | ||
| 119 | Makefile | ||
| 120 | libcnary/Makefile | ||
| 121 | src/Makefile | ||
| 122 | include/Makefile | ||
| 123 | tools/Makefile | ||
| 124 | cython/Makefile | ||
| 125 | test/Makefile | ||
| 126 | libplist.pc | ||
| 127 | libplist++.pc | ||
| 128 | doxygen.cfg | ||
| 129 | ]) | ||
| 130 | |||
| 131 | echo " | ||
| 132 | Configuration for $PACKAGE $VERSION: | ||
| 133 | ------------------------------------------- | ||
| 134 | |||
| 135 | Install prefix: .........: $prefix | ||
| 136 | Python bindings .........: $cython_python_bindings | ||
| 137 | |||
| 138 | Now type 'make' to build $PACKAGE $VERSION, | ||
| 139 | and then 'make install' for installation. | ||
| 140 | " | ||
