Skip to content

Commit

Permalink
Add configuration flag for enabling liblsof (#299) (#300)
Browse files Browse the repository at this point in the history
It's disabled by default since liblsof is still in alpha stage
  • Loading branch information
subnut authored Nov 15, 2023
1 parent 930aeff commit 279383b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# liblsof
lib_LTLIBRARIES = liblsof.la

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
liblsof_la_SOURCES += lib/common.h lib/proto.h lib/hash.h

if INSTALL_LIBLSOF
lib_LTLIBRARIES = liblsof.la
include_HEADERS = include/lsof.h include/lsof_fields.h
else
noinst_LTLIBRARIES = liblsof.la
endif

# Hide internal functions
AM_CFLAGS = -fvisibility=hidden
Expand Down Expand Up @@ -217,4 +221,4 @@ EXTRA_DIST += Lsof.8
clean-local:
rm -rf lsof.man
distclean-local:
rm -rf lockf_owner.h lockf.h
rm -rf lockf_owner.h lockf.h
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ AC_SUBST([LSOF_DIALECT_DIR])
AC_DEFINE([API_EXPORT], [__attribute__ ((visibility ("default")))],
[Set visibility to default for exported API functions.])

# --enable-liblsof to install liblsof
AC_ARG_ENABLE(liblsof, AS_HELP_STRING([--enable-liblsof],
[build and install liblsof @<:@default=no@:>@]), [], [enable_liblsof=no])
AM_CONDITIONAL([INSTALL_LIBLSOF], [test "x$enable_liblsof" = xyes])

# --enable-security to define HASSECURITY
AC_ARG_ENABLE(security, AS_HELP_STRING([--enable-security],
[allow only the root user to list all open files @<:@default=no@:>@]), [], [enable_security=no])
Expand Down

0 comments on commit 279383b

Please sign in to comment.