Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-06 21:00:11 -0500
committerDan McGee <dan@archlinux.org>2008-04-06 21:00:11 -0500
commita708c6eadc107475015eb2fbe2c7ec5d00bc0099 (patch)
treeaea2f624e4eb92554b041f355862c44662cfb10e /configure.ac
parent9c7ebe68724791f06cdde2febdf91f0472f18407 (diff)
Allow disabling of internal (libdownload) code
Add a new --disable-internal-download flag to configure allowing the internal download code to be skipped. This will be helpful on platforms that currently don't support either libdownload or libfetch (such as Cygwin) and for just compiling a lighter weight pacman binary. This was made really easy by our recent refactoring of the download code into separate internal and external functions, as well as some error code cleanup. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 20 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f77614bb..3820d894 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,11 @@ AC_ARG_WITH(db-ext,
AC_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
[DBEXT=$withval], [DBEXT=.db.tar.gz])
+# Help line for libdownload/libfetch
+AC_ARG_ENABLE(internal-download,
+ AC_HELP_STRING([--disable-internal-download], [do not build with libdownload/libfetch support]),
+ [internaldownload=$enableval], [internaldownload=yes])
+
# Help line for documentation
AC_ARG_ENABLE(doc,
AC_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
@@ -137,10 +142,21 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.13.1)
# Check for libarchive
-AC_CHECK_LIB([archive], [archive_read_data], , AC_MSG_ERROR([libarchive is needed to compile pacman!]))
+AC_CHECK_LIB([archive], [archive_read_data], ,
+ AC_MSG_ERROR([libarchive is needed to compile pacman!]))
-# Check for libdownload
-AC_CHECK_LIB([download], [downloadParseURL], , AC_MSG_ERROR([libdownload is needed to compile pacman!]))
+# Enable or disable usage of libdownload/libfetch
+AC_MSG_CHECKING(whether to link with download library)
+if test "x$internaldownload" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
+ # Check for libdownload if it was actually requested
+ AC_CHECK_LIB([download], [downloadParseURL], ,
+ AC_MSG_ERROR([libdownload is needed to compile pacman!]))
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(INTERNAL_DOWNLOAD, test "x$internaldownload" = "xyes")
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/statvfs.h sys/time.h syslog.h wchar.h])
@@ -352,6 +368,7 @@ pacman_display_version:
Compilation options:
Run make in doc/ dir : ${wantdoc}
+ Use download library : ${internaldownload}
Doxygen support : ${usedoxygen}
Asciidoc support : ${useasciidoc}
debug support : ${debug}