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>
This commit is contained in:
Serj Kalichev 2012-03-26 10:19:00 -04:00 committed by Neil Horman
parent 1189cd6f19
commit 8d7404149e
5 changed files with 42 additions and 4 deletions

6
.gitignore vendored
View file

@ -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.*

View file

@ -25,7 +25,7 @@ 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 \
@ -33,6 +33,7 @@ noinst_HEADERS = bitmap.h constants.h cpumask.h irqbalance.h non-atomic.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/*
@ -40,3 +41,4 @@ clean-generic:
rm -rf autom4te*.cache
rm -f *.rej *.orig *~
SUBDIRS = $(GLIB_SUBDIR)

View file

@ -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])

View file

@ -27,6 +27,7 @@
#include <syslog.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#ifdef HAVE_GETOPT_LONG
#include <getopt.h>
#endif

View file

@ -9,6 +9,7 @@
#include <stdint.h>
#include <glib.h>
#include <syslog.h>
#include <limits.h>
#include "types.h"
#ifdef HAVE_NUMA_H