Skip to content

Commit

Permalink
Use pkg-config to detect e2fsprogs libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmjones committed Mar 30, 2012
1 parent a789126 commit 65c745e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 7 additions & 13 deletions configure.ac
Expand Up @@ -89,7 +89,7 @@ AC_CHECK_PROG(PACMAN,[pacman],[pacman],[no])
dnl Support for gzipped kernel modules.
AC_CHECK_LIB([z],[gzopen])

dnl Required programs, libraries.
dnl mke2fs.
AC_PATH_PROG([MKE2FS],[mke2fs],[no],
[$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR])
if test "x$MKE2FS" = "xno" ; then
Expand All @@ -98,23 +98,17 @@ fi
AC_DEFINE_UNQUOTED([MKE2FS],["$MKE2FS"],
[Full path to the mke2fs program.])

old_LIBS="$LIBS"
AC_CHECK_LIB([com_err],[error_message],[],[
AC_MSG_FAILURE([com_err library not found (part of e2fsprogs)])
])
LIBS="$old_LIBS"
dnl ext2fs, com_err.
PKG_CHECK_MODULES([EXT2FS], [ext2fs])
PKG_CHECK_MODULES([COM_ERR], [com_err])

dnl Optional ext2fs_close2 function.
old_LIBS="$LIBS"
AC_CHECK_LIB([ext2fs],[ext2fs_file_open2],[],[
AC_MSG_FAILURE([libext2fs library not found (part of e2fsprogs)])
])
LIBS="$EXT2FS_LIBS $COM_ERR_LIBS"
AC_CHECK_FUNCS([ext2fs_close2])
LIBS="$old_LIBS"

AC_CHECK_HEADER([ext2fs/ext2fs.h],[],[
AC_MSG_FAILURE([Header <ext2fs/ext2fs.h> not found (part of e2fsprogs)])
])

dnl GNU awk.
AC_CHECK_PROG(GAWK,[gawk],[gawk],[no])
if test "x$GAWK" = "xno" ; then
AC_MSG_FAILURE([gawk (GNU awk) not found])
Expand Down
6 changes: 4 additions & 2 deletions helper/Makefile.am
Expand Up @@ -32,9 +32,11 @@ febootstrap_supermin_helper_SOURCES = \
kernel.c \
main.c \
utils.c
febootstrap_supermin_helper_CFLAGS = -Wall -I../lib
febootstrap_supermin_helper_CFLAGS = \
-Wall $(EXT2FS_CFLAGS) $(COM_ERR_CFLAGS) -I../lib
febootstrap_supermin_helper_LDADD = \
ext2init.o -lext2fs -lcom_err $(LTLIBINTL) -L../lib -lgnu
ext2init.o $(EXT2FS_LIBS) $(COM_ERR_LIBS) \
$(LTLIBINTL) -L../lib -lgnu

# init "script" used by ext2 initrd.
noinst_PROGRAMS = init
Expand Down

0 comments on commit 65c745e

Please sign in to comment.