summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-12-13 00:44:17 +0100
committerGravatar Nikias Bassen2013-12-13 00:44:17 +0100
commita798afc8b5b00a43f4b121168e0419df2d398338 (patch)
treec178d7a149028944254511d03f91266ca43cfcbd /configure.ac
parent3b7647499474619b3e24bf01105b6b037887a0ed (diff)
downloadlibplist-a798afc8b5b00a43f4b121168e0419df2d398338.tar.gz
libplist-a798afc8b5b00a43f4b121168e0419df2d398338.tar.bz2
change build system to autotools
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac140
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
4AC_PREREQ(2.61)
5AC_INIT(libplist, 1.11, nospam@nowhere.com)
6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
8AC_CONFIG_SRCDIR([src/])
9AC_CONFIG_HEADERS([config.h])
10AC_CONFIG_MACRO_DIR([m4])
11
12dnl 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
18LIBPLIST_SO_VERSION=2:0:0
19
20AC_SUBST(LIBPLIST_SO_VERSION)
21
22dnl Minimum package versions
23LIBXML2_VERSION=2.8.0
24
25AC_SUBST(LIBXML2_VERSION)
26
27# Checks for programs.
28AC_PROG_CC
29AC_PROG_CXX
30AM_PROG_CC_C_O
31AC_PROG_LIBTOOL
32
33# Checks for libraries.
34PKG_CHECK_MODULES(libxml2, libxml-2.0 >= $LIBXML2_VERSION)
35
36# Checks for header files.
37AC_HEADER_STDC
38AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
39
40# Checks for typedefs, structures, and compiler characteristics.
41AC_C_CONST
42AC_TYPE_SIZE_T
43AC_TYPE_SSIZE_T
44AC_TYPE_UINT16_T
45AC_TYPE_UINT32_T
46AC_TYPE_UINT8_T
47
48# Checks for library functions.
49AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf])
50
51AC_CHECK_HEADER(endian.h, [ac_cv_have_endian_h="yes"], [ac_cv_have_endian_h="no"])
52if 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
61fi
62
63# Check for operating system
64AC_MSG_CHECKING([whether to enable WIN32 build settings])
65case ${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 ;;
75esac
76AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
77
78# Cython Python Bindings
79AC_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])
84if test "$build_cython" = "true"; then
85 AM_PATH_PYTHON(2.3)
86 AC_PROG_CYTHON(0.17.0)
87 CYTHON_PYTHON
88else
89 CYTHON=false
90fi
91if [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
106else
107 CYTHON_SUB=
108 cython_python_bindings=no
109fi
110AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"])
111AC_SUBST([CYTHON_SUB])
112
113AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter")
114AC_SUBST(GLOBAL_CFLAGS)
115
116m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
117
118AC_OUTPUT([
119Makefile
120libcnary/Makefile
121src/Makefile
122include/Makefile
123tools/Makefile
124cython/Makefile
125test/Makefile
126libplist.pc
127libplist++.pc
128doxygen.cfg
129])
130
131echo "
132Configuration 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"