Skip to content
Permalink
Browse files

irqbalance: Misc build enhancements

- Remove AC_CANONICAL_TARGET macro from configure to allow easier cross
  compilation

- Add private implementation of called glib2 functions so that irqbalance can be
  built on systems not supporting a sufficiently recent version of glib2

- Add --without-glib2 configure option to support explicit selection of internal
  glib2 function definitions, overriding automatic selection.

Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
  • Loading branch information...
pkun authored and Neil Horman committed Mar 26, 2012
1 parent 1189cd6 commit 8d7404149eb0ca695a54b4659c11e9ae4d63922c
Showing with 42 additions and 4 deletions.
  1. +6 −0 .gitignore
  2. +3 −1 Makefile.am
  3. +31 −3 configure.ac
  4. +1 −0 irqbalance.c
  5. +1 −0 irqbalance.h
@@ -1,6 +1,9 @@
*.a
*.o
*~

.deps

*.diff
*.patch
*.orig
@@ -9,6 +12,8 @@
/INSTALL
/Makefile
/Makefile.in
*/Makefile
*/Makefile.in
/aclocal.m4
/autom4te.cache
/compile
@@ -25,6 +30,7 @@
/m4
/missing
/stamp-h1
/depcomp

/irqbalance
irqbalance-*.tar.*
@@ -25,18 +25,20 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = README INSTALL COPYING autogen.sh m4/cap-ng.m4 misc/irqbalance.service

INCLUDES = -I${top_srcdir}
LIBS = $(CAPNG_LDADD) $(GLIB_LIBS) @LIBS@
LIBS = $(CAPNG_LDADD) @LIBS@
AM_CFLAGS = $(GLIB_CFLAGS)
AM_CPPFLAGS = -W -Wall -Wshadow -Wformat -Wundef -D_GNU_SOURCE
noinst_HEADERS = bitmap.h constants.h cpumask.h irqbalance.h non-atomic.h \
types.h
sbin_PROGRAMS = irqbalance
irqbalance_SOURCES = activate.c bitmap.c classify.c cputree.c irqbalance.c \
irqlist.c numa.c placement.c powermode.c procinterrupts.c
irqbalance_LDADD = $(CAPNG_LDADD) $(GLIB_LIBS)
dist_man_MANS = irqbalance.1

CONFIG_CLEAN_FILES = debug*.list config/*
clean-generic:
rm -rf autom4te*.cache
rm -f *.rej *.orig *~

SUBDIRS = $(GLIB_SUBDIR)
@@ -36,7 +36,6 @@ AM_CONFIG_HEADER(config.h)
echo Configuring irqbalance $VERSION

AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
@@ -70,10 +69,39 @@ AC_C_CONST
AC_C_INLINE
AM_PROG_CC_C_O

PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
AC_ARG_WITH([glib2],
[AS_HELP_STRING([--without-glib2],
[Don't use system glib2 library. Use local implementation instead.])],
[],
[with_glib2=check])

local_glib2=
AS_IF(
[test "x$with_glib2" = xyes],
[PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])],

[test "x$with_glib2" = xno],
[local_glib2="yes"],

[PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28], [], [local_glib2="yes"])]
)

AS_IF(
[test "x$local_glib2" = xyes],
[
GLIB_CFLAGS=-I./glib-local
GLIB_LIBS=glib-local/libglib.a
GLIB_SUBDIR=glib-local
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_SUBDIR)
AC_MSG_WARN(Using locale implementation of GList functions)
]
)

LIBCAP_NG_PATH

AC_OUTPUT(Makefile)
AC_OUTPUT(Makefile glib-local/Makefile)

AC_MSG_NOTICE()
AC_MSG_NOTICE([irqbalance Version: $VERSION])
@@ -27,6 +27,7 @@
#include <syslog.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#ifdef HAVE_GETOPT_LONG
#include <getopt.h>
#endif
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <glib.h>
#include <syslog.h>
#include <limits.h>

#include "types.h"
#ifdef HAVE_NUMA_H

0 comments on commit 8d74041

Please sign in to comment.
You can’t perform that action at this time.