-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathconfigure.ac
More file actions
144 lines (117 loc) · 4.18 KB
/
configure.ac
File metadata and controls
144 lines (117 loc) · 4.18 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
AC_INIT(irqbalance,1.9.5)
AC_PREREQ(2.69)dnl
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign] [subdir-objects])
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_AWK
AC_HEADER_STDC
AC_CHECK_HEADERS([numa.h])
AC_CHECK_FUNCS(getopt_long)
AC_ARG_ENABLE([staticbuild],
AS_HELP_STRING([--enable-staticbuild], [enable static builds(default disabled)]))
AM_CONDITIONAL([STATICBUILD], [test "x$enable_staticbuild" = "xyes"])
# If we requested static building, enable that in pkg-config
AS_IF([test "x$enable_staticbuild" = "xyes"], [
PKG_CONFIG="$PKG_CONFIG --static"],[])
AC_ARG_ENABLE([numa],
AS_HELP_STRING([--disable-numa], [enable numa support (default is auto)]))
AS_IF([test "$enable_numa" = "no"],[
ac_cv_header_numa_h=no
ac_cv_lib_numa_numa_available=no
])
PKG_CHECK_MODULES([NUMA], [numa], [has_numa=yes], [AC_CHECK_LIB(numa, numa_available)])
AC_CHECK_LIB(m, floor)
PKG_CHECK_MODULES([GLIB2], [glib-2.0], [], [AC_MSG_ERROR([glib-2.0 is required])])
PKG_CHECK_MODULES([NCURSESW], [ncursesw], [has_ncursesw=yes], [AC_CHECK_LIB(curses, mvprintw)])
AC_CANONICAL_HOST
AC_ARG_ENABLE(thermal,
AS_HELP_STRING([--enable-thermal], [enable thermal event support [default=auto]]),,
AS_IF([test x"$host_cpu" = x"x86_64"], [enable_thermal=yes], [enable_thermal=no])
)
AS_IF([test x"$enable_thermal" = x"yes" && test x"$host_cpu" != x"x86_64"],
AC_MSG_ERROR([no thermal events support on $host_cpu systems.]),
)
AS_IF([test x"$enable_thermal" = x"yes"],
[PKG_CHECK_MODULES([LIBNL3], [libnl-3.0 libnl-genl-3.0], [have_thermal=yes],
AC_MSG_NOTICE([no thermal event support as libnl-3.0 is unavailable.])
)]
)
AS_IF([test "x$have_thermal" = xyes],
AC_DEFINE([HAVE_THERMAL], 1, [Build irqbalance to support thermal events])
)
AM_CONDITIONAL([THERMAL], [test "x$have_thermal" = xyes])
AC_C_CONST
AC_C_INLINE
AM_PROG_CC_C_O
AC_ARG_WITH([irqbalance-ui],
[AS_HELP_STRING([--without-irqbalance-ui],
[Dont build the irqbalance ui component])],
[with_irqbalanceui=$withval], [with_irqbalanceui=yes])
AS_IF(
[test "x$with_irqbalanceui" = "xyes"], [
AC_DEFINE([HAVE_IRQBALANCEUI], 1, [Build irqbalance ui component.])
AS_IF([test "x$has_ncursesw" = "xyes"], [
AC_SUBST([NCURSESW_CFLAGS])
AC_SUBST([NCURSESW_LIBS])
LIBS="$LIBS $NCURSESW_LIBS"
AC_SUBST([LIBS])
])
])
AM_CONDITIONAL([IRQBALANCEUI], [test x$with_irqbalanceui = xyes])
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--with-systemd],[Add systemd-lib support])]
)
AS_IF(
[test "x$with_systemd" = xyes], [
PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [journal_lib=yes], [journal_lib=no])
AS_IF([test "x$journal_lib" != "xyes"], [
PKG_CHECK_MODULES([SYSTEMD], [libsystemd-journal], [journal_lib=yes])
])
AC_DEFINE(HAVE_LIBSYSTEMD, 1, [systemd support])
AC_CHECK_LIB([systemd], [sd_journal_print_with_location])
AC_CHECK_LIB([systemd], [sd_journal_print])
])
AC_ARG_WITH([libcap-ng],
AS_HELP_STRING([libcap-ng], [Add libcap-ng-support @<:@default=auto@:>@]))
AS_IF(
[test "x$with_libcap_ng" != "xno"],
[
PKG_CHECK_MODULES([LIBCAP_NG], [libcap-ng],
[AC_DEFINE(HAVE_LIBCAP_NG,1,[libcap-ng support])],
[
AS_IF(
[test "x$libcap_ng" = "xyes"],
[
AC_MSG_ERROR([libcap-ng not found])
]
)
]
)
]
)
AC_ARG_WITH([pkgconfdir],
[AS_HELP_STRING([--with-pkgconfdir=DIR],
[Systemd Environment configs sourced by irqbalanced])],
[pkgconfdir=$withval],
[pkgconfdir="$prefix/etc/default"])
AC_SUBST([pkgconfdir])
AC_ARG_WITH([usrconfdir],
[AS_HELP_STRING([--with-usrconfdir=DIR],
[Systemd Environment user configs sourced by irqbalanced])],
[usrconfdir=$withval],
[usrconfdir="${sysconfdir}/default"])
AC_SUBST([usrconfdir])
AC_CONFIG_FILES([misc/irqbalance.service])
PKG_CHECK_VAR([systemdsystemunitdir], [systemd], [systemdsystemunitdir])
AC_OUTPUT(Makefile tests/Makefile)
AC_MSG_NOTICE()
AC_MSG_NOTICE([irqbalance Version: $VERSION])
AC_MSG_NOTICE([Target: $target])
AC_MSG_NOTICE([Installation prefix: $prefix])
AC_MSG_NOTICE([Compiler: $CC])
AC_MSG_NOTICE([Compiler flags: $CFLAGS])
AC_MSG_NOTICE([Systemdunitdir: $systemdsystemunitdir])