1 dnl Process this file with autoconf to produce a configure script.
2 dnl ==================================================
4 AC_INIT([zypp], [LIBZYPP_MAJOR.LIBZYPP_MINOR.LIBZYPP_PATCH])
5 dnl ==================================================
6 AC_CONFIG_SRCDIR(zypp/Makefile.am)
8 AC_PREFIX_DEFAULT(/usr)
12 AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip tar-ustar)
13 AM_CONFIG_HEADER(config.h)
15 dnl ==================================================
16 dnl The calculations below allows us to include the minor version
17 dnl in soname without to break the compatibility (soname) flags of
18 dnl the library by default. (Thanx to Marius)
19 dnl See VERSION file for further details.
20 LIBZYPP_CURRENT=$((LIBZYPP_MAJOR * 100 + LIBZYPP_MINOR))
21 LIBZYPP_AGE=$((LIBZYPP_MINOR - LIBZYPP_COMPATMINOR))
22 LIBZYPP_VERSION_INFO="-version-info $LIBZYPP_CURRENT:LIBZYPP_PATCH:$LIBZYPP_AGE"
23 AC_SUBST(LIBZYPP_VERSION_INFO)
25 # just to display the library name at the end of configure
26 LIBZYPP_LIBRARY_NAME=lib${PACKAGE}.so.$((${LIBZYPP_CURRENT}-${LIBZYPP_AGE})).${LIBZYPP_AGE}.LIBZYPP_PATCH
27 dnl ==================================================
29 # libzypp compile time features/option tags,
30 # that can be used for consistence checks ...
32 AC_SUBST(ZYPP_FEATURES)
34 # libzypp cflags to add to pkg-config cflags
38 dnl ==================================================
40 CXXFLAGS="${CXXFLAGS} -g -O3 -Wall -Wformat -Woverloaded-virtual"
42 if test "$enable_largefile" != no ; then
44 if test "$ac_cv_sys_file_offset_bits" != no; then
45 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
47 if test "$ac_cv_sys_large_files" != no; then
48 LFS_CFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $LFS_CFLAGS"
50 ZYPP_FEATURES="LFS $ZYPP_FEATURES"
51 ZYPP_CFLAGS="$LFS_CFLAGS $ZYPP_CFLAGS"
54 test -n "$LFS_CFLAGS" && CXXFLAGS="$CXXFLAGS $LFS_CFLAGS"
56 dnl ==================================================
58 docdir=\${datadir}/doc/packages
59 pkgdocdir=\${docdir}/$PACKAGE
64 zyppdir=${prefix}/share/$PACKAGE
65 localedir=${prefix}/share/locale
66 yumschemadir=${zyppdir}/schema/yum
67 xmlstoreschemadir=${zyppdir}/schema/xmlstore
71 AC_SUBST(yumschemadir)
72 AC_SUBST(xmlstoreschemadir)
74 AH_TEMPLATE([LOCALEDIR],[gettext localedir])
75 AC_DEFINE_UNQUOTED([LOCALEDIR], ["${localedir}"])
76 AH_TEMPLATE([TEXTDOMAIN],[gettext textdomain])
77 AC_DEFINE_UNQUOTED([TEXTDOMAIN], ["$PACKAGE"])
79 dnl ==================================================
80 dnl checks for programs
82 dnl check for c++ compiler and tools
89 dnl do AC_CHECK_* tests using c++ (e.g. boost header)
92 AC_PATH_PROG(DOCGEN, doxygen)
93 if test -z "$DOCGEN" ; then
94 AC_MSG_ERROR(doxygen is missing; please install doxygen.)
97 AC_PATH_PROG(HAVE_DOT, dot)
98 if test -z "$HAVE_DOT" ; then
99 AC_MSG_WARN(dot not found; you should install graphviz.)
105 AC_PATH_PROG(XGETTEXT, xgettext)
106 if test -z "$XGETTEXT" ; then
107 AC_MSG_ERROR(xgettext is missing; please install gettext-devel.)
110 AC_PATH_PROG(MYRUNTEST, runtest)
111 if test -z "$MYRUNTEST" ; then
112 AC_MSG_ERROR(runtest is missing; please install dejagnu.)
115 dnl ==================================================
117 dnl Switches during develpoment only. They disable code using
118 dnl certain libraries (e.g. hal ) which may be temporarily
119 dnl unavailable or broken. This is just to allow building and testing
120 dnl the remaining parts of zypp.
122 AC_ARG_ENABLE(faked-hal, [ --enable-faked-hal do not use libhal (DEVELOPMENT ONLY)],
123 devel_faked_hal=yes, devel_faked_hal=no)
125 dnl ==================================================
126 dnl checks for libraries
127 AC_CHECK_LIB([z], [gzopen],
129 AC_MSG_ERROR([libz not found. please install zlib-devel]))
130 AC_CHECK_LIB([xml2], [xmlNewTextReader],
132 AC_MSG_ERROR([libxml2 not found. please install libxml2-devel]))
134 dnl ==================================================
135 PKG_CHECK_MODULES(CURL, [libcurl])
136 AC_SUBST(CURL_CFLAGS)
139 dnl ==================================================
141 AM_CONDITIONAL(BUILD_ZMD, true)
142 PKG_CHECK_MODULES(SQLITE, sqlite3, pkg_sqlite=yes, pkg_sqlite=no)
143 if test $pkg_sqlite = no; then
145 AC_MSG_ERROR([Could not find sqlite3 library, please install sqlite-devel])
148 dnl ==================================================
149 PKG_CHECK_MODULES(IDN, [libidn])
153 dnl ==================================================
154 PKG_CHECK_MODULES(OPENSSL, [openssl])
155 AC_SUBST(OPENSSL_CFLAGS)
156 AC_SUBST(OPENSSL_LIBS)
158 dnl ==================================================
159 if test "x$devel_faked_hal" = "xyes"; then
160 HAL_CFLAGS=-DFAKE_HAL
162 dnl checks for pkgconfig modules
163 hal_module="hal >= 0.5.4, hal-storage >= 0.5.4"
164 dbus_module="dbus-1 >= 0.33"
165 hal_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.33, $dbus_module, $hal_module"
166 PKG_CHECK_MODULES(HAL, [$hal_modules])
172 dnl ==================================================
173 dnl checks for header files
174 AC_CHECK_HEADERS([boost/scoped_ptr.hpp],
176 AC_MSG_ERROR([boost header not found. please install boost-devel]))
177 AC_CHECK_HEADERS([curl/curl.h],
179 AC_MSG_ERROR([libcurl header not found. please install curl-devel.]))
180 AC_CHECK_HEADERS([idn-free.h],
182 AC_MSG_ERROR([libidn header not found. please install libidn-devel.]))
183 AC_CHECK_HEADERS([openssl/evp.h],
185 AC_MSG_ERROR([openssl header not found. please install openssl-devel.]))
186 AC_CHECK_HEADERS([rpm/rpmlib.h],
188 AC_MSG_ERROR([rpmlib header not found. please install rpm-devel.]))
189 AC_CHECK_HEADERS([popt.h],
191 AC_MSG_ERROR([popt header not found. please install popt-devel.]))
193 dnl internationalization macros
196 dnl ==================================================
197 dnl checks for typedefs
199 AH_TEMPLATE([HAVE_RPM_ENHANCES], [the new enhances dependency])
200 AC_MSG_CHECKING([for Enhances in librpm])
203 [AC_LANG_PROGRAM([#include <rpm/rpmlib.h>],
204 [int i = RPMTAG_ENHANCESNAME;])],
205 [AC_DEFINE([HAVE_RPM_ENHANCES]) hre=yes]
207 AC_MSG_RESULT([$hre])
209 dnl ==================================================
210 dnl checks for structures
211 dnl ==================================================
212 dnl checks for compiler characteristics
213 dnl ==================================================
214 dnl checks for library functions
215 dnl ==================================================
216 dnl checks for system services
217 dnl ==================================================
218 dnl AC_CONFIG_FILES([FILE...])
219 AC_OUTPUT( po/Makefile.in\
225 devel/devel.jsrain/Makefile \
226 devel/devel.dmacvicar/Makefile \
227 devel/devel.jsrain/yum/Makefile \
228 devel/devel.ma/Makefile \
229 devel/devel.kkaempf/Makefile \
230 devel/devel.mvidner/Makefile \
232 doc/autodoc/Makefile \
233 doc/autodoc/Doxyfile \
235 testsuite/src/Makefile \
236 testsuite/src/utils/Makefile \
237 testsuite/zypp/Makefile \
238 testsuite/cache/Makefile \
239 testsuite/solver/Makefile \
240 testsuite/solver/src/Makefile \
241 testsuite/src/helix/Makefile \
242 testsuite/solver/single.out/Makefile \
243 testsuite/source/Makefile \
244 testsuite/parser/Makefile \
245 testsuite/parser/tests/Makefile \
246 testsuite/target/Makefile \
247 testsuite/target/tests/Makefile \
248 testsuite/media/Makefile \
250 tools/registration/Makefile \
254 zypp/thread/Makefile \
255 zypp/detail/Makefile \
256 zypp/capability/Makefile \
257 zypp/parser/Makefile \
258 zypp/parser/yum/Makefile \
259 zypp/parser/yum2/Makefile \
260 zypp/parser/yum/schema/Makefile \
261 zypp/parser/tagfile/Makefile \
262 zypp/parser/xmlstore/Makefile \
263 zypp/parser/xmlstore/schema/Makefile \
265 zypp/solver/Makefile \
266 zypp/solver/detail/Makefile \
269 zypp2/cache/Makefile \
270 zypp2/cache/sqlite3x/Makefile
271 zypp2/source/Makefile \
272 zypp2/source/yum/Makefile \
273 zypp/source/Makefile \
274 zypp/source/plaindir/Makefile \
275 zypp/source/susetags/Makefile \
276 zypp/source/yum/Makefile \
277 zypp2/source/sqlite-source/Makefile \
278 zypp/media/Makefile \
279 zypp/media/proxyinfo/Makefile \
282 zypp/target/Makefile \
283 zypp/target/rpm/Makefile \
284 zypp/target/store/Makefile \
285 zypp/target/store/xml/Makefile \
286 zypp/target/hal/Makefile \
287 zypp/target/modalias/Makefile \
288 zypp/zypp_detail/Makefile
290 dnl ==================================================
298 LIBZYPP_VERSION_INFO: ${LIBZYPP_VERSION_INFO}
299 LIBZYPP_LIBRARY_NAME: ${LIBZYPP_LIBRARY_NAME}
301 FEATURES: ${ZYPP_FEATURES}
304 CXXFLAGS: ${CXXFLAGS}
310 if test "x$devel_faked_hal" = "xyes"; then
311 echo "**WARNIG: faked_hal"