- Introduce examples/
[platform/upstream/libzypp.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl ==================================================
3 m4_include([VERSION])
4 AC_INIT([zypp], [LIBZYPP_MAJOR.LIBZYPP_MINOR.LIBZYPP_PATCH])
5 dnl ==================================================
6 AC_CONFIG_SRCDIR(zypp/Makefile.am)
7
8 AC_PREFIX_DEFAULT(/usr)
9 AC_CANONICAL_TARGET
10 AC_ARG_PROGRAM
11
12 AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip tar-ustar)
13 AM_CONFIG_HEADER(config.h)
14
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 ==================================================
25
26 # libzypp compile time features/option tags,
27 # that can be used for consistence checks ...
28 ZYPP_FEATURES=""
29 AC_SUBST(ZYPP_FEATURES)
30
31 # libzypp cflags to add to pkg-config cflags
32 ZYPP_CFLAGS=""
33 AC_SUBST(ZYPP_CFLAGS)
34
35 dnl ==================================================
36
37 CXXFLAGS="${CXXFLAGS} -g -pg -O3 -Wall -Wformat"
38 AC_SYS_LARGEFILE
39 if test "$enable_largefile" != no ; then
40         enable_largefile=yes
41         if test "$ac_cv_sys_file_offset_bits" != no; then
42                 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
43         fi
44         if test "$ac_cv_sys_large_files" != no; then
45                 LFS_CFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $LFS_CFLAGS"
46         fi
47         ZYPP_FEATURES="LFS $ZYPP_FEATURES"
48         ZYPP_CFLAGS="$LFS_CFLAGS $ZYPP_CFLAGS"
49 fi
50 AC_SUBST(LFS_CFLAGS)
51 test -n "$LFS_CFLAGS" && CXXFLAGS="$CXXFLAGS $LFS_CFLAGS"
52
53 dnl ==================================================
54
55 docdir=\${datadir}/doc/packages
56 pkgdocdir=\${docdir}/$PACKAGE
57
58 AC_SUBST(docdir)
59 AC_SUBST(pkgdocdir)
60
61 zyppdir=${prefix}/share/$PACKAGE
62 localedir=${prefix}/share/locale
63 yumschemadir=${zyppdir}/schema/yum
64 xmlstoreschemadir=${zyppdir}/schema/xmlstore
65
66 AC_SUBST(zyppdir)
67 AC_SUBST(localedir)
68 AC_SUBST(yumschemadir)
69 AC_SUBST(xmlstoreschemadir)
70
71 AH_TEMPLATE([LOCALEDIR],[gettext localedir])
72 AC_DEFINE_UNQUOTED([LOCALEDIR], ["${localedir}"])
73 AH_TEMPLATE([TEXTDOMAIN],[gettext textdomain])
74 AC_DEFINE_UNQUOTED([TEXTDOMAIN], ["$PACKAGE"])
75
76 dnl ==================================================
77 dnl checks for programs
78
79 dnl   check for c++ compiler and tools
80 AC_PROG_CXX
81 AC_PROG_CXX
82 AC_PROG_CXXCPP
83 AC_PROG_INSTALL
84 AM_PROG_LIBTOOL
85
86 dnl   do AC_CHECK_* tests using c++ (e.g. boost header)
87 AC_LANG([C++])
88
89 AC_PATH_PROG(DOCGEN, doxygen)
90 if test -z "$DOCGEN" ; then
91     AC_MSG_ERROR(doxygen is missing; please install doxygen.)
92 fi
93
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.)
97     HAVE_DOT=NO
98 else
99     HAVE_DOT=YES
100 fi
101
102 AC_PATH_PROG(XGETTEXT, xgettext)
103 if test -z "$XGETTEXT" ; then
104     AC_MSG_ERROR(xgettext is missing; please install gettext-devel.)
105 fi
106
107 AC_PATH_PROG(MYRUNTEST, runtest)
108 if test -z "$MYRUNTEST" ; then
109     AC_MSG_ERROR(runtest is missing; please install dejagnu.)
110 fi
111
112 dnl ==================================================
113 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.
118 dnl
119 AC_ARG_ENABLE(faked-hal, [  --enable-faked-hal   do not use libhal (DEVELOPMENT ONLY)],
120   devel_faked_hal=yes, devel_faked_hal=no)
121
122 dnl ==================================================
123 dnl checks for libraries
124 AC_CHECK_LIB([z], [gzopen],
125         [:],
126         AC_MSG_ERROR([libz not found. please install zlib-devel]))
127 AC_CHECK_LIB([xml2], [xmlNewTextReader],
128         [:],
129         AC_MSG_ERROR([libxml2 not found. please install libxml2-devel]))
130
131 dnl ==================================================
132 PKG_CHECK_MODULES(CURL, [libcurl])
133 AC_SUBST(CURL_CFLAGS)
134 AC_SUBST(CURL_LIBS)
135
136 dnl ==================================================
137 PKG_CHECK_MODULES(BLKID, [blkid])
138 AC_SUBST(BLKID_CFLAGS)
139 AC_SUBST(BLKID_LIBS)
140
141 dnl sqlite
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
145   echo
146   AC_MSG_ERROR([Could not find sqlite3 library, please install sqlite-devel])
147 fi
148
149 dnl ==================================================
150 PKG_CHECK_MODULES(IDN, [libidn])
151 AC_SUBST(IDN_CFLAGS)
152 AC_SUBST(IDN_LIBS)
153
154 dnl ==================================================
155 PKG_CHECK_MODULES(OPENSSL, [openssl])
156 AC_SUBST(OPENSSL_CFLAGS)
157 AC_SUBST(OPENSSL_LIBS)
158
159 dnl ==================================================
160 if test "x$devel_faked_hal" = "xyes"; then
161  HAL_CFLAGS=-DFAKE_HAL
162 else
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])
168 fi
169 AC_SUBST(HAL_CFLAGS)
170 AC_SUBST(HAL_LDADD)
171 AC_SUBST(HAL_LIBS)
172
173 dnl ==================================================
174 dnl checks for header files
175 AC_CHECK_HEADERS([boost/scoped_ptr.hpp],
176         [],
177         AC_MSG_ERROR([boost header not found. please install boost-devel]))
178 AC_CHECK_HEADERS([curl/curl.h],
179         [],
180         AC_MSG_ERROR([libcurl header not found. please install curl-devel.]))
181 AC_CHECK_HEADERS([blkid/blkid.h],
182         [],
183         AC_MSG_ERROR([libblkid header not found. please install e2fsprogs-devel.]))
184 AC_CHECK_HEADERS([idn-free.h],
185         [],
186         AC_MSG_ERROR([libidn header not found. please install libidn-devel.]))
187 AC_CHECK_HEADERS([openssl/evp.h],
188         [],
189         AC_MSG_ERROR([openssl header not found. please install openssl-devel.]))
190 AC_CHECK_HEADERS([rpm/rpmlib.h],
191         [],
192         AC_MSG_ERROR([rpmlib header not found. please install rpm-devel.]))
193 AC_CHECK_HEADERS([popt.h],
194         [],
195         AC_MSG_ERROR([popt header not found. please install popt-devel.]))
196
197 dnl internationalization macros
198 AM_GNU_GETTEXT
199
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\
213         Makefile                        \
214         libzypp.spec                    \
215         libzypp.pc                      \
216         devel/Makefile                  \
217         devel/genclass                  \
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    \
224         doc/Makefile                    \
225         doc/autodoc/Makefile            \
226         doc/autodoc/Doxyfile            \
227         testsuite/Makefile              \
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  \
244   examples/Makefile  \
245   zypp/Makefile                 \
246         zypp/base/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  \
257         zypp/pool/Makefile              \
258         zypp/solver/Makefile            \
259         zypp/solver/detail/Makefile     \
260   zypp/data/Makefile \
261   zypp2/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   \
273         zypp/ui/Makefile                \
274         zypp/url/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
282 )
283 dnl ==================================================
284
285 echo "
286 Configuration:
287
288   PACKAGE:              ${PACKAGE}
289   VERSION:              ${VERSION}
290   LIBZYPP_VERSION_INFO  ${LIBZYPP_VERSION_INFO}
291
292   FEATURES:             ${ZYPP_FEATURES}
293
294   COMPILER:             ${CXX}
295   CXXFLAGS:             ${CXXFLAGS}
296
297   PREFIX:               ${prefix}
298   LIBDIR:               ${libdir}
299
300 "
301 if test "x$devel_faked_hal" = "xyes"; then
302   echo "**WARNIG:       faked_hal"
303 fi
304 echo
305