1- bin_PROGRAMS = lsof
2-
3- # Documentation
4- EXTRA_DIST = 00.README.FIRST 00CREDITS 00DCACHE 00DIALECTS 00DIST 00FAQ 00LSOF-L 00MANIFEST 00PORTING 00QUICKSTART 00README 00TEST 00XCONFIG
5- # Testing
6- EXTRA_DIST += tests/00README tests/TestDB tests/CkTestDB tests/Makefile tests/LsofTest.h check.bash
1+ # liblsof
2+ lib_LTLIBRARIES = liblsof.la
73
8- # Dialect neutral sources
9- lsof_SOURCES = src/arg.c src/main.c lib/node.c src/print.c src/ptti.c src/store.c src/usage.c src/util.c \
10- lib/ckkv.c lib/cvfs.c lib/dvch.c lib/fino.c lib/lsof.c lib/isfn.c lib/lkud.c lib/misc.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
11- lsof_SOURCES += lib/common.h include/lsof_fields.h lib/proto.h lib/hash.h src/cli.h
4+ 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
5+ liblsof_la_SOURCES += lib/common.h lib/proto.h lib/hash.h
126include_HEADERS = include/lsof.h include/lsof_fields.h
7+
8+ # Hide internal functions
9+ AM_CFLAGS = -fvisibility=hidden
10+
1311DIALECT_ROOT = $(top_srcdir ) /lib/dialects
1412DIALECT_PATH = $(DIALECT_ROOT ) /$(LSOF_DIALECT_DIR )
1513
1614# Dialect specific sources
1715if LINUX
18- lsof_SOURCES += lib/dialects/linux/dfile.c \
16+ liblsof_la_SOURCES += lib/dialects/linux/dfile.c \
1917 lib/dialects/linux/dmnt.c \
2018 lib/dialects/linux/dnode.c \
2119 lib/dialects/linux/dproc.c \
@@ -27,7 +25,7 @@ lsof_SOURCES += lib/dialects/linux/dfile.c \
2725endif
2826
2927if DARWIN
30- lsof_SOURCES += lib/dialects/darwin/ddev.c \
28+ liblsof_la_SOURCES += lib/dialects/darwin/ddev.c \
3129 lib/dialects/darwin/dfile.c \
3230 lib/dialects/darwin/dmnt.c \
3331 lib/dialects/darwin/dproc.c \
@@ -39,7 +37,7 @@ lsof_SOURCES += lib/dialects/darwin/ddev.c \
3937endif
4038
4139if FREEBSD
42- lsof_SOURCES += lib/dialects/freebsd/dmnt.c \
40+ liblsof_la_SOURCES += lib/dialects/freebsd/dmnt.c \
4341 lib/dialects/freebsd/dnode.c \
4442 lib/dialects/freebsd/dproc.c \
4543 lib/dialects/freebsd/dsock.c \
@@ -50,7 +48,7 @@ lsof_SOURCES += lib/dialects/freebsd/dmnt.c \
5048endif
5149
5250if NETBSD
53- lsof_SOURCES += lib/dialects/netbsd/dmnt.c \
51+ liblsof_la_SOURCES += lib/dialects/netbsd/dmnt.c \
5452 lib/dialects/netbsd/dnode.c \
5553 lib/dialects/netbsd/dproc.c \
5654 lib/dialects/netbsd/dsock.c \
@@ -61,7 +59,7 @@ lsof_SOURCES += lib/dialects/netbsd/dmnt.c \
6159endif
6260
6361if OPENBSD
64- lsof_SOURCES += lib/dialects/openbsd/dfile.c \
62+ liblsof_la_SOURCES += lib/dialects/openbsd/dfile.c \
6563 lib/dialects/openbsd/dmnt.c \
6664 lib/dialects/openbsd/dnode.c \
6765 lib/dialects/openbsd/dproc.c \
@@ -73,7 +71,7 @@ lsof_SOURCES += lib/dialects/openbsd/dfile.c \
7371endif
7472
7573if SOLARIS
76- lsof_SOURCES += lib/dialects/sun/ddev.c \
74+ liblsof_la_SOURCES += lib/dialects/sun/ddev.c \
7775 lib/dialects/sun/dfile.c \
7876 lib/dialects/sun/dmnt.c \
7977 lib/dialects/sun/dnode.c \
@@ -86,7 +84,7 @@ lsof_SOURCES += lib/dialects/sun/ddev.c \
8684endif
8785
8886if AIX
89- lsof_SOURCES += lib/dialects/aix/ddev.c \
87+ liblsof_la_SOURCES += lib/dialects/aix/ddev.c \
9088 lib/dialects/aix/dfile.c \
9189 lib/dialects/aix/dmnt.c \
9290 lib/dialects/aix/dnode.c \
@@ -99,22 +97,28 @@ lsof_SOURCES += lib/dialects/aix/ddev.c \
9997 lib/dialects/aix/machine.h
10098endif
10199
102- lsof_CPPFLAGS = -I $( DIALECT_PATH ) -Iautotools -I $( top_srcdir ) /lib -I $( top_srcdir ) /include
103- lsof_CPPFLAGS += -DAUTOTOOLS
100+ # Binary
101+ bin_PROGRAMS = lsof
104102
105- # Manpages
106- lsof.man : Lsof.8 version 00DIALECTS
107- soelim < Lsof.8 > $@
108- man8_MANS = lsof.man
109- EXTRA_DIST += Lsof.8
110- # Fix distcheck error
111- clean-local :
112- rm -rf lsof.man
113- distclean-local :
114- rm -rf lockf_owner.h lockf.h
103+ lsof_SOURCES = src/arg.c src/main.c src/print.c src/ptti.c src/store.c src/usage.c src/util.c
104+ lsof_SOURCES += src/cli.h
105+
106+ if LINUX
107+ lsof_SOURCES += src/dialects/linux/dprint.c
108+ endif
109+ if DARWIN
110+ lsof_SOURCES += src/dialects/darwin/dprint.c
111+ endif
112+ # TODO: link to dynamic library instead after internal functions are no longer used
113+ lsof_SOURCES += $(liblsof_la_SOURCES )
114+ # lsof_LDADD = liblsof.la
115+
116+ liblsof_la_CPPFLAGS = -I$(DIALECT_PATH ) -Iautotools -DAUTOTOOLS -I$(top_srcdir ) /lib -I$(top_srcdir ) /include
117+ lsof_CPPFLAGS = -I$(DIALECT_PATH ) -Iautotools -DAUTOTOOLS -I$(top_srcdir ) /lib -I$(top_srcdir ) /include -I$(top_srcdir ) /src
115118
116119# Testing scripts
117120AM_TESTS_ENVIRONMENT = export LSOF_DIALECT_DIR=$(LSOF_DIALECT_DIR ) ; export LSOF_DIALECT=$(LSOF_DIALECT ) ;
121+ EXTRA_DIST =
118122# Dialect neutral
119123DIALECT_NEUTRAL_TESTS = tests/case-00-hello.bash \
120124 tests/case-01-version.bash \
@@ -193,3 +197,24 @@ tests_LTszoff_SOURCES = tests/LTszoff.c tests/LTlib.c
193197tests_LTszoff_CFLAGS = @LSOF_TEST_CFLAGS@ -I$(top_srcdir ) /include
194198tests_LTunix_SOURCES = tests/LTunix.c tests/LTlib.c
195199tests_LTunix_CFLAGS = @LSOF_TEST_CFLAGS@ -I$(top_srcdir ) /include
200+
201+ TESTS += tests/LTbasic2
202+ check_PROGRAMS += tests/LTbasic2
203+ tests_LTbasic2_CFLAGS = -I$(top_srcdir ) /include
204+ tests_LTbasic2_LDADD = liblsof.la
205+
206+ # Documentation
207+ EXTRA_DIST += 00.README.FIRST 00CREDITS 00DCACHE 00DIALECTS 00DIST 00FAQ 00LSOF-L 00MANIFEST 00PORTING 00QUICKSTART 00README 00TEST 00XCONFIG
208+ # Testing
209+ EXTRA_DIST += tests/00README tests/TestDB tests/CkTestDB tests/Makefile tests/LsofTest.h check.bash
210+
211+ # Manpages
212+ lsof.man : Lsof.8 version 00DIALECTS
213+ soelim < Lsof.8 > $@
214+ man8_MANS = lsof.man
215+ EXTRA_DIST += Lsof.8
216+ # Fix distcheck error
217+ clean-local :
218+ rm -rf lsof.man
219+ distclean-local :
220+ rm -rf lockf_owner.h lockf.h
0 commit comments