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