summaryrefslogtreecommitdiff
blob: f59e176473e12802f557329c6b6de69224347eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
-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