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