summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2018-07-26 13:34:39 -0700
committerDavid Sterba <dsterba@suse.com>2018-08-06 15:03:41 +0200
commita4770b0a013e5934461d05f256dd90266c4cf0c5 (patch)
treeb7e8dc50a3dc92a3a7a4404c3d5f0f53478b9d69 /configure.ac
parent996a07c602e74a7da7d7ac2f1225d243c819af2e (diff)
btrfs-progs: build: add --disable-shared and --disable-static
The build system mentioned in the previous commit builds libraries in both PIC and non-PIC mode. Shared libraries don't work in PIC mode, so it expects a --disable-shared configure option, which most open source libraries using autoconf have. Let's add it, too. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 230f37fa..df02f206 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,20 @@ AC_ARG_ENABLE([programs],
AS_IF([test "x$enable_programs" = xyes], [BUILD_PROGRAMS=1], [BUILD_PROGRAMS=0])
AC_SUBST([BUILD_PROGRAMS])
+AC_ARG_ENABLE([shared],
+ AS_HELP_STRING([--disable-shared], [do not build shared libraries]),
+ [], [enable_shared=yes]
+)
+AS_IF([test "x$enable_shared" = xyes], [BUILD_SHARED_LIBRARIES=1], [BUILD_SHARED_LIBRARIES=0])
+AC_SUBST([BUILD_SHARED_LIBRARIES])
+
+AC_ARG_ENABLE([static],
+ AS_HELP_STRING([--disable-static], [do not build static libraries]),
+ [], [enable_static=yes]
+)
+AS_IF([test "x$enable_static" = xyes], [BUILD_STATIC_LIBRARIES=1], [BUILD_STATIC_LIBRARIES=0])
+AC_SUBST([BUILD_STATIC_LIBRARIES])
+
AC_ARG_ENABLE([convert],
AS_HELP_STRING([--disable-convert], [do not build btrfs-convert]),
[], [enable_convert=$enable_programs]
@@ -222,7 +236,7 @@ AC_SUBST(BTRFSRESTORE_ZSTD)
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python], [do not build libbtrfsutil Python bindings]),
- [], [enable_python=yes]
+ [], [enable_python=$enable_shared]
)
if test "x$enable_python" = xyes; then
@@ -285,6 +299,8 @@ AC_MSG_RESULT([
ldflags: ${LDFLAGS}
programs: ${enable_programs}
+ shared libraries: ${enable_shared}
+ static libraries: ${enable_static}
documentation: ${enable_documentation}
doc generator: ${ASCIIDOC_TOOL}
backtrace support: ${enable_backtrace}