public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.893-5-g4221a21
@ 2018-10-04 12:38 jturney
  0 siblings, 0 replies; only message in thread
From: jturney @ 2018-10-04 12:38 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=4221a2166b376dad13bfb0c1ac5c080f4ff7cd59

commit 4221a2166b376dad13bfb0c1ac5c080f4ff7cd59
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Nov 1 13:56:26 2017 +0000

    Use pkg-config for dependency checking where possible
    
    Modernise depedency checking and use pkg-config where possible


Diff:
---
 Makefile.am  |   10 ++++++++--
 configure.ac |   33 ++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7bd7c57..a4f9a12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,7 +28,8 @@ AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
 AM_YFLAGS = -d
 AM_LFLAGS = -8
 WINDRES = @WINDRES@
-AM_CPPFLAGS = -DLZMA_API_STATIC -I$(srcdir)/libgetopt++/include
+AM_CPPFLAGS = -DLZMA_API_STATIC -I$(srcdir)/libgetopt++/include \
+	       $(ZLIB_CFLAGS) $(LZMA_CFLAGS) $(LIBCRYPT_CFLAGS) $(LIBSOLV_CFLAGS)
 
 inilex_CXXFLAGS:=-Wno-sign-compare
 
@@ -97,7 +98,12 @@ inilint_SOURCES = \
 	String++.h
 
 @SETUP@_LDADD = \
-	libgetopt++/libgetopt++.la -lgcrypt -lgpg-error -llzma -lbz2 -lz -lsolv -lregex \
+	libgetopt++/libgetopt++.la \
+	$(LIBGCRYPT_LIBS) \
+	$(LZMA_LIBS) \
+	$(BZ2_LIBS) \
+	$(ZLIB_LIBS) \
+	$(LIBSOLV_LIBS) -lregex \
 	-lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll -lwininet -lws2_32 -lmingw32
 @SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
 @SETUP@_SOURCES = \
diff --git a/configure.ac b/configure.ac
index dcab4ee..103b89e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,28 +48,35 @@ AC_PROG_LIBTOOL
 AC_CHECK_TOOL(WINDRES, windres, windres)
 AC_CHECK_TOOL(OBJCOPY, objcopy, objcopy)
 
-AC_CHECK_HEADERS(alloca.h \
-		 errno.h \
-		 string \
-		 string.h )
+dnl dependencies we can check for using pkgconfig
+PKG_CHECK_MODULES(ZLIB, [zlib])
+PKG_CHECK_MODULES(LZMA, [liblzma])
+PKG_CHECK_MODULES(LIBSOLV, [libsolv])
 
-AC_CHECK_HEADER(zlib.h, , missing_deps="$missing_deps zlib")
-AC_CHECK_HEADER(bzlib.h, , missing_deps="$missing_deps libbz2")
-AC_CHECK_HEADER(lzma.h, , missing_deps="$missing_deps liblzma")
-AC_CHECK_HEADER(gcrypt.h, , missing_deps="$missing_deps libgcrypt")
-AC_CHECK_HEADER(solv/pool.h, , missing_deps="$missing_deps libsolv")
-AC_CHECK_HEADER(regex.h, , missing_deps="$missing_deps libregex")
+dnl dependencies we need to check for by hand
+export SYSROOT=$($CC --print-sysroot)/mingw
+AM_PATH_LIBGCRYPT
+unset SYSROOT
 
-if test -n "$missing_deps"; then
-	AC_MSG_ERROR([missing prerequisites: $missing_deps])
+save_LIBS=$LIBS
+LIBS="$LIBS -lbz2"
+AC_MSG_CHECKING([for bzip2])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bzlib.h>]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no])
+AC_MSG_RESULT($HAVE_BZ2)
+LIBS=$save_LIBS
+if test "x$HAVE_BZ2" = "xno"; then
+    AC_MSG_ERROR([bzip2 not found])
+  else
+    BZ2_LIBS="-lbz2"
 fi
+AC_SUBST(BZ2_LIBS)
 
+dnl configure in libgetopt++
 prefix=`pwd`/inst; mkdir -p "$prefix"
 exec_prefix=$prefix
 ac_configure_args="$ac_configure_args --disable-shared"
 AC_CONFIG_SUBDIRS(libgetopt++)
 
-dnl add portability sources to inilint
 case "$host" in
 i?86-*-mingw32)
   SETUP="setup"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-04 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 12:38 [setup - the official Cygwin setup program] branch master, updated. release_2.893-5-g4221a21 jturney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).