]>
Commit | Line | Data |
---|---|---|
dd926c7a DM |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | # Minimum version of autoconf required | |
f489e969 | 4 | AC_PREREQ(2.62) |
dd926c7a | 5 | |
16c91bed DM |
6 | # UPDATING VERSION NUMBERS FOR RELEASES |
7 | # | |
8 | # libalpm: | |
9 | # current | |
10 | # The most recent interface number that this library implements. | |
11 | # revision | |
12 | # The implementation number of the current interface. | |
13 | # age | |
14 | # The difference between the newest and oldest interfaces that this library | |
15 | # implements. In other words, the library implements all the interface | |
16 | # numbers in the range from number current - age to current. | |
17 | # | |
18 | # 1. Start with version information of `0:0:0' for each libtool library. | |
19 | # 2. Update the version information only immediately before a public release of | |
20 | # your software. More frequent updates are unnecessary, and only guarantee | |
21 | # that the current interface number gets larger faster. | |
22 | # 3. If the library source code has changed at all since the last update, then | |
23 | # increment revision (`c:r:a' becomes `c:r+1:a'). | |
24 | # 4. If any interfaces have been added, removed, or changed since the last | |
25 | # update, increment current, and set revision to 0. | |
26 | # 5. If any interfaces have been added since the last public release, then | |
27 | # increment age. | |
28 | # 6. If any interfaces have been removed since the last public release, then | |
29 | # set age to 0. | |
30 | # | |
31 | # pacman: | |
32 | # Extreme huge major changes: | |
33 | # pacman_version_major += 1 | |
34 | # pacman_version_minor = 0 | |
35 | # pacman_version_micro = 0 | |
36 | # | |
37 | # Real releases: | |
38 | # pacman_version_minor += 1 | |
39 | # pacman_version_micro = 0 | |
40 | # | |
41 | # Bugfix releases: | |
42 | # pacman_version_micro += 1 | |
16c91bed | 43 | |
312e9252 | 44 | m4_define([lib_current], [8]) |
5a0c659a | 45 | m4_define([lib_revision], [2]) |
4eb14697 | 46 | m4_define([lib_age], [0]) |
16c91bed | 47 | |
c5eccedc | 48 | m4_define([pacman_version_major], [4]) |
312e9252 | 49 | m4_define([pacman_version_minor], [1]) |
5a0c659a | 50 | m4_define([pacman_version_micro], [2]) |
16c91bed DM |
51 | m4_define([pacman_version], |
52 | [pacman_version_major.pacman_version_minor.pacman_version_micro]) | |
16c91bed | 53 | |
dd926c7a | 54 | # Autoconf initialization |
63661043 | 55 | AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org]) |
dd926c7a DM |
56 | AC_CONFIG_SRCDIR([config.h.in]) |
57 | AC_CONFIG_HEADERS([config.h]) | |
5f774025 | 58 | AC_CONFIG_MACRO_DIR([m4]) |
30ca48df | 59 | AC_CONFIG_AUX_DIR([build-aux]) |
dd926c7a | 60 | |
332c1271 | 61 | AC_CANONICAL_HOST |
dacda1f6 DM |
62 | AM_INIT_AUTOMAKE([1.11]) |
63 | AM_SILENT_RULES([yes]) | |
a1526a3e | 64 | |
5f774025 | 65 | LT_INIT |
3b464dc8 | 66 | LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision |
16c91bed | 67 | LIB_VERSION_INFO="lib_current:lib_revision:lib_age" |
a1526a3e | 68 | |
d2669b47 | 69 | # Respect empty CFLAGS during compiler tests |
1d0ab50c | 70 | if test "x$CFLAGS" = "x"; then |
d2669b47 AM |
71 | CFLAGS="" |
72 | fi | |
73 | ||
dd926c7a DM |
74 | # Set subsitution values for version stuff in Makefiles and anywhere else, |
75 | # and put LIB_VERSION in config.h | |
332c1271 DM |
76 | AC_SUBST(LIB_VERSION) |
77 | AC_SUBST(LIB_VERSION_INFO) | |
332c1271 | 78 | AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number]) |
a1526a3e | 79 | |
dd926c7a | 80 | # Help line for root directory |
c3ad8bd7 | 81 | AC_ARG_WITH(root-dir, |
eba52191 | 82 | AS_HELP_STRING([--with-root-dir=path], [set the location of the root operating directory]), |
e0afe6e9 | 83 | [ROOTDIR=$withval], [ROOTDIR=/]) |
c3ad8bd7 | 84 | |
dd926c7a | 85 | # Help line for package extension |
c3ad8bd7 | 86 | AC_ARG_WITH(pkg-ext, |
57acfced | 87 | AS_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]), |
e0afe6e9 | 88 | [PKGEXT=$withval], [PKGEXT=.pkg.tar.gz]) |
c3ad8bd7 | 89 | |
e422b71a AF |
90 | # Help line for source package directory |
91 | AC_ARG_WITH(src-ext, | |
57acfced | 92 | AS_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]), |
e0afe6e9 | 93 | [SRCEXT=$withval], [SRCEXT=.src.tar.gz]) |
e422b71a | 94 | |
8f26bb90 AM |
95 | # Help line for buildscript filename |
96 | AC_ARG_WITH(buildscript, | |
97 | AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]), | |
98 | [BUILDSCRIPT=$withval], [BUILDSCRIPT=PKGBUILD]) | |
99 | ||
ce312519 FP |
100 | # Help line for buildscript filename |
101 | AC_ARG_WITH(makepkg-template-dir, | |
102 | AS_HELP_STRING([--with-makepkg-template-dir=name], [set the template dir used by makepkg-template]), | |
103 | [TEMPLATE_DIR=$withval], [TEMPLATE_DIR=/usr/share/makepkg-template]) | |
104 | ||
13667fd4 AM |
105 | # Help line for debug package suffix |
106 | AC_ARG_WITH(debug-suffix, | |
107 | AS_HELP_STRING([--with-debug-suffix=name], [set the suffix for split debugging symbol packages used by makepkg]), | |
108 | [DEBUGSUFFIX=$withval], [DEBUGSUFFIX=debug]) | |
109 | ||
3ba53918 AM |
110 | # Help line for changing shell used to run install scriptlets |
111 | AC_ARG_WITH(scriptlet-shell, | |
112 | AS_HELP_STRING([--with-scriptlet-shell=shell], | |
ad280e1b AM |
113 | [set the full path to the shell used to run install scriptlets]), |
114 | [SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=/bin/sh]) | |
3ba53918 | 115 | |
89ecf8ca AM |
116 | # Help line for ldconfig path |
117 | AC_ARG_WITH(ldconfig, | |
118 | AS_HELP_STRING([--with-ldconfig=path], | |
119 | [set the full path to ldconfig]), | |
120 | [LDCONFIG=$withval], [LDCONFIG=/sbin/ldconfig]) | |
121 | ||
eba52191 DM |
122 | # Help line for using OpenSSL |
123 | AC_ARG_WITH(openssl, | |
124 | AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]), | |
125 | [], [with_openssl=check]) | |
126 | ||
97be2f0e DM |
127 | # Help line for using gpgme |
128 | AC_ARG_WITH(gpgme, | |
129 | AS_HELP_STRING([--with-gpgme], [use GPGME for PGP signature verification]), | |
130 | [], [with_gpgme=check]) | |
131 | ||
b2226ed1 DR |
132 | # Help line for using libcurl |
133 | AC_ARG_WITH(curl, | |
134 | AS_HELP_STRING([--with-libcurl], [use libcurl for the internal downloader]), | |
135 | [], [with_curl=check]) | |
a708c6ea | 136 | |
26c05b1c DM |
137 | # Help line for documentation |
138 | AC_ARG_ENABLE(doc, | |
7fc50d79 DM |
139 | AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]), |
140 | [wantdoc=$enableval], [wantdoc=yes]) | |
26c05b1c | 141 | |
dd926c7a | 142 | # Help line for doxygen |
c3ad8bd7 | 143 | AC_ARG_ENABLE(doxygen, |
57acfced | 144 | AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]), |
103c3ac5 | 145 | [wantdoxygen=$enableval], [wantdoxygen=no]) |
3595201f | 146 | |
dd926c7a | 147 | # Help line for debug |
3595201f | 148 | AC_ARG_ENABLE(debug, |
57acfced | 149 | AS_HELP_STRING([--enable-debug], [enable debugging support]), |
e0afe6e9 | 150 | [debug=$enableval], [debug=no]) |
3595201f | 151 | |
b729ed01 DM |
152 | # Help line for compiler warning flags |
153 | AC_ARG_ENABLE(warningflags, | |
154 | AS_HELP_STRING([--enable-warningflags], [enable extra compiler warning flags]), | |
155 | [warningflags=$enableval], [warningflags=no]) | |
156 | ||
63661043 DM |
157 | # Help line for using git version in pacman version string |
158 | AC_ARG_ENABLE(git-version, | |
159 | AS_HELP_STRING([--enable-git-version], | |
160 | [enable use of git version in version string if available]), | |
161 | [wantgitver=$enableval], [wantgitver=no]) | |
162 | ||
115c0381 NPB |
163 | # Enable large file support if available (must be enabled before |
164 | # testing compilation against gpgme). | |
165 | AC_SYS_LARGEFILE | |
166 | ||
dd926c7a DM |
167 | # Checks for programs. |
168 | AC_PROG_AWK | |
288dd549 | 169 | AC_PROG_CC_C99 |
dd926c7a | 170 | AC_PROG_INSTALL |
283ef651 | 171 | AC_CHECK_PROGS([PYTHON], [python2.7 python2.6 python2.5 python2 python], [false]) |
ea4aa6f1 DR |
172 | AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false]) |
173 | ||
ce312519 FP |
174 | # check for perl 5.10.1 (needed by makepkg-template) |
175 | AC_PATH_PROG([PERL],[perl]) | |
176 | AC_DEFUN([AX_PROG_PERL_VERSION], | |
177 | [AC_CACHE_CHECK([for Perl version $1 or later], [ax_cv_prog_perl_version], | |
178 | [AS_IF(["$PERL" -e 'require v$1;' >/dev/null 2>&1], | |
179 | [ax_cv_prog_perl_version=yes], | |
180 | [ax_cv_prog_perl_version=no])]) | |
181 | AS_IF([test x"$ax_cv_prog_perl_version" = xyes], [$2], [$3])]) | |
182 | AX_PROG_PERL_VERSION([5.10.1], [], [AC_MSG_ERROR([perl is too old])]) | |
183 | ||
ea4aa6f1 DR |
184 | AS_IF([test "x$BASH_SHELL" = "xfalse"], |
185 | AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]), | |
186 | [bash_version_major=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}"'` | |
187 | bash_version_minor=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[1]]}"'` | |
188 | ok=yes | |
189 | if test "$bash_version_major" -lt 4; then | |
190 | ok=no | |
191 | fi | |
192 | if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then | |
193 | ok=no | |
194 | fi | |
195 | if test "$ok" = "no"; then | |
196 | AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts]) | |
197 | fi | |
198 | unset bash_version_major bash_version_minor ok]) | |
dd926c7a DM |
199 | |
200 | # find installed gettext | |
fa3aa644 | 201 | AM_GNU_GETTEXT([external], [need-ngettext]) |
dd926c7a DM |
202 | AM_GNU_GETTEXT_VERSION(0.13.1) |
203 | ||
0e03c084 XC |
204 | AC_CHECK_LIB([m], [fabs], , |
205 | AC_MSG_ERROR([libm is needed to compile pacman!])) | |
206 | ||
dd926c7a | 207 | # Check for libarchive |
059c572c DR |
208 | PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 2.8.0], , |
209 | AC_MSG_ERROR([*** libarchive >= 2.8.0 is needed to compile pacman!])) | |
dd926c7a | 210 | |
eba52191 | 211 | # Check for OpenSSL |
c5d95184 DR |
212 | have_openssl=no |
213 | if test "x$with_openssl" != "xno"; then | |
1eb6a9cb | 214 | PKG_CHECK_MODULES(LIBSSL, [libcrypto], |
c5d95184 DR |
215 | [AC_DEFINE(HAVE_LIBSSL, 1, [Define if libcrypto is available]) have_openssl=yes], have_openssl=no) |
216 | if test "x$have_openssl" = xno -a "x$with_openssl" = xyes; then | |
217 | AC_MSG_ERROR([*** openssl support requested but libraries not found]) | |
218 | fi | |
219 | fi | |
220 | AM_CONDITIONAL(HAVE_LIBSSL, [test "$have_openssl" = "yes"]) | |
eba52191 | 221 | |
b2226ed1 DR |
222 | # Check for libcurl |
223 | have_libcurl=no | |
224 | if test "x$with_libcurl" != "xno"; then | |
225 | PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.19.4], | |
226 | [AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available]) have_libcurl=yes], have_libcurl=no) | |
227 | if test "x$have_libcurl" = xno -a "x$with_libcurl" = xyes; then | |
228 | AC_MSG_ERROR([*** libcurl >= 7.19.4 is required for internal downloader support]) | |
229 | fi | |
230 | fi | |
231 | AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"]) | |
232 | ||
39c75c70 | 233 | # Check for gpgme |
97be2f0e DM |
234 | AC_MSG_CHECKING(whether to link with libgpgme) |
235 | AS_IF([test "x$with_gpgme" != "xno"], | |
115c0381 NPB |
236 | [AC_MSG_RESULT([yes])], |
237 | [AC_MSG_RESULT([no])]) | |
238 | ||
cb5b6636 | 239 | have_gpgme=no |
115c0381 | 240 | AS_IF([test "x$with_gpgme" != "xno"], |
cb5b6636 | 241 | [AM_PATH_GPGME([1.3.0], |
115c0381 NPB |
242 | [LIBS_save="$LIBS" |
243 | CPPFLAGS_save="$CPPFLAGS" | |
244 | CFLAGS_save="$CFLAGS" | |
245 | ||
246 | LIBS="$LIBS $GPGME_LIBS" | |
247 | CPPFLAGS="$CPPFLAGS $GPGME_CPPFLAGS" | |
248 | CFLAGS="$CFLAGS $GPGME_CFLAGS" | |
249 | ||
250 | AC_MSG_CHECKING([for sane gpgme]) | |
251 | AC_LINK_IFELSE( | |
252 | [AC_LANG_PROGRAM( | |
253 | [[#include <gpgme.h>]], | |
cb5b6636 | 254 | [[return gpgme_check_version("1.3.0");]])], |
115c0381 | 255 | [AC_MSG_RESULT([yes]) |
cb5b6636 | 256 | have_gpgme=yes |
115c0381 NPB |
257 | AC_DEFINE([HAVE_LIBGPGME], [1], [Define if gpgme should be used to provide GPG signature support.])], |
258 | [AC_MSG_RESULT([no]) | |
cb5b6636 DR |
259 | have_gpgme=no |
260 | unset GPGME_LIBS | |
261 | unset GPGME_CFLAGS] | |
262 | AS_IF([test "x$with_gpgme" = "xyes"], | |
263 | [AC_MSG_FAILURE([*** gpgme >= 1.3.0 is needed for GPG signature support])]) | |
1d0a69c6 AM |
264 | ) |
265 | ||
266 | LIBS="$LIBS_save" | |
cb5b6636 DR |
267 | CPPFLAGS="$CPPFLAGS_save" |
268 | CFLAGS="$CFLAGS_save" | |
269 | unset CPPFLAGS_save | |
1d0a69c6 AM |
270 | unset CFLAGS_save],)]) |
271 | ||
cb5b6636 DR |
272 | AS_IF([test "x$have_gpgme" = xno -a "x$with_gpgme" = xyes], |
273 | [AC_MSG_FAILURE([--with-gpgme was given, but gpgme was not found])]) | |
274 | AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$have_gpgme" = "xyes"]) | |
39c75c70 | 275 | |
dd926c7a | 276 | # Checks for header files. |
1c0c2927 DR |
277 | AC_CHECK_HEADERS([fcntl.h float.h glob.h langinfo.h libintl.h limits.h \ |
278 | locale.h mntent.h netinet/in.h netinet/tcp.h \ | |
44f146f2 | 279 | stddef.h string.h sys/ioctl.h \ |
1eb40c83 | 280 | sys/mnttab.h sys/mount.h \ |
c5c1a134 AM |
281 | sys/param.h sys/statvfs.h sys/time.h sys/types.h \ |
282 | sys/ucred.h syslog.h termios.h wchar.h]) | |
dd926c7a DM |
283 | |
284 | # Checks for typedefs, structures, and compiler characteristics. | |
dd926c7a | 285 | AC_C_INLINE |
c5c1a134 | 286 | AC_TYPE_INT64_T |
dd926c7a DM |
287 | AC_TYPE_MODE_T |
288 | AC_TYPE_OFF_T | |
289 | AC_TYPE_PID_T | |
290 | AC_TYPE_SIZE_T | |
c5c1a134 | 291 | AC_TYPE_SSIZE_T |
dd926c7a DM |
292 | AC_STRUCT_TM |
293 | AC_TYPE_UID_T | |
fc74ef93 | 294 | AC_STRUCT_DIRENT_D_TYPE |
81dd9d3e | 295 | PATH_MAX_DEFINED |
dd926c7a DM |
296 | |
297 | # Checks for library functions. | |
dd926c7a | 298 | AC_FUNC_FORK |
f4e9deb6 | 299 | AC_FUNC_GETMNTENT |
dd926c7a | 300 | AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK |
c5c1a134 | 301 | AC_FUNC_MALLOC |
288dd549 | 302 | AC_FUNC_MKTIME |
c5c1a134 | 303 | AC_FUNC_STRCOLL |
d5a6ce8c | 304 | AC_CHECK_FUNCS([dup2 getcwd getmntinfo gettimeofday memmove memset \ |
c5c1a134 AM |
305 | mkdir realpath regcomp rmdir setenv setlocale strcasecmp \ |
306 | strchr strcspn strdup strerror strndup strrchr strsep strstr \ | |
307 | strtol swprintf tcflush wcwidth uname]) | |
dee8144c | 308 | AC_CHECK_MEMBERS([struct stat.st_blksize],,,[[#include <sys/stat.h>]]) |
c5c1a134 | 309 | |
ec136784 DM |
310 | # For the diskspace code |
311 | FS_STATS_TYPE | |
3afe3b6d DM |
312 | AC_CHECK_MEMBERS([struct statvfs.f_flag],,,[[#include <sys/statvfs.h>]]) |
313 | AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h> | |
314 | #include <sys/mount.h>]]) | |
315 | ||
c26fe63e DM |
316 | # Check if we can use symbol visibility support in GCC |
317 | GCC_VISIBILITY_CC | |
318 | # Check if we have -fgnu89-inline flag | |
319 | GCC_GNU89_INLINE_CC | |
320 | ||
c7a81c0b | 321 | # Host-dependant definitions |
19c23475 | 322 | INODECMD="stat -c '%i %n'" |
cb64fbea | 323 | SIZECMD="stat -c %s" |
8624eddb | 324 | SEDINPLACE="sed --follow-symlinks -i" |
241d6b88 | 325 | DUFLAGS="-sk --apparent-size" |
5fe41df8 CS |
326 | STRIP_BINARIES="--strip-all" |
327 | STRIP_SHARED="--strip-unneeded" | |
328 | STRIP_STATIC="--strip-debug" | |
c7a81c0b | 329 | case "${host_os}" in |
282eeadc | 330 | *bsd*) |
3e0e748b | 331 | INODECMD="stat -f '%i %N'" |
cb64fbea | 332 | SIZECMD="stat -f %z" |
b1a09b93 | 333 | SEDINPLACE="sed -i \"\"" |
241d6b88 | 334 | DUFLAGS="-sk" |
282eeadc | 335 | ;; |
c7a81c0b DM |
336 | darwin*) |
337 | host_os_darwin=yes | |
3e0e748b | 338 | INODECMD="/usr/bin/stat -f '%i %N'" |
cb64fbea | 339 | SIZECMD="/usr/bin/stat -f %z" |
f569c4a0 | 340 | SEDINPLACE="/usr/bin/sed -i ''" |
241d6b88 | 341 | DUFLAGS="-sk" |
5fe41df8 CS |
342 | STRIP_BINARIES="" |
343 | STRIP_SHARED="-S" | |
344 | STRIP_STATIC="-S" | |
c7a81c0b | 345 | ;; |
3595201f DM |
346 | esac |
347 | ||
c7a81c0b | 348 | AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes") |
3f1ea8b6 | 349 | AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] ) |
19c23475 | 350 | AC_SUBST(INODECMD) |
282eeadc | 351 | AC_SUBST(SIZECMD) |
c2790466 | 352 | AC_SUBST(SEDINPLACE) |
241d6b88 | 353 | AC_SUBST(DUFLAGS) |
5fe41df8 CS |
354 | AC_SUBST(STRIP_BINARIES) |
355 | AC_SUBST(STRIP_SHARED) | |
356 | AC_SUBST(STRIP_STATIC) | |
c7a81c0b | 357 | |
ca414704 DM |
358 | # Variables plugged into makepkg.conf |
359 | CARCH="${host%%-*}" | |
3595201f | 360 | CHOST="${host}" |
94810222 | 361 | AC_SUBST(CARCH) |
94810222 | 362 | AC_SUBST(CHOST) |
a1526a3e | 363 | |
26c05b1c | 364 | # Check for documentation support and status |
d44e5099 | 365 | AC_CHECK_PROGS([ASCIIDOC], [asciidoc]) |
26c05b1c DM |
366 | AC_MSG_CHECKING([for building documentation]) |
367 | if test "x$wantdoc" = "xyes" ; then | |
d44e5099 XC |
368 | if test $ASCIIDOC ; then |
369 | AC_MSG_RESULT([yes, enabled by configure]) | |
370 | else | |
371 | asciidoc="(warning : asciidoc not installed)" | |
372 | AC_MSG_RESULT([yes $asciidoc]) | |
373 | fi | |
26c05b1c DM |
374 | wantdoc=yes |
375 | else | |
7fc50d79 | 376 | AC_MSG_RESULT([no, disabled by configure]) |
26c05b1c DM |
377 | wantdoc=no |
378 | fi | |
379 | AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes") | |
380 | ||
d2613b97 | 381 | # Check for doxygen support and status |
63661043 | 382 | AC_CHECK_PROGS([DOXYGEN], [doxygen]) |
dd926c7a | 383 | AC_MSG_CHECKING([for doxygen]) |
3595201f | 384 | if test "x$wantdoxygen" = "xyes" ; then |
e0afe6e9 | 385 | if test $DOXYGEN ; then |
dd926c7a | 386 | AC_MSG_RESULT([yes]) |
332c1271 | 387 | usedoxygen=yes |
e0afe6e9 | 388 | else |
dd926c7a | 389 | AC_MSG_RESULT([no, doxygen missing]) |
332c1271 | 390 | usedoxygen=no |
e0afe6e9 | 391 | fi |
48cc9f3b | 392 | else |
e0afe6e9 | 393 | AC_MSG_RESULT([no, disabled by configure]) |
332c1271 | 394 | usedoxygen=no |
a1526a3e | 395 | fi |
d2613b97 DM |
396 | AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes") |
397 | ||
dd926c7a | 398 | # Enable or disable debug code |
94810222 | 399 | AC_MSG_CHECKING(for debug mode request) |
332c1271 | 400 | if test "x$debug" = "xyes" ; then |
a8731ff2 | 401 | AC_MSG_RESULT(yes) |
332c1271 | 402 | AC_DEFINE([PACMAN_DEBUG], , [Enable debug code]) |
8feccaed DM |
403 | # Check for -fstack-protector availability |
404 | GCC_STACK_PROTECT_LIB | |
405 | GCC_STACK_PROTECT_CC | |
90060591 | 406 | GCC_FORTIFY_SOURCE_CC |
793eff37 | 407 | WARNING_CFLAGS="-g -Wall -Werror" |
94810222 | 408 | else |
e0afe6e9 | 409 | AC_MSG_RESULT(no) |
793eff37 | 410 | WARNING_CFLAGS="-Wall" |
94810222 AG |
411 | fi |
412 | ||
b729ed01 DM |
413 | # Enable or disable compiler warning flags |
414 | AC_MSG_CHECKING(for excessive compiler warning flags) | |
415 | if test "x$warningflags" = "xyes" ; then | |
416 | AC_MSG_RESULT(yes) | |
417 | CFLAGS_ADD([-Wcast-align], [WARNING_CFLAGS]) | |
418 | CFLAGS_ADD([-Wclobbered], [WARNING_CFLAGS]) | |
419 | CFLAGS_ADD([-Wempty-body], [WARNING_CFLAGS]) | |
420 | CFLAGS_ADD([-Wfloat-equal], [WARNING_CFLAGS]) | |
421 | CFLAGS_ADD([-Wformat-nonliteral], [WARNING_CFLAGS]) | |
422 | CFLAGS_ADD([-Wformat-security], [WARNING_CFLAGS]) | |
423 | CFLAGS_ADD([-Wignored-qualifiers], [WARNING_CFLAGS]) | |
424 | CFLAGS_ADD([-Winit-self], [WARNING_CFLAGS]) | |
425 | CFLAGS_ADD([-Wlogical-op], [WARNING_CFLAGS]) | |
426 | CFLAGS_ADD([-Wmissing-declarations], [WARNING_CFLAGS]) | |
8fb1948c | 427 | CFLAGS_ADD([-Wmissing-field-initializers], [WARNING_CFLAGS]) |
b729ed01 DM |
428 | CFLAGS_ADD([-Wmissing-parameter-type], [WARNING_CFLAGS]) |
429 | CFLAGS_ADD([-Wmissing-prototypes], [WARNING_CFLAGS]) | |
430 | CFLAGS_ADD([-Wold-style-declaration], [WARNING_CFLAGS]) | |
431 | CFLAGS_ADD([-Woverride-init], [WARNING_CFLAGS]) | |
432 | CFLAGS_ADD([-Wpointer-arith], [WARNING_CFLAGS]) | |
433 | CFLAGS_ADD([-Wredundant-decls], [WARNING_CFLAGS]) | |
434 | CFLAGS_ADD([-Wshadow], [WARNING_CFLAGS]) | |
435 | CFLAGS_ADD([-Wsign-compare], [WARNING_CFLAGS]) | |
436 | CFLAGS_ADD([-Wstrict-aliasing], [WARNING_CFLAGS]) | |
437 | CFLAGS_ADD([-Wstrict-overflow=5], [WARNING_CFLAGS]) | |
438 | CFLAGS_ADD([-Wstrict-prototypes], [WARNING_CFLAGS]) | |
439 | CFLAGS_ADD([-Wtype-limits], [WARNING_CFLAGS]) | |
440 | CFLAGS_ADD([-Wuninitialized], [WARNING_CFLAGS]) | |
441 | CFLAGS_ADD([-Wunused-but-set-parameter], [WARNING_CFLAGS]) | |
442 | CFLAGS_ADD([-Wunused-parameter], [WARNING_CFLAGS]) | |
443 | CFLAGS_ADD([-Wwrite-strings], [WARNING_CFLAGS]) | |
444 | else | |
445 | AC_MSG_RESULT(no) | |
446 | fi | |
447 | ||
63661043 | 448 | # Enable or disable use of git version in pacman version string |
63661043 DM |
449 | AC_MSG_CHECKING(whether to use git version if available) |
450 | if test "x$wantgitver" = "xyes" ; then | |
bf7c3eb1 ML |
451 | AC_CHECK_PROGS([GIT], [git]) |
452 | AC_CHECK_FILE([.git/], hasgitdir=yes) | |
768c8ba1 | 453 | usegitver=$ac_cv_file__git_ |
63661043 | 454 | if test $GIT -a "x$hasgitdir" = "xyes"; then |
63661043 | 455 | AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string]) |
63661043 DM |
456 | fi |
457 | else | |
458 | AC_MSG_RESULT([no, disabled by configure]) | |
459 | usegitver=no | |
460 | fi | |
461 | AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes") | |
462 | ||
dd926c7a | 463 | # Set root directory |
139d3c5e | 464 | AC_SUBST(ROOTDIR) |
8741551d | 465 | AC_DEFINE_UNQUOTED([ROOTDIR], "$ROOTDIR", [The location of the root operating directory]) |
dd926c7a | 466 | # Set package file extension |
139d3c5e | 467 | AC_SUBST(PKGEXT) |
7bd2ff68 | 468 | AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages]) |
e422b71a AF |
469 | # Set source package file extension |
470 | AC_SUBST(SRCEXT) | |
471 | AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages]) | |
8f26bb90 AM |
472 | # Set makepkg build script name |
473 | AC_SUBST(BUILDSCRIPT) | |
474 | AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg]) | |
ce312519 FP |
475 | # Set makepkg-template template directory |
476 | AC_SUBST(TEMPLATE_DIR) | |
477 | AC_DEFINE_UNQUOTED([TEMPLATE_DIR], "$TEMPLATE_DIR", [The template directory used by makepkg-teplate]) | |
13667fd4 AM |
478 | # Set makepkg split debugging symbol package suffix |
479 | AC_SUBST(DEBUGSUFFIX) | |
480 | AC_DEFINE_UNQUOTED([DEBUGSUFFIX], "$DEBUGSUFFIX", [The suffix for debugging symbol packages used by makepkg]) | |
3ba53918 AM |
481 | # Set shell used by install scriptlets |
482 | AC_SUBST(SCRIPTLET_SHELL) | |
ad280e1b | 483 | AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The full path of the shell used to run install scriptlets]) |
89ecf8ca AM |
484 | # Set ldconfig path |
485 | AC_SUBST(LDCONFIG) | |
486 | AC_DEFINE_UNQUOTED([LDCONFIG], "$LDCONFIG", [The full path to ldconfig]) | |
487 | ||
c3ad8bd7 | 488 | |
dd926c7a DM |
489 | # Configuration files |
490 | AC_CONFIG_FILES([ | |
a1526a3e | 491 | lib/libalpm/Makefile |
7236dd32 | 492 | lib/libalpm/po/Makefile.in |
82b71225 | 493 | lib/libalpm/libalpm.pc |
27d9c25e | 494 | src/common/Makefile |
a1526a3e | 495 | src/pacman/Makefile |
a4a7006a | 496 | src/pacman/po/Makefile.in |
a1526a3e JV |
497 | src/util/Makefile |
498 | scripts/Makefile | |
a4a7006a | 499 | scripts/po/Makefile.in |
a1526a3e | 500 | doc/Makefile |
94810222 | 501 | etc/Makefile |
844d82fa AM |
502 | test/pacman/Makefile |
503 | test/pacman/tests/Makefile | |
8679cd68 | 504 | test/scripts/Makefile |
2ee18650 | 505 | test/util/Makefile |
c799433e | 506 | contrib/Makefile |
a1526a3e JV |
507 | Makefile |
508 | ]) | |
dd926c7a | 509 | AC_OUTPUT |
a1526a3e JV |
510 | |
511 | echo " | |
63661043 | 512 | ${PACKAGE_NAME}: |
94810222 | 513 | |
7bd2ff68 DM |
514 | Build information: |
515 | source code location : ${srcdir} | |
332c1271 | 516 | prefix : ${prefix} |
b6387b95 | 517 | sysconfdir : $(eval echo ${sysconfdir}) |
7bd2ff68 DM |
518 | conf file : $(eval echo ${sysconfdir})/pacman.conf |
519 | localstatedir : $(eval echo ${localstatedir}) | |
7bd2ff68 DM |
520 | database dir : $(eval echo ${localstatedir})/lib/pacman/ |
521 | cache dir : $(eval echo ${localstatedir})/cache/pacman/pkg/ | |
f0e34be9 | 522 | |
332c1271 | 523 | compiler : ${CC} |
f0e34be9 | 524 | preprocessor flags : ${CPPFLAGS} |
793eff37 | 525 | compiler flags : ${WARNING_CFLAGS} ${CFLAGS} |
cb5b6636 | 526 | library flags : ${LIBS} ${LIBSSL_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS} |
f0e34be9 | 527 | linker flags : ${LDFLAGS} |
94810222 | 528 | |
332c1271 | 529 | Architecture : ${CARCH} |
332c1271 | 530 | Host Type : ${CHOST} |
19c23475 | 531 | File inode command : ${INODECMD} |
282eeadc | 532 | Filesize command : ${SIZECMD} |
c2790466 | 533 | In-place sed command : ${SEDINPLACE} |
48cc9f3b | 534 | |
332c1271 | 535 | libalpm version : ${LIB_VERSION} |
3b464dc8 | 536 | libalpm version info : ${LIB_VERSION_INFO} |
332c1271 | 537 | pacman version : ${PACKAGE_VERSION} |
63661043 | 538 | using git version : ${usegitver} |
94810222 | 539 | |
c3ad8bd7 | 540 | Directory and file information: |
7bd2ff68 | 541 | root working directory : ${ROOTDIR} |
f3836ff8 | 542 | package extension : ${PKGEXT} |
e422b71a | 543 | source pkg extension : ${SRCEXT} |
8f26bb90 | 544 | build script name : ${BUILDSCRIPT} |
ce312519 | 545 | template directory : ${TEMPLATE_DIR} |
c3ad8bd7 DM |
546 | |
547 | Compilation options: | |
b2226ed1 | 548 | Use libcurl : ${have_libcurl} |
cb5b6636 | 549 | Use GPGME : ${have_gpgme} |
c5d95184 | 550 | Use OpenSSL : ${have_openssl} |
d44e5099 | 551 | Run make in doc/ dir : ${wantdoc} ${asciidoc} |
332c1271 | 552 | Doxygen support : ${usedoxygen} |
332c1271 | 553 | debug support : ${debug} |
b729ed01 DM |
554 | extra warning flags : ${warningflags} |
555 | use git version : ${wantgitver} | |
a1526a3e | 556 | " |
e0afe6e9 AF |
557 | |
558 | # vim:set ts=2 sw=2 noet: |