From 76e875f69ac17996186f1f363a7f5f6936a5dae2 Mon Sep 17 00:00:00 2001 From: Robert Gill Date: Tue, 12 Aug 2025 20:50:28 +0000 Subject: [PATCH] allow disabling building of whiptail binary --- Makefile.in | 35 +++++++++++++++++++++++++---------- configure.ac | 15 ++++++++++++++- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index f8fe290..c461122 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,15 +13,25 @@ TAG = r$(subst .,-,$(VERSION)) SONAME = @SONAME@ SOEXT = so +INSTALL_NLS = @INSTALL_NLS@ PYTHONVERS = @PYTHONVERS@ +WHIPTAIL = @WHIPTAIL@ +ifneq ($(WHIPTAIL),) +INSTALL_WHIPTAIL = install-whiptail +else +INSTALL_WHIPTAIL = +endif + WHIPTCLLIB = @WHIPTCLLIB@ ifneq ($(WHIPTCLLIB),) WHIPTCLSO = $(WHIPTCLLIB).$(SOEXT) +INSTALL_TCL = install-tcl else WHIPTCLSO = +INSTALL_TCL = endif -PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey +PROGS = $(WHIPTAIL) $(WHIPTCLSO) test testgrid testtree showchars showkey TESTOBJS = test.o testgrid.o testtree.o showchars.o showkey.o NDIALOGOBJS = whiptail.o dialogboxes.o WHIPTCLOBJS = shared/whiptcl.o shared/dialogboxes.o @@ -134,16 +144,12 @@ $(SHAREDDIR)/%.o : %.c @mkdir -p $(SHAREDDIR) $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< -install: $(LIBNEWT) install-sh whiptail - [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir) +install: $(LIBNEWT) $(INSTALL_WHIPTAIL) install-sh [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir) [ -d $(instroot)/$(man1dir) ] || install -m 755 -d $(instroot)/$(man1dir) install -m 644 $(LIBNEWT) $(instroot)/$(libdir) - install -m 755 whiptail $(instroot)/$(bindir) - install -m 644 whiptail.1 $(instroot)/$(man1dir) - make -C po datadir=$(instroot)/$(datadir) install -install-sh: sharedlib install-tcl install-py +install-sh: sharedlib install-py $(INSTALL_TCL) [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir) [ -d $(instroot)/$(includedir) ] || install -m 755 -d $(instroot)/$(includedir) [ -d $(instroot)/$(pkgconfigdir) ] || install -m 755 -d $(instroot)/$(pkgconfigdir) @@ -153,11 +159,15 @@ install-sh: sharedlib install-tcl install-py ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME) install -m 644 libnewt.pc $(instroot)/$(pkgconfigdir) -install-tcl: $(WHIPTCLSO) -ifneq ($(WHIPTCLSO),) +install-whiptail: $(WHIPTAIL) $(INSTALL_NLS) + [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir) + [ -d $(instroot)/$(man1dir) ] || install -m 755 -d $(instroot)/$(man1dir) + install -m 755 whiptail $(instroot)/$(bindir) + install -m 644 whiptail.1 $(instroot)/$(man1dir) + +install-tcl: $(WHIPTCLSO) $(INSTALL_NLS) [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir) install -m 755 $(WHIPTCLSO) $(instroot)/$(libdir) -endif install-py: _snack.$(SOEXT) ifneq ($(PYTHONVERS),) @@ -171,6 +181,9 @@ ifneq ($(PYTHONVERS),) done endif +install-nls: + make -C po datadir=$(instroot)/$(datadir) install + Makefile: configure.ac @echo "You need to rerun ./autogen.sh and ./configure before continuing" @exit 1 @@ -194,3 +207,5 @@ archive: tag-archive create-archive ifeq (.depend,$(wildcard .depend)) include .depend endif + +.PHONY: install-nls install-sh diff --git a/configure.ac b/configure.ac index 434121e..a25f9a2 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ if test x$ac_cv_header_slang_h = x; then LDFLAGS="${LDFLAGS} -L/sw/lib" fi fi -AC_CHECK_HEADERS([popt.h libintl.h]) +AC_CHECK_HEADERS([libintl.h]) AC_MSG_CHECKING([for python versions]) AC_ARG_WITH([python], [ --without-python do not compile python support], @@ -137,8 +137,17 @@ if test "x$enable_nls" != "xno"; then ]) if test "x$enable_nls" != "xno"; then AC_DEFINE([ENABLE_NLS], 1, [Define to 1 if NLS support is enabled]) + INSTALL_NLS=install-nls fi fi +AC_SUBST([INSTALL_NLS]) + +AC_ARG_ENABLE([whiptail], [ --disable-whiptail disable compilation of whiptail]) + +if test "x$enable_whiptail" != "xno"; then + WHIPTAIL=whiptail +fi +AC_SUBST([WHIPTAIL]) AC_ARG_WITH(colorsfile, [ --with-colorsfile=file set default location of colors file]) @@ -150,6 +159,10 @@ if test "x$with_colorsfile" != "xno"; then fi fi +if test "x$with_tcl" != "xno" || test "x$enable_whiptail" != "xno"; then + AC_CHECK_HEADERS([popt.h]) +fi + AC_CONFIG_FILES([Makefile libnewt.pc]) AC_OUTPUT -- 2.47.2