]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
allow disabling building of whiptail binary master
authorRobert Gill <rtgill82@gmail.com>
Tue, 12 Aug 2025 20:50:28 +0000 (20:50 +0000)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 13 Aug 2025 06:41:15 +0000 (08:41 +0200)
Makefile.in
configure.ac

index f8fe2909c8adba288c01c4689e1bc5342cdf9f6b..c4611224d0efba03df94808ddf10b2261ba800ba 100644 (file)
@@ -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
index 434121ef860e63c35dcf3f15630f70df7740843b..a25f9a250cef559e6f4b5d9998747efecaf33f37 100644 (file)
@@ -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