selection data access (YUM does not compile yet)
[platform/upstream/libzypp.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl ==================================================
3
4 AC_INIT(zypp,0.0.0)
5 AC_CONFIG_SRCDIR(zypp/Makefile.am)
6
7 AC_PREFIX_DEFAULT(/usr)
8 AC_CANONICAL_TARGET
9 AC_ARG_PROGRAM
10
11 AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip tar-ustar)
12 AM_CONFIG_HEADER(config.h)
13
14 dnl ==================================================
15 dnl Versioning
16 dnl ==========
17 dnl
18 dnl CURRENT    The most recent interface number that this library implements.
19 dnl
20 dnl REVISION   The implementation number of the current interface.
21 dnl
22 dnl AGE        The difference between the newest and oldest interfaces that this
23 dnl            library implements.
24 dnl            In other words, the library implements all the interface numbers
25 dnl            in the range from number 'CURRENT - AGE' to 'CURRENT'.
26 dnl
27 dnl 1) Start with version information of `0:0:0' for each libtool library.
28 dnl
29 dnl 2) Update the version information only immediately before a public release
30 dnl    of your software. More frequent updates are unnecessary, and only guarantee
31 dnl    that the current interface number gets larger faster.
32 dnl
33 dnl 3) If the library source code has changed at all since the last update,
34 dnl    then increment revision (`c:r:a' becomes `c:r+1:a').
35 dnl
36 dnl 4) If any interfaces have been added, removed, or changed since the last
37 dnl    update, increment current, and set revision to 0.
38 dnl
39 dnl 5) If any interfaces have been added since the last public release, then
40 dnl    increment age.
41 dnl
42 dnl 6) If any interfaces have been removed since the last public release, then
43 dnl    set age to 0.
44 dnl
45
46 LIBZYPP_CURRENT=0
47 LIBZYPP_REVISION=0
48 LIBZYPP_AGE=0
49
50 LIBZYPP_VERSION=$LIBZYPP_CURRENT.$LIBZYPP_REVISION.$LIBZYPP_AGE
51 AC_SUBST(LIBZYPP_VERSION)
52
53 LIBZYPP_VERSION_INFO="-version-info $LIBZYPP_CURRENT:$LIBZYPP_REVISION:$LIBZYPP_AGE"
54 AC_SUBST(LIBZYPP_VERSION_INFO)
55
56 dnl ==================================================
57
58 CXXFLAGS="-g -O2 -Wall -Wformat"
59
60 dnl ==================================================
61
62 docdir=\${datadir}/doc/packages
63 pkgdocdir=\${docdir}/$PACKAGE
64
65 AC_SUBST(docdir)
66 AC_SUBST(pkgdocdir)
67
68 zyppdir=${prefix}/share/$PACKAGE
69 localedir=${zyppdir}/locale
70 schemadir=${zyppdir}/schema
71
72 AC_SUBST(zyppdir)
73 AC_SUBST(localedir)
74 AC_SUBST(schemadir)
75
76 AH_TEMPLATE([LOCALEDIR],[gettext localedir])
77 AC_DEFINE_UNQUOTED([LOCALEDIR], ["${localedir}"])
78 AH_TEMPLATE([TEXTDOMAIN],[gettext textdomain])
79 AC_DEFINE_UNQUOTED([TEXTDOMAIN], ["$PACKAGE"])
80
81 dnl ==================================================
82 dnl checks for programs
83
84 dnl   check for c++ compiler and tools
85 AC_PROG_CXX
86 AC_PROG_CXX
87 AC_PROG_CXXCPP
88 AC_PROG_INSTALL
89 AM_PROG_LIBTOOL
90
91 dnl   do AC_CHECK_* tests using c++ (e.g. boost header)
92 AC_LANG([C++])
93
94 AC_PATH_PROG(DOCGEN, doxygen)
95 if test -z "$DOCGEN" ; then
96     AC_MSG_ERROR(doxygen is missing; please install doxygen.)
97 fi
98
99 AC_PATH_PROG(HAVE_DOT, dot)
100 if test -z "$HAVE_DOT" ; then
101     AC_MSG_WARN(dot not found; you should install graphviz.)
102     HAVE_DOT=NO
103 else
104     HAVE_DOT=YES
105 fi
106
107 AC_PATH_PROG(XGETTEXT, xgettext)
108 if test -z "$XGETTEXT" ; then
109     AC_MSG_ERROR(xgettext is missing; please install gettext-devel.)
110 fi
111
112 AC_PATH_PROG(MYRUNTEST, runtest)
113 if test -z "$MYRUNTEST" ; then
114     AC_MSG_ERROR(runtest is missing; please install dejagnu.)
115 fi
116
117 dnl ==================================================
118 dnl
119 dnl Switches during develpoment only. They disable code using
120 dnl certain libraries (e.g. hal, sqlite) which may be temporarily
121 dnl unavailable or broken. This is just to allow building and testing
122 dnl the remaining parts of zypp.
123 dnl
124 AC_ARG_ENABLE(faked-hal, [  --enable-faked-hal   do not use libhal (DEVELOPMENT ONLY)],
125   devel_faked_hal=yes, devel_faked_hal=no)
126
127 AC_ARG_ENABLE(faked-zmd, [  --enable-faked-zmd   do not build zmd (DEVELOPMENT ONLY)],
128   devel_faked_zmd=yes, devel_faked_zmd=no)
129
130 dnl ==================================================
131 dnl checks for libraries
132 AC_CHECK_LIB([z], [gzopen],
133         [:],
134         AC_MSG_ERROR([libz not found. please install zlib-devel]))
135 AC_CHECK_LIB([xml2], [xmlNewTextReader],
136         [:],
137         AC_MSG_ERROR([libxml2 not found. please install libxml2-devel]))
138
139 dnl sqlite
140 if test "x$devel_faked_zmd" = "xyes"; then
141  AM_CONDITIONAL(BUILD_ZMD, false)
142 else
143  AM_CONDITIONAL(BUILD_ZMD, true)
144  PKG_CHECK_MODULES(SQLITE, sqlite3, pkg_sqlite=yes, pkg_sqlite=no)
145  if test ! -f $SQLITE_LIBS/libsqlite3.so; then
146    echo
147    AC_MSG_ERROR([Could not find sqlite3 library, please install sqlite-devel])
148  fi
149 fi
150 dnl ==================================================
151
152 if test "x$devel_faked_hal" = "xyes"; then
153  HAL_CFLAGS=-DFAKE_HAL
154 else
155  dnl checks for pkgconfig modules
156  hal_module="hal >= 0.5.4"
157  dbus_module="dbus-1 >= 0.33"
158  hal_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.33, $dbus_module, $hal_module"
159  PKG_CHECK_MODULES(HAL, [$hal_modules])
160 fi
161 AC_SUBST(HAL_CFLAGS)
162 AC_SUBST(HAL_LDADD)
163 AC_SUBST(HAL_LIBS)
164
165 dnl ==================================================
166 dnl checks for header files
167 AC_CHECK_HEADERS([boost/scoped_ptr.hpp],
168         [],
169         AC_MSG_ERROR([boost header not found. please install boost-devel]))
170 AC_CHECK_HEADERS([curl/curl.h],
171         [],
172         AC_MSG_ERROR([libcurl header not found. please install curl-devel.]))
173 AC_CHECK_HEADERS([rpm/rpmlib.h],
174         [],
175         AC_MSG_ERROR([rpmlib header not found. please install rpm-devel.]))
176 AC_CHECK_HEADERS([popt.h],
177         [],
178         AC_MSG_ERROR([popt header not found. please install popt-devel.]))
179 dnl ==================================================
180 dnl checks for typedefs
181 dnl ==================================================
182 dnl checks for structures
183 dnl ==================================================
184 dnl checks for compiler characteristics
185 dnl ==================================================
186 dnl checks for library functions
187 dnl ==================================================
188 dnl checks for system services
189 dnl ==================================================
190 dnl AC_CONFIG_FILES([FILE...])
191 AC_OUTPUT(      \
192         Makefile                        \
193         devel/Makefile                  \
194         devel/genclass                  \
195         devel/devel.jsrain/Makefile     \
196         devel/devel.jsrain/yum/Makefile \
197         devel/devel.ma/Makefile         \
198         devel/devel.kkaempf/Makefile    \
199         doc/Makefile                    \
200         doc/autodoc/Makefile            \
201         doc/autodoc/Doxyfile            \
202         testsuite/Makefile              \
203         testsuite/zypp/Makefile         \
204         testsuite/zypp/tests/Makefile   \
205         testsuite/solver/Makefile       \
206         testsuite/solver/src/Makefile   \
207         testsuite/solver/src/helix/Makefile     \
208         testsuite/solver/single.out/Makefile    \
209         testsuite/source/Makefile       \
210         testsuite/source/tests/Makefile \
211         testsuite/parser/Makefile       \
212         testsuite/parser/tests/Makefile \
213         testsuite/target/Makefile       \
214         testsuite/target/tests/Makefile \
215         zypp/Makefile                   \
216         zypp/base/Makefile              \
217         zypp/detail/Makefile            \
218         zypp/capability/Makefile        \
219         zypp/parser/Makefile            \
220         zypp/parser/yum/Makefile        \
221         zypp/parser/yum/schema/Makefile \
222         zypp/parser/tagfile/Makefile    \
223         zypp/pool/Makefile              \
224         zypp/solver/Makefile            \
225         zypp/solver/detail/Makefile     \
226         zypp/source/Makefile            \
227         zypp/source/susetags/Makefile   \
228         zypp/source/yum/Makefile        \
229         zypp/media/Makefile             \
230         zypp/media/proxyinfo/Makefile   \
231         zypp/url/Makefile               \
232         zypp/target/Makefile            \
233         zypp/target/rpm/Makefile        \
234         zypp/target/store/Makefile      \
235         zypp/target/hal/Makefile        \
236         zypp/zypp_detail/Makefile       \
237         zmd/Makefile                    \
238         zmd/backend/Makefile
239
240 )
241 dnl ==================================================
242
243 echo "
244 Configuration:
245
246   PACKAGE:              ${PACKAGE}
247   VERSION:              ${VERSION}
248   LIBVERSION:           lib${PACKAGE}.so.${LIBZYPP_VERSION}
249
250   COMPILER:             ${CXX}
251   CXXFLAGS:             ${CXXFLAGS}
252
253   PREFIX:               ${prefix}
254   LIBDIR:               ${libdir}
255
256 "
257 if test "x$devel_faked_hal" = "xyes"; then
258   echo "**WARNIG:       faked_hal"
259 fi
260 if test "x$devel_faked_zmd" = "xyes"; then
261   echo "**WARNIG:       faked_zmd"
262 fi
263 echo
264