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)
24 dnl ==================================================
26 # libzypp compile time features/option tags,
27 # that can be used for consistence checks ...
29 AC_SUBST(ZYPP_FEATURES)
31 # libzypp cflags to add to pkg-config cflags
35 dnl ==================================================
37 CXXFLAGS="${CXXFLAGS} -g -pg -O3 -Wall -Wformat"
39 if test "$enable_largefile" != no ; then
41 if test "$ac_cv_sys_file_offset_bits" != no; then
42 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
44 if test "$ac_cv_sys_large_files" != no; then
45 LFS_CFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $LFS_CFLAGS"
47 ZYPP_FEATURES="LFS $ZYPP_FEATURES"
48 ZYPP_CFLAGS="$LFS_CFLAGS $ZYPP_CFLAGS"
51 test -n "$LFS_CFLAGS" && CXXFLAGS="$CXXFLAGS $LFS_CFLAGS"
53 dnl ==================================================
55 docdir=\${datadir}/doc/packages
56 pkgdocdir=\${docdir}/$PACKAGE
61 zyppdir=${prefix}/share/$PACKAGE
62 localedir=${prefix}/share/locale
63 yumschemadir=${zyppdir}/schema/yum
64 xmlstoreschemadir=${zyppdir}/schema/xmlstore
68 AC_SUBST(yumschemadir)
69 AC_SUBST(xmlstoreschemadir)
71 AH_TEMPLATE([LOCALEDIR],[gettext localedir])
72 AC_DEFINE_UNQUOTED([LOCALEDIR], ["${localedir}"])
73 AH_TEMPLATE([TEXTDOMAIN],[gettext textdomain])
74 AC_DEFINE_UNQUOTED([TEXTDOMAIN], ["$PACKAGE"])
76 dnl ==================================================
77 dnl checks for programs
79 dnl check for c++ compiler and tools
86 dnl do AC_CHECK_* tests using c++ (e.g. boost header)
89 AC_PATH_PROG(DOCGEN, doxygen)
90 if test -z "$DOCGEN" ; then
91 AC_MSG_ERROR(doxygen is missing; please install doxygen.)
94 AC_PATH_PROG(HAVE_DOT, dot)
95 if test -z "$HAVE_DOT" ; then
96 AC_MSG_WARN(dot not found; you should install graphviz.)
102 AC_PATH_PROG(XGETTEXT, xgettext)
103 if test -z "$XGETTEXT" ; then
104 AC_MSG_ERROR(xgettext is missing; please install gettext-devel.)
107 AC_PATH_PROG(MYRUNTEST, runtest)
108 if test -z "$MYRUNTEST" ; then
109 AC_MSG_ERROR(runtest is missing; please install dejagnu.)
112 dnl ==================================================
114 dnl Switches during develpoment only. They disable code using
115 dnl certain libraries (e.g. hal ) which may be temporarily
116 dnl unavailable or broken. This is just to allow building and testing
117 dnl the remaining parts of zypp.
119 AC_ARG_ENABLE(faked-hal, [ --enable-faked-hal do not use libhal (DEVELOPMENT ONLY)],
120 devel_faked_hal=yes, devel_faked_hal=no)
122 dnl ==================================================
123 dnl checks for libraries
124 AC_CHECK_LIB([z], [gzopen],
126 AC_MSG_ERROR([libz not found. please install zlib-devel]))
127 AC_CHECK_LIB([xml2], [xmlNewTextReader],
129 AC_MSG_ERROR([libxml2 not found. please install libxml2-devel]))
131 dnl ==================================================
132 PKG_CHECK_MODULES(CURL, [libcurl])
133 AC_SUBST(CURL_CFLAGS)
136 dnl ==================================================
137 PKG_CHECK_MODULES(BLKID, [blkid])
138 AC_SUBST(BLKID_CFLAGS)
142 AM_CONDITIONAL(BUILD_ZMD, true)
143 PKG_CHECK_MODULES(SQLITE, sqlite3, pkg_sqlite=yes, pkg_sqlite=no)
144 if test $pkg_sqlite = no; then
146 AC_MSG_ERROR([Could not find sqlite3 library, please install sqlite-devel])
149 dnl ==================================================
150 PKG_CHECK_MODULES(IDN, [libidn])
154 dnl ==================================================
155 PKG_CHECK_MODULES(OPENSSL, [openssl])
156 AC_SUBST(OPENSSL_CFLAGS)
157 AC_SUBST(OPENSSL_LIBS)
159 dnl ==================================================
160 if test "x$devel_faked_hal" = "xyes"; then
161 HAL_CFLAGS=-DFAKE_HAL
163 dnl checks for pkgconfig modules
164 hal_module="hal >= 0.5.4, hal-storage >= 0.5.4"
165 dbus_module="dbus-1 >= 0.33"
166 hal_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.33, $dbus_module, $hal_module"
167 PKG_CHECK_MODULES(HAL, [$hal_modules])
173 dnl ==================================================
174 dnl checks for header files
175 AC_CHECK_HEADERS([boost/scoped_ptr.hpp],
177 AC_MSG_ERROR([boost header not found. please install boost-devel]))
178 AC_CHECK_HEADERS([curl/curl.h],
180 AC_MSG_ERROR([libcurl header not found. please install curl-devel.]))
181 AC_CHECK_HEADERS([blkid/blkid.h],
183 AC_MSG_ERROR([libblkid header not found. please install e2fsprogs-devel.]))
184 AC_CHECK_HEADERS([idn-free.h],
186 AC_MSG_ERROR([libidn header not found. please install libidn-devel.]))
187 AC_CHECK_HEADERS([openssl/evp.h],
189 AC_MSG_ERROR([openssl header not found. please install openssl-devel.]))
190 AC_CHECK_HEADERS([rpm/rpmlib.h],
192 AC_MSG_ERROR([rpmlib header not found. please install rpm-devel.]))
193 AC_CHECK_HEADERS([popt.h],
195 AC_MSG_ERROR([popt header not found. please install popt-devel.]))
197 dnl internationalization macros
200 dnl ==================================================
201 dnl checks for typedefs
202 dnl ==================================================
203 dnl checks for structures
204 dnl ==================================================
205 dnl checks for compiler characteristics
206 dnl ==================================================
207 dnl checks for library functions
208 dnl ==================================================
209 dnl checks for system services
210 dnl ==================================================
211 dnl AC_CONFIG_FILES([FILE...])
212 AC_OUTPUT( po/Makefile.in\
218 devel/devel.jsrain/Makefile \
219 devel/devel.dmacvicar/Makefile \
220 devel/devel.jsrain/yum/Makefile \
221 devel/devel.ma/Makefile \
222 devel/devel.kkaempf/Makefile \
223 devel/devel.mvidner/Makefile \
225 doc/autodoc/Makefile \
226 doc/autodoc/Doxyfile \
228 testsuite/src/Makefile \
229 testsuite/src/utils/Makefile \
230 testsuite/zypp/Makefile \
231 testsuite/cache/Makefile \
232 testsuite/solver/Makefile \
233 testsuite/solver/src/Makefile \
234 testsuite/src/helix/Makefile \
235 testsuite/solver/single.out/Makefile \
236 testsuite/source/Makefile \
237 testsuite/source/tests/Makefile \
238 testsuite/parser/Makefile \
239 testsuite/parser/tests/Makefile \
240 testsuite/target/Makefile \
241 testsuite/target/tests/Makefile \
242 testsuite/media/Makefile \
243 testsuite/media/tests/Makefile \
247 zypp/thread/Makefile \
248 zypp/detail/Makefile \
249 zypp/capability/Makefile \
250 zypp/parser/Makefile \
251 zypp/parser/yum/Makefile \
252 zypp/parser/yum2/Makefile \
253 zypp/parser/yum/schema/Makefile \
254 zypp/parser/tagfile/Makefile \
255 zypp/parser/xmlstore/Makefile \
256 zypp/parser/xmlstore/schema/Makefile \
258 zypp/solver/Makefile \
259 zypp/solver/detail/Makefile \
262 zypp2/cache/Makefile \
263 zypp2/cache/sqlite3x/Makefile
264 zypp2/source/Makefile \
265 zypp2/source/yum/Makefile \
266 zypp/source/Makefile \
267 zypp/source/plaindir/Makefile \
268 zypp/source/susetags/Makefile \
269 zypp/source/yum/Makefile \
270 zypp2/source/sqlite-source/Makefile \
271 zypp/media/Makefile \
272 zypp/media/proxyinfo/Makefile \
275 zypp/target/Makefile \
276 zypp/target/rpm/Makefile \
277 zypp/target/store/Makefile \
278 zypp/target/store/xml/Makefile \
279 zypp/target/hal/Makefile \
280 zypp/target/modalias/Makefile \
281 zypp/zypp_detail/Makefile
283 dnl ==================================================
290 LIBZYPP_VERSION_INFO ${LIBZYPP_VERSION_INFO}
292 FEATURES: ${ZYPP_FEATURES}
295 CXXFLAGS: ${CXXFLAGS}
301 if test "x$devel_faked_hal" = "xyes"; then
302 echo "**WARNIG: faked_hal"