Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build: simplify check for glib2
Instead of hand-crafting a pkg-config check, just use the
PKG_CHECK_MODULES autoconf macro.
  • Loading branch information
fghaas committed May 29, 2012
commit eb453b8c5265e901ad69e0df80477c38aa93c9f3
37 changes: 1 addition & 36 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -65,42 +65,7 @@ AM_CONDITIONAL(HAVE_HELP2MAN, test x"${HELP2MAN}" != x"")
AC_CHECK_LIB([socket], [socket])
AC_CHECK_LIB([nsl], [t_open])

#
# glib
#
if test x"${PKGCONFIG}" = x""; then
AC_MSG_ERROR(You need pkgconfig installed in order to build ${PACKAGE})
fi
GPKGNAME="glib-2.0"

if
$PKGCONFIG --exists $GPKGNAME
then
GLIBCONFIG="$PKGCONFIG $GPKGNAME"
else
set -x
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
$PKGCONFIG --exists $GPKGNAME; echo $?
$PKGCONFIG --cflags $GPKGNAME; echo $?
$PKGCONFIG $GPKGNAME; echo $?
set +x

AC_MSG_ERROR(You need glib2-devel installed in order to build ${PACKAGE})
fi
AC_MSG_RESULT(using $GLIBCONFIG)

if test "X$GLIBCONFIG" != X; then
AC_MSG_CHECKING(for special glib includes: )
GLIBHEAD=`$GLIBCONFIG --cflags`
AC_MSG_RESULT($GLIBHEAD)
CPPFLAGS="$CPPFLAGS $GLIBHEAD"

AC_MSG_CHECKING(for glib library flags)
GLIBLIB=`$GLIBCONFIG --libs`
AC_MSG_RESULT($GLIBLIB)
LIBS="$LIBS $GLIBLIB"
fi

PKG_CHECK_MODULES(GLIB, [glib-2.0])

# Checks for header files.
AC_FUNC_ALLOCA
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ boothd_SOURCES = config.c main.c paxos.c ticket.c transport.c \
pacemaker.c paxos_lease.c timer.c

boothd_LDADD = -lplumb -lplumbgpl
boothd_LDFLAGS = $(OS_DYFLAGS) -L./
boothd_LDFLAGS = $(OS_DYFLAGS) -L./ $(GLIB_LIBS)
boothd_CPPFLAGS = $(GLIB_CFLAGS)

noinst_HEADERS = booth.h list.h pacemaker.h paxos_lease.h timer.h \
config.h log.h paxos.h ticket.h transport.h
Expand Down