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