1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3# Minimum version of autoconf required
4AC_PREREQ(2.64)
5
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
43
44m4_define([lib_current], [11])
45m4_define([lib_revision], [3])
46m4_define([lib_age], [0])
47
48m4_define([pacman_version_major], [5])
49m4_define([pacman_version_minor], [1])
50m4_define([pacman_version_micro], [3])
51m4_define([pacman_version],
52          [pacman_version_major.pacman_version_minor.pacman_version_micro])
53
54# Autoconf initialization
55AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org])
56AC_CONFIG_SRCDIR([config.h.in])
57AC_CONFIG_HEADERS([config.h])
58AC_CONFIG_MACRO_DIR([m4])
59AC_CONFIG_AUX_DIR([build-aux])
60AC_REQUIRE_AUX_FILE([tap-driver.sh])
61
62AC_CANONICAL_HOST
63AM_INIT_AUTOMAKE([1.11 foreign])
64AM_SILENT_RULES([yes])
65
66LT_INIT
67LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision
68LIB_VERSION_INFO="lib_current:lib_revision:lib_age"
69
70# Respect empty CFLAGS during compiler tests
71if test "x$CFLAGS" = "x"; then
72  CFLAGS=""
73fi
74
75# Set subsitution values for version stuff in Makefiles and anywhere else,
76# and put LIB_VERSION in config.h
77AC_SUBST(LIB_VERSION)
78AC_SUBST(LIB_VERSION_INFO)
79AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
80
81# Help line for root directory
82AC_ARG_WITH(root-dir,
83	AS_HELP_STRING([--with-root-dir=path], [set the location of the root operating directory]),
84	[ROOTDIR=$withval], [ROOTDIR=/])
85
86# Help line for package extension
87AC_ARG_WITH(pkg-ext,
88	AS_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
89	[PKGEXT=$withval], [PKGEXT=.pkg.tar.gz])
90
91# Help line for source package directory
92AC_ARG_WITH(src-ext,
93	AS_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
94	[SRCEXT=$withval], [SRCEXT=.src.tar.gz])
95
96# Help line for buildscript filename
97AC_ARG_WITH(buildscript,
98	AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]),
99	[BUILDSCRIPT=$withval], [BUILDSCRIPT=PKGBUILD])
100
101# Help line for buildscript filename
102AC_ARG_WITH(makepkg-template-dir,
103	AS_HELP_STRING([--with-makepkg-template-dir=name], [set the template dir used by makepkg-template]),
104	[TEMPLATE_DIR=$withval], [TEMPLATE_DIR=/usr/share/makepkg-template])
105
106# Help line for debug package suffix
107AC_ARG_WITH(debug-suffix,
108	AS_HELP_STRING([--with-debug-suffix=name], [set the suffix for split debugging symbol packages used by makepkg]),
109	[DEBUGSUFFIX=$withval], [DEBUGSUFFIX=debug])
110
111# Help line for changing shell used to run install scriptlets
112AC_ARG_WITH(scriptlet-shell,
113	AS_HELP_STRING([--with-scriptlet-shell=shell],
114		[set the full path to the shell used to run install scriptlets]),
115	[SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=/bin/sh])
116
117# Help line for ldconfig path
118AC_ARG_WITH(ldconfig,
119	AS_HELP_STRING([--with-ldconfig=path],
120		[set the full path to ldconfig]),
121	[LDCONFIG=$withval], [LDCONFIG=/sbin/ldconfig])
122
123# Help line for selecting a crypto library
124AC_ARG_WITH(crypto,
125	AS_HELP_STRING([--with-crypto={openssl|nettle}],
126		[select crypto implementation @<:@default=openssl@:>@]),
127	[with_crypto=$withval], [with_crypto=openssl])
128
129# Help line for using gpgme
130AC_ARG_WITH(gpgme,
131	AS_HELP_STRING([--with-gpgme], [use GPGME for PGP signature verification]),
132	[], [with_gpgme=check])
133
134# Help line for using libcurl
135AC_ARG_WITH(libcurl,
136	AS_HELP_STRING([--with-libcurl], [use libcurl for the internal downloader]),
137	[], [with_libcurl=check])
138
139# Help line for documentation
140AC_ARG_ENABLE(doc,
141	AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
142	[wantdoc=$enableval], [wantdoc=yes])
143
144# Help line for doxygen
145AC_ARG_ENABLE(doxygen,
146	AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
147	[wantdoxygen=$enableval], [wantdoxygen=no])
148
149# Help line for debug
150AC_ARG_ENABLE(debug,
151	AS_HELP_STRING([--enable-debug], [enable debugging support]),
152	[debug=$enableval], [debug=no])
153
154# Help line for compiler warning flags
155AC_ARG_ENABLE(warningflags,
156	AS_HELP_STRING([--enable-warningflags], [enable extra compiler warning flags]),
157	[warningflags=$enableval], [warningflags=no])
158
159# Help line for using git version in pacman version string
160AC_ARG_ENABLE(git-version,
161	AS_HELP_STRING([--enable-git-version],
162		[enable use of git version in version string if available]),
163	[wantgitver=$enableval], [wantgitver=no])
164
165# Enable large file support if available (must be enabled before
166# testing compilation against gpgme).
167AC_SYS_LARGEFILE
168
169# Record large file flags in pkgconfig file
170if test "$enable_largefile" != no; then
171	if test "$ac_cv_sys_file_offset_bits" != 'no'; then
172		LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
173	fi
174fi
175AC_SUBST(LFS_CFLAGS)
176
177
178# Checks for programs.
179AC_PROG_AWK
180AC_PROG_CC_C99
181AC_PROG_INSTALL
182AC_CHECK_PROGS([PYTHON], [python2.7 python2 python], [false])
183AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false])
184
185# check for perl 5.10.1 (needed by makepkg-template)
186AC_PATH_PROG([PERL],[perl])
187AC_DEFUN([AX_PROG_PERL_VERSION],
188	[AC_CACHE_CHECK([for Perl version $1 or later], [ax_cv_prog_perl_version],
189		[AS_IF(["$PERL" -e 'require v$1;' >/dev/null 2>&1],
190			[ax_cv_prog_perl_version=yes],
191			[ax_cv_prog_perl_version=no])])
192	AS_IF([test x"$ax_cv_prog_perl_version" = xyes], [$2], [$3])])
193AX_PROG_PERL_VERSION([5.10.1], [], [AC_MSG_ERROR([perl is too old])])
194
195AS_IF([test "x$BASH_SHELL" = "xfalse"],
196	AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]),
197	[bash_version_major=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}"'`
198	bash_version_minor=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[1]]}"'`
199	ok=yes
200	if test "$bash_version_major" -lt 4; then
201		ok=no
202	fi
203	if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then
204		ok=no
205	fi
206	if test "$ok" = "no"; then
207		AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts])
208	fi
209	unset bash_version_major bash_version_minor ok])
210
211# find installed gettext
212AM_GNU_GETTEXT([external], [need-ngettext])
213AM_GNU_GETTEXT_VERSION(0.13.1)
214
215AC_CHECK_LIB([m], [fabs], ,
216	AC_MSG_ERROR([libm is needed to compile pacman!]))
217
218# Check for libarchive
219PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 3.0.0], ,
220	AC_MSG_ERROR([*** libarchive >= 3.0.0 is needed to compile pacman!]))
221
222# Check for OpenSSL
223have_openssl=no
224have_nettle=no
225if test "x$with_crypto" = "xnettle"; then
226	AC_SUBST(pc_crypto, [nettle])
227	PKG_CHECK_MODULES(NETTLE, [nettle],
228		[AC_DEFINE(HAVE_LIBNETTLE, 1, [Define whether to use nettle]) have_nettle=yes], have_nettle=no)
229	if test "x$have_nettle" = xno -a "x$with_crypto" = xnettle; then
230		AC_MSG_ERROR([*** nettle support requested but libraries not found])
231	fi
232else if test "x$with_crypto" = "xopenssl"; then
233	AC_SUBST(pc_crypto, [libcrypto])
234	PKG_CHECK_MODULES(LIBSSL, [libcrypto],
235		[AC_DEFINE(HAVE_LIBSSL, 1, [Define if libcrypto is available]) have_openssl=yes], have_openssl=no)
236	if test "x$have_openssl" = xno; then
237		AC_MSG_ERROR([*** openssl support requested but libraries not found])
238	fi
239else
240	AC_MSG_ERROR([*** unknown crypto support library requested - $with_crypto])
241fi
242fi
243AM_CONDITIONAL(HAVE_LIBSSL, [test "$have_openssl" = "yes"])
244AM_CONDITIONAL(HAVE_LIBNETTLE, [test "$have_nettle" = "yes"])
245
246# Check for libcurl
247have_libcurl=no
248if test "x$with_libcurl" != "xno"; then
249	PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.32.0],
250		[AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available]) have_libcurl=yes], have_libcurl=no)
251	if test "x$have_libcurl" = xno -a "x$with_libcurl" = xyes; then
252		AC_MSG_ERROR([*** libcurl >= 7.32.0 is required for internal downloader support])
253	fi
254fi
255AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
256# used to generate libalpm.pc
257if test "x$have_libcurl" = xyes; then
258	AC_SUBST(pc_libcurl, [libcurl])
259fi
260
261# Check for gpgme
262AC_MSG_CHECKING(whether to link with libgpgme)
263AS_IF([test "x$with_gpgme" != "xno"],
264	[AC_MSG_RESULT([yes])],
265	[AC_MSG_RESULT([no])])
266
267have_gpgme=no
268AS_IF([test "x$with_gpgme" != "xno"],
269	[AM_PATH_GPGME([1.3.0],
270		[LIBS_save="$LIBS"
271		CPPFLAGS_save="$CPPFLAGS"
272		CFLAGS_save="$CFLAGS"
273
274		LIBS="$LIBS $GPGME_LIBS"
275		CPPFLAGS="$CPPFLAGS $GPGME_CPPFLAGS"
276		CFLAGS="$CFLAGS $GPGME_CFLAGS"
277
278		AC_MSG_CHECKING([for sane gpgme])
279		AC_LINK_IFELSE(
280			[AC_LANG_PROGRAM(
281				[[#include <gpgme.h>]],
282				[[return gpgme_check_version("1.3.0");]])],
283			[AC_MSG_RESULT([yes])
284			have_gpgme=yes
285			AC_DEFINE([HAVE_LIBGPGME], [1], [Define if gpgme should be used to provide GPG signature support.])],
286			[AC_MSG_RESULT([no])
287			have_gpgme=no
288			unset GPGME_LIBS
289			unset GPGME_CFLAGS]
290			AS_IF([test "x$with_gpgme" = "xyes"],
291				[AC_MSG_FAILURE([*** gpgme >= 1.3.0 is needed for GPG signature support])])
292			)
293
294		LIBS="$LIBS_save"
295		CPPFLAGS="$CPPFLAGS_save"
296		CFLAGS="$CFLAGS_save"
297		unset CPPFLAGS_save
298		unset CFLAGS_save],)])
299
300AS_IF([test "x$have_gpgme" = xno -a "x$with_gpgme" = xyes],
301	[AC_MSG_FAILURE([--with-gpgme was given, but gpgme was not found])])
302AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$have_gpgme" = "xyes"])
303
304# Checks for header files.
305AC_CHECK_HEADERS([fcntl.h float.h glob.h langinfo.h libintl.h limits.h \
306                  locale.h mntent.h netinet/in.h netinet/tcp.h \
307                  stddef.h string.h sys/ioctl.h \
308                  sys/mnttab.h sys/mount.h \
309                  sys/param.h sys/statvfs.h sys/time.h sys/types.h \
310                  sys/ucred.h syslog.h termios.h wchar.h])
311
312# Checks for typedefs, structures, and compiler characteristics.
313AC_C_INLINE
314AC_TYPE_INT64_T
315AC_TYPE_MODE_T
316AC_TYPE_OFF_T
317AC_TYPE_PID_T
318AC_TYPE_SIZE_T
319AC_TYPE_SSIZE_T
320AC_STRUCT_TM
321AC_TYPE_UID_T
322AC_STRUCT_DIRENT_D_TYPE
323PATH_MAX_DEFINED
324
325# Checks for library functions.
326AC_FUNC_FORK
327AC_FUNC_GETMNTENT
328AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
329AC_FUNC_MKTIME
330AC_FUNC_STRCOLL
331AC_CHECK_FUNCS([dup2 getcwd getmntinfo gettimeofday memmove memset \
332                mkdir realpath regcomp rmdir setenv setlocale strcasecmp \
333                strchr strcspn strdup strerror strndup strnlen strrchr \
334                strsep strstr strtol swprintf tcflush wcwidth uname])
335AC_CHECK_MEMBERS([struct stat.st_blksize],,,[[#include <sys/stat.h>]])
336
337# For the diskspace code
338FS_STATS_TYPE
339AC_CHECK_MEMBERS([struct statvfs.f_flag],,,[[#include <sys/statvfs.h>]])
340AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h>
341                  #include <sys/mount.h>]])
342
343# Check if we can use symbol visibility support in GCC
344GCC_VISIBILITY_CC
345
346# Host-dependant definitions
347DEFAULT_DUFLAGS=" -sk --apparent-size"
348DEFAULT_SEDINPLACEFLAGS=" --follow-symlinks -i"
349INODECMD="stat -c '%i %n'"
350OWNERCMD="stat -c '%u:%g'"
351MODECMD="stat -c '%a'"
352STRIP_BINARIES="--strip-all"
353STRIP_SHARED="--strip-unneeded"
354STRIP_STATIC="--strip-debug"
355case "${host_os}" in
356	*bsd*)
357		INODECMD="stat -f '%i %N'"
358		OWNERCMD="stat -f '%u:%g'"
359		MODECMD="stat -f '%Lp'"
360		DEFAULT_SEDINPLACEFLAGS=" -i \"\""
361		DEFAULT_DUFLAGS=" -sk"
362		;;
363	darwin*)
364		host_os_darwin=yes
365		INODECMD="/usr/bin/stat -f '%i %N'"
366		OWNERCMD="/usr/bin/stat -f '%u:%g'"
367		MODECMD="/usr/bin/stat -f '%Lp'"
368		DEFAULT_SEDINPLACEFLAGS=" -i ''"
369		DEFAULT_DUFLAGS=" -sk"
370		STRIP_BINARIES=""
371		STRIP_SHARED="-S"
372		STRIP_STATIC="-S"
373		;;
374esac
375AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
376AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] )
377AC_PATH_PROGS([SEDPATH], [sed], [sed], [/usr/bin$PATH_SEPARATOR/bin] )
378AC_SUBST(INODECMD)
379AC_SUBST(OWNERCMD)
380AC_SUBST(MODECMD)
381AC_SUBST(STRIP_BINARIES)
382AC_SUBST(STRIP_SHARED)
383AC_SUBST(STRIP_STATIC)
384
385# Flags for du
386if test "${DUFLAGS+set}" != "set"; then
387    DUFLAGS="${DEFAULT_DUFLAGS}"
388fi
389AC_ARG_VAR(DUFLAGS, [flags for du, overriding the default])
390
391# Flags for sed in place
392if test "${SEDINPLACEFLAGS+set}" != "set"; then
393    SEDINPLACEFLAGS="${DEFAULT_SEDINPLACEFLAGS}"
394fi
395AC_ARG_VAR(SEDINPLACEFLAGS, [flags for sed, overriding the default])
396
397# Variables plugged into makepkg.conf
398CARCH="${host%%-*}"
399CHOST="${host}"
400AC_SUBST(CARCH)
401AC_SUBST(CHOST)
402
403# Check for documentation support and status
404AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
405AC_MSG_CHECKING([for building documentation])
406if test "x$wantdoc" = "xyes" ; then
407	if test $ASCIIDOC ; then
408		AC_MSG_RESULT([yes, enabled by configure])
409	else
410		asciidoc="(warning : asciidoc not installed)"
411		AC_MSG_RESULT([yes $asciidoc])
412	fi
413	wantdoc=yes
414else
415	AC_MSG_RESULT([no, disabled by configure])
416	wantdoc=no
417fi
418AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes")
419
420# Check for doxygen support and status
421AC_CHECK_PROGS([DOXYGEN], [doxygen])
422AC_MSG_CHECKING([for doxygen])
423if test "x$wantdoxygen" = "xyes" ; then
424	if test $DOXYGEN ; then
425		AC_MSG_RESULT([yes])
426		usedoxygen=yes
427	else
428		AC_MSG_RESULT([no, doxygen missing])
429		usedoxygen=no
430	fi
431else
432	AC_MSG_RESULT([no, disabled by configure])
433	usedoxygen=no
434fi
435AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
436
437# Enable or disable debug code
438AC_MSG_CHECKING(for debug mode request)
439if test "x$debug" = "xyes" ; then
440	AC_MSG_RESULT(yes)
441	AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
442	# Check for -fstack-protector availability
443	GCC_STACK_PROTECT_LIB
444	GCC_STACK_PROTECT_CC
445	GCC_FORTIFY_SOURCE_CC
446	WARNING_CFLAGS="-g -Wall -Werror"
447else
448	AC_MSG_RESULT(no)
449	WARNING_CFLAGS="-Wall"
450fi
451
452# Enable or disable compiler warning flags
453AC_MSG_CHECKING(for excessive compiler warning flags)
454if test "x$warningflags" = "xyes" ; then
455	AC_MSG_RESULT(yes)
456	CFLAGS_ADD([-Wcast-align], [WARNING_CFLAGS])
457	CFLAGS_ADD([-Wclobbered], [WARNING_CFLAGS])
458	CFLAGS_ADD([-Wempty-body], [WARNING_CFLAGS])
459	CFLAGS_ADD([-Wfloat-equal], [WARNING_CFLAGS])
460	CFLAGS_ADD([-Wformat-nonliteral], [WARNING_CFLAGS])
461	CFLAGS_ADD([-Wformat-security], [WARNING_CFLAGS])
462	CFLAGS_ADD([-Wignored-qualifiers], [WARNING_CFLAGS])
463	CFLAGS_ADD([-Winit-self], [WARNING_CFLAGS])
464	CFLAGS_ADD([-Wlogical-op], [WARNING_CFLAGS])
465	CFLAGS_ADD([-Wmissing-declarations], [WARNING_CFLAGS])
466	CFLAGS_ADD([-Wmissing-field-initializers], [WARNING_CFLAGS])
467	CFLAGS_ADD([-Wmissing-parameter-type], [WARNING_CFLAGS])
468	CFLAGS_ADD([-Wmissing-prototypes], [WARNING_CFLAGS])
469	CFLAGS_ADD([-Wold-style-declaration], [WARNING_CFLAGS])
470	CFLAGS_ADD([-Woverride-init], [WARNING_CFLAGS])
471	CFLAGS_ADD([-Wpointer-arith], [WARNING_CFLAGS])
472	CFLAGS_ADD([-Wredundant-decls], [WARNING_CFLAGS])
473	CFLAGS_ADD([-Wshadow], [WARNING_CFLAGS])
474	CFLAGS_ADD([-Wsign-compare], [WARNING_CFLAGS])
475	CFLAGS_ADD([-Wstrict-aliasing], [WARNING_CFLAGS])
476	CFLAGS_ADD([-Wstrict-overflow=5], [WARNING_CFLAGS])
477	CFLAGS_ADD([-Wstrict-prototypes], [WARNING_CFLAGS])
478	CFLAGS_ADD([-Wtype-limits], [WARNING_CFLAGS])
479	CFLAGS_ADD([-Wuninitialized], [WARNING_CFLAGS])
480	CFLAGS_ADD([-Wunused-but-set-parameter], [WARNING_CFLAGS])
481	CFLAGS_ADD([-Wunused-parameter], [WARNING_CFLAGS])
482	CFLAGS_ADD([-Wwrite-strings], [WARNING_CFLAGS])
483else
484	AC_MSG_RESULT(no)
485fi
486
487# Enable or disable use of git version in pacman version string
488AC_MSG_CHECKING(whether to use git version if available)
489if test "x$wantgitver" = "xyes" ; then
490	AC_CHECK_PROGS([GIT], [git])
491	AC_CHECK_FILE([.git/], hasgitdir=yes)
492	usegitver=$ac_cv_file__git_
493	if test $GIT -a "x$hasgitdir" = "xyes"; then
494		AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
495	fi
496else
497	AC_MSG_RESULT([no, disabled by configure])
498	usegitver=no
499fi
500AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
501
502# Set root directory
503AC_SUBST(ROOTDIR)
504AC_DEFINE_UNQUOTED([ROOTDIR], "$ROOTDIR", [The location of the root operating directory])
505# Set package file extension
506AC_SUBST(PKGEXT)
507AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages])
508# Set source package file extension
509AC_SUBST(SRCEXT)
510AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages])
511# Set makepkg build script name
512AC_SUBST(BUILDSCRIPT)
513AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg])
514# Set makepkg-template template directory
515AC_SUBST(TEMPLATE_DIR)
516AC_DEFINE_UNQUOTED([TEMPLATE_DIR], "$TEMPLATE_DIR", [The template directory used by makepkg-teplate])
517# Set makepkg split debugging symbol package suffix
518AC_SUBST(DEBUGSUFFIX)
519AC_DEFINE_UNQUOTED([DEBUGSUFFIX], "$DEBUGSUFFIX", [The suffix for debugging symbol packages used by makepkg])
520# Set shell used by install scriptlets
521AC_SUBST(SCRIPTLET_SHELL)
522AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The full path of the shell used to run install scriptlets])
523# Set ldconfig path
524AC_SUBST(LDCONFIG)
525AC_DEFINE_UNQUOTED([LDCONFIG], "$LDCONFIG", [The full path to ldconfig])
526
527
528# Configuration files
529AC_CONFIG_FILES([
530lib/libalpm/Makefile
531lib/libalpm/po/Makefile.in
532lib/libalpm/libalpm.pc
533src/common/Makefile
534src/pacman/Makefile
535src/pacman/po/Makefile.in
536src/util/Makefile
537scripts/Makefile
538scripts/po/Makefile.in
539doc/Makefile
540etc/Makefile
541test/pacman/Makefile
542test/pacman/tests/Makefile
543test/scripts/Makefile
544test/util/Makefile
545Makefile
546])
547AC_OUTPUT
548
549echo "
550${PACKAGE_NAME}:
551
552  Build information:
553    source code location   : ${srcdir}
554    prefix                 : ${prefix}
555    sysconfdir             : $(eval echo ${sysconfdir})
556       conf file           : $(eval echo ${sysconfdir})/pacman.conf
557    localstatedir          : $(eval echo ${localstatedir})
558       database dir        : $(eval echo ${localstatedir})/lib/pacman/
559       cache dir           : $(eval echo ${localstatedir})/cache/pacman/pkg/
560
561    compiler               : ${CC}
562    preprocessor flags     : ${CPPFLAGS}
563    compiler flags         : ${WARNING_CFLAGS} ${CFLAGS}
564    library flags          : ${LIBS} ${LIBSSL_LIBS} ${NETTLE_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS}
565    linker flags           : ${LDFLAGS}
566
567    Architecture           : ${CARCH}
568    Host Type              : ${CHOST}
569    File inode command     : ${INODECMD}
570    File owner command     : ${OWNERCMD}
571    File mode command      : ${MODECMD}
572    In-place sed command   : ${SEDPATH} ${SEDINPLACEFLAGS}
573
574    libalpm version        : ${LIB_VERSION}
575    libalpm version info   : ${LIB_VERSION_INFO}
576    pacman version         : ${PACKAGE_VERSION}
577    using git version      : ${usegitver}
578
579  Directory and file information:
580    root working directory : ${ROOTDIR}
581    package extension      : ${PKGEXT}
582    source pkg extension   : ${SRCEXT}
583    build script name      : ${BUILDSCRIPT}
584    template directory     : ${TEMPLATE_DIR}
585
586  Compilation options:
587    Use libcurl            : ${have_libcurl}
588    Use GPGME              : ${have_gpgme}
589    Use OpenSSL            : ${have_openssl}
590    Use nettle             : ${have_nettle}
591    Run make in doc/ dir   : ${wantdoc} ${asciidoc}
592    Doxygen support        : ${usedoxygen}
593    debug support          : ${debug}
594    extra warning flags    : ${warningflags}
595    use git version        : ${wantgitver}
596"
597