]> git.datanom.net - vcard-parser.git/blame - configure.ac
New function
[vcard-parser.git] / configure.ac
CommitLineData
b198a81e
MR
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
a66ef46e 5AC_INIT(libvcard, 0.1, mir@datanom.net)
4a29ae6b
MR
6
7LIB_VERSION="0:0:0"
8AC_SUBST(LIB_VERSION)
9
a66ef46e 10AC_CONFIG_SRCDIR(src/vcard.c)
b198a81e
MR
11AM_INIT_AUTOMAKE
12AM_MAINTAINER_MODE
13AC_CONFIG_HEADER([config.h])
14CFLAGS="-Wall"
15AC_CONFIG_MACRO_DIR([m4])
16
17# Checks for programs.
18AC_PROG_CC
19AM_PROG_CC_STDC
20AC_LANG_C
21AC_ISC_POSIX
22AC_PROG_INSTALL
23AC_PROG_LN_S
24AC_PROG_MAKE_SET
25AC_PROG_CPP
26AC_PROG_INSTALL
27AC_PROG_LIBTOOL
28
29# Find pkg-config
30#
31AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
32if test x$PKG_CONFIG = xno ; then
33 AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
34fi
35
0d68a955 36PKG_CHECK_MODULES(GLIB, [[glib-2.0 >= 2.30 gmodule-2.0 >= 2.30 gobject-2.0 >= 2.30 gthread-2.0 >= 2.30]])
b198a81e
MR
37AC_SUBST(GLIB_CFLAGS)
38AC_SUBST(GLIB_LIBS)
39
40# Checks for header files.
41AC_HEADER_STDC
42
43# Checks for typedefs, structures, and compiler characteristics.
44AC_C_CONST
45AC_TYPE_SIZE_T
46AC_TYPE_SSIZE_T
47
48# Checks for library functions.
49
50# Optional building instructions
51if test $USE_MAINTAINER_MODE = yes; then
52 CFLAGS="$CFLAGS -g -Werror"
a66ef46e 53 LIBS="$GLIB_LIBS"
b198a81e
MR
54else
55 CFLAGS="$CFLAGS -O -O2"
a66ef46e 56 LIBS="$GLIB_LIBS"
b198a81e
MR
57fi
58
a66ef46e
MR
59ac_enable_example="no"
60AC_ARG_ENABLE([example],
b198a81e 61 [AC_HELP_STRING([--enable-example],[Build example [default=no]])],
a66ef46e 62 [ac_enable_example="${enableval}"])
b198a81e
MR
63
64AC_MSG_CHECKING([whether to compile the example application])
65if test x"$ac_enable_example" = xyes; then
66 AC_MSG_RESULT(yes)
67else
68 AC_MSG_RESULT(no)
69fi
70AM_CONDITIONAL(BUILD_EXAMPLE, test x"$ac_enable_example" = "xyes")
71
0d68a955
MR
72AC_DEFINE_UNQUOTED(TEST_SRC_DIR, "$srcdir", [location of source code])
73
b198a81e
MR
74AC_CONFIG_COMMANDS(
75 [summary],
76 [[echo ""
aa039bee 77 echo -e "libvCard will be compiled with these settings:"
b198a81e
MR
78 echo -e "\tCFLAGS:\t\t${CFLAGS}"
79 echo -e "\tLIBS:\t\t${LIBS}"
a66ef46e 80 echo -e "\tExample:\t${EXAMPLE}"
b198a81e
MR
81 echo ""
82 echo -e "Now run make to build library"
83 echo ""
84 echo -e "Please send bugs or feature requests to the maintainer(s)."
85 echo -e "Email addresses can be found in the AUTHORS file."
86 echo ""]],
87 [
88 CFLAGS="$CFLAGS"
89 LIBS="$LIBS"
a66ef46e 90 EXAMPLE="$ac_enable_example"
b198a81e
MR
91 ]
92)
93
94AC_OUTPUT([
95 Makefile
aa039bee 96 example/Makefile
b198a81e
MR
97 src/Makefile
98])
This page took 0.044697 seconds and 5 git commands to generate.