]> granicus.if.org Git - libx264/commitdiff
cli: Install bash autocomplete during 'make install'
authorHenrik Gramner <henrik@gramner.com>
Wed, 10 Jun 2020 17:18:08 +0000 (19:18 +0200)
committerAnton Mitrofanov <bugmaster@narod.ru>
Thu, 2 Jul 2020 17:20:21 +0000 (19:20 +0200)
Makefile
configure

index efc863fb23dc7bebe5163e39d8dd2f5a98931794..1314dd91b13933c4b52f62e8d6a2c89baa8b5619 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -388,6 +388,10 @@ distclean: clean
 install-cli: cli
        $(INSTALL) -d $(DESTDIR)$(bindir)
        $(INSTALL) x264$(EXE) $(DESTDIR)$(bindir)
+ifneq ($(BASHCOMPLETIONSDIR),)
+       $(INSTALL) -d $(DESTDIR)$(BASHCOMPLETIONSDIR)
+       $(INSTALL) -m 644 -T $(SRCPATH)/tools/bash-autocomplete.sh $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
+endif
 
 install-lib-dev:
        $(INSTALL) -d $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)/pkgconfig
@@ -418,6 +422,9 @@ ifneq ($(IMPLIBNAME),)
 else ifneq ($(SONAME),)
        rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
 endif
+ifneq ($(BASHCOMPLETIONSDIR),)
+       rm -f $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
+endif
 
 etags TAGS:
        etags $(SRCS) $(SRCS_X) $(SRCS_8)
index f2a3f17ec07c7cb238ceab95f02b9100f5ad1516..51c896e901c5d4bb3ac4408e005380f64fb8f230 100755 (executable)
--- a/configure
+++ b/configure
@@ -1528,6 +1528,9 @@ fi
 if [ "$cli" = "yes" ]; then
     echo 'default: cli' >> config.mak
     echo 'install: install-cli' >> config.mak
+    if pkg_check bash-completion ; then
+        echo "BASHCOMPLETIONSDIR=$($PKGCONFIG --variable=completionsdir bash-completion)" >> config.mak
+    fi
 fi
 
 if [ "$shared" = "yes" ]; then