2 # Process this file with autoconf to produce a configure script.
3 # Minimum version of autoconf required
6 # UPDATING VERSION NUMBERS FOR RELEASES
10 # The most recent interface number that this library implements.
12 # The implementation number of the current interface.
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.
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
28 # 6. If any interfaces have been removed since the last public release, then
32 # Extreme huge major changes:
33 # pacman_version_major += 1
34 # pacman_version_minor = 0
35 # pacman_version_micro = 0
38 # pacman_version_minor += 1
39 # pacman_version_micro = 0
42 # pacman_version_micro += 1
44 m4_define([lib_current], [8])
45 m4_define([lib_revision], [2])
46 m4_define([lib_age], [0])
48 m4_define([pacman_version_major], [4])
49 m4_define([pacman_version_minor], [1])
50 m4_define([pacman_version_micro], [2])
51 m4_define([pacman_version],
52 [pacman_version_major.pacman_version_minor.pacman_version_micro])
54 # Autoconf initialization
55 AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org])
56 AC_CONFIG_SRCDIR([config.h.in])
57 AC_CONFIG_HEADERS([config.h])
58 AC_CONFIG_MACRO_DIR([m4])
59 AC_CONFIG_AUX_DIR([build-aux])
62 AM_INIT_AUTOMAKE([1.11])
63 AM_SILENT_RULES([yes])
66 LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision
67 LIB_VERSION_INFO="lib_current:lib_revision:lib_age"
69 # Respect empty CFLAGS during compiler tests
70 if test "x$CFLAGS" = "x"; then
74 # Set subsitution values for version stuff in Makefiles and anywhere else,
75 # and put LIB_VERSION in config.h
77 AC_SUBST(LIB_VERSION_INFO)
78 AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
80 # Help line for root directory
82 AS_HELP_STRING([--with-root-dir=path], [set the location of the root operating directory]),
83 [ROOTDIR=$withval], [ROOTDIR=/])
85 # Help line for package extension
87 AS_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
88 [PKGEXT=$withval], [PKGEXT=.pkg.tar.gz])
90 # Help line for source package directory
92 AS_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
93 [SRCEXT=$withval], [SRCEXT=.src.tar.gz])
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])
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])
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])
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],
113 [set the full path to the shell used to run install scriptlets]),
114 [SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=/bin/sh])
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])
122 # Help line for using OpenSSL
124 AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]),
125 [], [with_openssl=check])
127 # Help line for using gpgme
129 AS_HELP_STRING([--with-gpgme], [use GPGME for PGP signature verification]),
130 [], [with_gpgme=check])
132 # Help line for using libcurl
134 AS_HELP_STRING([--with-libcurl], [use libcurl for the internal downloader]),
135 [], [with_curl=check])
137 # Help line for documentation
139 AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
140 [wantdoc=$enableval], [wantdoc=yes])
142 # Help line for doxygen
143 AC_ARG_ENABLE(doxygen,
144 AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
145 [wantdoxygen=$enableval], [wantdoxygen=no])
147 # Help line for debug
149 AS_HELP_STRING([--enable-debug], [enable debugging support]),
150 [debug=$enableval], [debug=no])
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])
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])
163 # Enable large file support if available (must be enabled before
164 # testing compilation against gpgme).
167 # Checks for programs.
171 AC_CHECK_PROGS([PYTHON], [python2.7 python2.6 python2.5 python2 python], [false])
172 AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false])
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])])
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]]}"'`
189 if test "$bash_version_major" -lt 4; then
192 if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then
195 if test "$ok" = "no"; then
196 AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts])
198 unset bash_version_major bash_version_minor ok])
200 # find installed gettext
201 AM_GNU_GETTEXT([external], [need-ngettext])
202 AM_GNU_GETTEXT_VERSION(0.13.1)
204 AC_CHECK_LIB([m], [fabs], ,
205 AC_MSG_ERROR([libm is needed to compile pacman!]))
207 # Check for libarchive
208 PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 2.8.0], ,
209 AC_MSG_ERROR([*** libarchive >= 2.8.0 is needed to compile pacman!]))
213 if test "x$with_openssl" != "xno"; then
214 PKG_CHECK_MODULES(LIBSSL, [libcrypto],
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])
220 AM_CONDITIONAL(HAVE_LIBSSL, [test "$have_openssl" = "yes"])
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])
231 AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
234 AC_MSG_CHECKING(whether to link with libgpgme)
235 AS_IF([test "x$with_gpgme" != "xno"],
236 [AC_MSG_RESULT([yes])],
237 [AC_MSG_RESULT([no])])
240 AS_IF([test "x$with_gpgme" != "xno"],
241 [AM_PATH_GPGME([1.3.0],
243 CPPFLAGS_save="$CPPFLAGS"
244 CFLAGS_save="$CFLAGS"
246 LIBS="$LIBS $GPGME_LIBS"
247 CPPFLAGS="$CPPFLAGS $GPGME_CPPFLAGS"
248 CFLAGS="$CFLAGS $GPGME_CFLAGS"
250 AC_MSG_CHECKING([for sane gpgme])
253 [[#include <gpgme.h>]],
254 [[return gpgme_check_version("1.3.0");]])],
255 [AC_MSG_RESULT([yes])
257 AC_DEFINE([HAVE_LIBGPGME], [1], [Define if gpgme should be used to provide GPG signature support.])],
262 AS_IF([test "x$with_gpgme" = "xyes"],
263 [AC_MSG_FAILURE([*** gpgme >= 1.3.0 is needed for GPG signature support])])
267 CPPFLAGS="$CPPFLAGS_save"
268 CFLAGS="$CFLAGS_save"
270 unset CFLAGS_save],)])
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"])
276 # Checks for header files.
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 \
279 stddef.h string.h sys/ioctl.h \
280 sys/mnttab.h sys/mount.h \
281 sys/param.h sys/statvfs.h sys/time.h sys/types.h \
282 sys/ucred.h syslog.h termios.h wchar.h])
284 # Checks for typedefs, structures, and compiler characteristics.
294 AC_STRUCT_DIRENT_D_TYPE
297 # Checks for library functions.
300 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
304 AC_CHECK_FUNCS([dup2 getcwd getmntinfo gettimeofday memmove memset \
305 mkdir realpath regcomp rmdir setenv setlocale strcasecmp \
306 strchr strcspn strdup strerror strndup strrchr strsep strstr \
307 strtol swprintf tcflush wcwidth uname])
308 AC_CHECK_MEMBERS([struct stat.st_blksize],,,[[#include <sys/stat.h>]])
310 # For the diskspace code
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>]])
316 # Check if we can use symbol visibility support in GCC
318 # Check if we have -fgnu89-inline flag
321 # Host-dependant definitions
322 INODECMD="stat -c '%i %n'"
324 SEDINPLACE="sed --follow-symlinks -i"
325 DUFLAGS="-sk --apparent-size"
326 STRIP_BINARIES="--strip-all"
327 STRIP_SHARED="--strip-unneeded"
328 STRIP_STATIC="--strip-debug"
331 INODECMD="stat -f '%i %N'"
333 SEDINPLACE="sed -i \"\""
338 INODECMD="/usr/bin/stat -f '%i %N'"
339 SIZECMD="/usr/bin/stat -f %z"
340 SEDINPLACE="/usr/bin/sed -i ''"
348 AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
349 AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] )
354 AC_SUBST(STRIP_BINARIES)
355 AC_SUBST(STRIP_SHARED)
356 AC_SUBST(STRIP_STATIC)
358 # Variables plugged into makepkg.conf
364 # Check for documentation support and status
365 AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
366 AC_MSG_CHECKING([for building documentation])
367 if test "x$wantdoc" = "xyes" ; then
368 if test $ASCIIDOC ; then
369 AC_MSG_RESULT([yes, enabled by configure])
371 asciidoc="(warning : asciidoc not installed)"
372 AC_MSG_RESULT([yes $asciidoc])
376 AC_MSG_RESULT([no, disabled by configure])
379 AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes")
381 # Check for doxygen support and status
382 AC_CHECK_PROGS([DOXYGEN], [doxygen])
383 AC_MSG_CHECKING([for doxygen])
384 if test "x$wantdoxygen" = "xyes" ; then
385 if test $DOXYGEN ; then
389 AC_MSG_RESULT([no, doxygen missing])
393 AC_MSG_RESULT([no, disabled by configure])
396 AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
398 # Enable or disable debug code
399 AC_MSG_CHECKING(for debug mode request)
400 if test "x$debug" = "xyes" ; then
402 AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
403 # Check for -fstack-protector availability
404 GCC_STACK_PROTECT_LIB
406 GCC_FORTIFY_SOURCE_CC
407 WARNING_CFLAGS="-g -Wall -Werror"
410 WARNING_CFLAGS="-Wall"
413 # Enable or disable compiler warning flags
414 AC_MSG_CHECKING(for excessive compiler warning flags)
415 if test "x$warningflags" = "xyes" ; then
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])
427 CFLAGS_ADD([-Wmissing-field-initializers], [WARNING_CFLAGS])
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])
448 # Enable or disable use of git version in pacman version string
449 AC_MSG_CHECKING(whether to use git version if available)
450 if test "x$wantgitver" = "xyes" ; then
451 AC_CHECK_PROGS([GIT], [git])
452 AC_CHECK_FILE([.git/], hasgitdir=yes)
453 usegitver=$ac_cv_file__git_
454 if test $GIT -a "x$hasgitdir" = "xyes"; then
455 AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
458 AC_MSG_RESULT([no, disabled by configure])
461 AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
465 AC_DEFINE_UNQUOTED([ROOTDIR], "$ROOTDIR", [The location of the root operating directory])
466 # Set package file extension
468 AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages])
469 # Set source package file extension
471 AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages])
472 # Set makepkg build script name
473 AC_SUBST(BUILDSCRIPT)
474 AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg])
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])
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])
481 # Set shell used by install scriptlets
482 AC_SUBST(SCRIPTLET_SHELL)
483 AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The full path of the shell used to run install scriptlets])
486 AC_DEFINE_UNQUOTED([LDCONFIG], "$LDCONFIG", [The full path to ldconfig])
489 # Configuration files
492 lib/libalpm/po/Makefile.in
493 lib/libalpm/libalpm.pc
496 src/pacman/po/Makefile.in
499 scripts/po/Makefile.in
503 test/pacman/tests/Makefile
504 test/scripts/Makefile
515 source code location : ${srcdir}
517 sysconfdir : $(eval echo ${sysconfdir})
518 conf file : $(eval echo ${sysconfdir})/pacman.conf
519 localstatedir : $(eval echo ${localstatedir})
520 database dir : $(eval echo ${localstatedir})/lib/pacman/
521 cache dir : $(eval echo ${localstatedir})/cache/pacman/pkg/
524 preprocessor flags : ${CPPFLAGS}
525 compiler flags : ${WARNING_CFLAGS} ${CFLAGS}
526 library flags : ${LIBS} ${LIBSSL_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS}
527 linker flags : ${LDFLAGS}
529 Architecture : ${CARCH}
531 File inode command : ${INODECMD}
532 Filesize command : ${SIZECMD}
533 In-place sed command : ${SEDINPLACE}
535 libalpm version : ${LIB_VERSION}
536 libalpm version info : ${LIB_VERSION_INFO}
537 pacman version : ${PACKAGE_VERSION}
538 using git version : ${usegitver}
540 Directory and file information:
541 root working directory : ${ROOTDIR}
542 package extension : ${PKGEXT}
543 source pkg extension : ${SRCEXT}
544 build script name : ${BUILDSCRIPT}
545 template directory : ${TEMPLATE_DIR}
548 Use libcurl : ${have_libcurl}
549 Use GPGME : ${have_gpgme}
550 Use OpenSSL : ${have_openssl}
551 Run make in doc/ dir : ${wantdoc} ${asciidoc}
552 Doxygen support : ${usedoxygen}
553 debug support : ${debug}
554 extra warning flags : ${warningflags}
555 use git version : ${wantgitver}
558 # vim:set ts=2 sw=2 noet: