-
Notifications
You must be signed in to change notification settings - Fork 17
/
configure.ac
83 lines (63 loc) · 2.26 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([package-query],[1.12],[https://github.com/archlinuxfr/package-query])
AM_INIT_AUTOMAKE([-Wall])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/package-query.c])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
LT_INIT
# Checks for header files.
AC_CHECK_HEADERS([ctype.h getopt.h glob.h libintl.h limits.h locale.h regex.h signal.h sys/ioctl.h sys/stat.h sys/utsname.h])
AC_CHECK_LIB([alpm], [alpm_version], ,
AC_MSG_ERROR([pacman is needed to compile package-query]))
PKG_CHECK_MODULES([alpm], [libalpm >= 13.0.0])
AC_CHECK_LIB([yajl], [yajl_free], ,
AC_MSG_ERROR([yajl is needed to compile package-query]))
LIBCURL_CHECK_CONFIG([yes], [7.19.4])
usegitver=no
gitver=""
AC_CHECK_PROGS([GIT], [git])
if test "$GIT"; then
AC_CHECK_FILE([.git/], hasgitdir=yes)
if test "x$hasgitdir" = "xyes"; then
gitver=$(git describe --abbrev=4)
usegitver=yes
AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
AC_SUBST([GIT_VERSION], [$gitver])
fi
fi
AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
# Help line for root directory
AC_ARG_WITH(root-dir,
AS_HELP_STRING([--with-root-dir=path], [see pacman configuration]),
[ROOTDIR=$withval], [ROOTDIR=/])
AC_SUBST(ROOTDIR)
AC_ARG_WITH(aur-url,
AS_HELP_STRING([--with-aur-url=url], [default to https://aur.archlinux.org]),
[AUR_BASE_URL=$withval], [AUR_BASE_URL=https://aur.archlinux.org])
AC_SUBST(AUR_BASE_URL)
AC_CONFIG_FILES([src/Makefile
doc/Makefile
Makefile
])
AC_OUTPUT
echo "
${PACKAGE_NAME}:
Build information:
source code location : ${srcdir}
prefix : ${prefix}
sysconfdir : $(eval echo ${sysconfdir})
conf file : $(eval echo ${sysconfdir})/pacman.conf
localstatedir : $(eval echo ${localstatedir})
database dir : $(eval echo ${localstatedir})/lib/pacman/
compiler : ${CC}
compiler flags : ${CFLAGS}
package-query version : ${PACKAGE_VERSION}
using git version : ${usegitver}
git ver : ${gitver}
Variable information:
root working directory : ${ROOTDIR}
aur base url : ${AUR_BASE_URL}
"