Skip to content

Commit 279383b

Browse files
authored
Add configuration flag for enabling liblsof (#299) (#300)
It's disabled by default since liblsof is still in alpha stage
1 parent 930aeff commit 279383b

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Makefile.am

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# liblsof
2-
lib_LTLIBRARIES = liblsof.la
3-
42
liblsof_la_SOURCES = lib/ckkv.c lib/cvfs.c lib/dvch.c lib/fino.c lib/isfn.c lib/lkud.c lib/lsof.c lib/misc.c lib/node.c lib/pdvn.c lib/prfp.c lib/print.c lib/proc.c lib/ptti.c lib/rdev.c lib/rnmt.c lib/rmnt.c lib/rnam.c lib/rnch.c lib/rnmh.c
53
liblsof_la_SOURCES += lib/common.h lib/proto.h lib/hash.h
4+
5+
if INSTALL_LIBLSOF
6+
lib_LTLIBRARIES = liblsof.la
67
include_HEADERS = include/lsof.h include/lsof_fields.h
8+
else
9+
noinst_LTLIBRARIES = liblsof.la
10+
endif
711

812
# Hide internal functions
913
AM_CFLAGS = -fvisibility=hidden
@@ -217,4 +221,4 @@ EXTRA_DIST += Lsof.8
217221
clean-local:
218222
rm -rf lsof.man
219223
distclean-local:
220-
rm -rf lockf_owner.h lockf.h
224+
rm -rf lockf_owner.h lockf.h

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ AC_SUBST([LSOF_DIALECT_DIR])
253253
AC_DEFINE([API_EXPORT], [__attribute__ ((visibility ("default")))],
254254
[Set visibility to default for exported API functions.])
255255

256+
# --enable-liblsof to install liblsof
257+
AC_ARG_ENABLE(liblsof, AS_HELP_STRING([--enable-liblsof],
258+
[build and install liblsof @<:@default=no@:>@]), [], [enable_liblsof=no])
259+
AM_CONDITIONAL([INSTALL_LIBLSOF], [test "x$enable_liblsof" = xyes])
260+
256261
# --enable-security to define HASSECURITY
257262
AC_ARG_ENABLE(security, AS_HELP_STRING([--enable-security],
258263
[allow only the root user to list all open files @<:@default=no@:>@]), [], [enable_security=no])

0 commit comments

Comments
 (0)