[pacman-dev] [PATCH] Fix cross-compilation issues with git and libfetch
This patch fixes 2 issues I encountered when cross-compiling pacman. First is the test for libfetch which requires explicit linking to all libraries libfetch depends on. The other problem results from the AC_CHECK_PROGS test for git. This test will stop configure with an error when cross-compiling. The fix moves the call to AC_CHECK_PROG so that is only called of --enable-git is actually set. Signed-off-by: Matthias Lanzinger <mlaenz@gmail.com> --- configure.ac | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index faf774f..d0fed48 100644 --- a/configure.ac +++ b/configure.ac @@ -142,8 +142,8 @@ if test "x$internaldownload" = "xyes" ; then AC_MSG_RESULT(yes) AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library]) # Check for a download library if it was actually requested - AC_CHECK_LIB([fetch], [fetchParseURL], , - AC_MSG_ERROR([libfetch is needed to compile with internal download support]) ) + AC_CHECK_LIB([fetch], [fetchParseURL], [AC_SUBST([LIBS], ["-lfetch -lssl -lcrypto -ldl $LIBS"])], + AC_MSG_ERROR([libfetch is needed to compile with internal download support]), [-lssl -lcrypto -ldl] ) # Check if libfetch supports conditional GET # (version >=2.21, struct url has member last_modified) AC_CHECK_MEMBER(struct url.last_modified, , @@ -305,10 +305,10 @@ else fi # Enable or disable use of git version in pacman version string -AC_CHECK_PROGS([GIT], [git]) -AC_CHECK_FILE([.git/], hasgitdir=yes) AC_MSG_CHECKING(whether to use git version if available) if test "x$wantgitver" = "xyes" ; then + AC_CHECK_PROGS([GIT], [git]) + AC_CHECK_FILE([.git/], hasgitdir=yes) if test $GIT -a "x$hasgitdir" = "xyes"; then AC_MSG_RESULT([yes]) usegitver=yes -- 1.7.0.2
On 25/03/10 20:03, Matthias Lanzinger wrote:
This patch fixes 2 issues I encountered when cross-compiling pacman. First is the test for libfetch which requires explicit linking to all libraries libfetch depends on.
The other problem results from the AC_CHECK_PROGS test for git. This test will stop configure with an error when cross-compiling. The fix moves the call to AC_CHECK_PROG so that is only called of --enable-git is actually set.
Signed-off-by: Matthias Lanzinger<mlaenz@gmail.com>
Signed-off-by: Allan The only thing that might be a tiny concern is with --enable-git-version the configure output for the check looks like: checking whether to use git version if available... checking for git... git checking for .git/... yes yes which is a bit messy. But messy is better than broken! Allan
On Thu, Mar 25, 2010 at 5:12 AM, Allan McRae <allan@archlinux.org> wrote:
On 25/03/10 20:03, Matthias Lanzinger wrote:
This patch fixes 2 issues I encountered when cross-compiling pacman. First is the test for libfetch which requires explicit linking to all libraries libfetch depends on.
The other problem results from the AC_CHECK_PROGS test for git. This test will stop configure with an error when cross-compiling. The fix moves the call to AC_CHECK_PROG so that is only called of --enable-git is actually set.
Signed-off-by: Matthias Lanzinger<mlaenz@gmail.com>
Signed-off-by: Allan
The only thing that might be a tiny concern is with --enable-git-version the configure output for the check looks like:
checking whether to use git version if available... checking for git... git checking for .git/... yes yes
which is a bit messy. But messy is better than broken!
Oh well, I can deal with it and I'm sure you can. Thanks for the patch. -Dan
participants (3)
-
Allan McRae
-
Dan McGee
-
Matthias Lanzinger