Index: libarchive-1.3.1/configure.ac =================================================================== --- libarchive-1.3.1.orig/configure.ac +++ libarchive-1.3.1/configure.ac @@ -71,6 +71,11 @@ AC_CHECK_HEADERS([locale.h paths.h]) AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/acl.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h wchar.h zlib.h]) +AC_ARG_ENABLE([static-bsdtar], + AS_HELP_STRING([--disable-static-bsdtar], [Makes bsdtar link dynamically to libarchive (default: static)]) ) + +AM_CONDITIONAL([STATIC_BSDTAR], [test "x$enable_static_bsdtar" != "xno"]) + # Checks for libraries. AC_CHECK_LIB(acl,acl_set_file) AC_CHECK_LIB(attr,setxattr) Index: libarchive-1.3.1/Makefile.am =================================================================== --- libarchive-1.3.1.orig/Makefile.am +++ libarchive-1.3.1/Makefile.am @@ -114,8 +114,12 @@ bsdtar_DEPENDENCIES = libarchive.la \ libarchive/archive_entry.h \ libarchive/archive.h -bsdtar_LDADD= -larchive -lbz2 -lz -bsdtar_CPPFLAGS=-I$(top_builddir)/libarchive +if STATIC_BSDTAR # Link libarchive statically... -bsdtar_LDFLAGS= -static -I$(destdir)/libarchive +static=-all-static +endif + +bsdtar_LDADD= -L. -larchive -lbz2 -lz +bsdtar_CPPFLAGS=-I$(top_builddir)/libarchive +bsdtar_LDFLAGS= $(static) bsdtar_dist_man_MANS= tar/bsdtar.1