File: configure.ac

package info (click to toggle)
jool 4.1.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,396 kB
  • sloc: ansic: 24,645; sh: 4,680; makefile: 221
file content (93 lines) | stat: -rw-r--r-- 3,022 bytes parent folder | download
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
81
82
83
84
85
86
87
88
89
90
91
92
93
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.68])
AC_INIT([Jool], [4.1.15], [ydahhrk@gmail.com])
AC_CONFIG_SRCDIR([src/common/xlat.h])
AM_INIT_AUTOMAKE([subdir-objects])
LT_PREREQ([2.4.6])

# Checks for programs.
AC_PROG_CC

# Note: src/usr/iptables/Makefile does not depend on configure.ac.
# If you need it to inherit more warnings, you will have to add them manually
# for now.
AS_IF([test "$GCC" = "yes"],
	[WARNINGCFLAGS="-Wall -pedantic -std=gnu11"],
	[WARNINGCFLAGS=""])
AC_SUBST([WARNINGCFLAGS])

# It's been added because automake requires it, since automake 1.14 it is no longer required.
AM_PROG_CC_C_O

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL

# Checks for library functions.
AC_CHECK_FUNCS([inet_ntoa memset strcasecmp strtol pow])
AC_SEARCH_LIBS([pow], [m])
AC_SEARCH_LIBS([pthread_create], [pthread])
AC_CHECK_LIB([argp], [argp_parse])

# Dependency: libnlgenl (mandatory)
PKG_CHECK_MODULES(LIBNLGENL3, libnl-genl-3.0 >= 3.2.22)

# Dependency: xtables (optional)
AC_ARG_WITH(
	[xtables],
	AS_HELP_STRING(
		[--with-xtables@<:@=yes|no@:>@],
		[Include xtables dependency? @<:@default=yes@:>@]
	)
)
AS_IF([test "x$with_xtables" != "xno"], [
	PKG_CHECK_MODULES(XTABLES, xtables)
])
AM_CONDITIONAL([XTABLES_ENABLED], [test "x$with_xtables" != "xno"])

# Bash autocompletion option (https://www.swansontec.com/bash-completion.html):
# 1. Offer the user the `--with-bash-completion-dir` configure option,
#    which can be set to a directory, "yes" (default; means autodetect
#    directory) or "no" (disable autocompletion).
AC_ARG_WITH([bash-completion-dir],
	AS_HELP_STRING([--with-bash-completion-dir@<:@=yes|no|PATH@:>@],
		[Directory where the bash auto-completion script will be installed.
		("yes" attempts to guess.) @<:@default=yes@:>@]),
	[],
	[with_bash_completion_dir=yes])

# 2. If the user chose "yes", find a reasonable default directory.
if test "x$with_bash_completion_dir" = "xyes"; then
	PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
		[BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"],
		[BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
else
	BASH_COMPLETION_DIR="$with_bash_completion_dir"
fi

# 3. Export ENABLE_BASH_COMPLETION and BASH_COMPLETION_DIR so the Makefile can
#    use them.
AC_SUBST([BASH_COMPLETION_DIR])
AM_CONDITIONAL([ENABLE_BASH_COMPLETION],
	[test "x$with_bash_completion_dir" != "xno"])

# Needed by libtool. (Othewise autoreconf complains.)
LT_INIT
# Needed by libtoolize. (Othewise autoreconf complains.)
AC_CONFIG_MACRO_DIRS([m4])

# Spit out the makefiles.
AC_CONFIG_FILES([Makefile
	src/common/Makefile
	src/usr/Makefile
	src/usr/util/Makefile
	src/usr/nl/Makefile
	src/usr/argp/Makefile
	src/usr/siit/Makefile
	src/usr/nat64/Makefile
	src/usr/joold/Makefile])
AC_OUTPUT