Commit 325b7f68 authored by Wayne Porter's avatar Wayne Porter

Improved Cygwin support

Add logic to not compile unnecessary apps
Signed-off-by: Wayne Porter's avatarWayne Porter <wporter82@gmail.com>
parent e0784dda
Pipeline #9053223 failed with stage
in 3 minutes and 51 seconds
......@@ -62,3 +62,4 @@ watch
*~
*.log
*.sum
*.exe
CYGWINFLAGS =
if CYGWIN
CYGWINFLAGS += -lintl
CYGWINFLAGS += -lintl
usrbin_exec_PROGRAMS =
endif
AM_CPPFLAGS = \
......@@ -19,10 +20,20 @@ SUBDIRS = \
testsuite
AM_CFLAGS = -Iproc
AM_LDFLAGS = ./proc/libprocps.la $(CYGWINFLAGS)
LDADD = ./proc/libprocps.la $(CYGWINFLAGS)
transform = s/pscommand/ps/; $(program_transform_name)
transform =
if !CYGWIN
transform += s/pscommand/ps/; $(program_transform_name)
sbin_PROGRAMS = \
sysctl
else
transform += s/pscommand/procps/; $(program_transform_name)
endif
if !CYGWIN
bin_PROGRAMS = \
ps/pscommand \
free \
......@@ -34,9 +45,17 @@ bin_PROGRAMS = \
uptime \
vmstat \
w
sbin_PROGRAMS = \
sysctl
else
usrbin_exec_PROGRAMS += \
ps/pscommand \
free \
pgrep \
pkill \
pmap \
uptime \
vmstat \
w
endif
lib_LTLIBRARIES = \
proc/libprocps.la
......@@ -46,15 +65,19 @@ dist_man_MANS = \
pgrep.1 \
pkill.1 \
pmap.1 \
pwdx.1 \
sysctl.8 \
sysctl.conf.5 \
tload.1 \
uptime.1 \
vmstat.8 \
w.1 \
ps/ps.1
if !CYGWIN
dist_man_MANS += \
pwdx.1 \
tload.1 \
sysctl.8 \
sysctl.conf.5
endif
EXTRA_DIST = \
.version \
autogen.sh \
......@@ -63,7 +86,6 @@ EXTRA_DIST = \
misc/git-version-gen \
Documentation/CodingStyle.md \
Documentation/TODO \
sysctl.conf \
ps/HACKING \
ps/regression \
$(DIST_MAN_POTS)
......@@ -73,8 +95,17 @@ dist_procpsng_DATA = \
Documentation/bugs.md \
Documentation/FAQ
if !CYGWIN
EXTRA_DIST += \
sysctl.conf
endif
if BUILD_PIDOF
if !CYGWIN
bin_PROGRAMS += pidof
else
usrbin_exec_PROGRAMS += pidof
endif
dist_man_MANS += pidof.1
pidof_SOURCES = pidof.c lib/fileutils.c
else
......@@ -82,7 +113,13 @@ else
endif
if BUILD_KILL
if CYGWIN
transform += ;s/^kill/prockill/; $(program_transform_name)
usrbin_exec_PROGRAMS += kill
else
bin_PROGRAMS += kill
endif
dist_man_MANS += kill.1
kill_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c
else
......@@ -90,35 +127,52 @@ else
endif
if WITH_NCURSES
if !CYGWIN
bin_PROGRAMS += \
slabtop \
watch \
top/top
else
usrbin_exec_PROGRAMS += \
watch \
top/top
endif
dist_man_MANS += \
slabtop.1 \
watch.1 \
top/top.1
slabtop_SOURCES = slabtop.c lib/strutils.c lib/fileutils.c
slabtop_LDADD = $(LDADD) @NCURSES_LIBS@
watch_SOURCES = watch.c lib/strutils.c lib/fileutils.c
watch_LDADD = @WATCH_NCURSES_LIBS@ $(CYGWINFLAGS)
watch_CFLAGS = @WATCH_NCURSES_CFLAGS@
top_top_SOURCES = \
top/top.h \
top/top.c \
top/top_nls.h \
top/top_nls.c \
lib/fileutils.c
if CYGWIN
top_top_SOURCES += lib/strverscmp.c
top_top_SOURCES += lib/strverscmp.c
else
dist_man_MANS += \
slabtop.1
slabtop_SOURCES = slabtop.c lib/strutils.c lib/fileutils.c
slabtop_LDADD = $(LDADD) @NCURSES_LIBS@
endif
top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB)
endif
if BUILD_SKILL
if !CYGWIN
bin_PROGRAMS += \
skill \
snice
else
usrbin_exec_PROGRAMS += \
skill \
snice
endif
skill_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c
snice_SOURCES = skill.c lib/strutils.c lib/fileutils.c lib/nsutils.c
dist_man_MANS += \
......@@ -134,9 +188,11 @@ free_SOURCES = free.c lib/strutils.c lib/fileutils.c
pgrep_SOURCES = pgrep.c lib/fileutils.c lib/nsutils.c
pkill_SOURCES = pgrep.c lib/fileutils.c lib/nsutils.c
pmap_SOURCES = pmap.c lib/fileutils.c
if !CYGWIN
pwdx_SOURCES = pwdx.c lib/fileutils.c
pwdx_LDADD= $(CYGWINFLAGS)
sysctl_SOURCES = sysctl.c lib/fileutils.c
endif
tload_SOURCES = tload.c lib/strutils.c lib/fileutils.c
uptime_SOURCES = uptime.c lib/fileutils.c
vmstat_SOURCES = vmstat.c lib/strutils.c lib/fileutils.c
......@@ -250,9 +306,24 @@ lib_test_process_LDADD = $(CYGWINFLAGS)
lib_test_strtod_nol_SOURCES = lib/test_strtod_nol.c lib/strutils.c
lib_test_strtod_nol_LDADD = $(CYGWINFLAGS)
skill_LDADD = $(CYGWINFLAGS)
kill_LDADD = $(CYGWINFLAGS)
free_LDADD = $(CYGWINFLAGS)
pgrep_LDADD = $(CYGWINFLAGS)
pkill_LDADD = $(CYGWINFLAGS)
pidof_LDADD = $(CYGWINFLAGS)
pmap_LDADD = $(CYGWINFLAGS)
snice_LDADD = $(CYGWINFLAGS)
tload_LDADD = $(CYGWINFLAGS)
uptime_LDADD = $(CYGWINFLAGS)
w_LDADD = $(CYGWINFLAGS)
lib_test_process_LDADD = $(CYGWINFLAGS)
if EXAMPLE_FILES
if !CYGWIN
sysconf_DATA = sysctl.conf
endif
endif
BUILT_SOURCES = $(top_srcdir)/.version
......
......@@ -69,6 +69,27 @@ AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRTOD
usrbin_execdir='${exec_prefix}/bin'
AC_SUBST([usrbin_execdir])
if test "x$host_os" = xcygwin
then
prefix=/usr
sysconfdir=/etc
libexecdir=/usr/lib
localstatedir=/var
datadir=/usr/share
mandir=/usr/share/man
infodir=/usr/share/info
AC_SUBST([prefix])
AC_SUBST([sysconfdir])
AC_SUBST([libexecdir])
AC_SUBST([localstatedir])
AC_SUBST([datadir])
AC_SUBST([mandir])
AC_SUBST([infodir])
fi
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])
if test -d "$srcdir/po"
......@@ -144,6 +165,7 @@ else
fi
AC_SUBST([NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_CFLAGS])
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--with-systemd], [enable systemd support])],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment