public inbox for cygwin-apps-cvs@sourceware.org help / color / mirror / Atom feed
From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.893-5-g4221a21 Date: Thu, 04 Oct 2018 12:38:00 -0000 [thread overview] Message-ID: <20181004123823.21042.qmail@sourceware.org> (raw) 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"
reply other threads:[~2018-10-04 12:38 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181004123823.21042.qmail@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-apps-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).