Commit 375cc588 authored by Anton Mitrofanov's avatar Anton Mitrofanov

configure: Add options for bash-completion install

parent 4c2aafd8
Pipeline #20121 passed with stages
in 9 minutes and 29 seconds
......@@ -388,10 +388,6 @@ 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
......@@ -414,6 +410,12 @@ else ifneq ($(SONAME),)
$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(libdir)
endif
install-bashcompletion:
ifneq ($(BASHCOMPLETIONSDIR),)
$(INSTALL) -d $(DESTDIR)$(BASHCOMPLETIONSDIR)
$(INSTALL) -m 644 -T $(SRCPATH)/tools/bash-autocomplete.sh $(DESTDIR)$(BASHCOMPLETIONSDIR)/x264
endif
uninstall:
rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(includedir)/x264_config.h $(DESTDIR)$(libdir)/libx264.a
rm -f $(DESTDIR)$(bindir)/x264$(EXE) $(DESTDIR)$(libdir)/pkgconfig/x264.pc
......
......@@ -25,6 +25,9 @@ Configuration options:
--system-libx264 use system libx264 instead of internal
--enable-shared build shared library
--enable-static build static library
--disable-bashcompletion disable installation of bash-completion script
--enable-bashcompletion force installation of bash-completion script
--bashcompletionsdir=DIR install bash-completion script in DIR [auto]
--disable-opencl disable OpenCL features
--disable-gpl disable GPL-only features
--disable-thread disable multithreaded encoding
......@@ -363,6 +366,8 @@ cli="yes"
cli_libx264="internal"
shared="no"
static="no"
bashcompletion="auto"
bashcompletionsdir=""
avs="auto"
lavf="auto"
ffms="auto"
......@@ -439,6 +444,15 @@ for opt do
--enable-static)
static="yes"
;;
--disable-bashcompletion)
bashcompletion="no"
;;
--enable-bashcompletion)
bashcompletion="yes"
;;
--bashcompletionsdir=*)
bashcompletionsdir="$optarg"
;;
--disable-asm)
asm="no"
;;
......@@ -1529,9 +1543,6 @@ 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
......@@ -1567,6 +1578,27 @@ if [ "$static" = "yes" ]; then
echo 'install: install-lib-static' >> config.mak
fi
if [ "$bashcompletion" = "auto" ]; then
if [ "$cli" = "no" ]; then
bashcompletion="no"
elif [[ -z "$bashcompletionsdir" && "$prefix" != "/usr" && "$prefix" != "/usr/"* ]]; then
bashcompletion="no"
fi
fi
if [ "$bashcompletion" != "no" ]; then
if [ -z "$bashcompletionsdir" ] && pkg_check bash-completion ; then
bashcompletionsdir="$($PKGCONFIG --variable=completionsdir bash-completion)"
fi
if [ -n "$bashcompletionsdir" ]; then
bashcompletion="yes"
echo 'install: install-bashcompletion' >> config.mak
echo "BASHCOMPLETIONSDIR=$bashcompletionsdir" >> config.mak
else
bashcompletion="no"
fi
fi
cat > x264.pc << EOF
prefix=$prefix
exec_prefix=$exec_prefix
......@@ -1585,30 +1617,31 @@ filters="crop select_every"
[ $swscale = yes ] && filters="resize $filters"
cat > conftest.log <<EOF
platform: $ARCH
byte order: $CPU_ENDIAN
system: $SYS
cli: $cli
libx264: $cli_libx264
shared: $shared
static: $static
asm: $asm
interlaced: $interlaced
avs: $avs
lavf: $lavf
ffms: $ffms
mp4: $mp4
gpl: $gpl
thread: $thread
opencl: $opencl
filters: $filters
lto: $lto
debug: $debug
gprof: $gprof
strip: $strip
PIC: $pic
bit depth: $bit_depth
chroma format: $chroma_format
platform: $ARCH
byte order: $CPU_ENDIAN
system: $SYS
cli: $cli
libx264: $cli_libx264
shared: $shared
static: $static
bashcompletion: $bashcompletion
asm: $asm
interlaced: $interlaced
avs: $avs
lavf: $lavf
ffms: $ffms
mp4: $mp4
gpl: $gpl
thread: $thread
opencl: $opencl
filters: $filters
lto: $lto
debug: $debug
gprof: $gprof
strip: $strip
PIC: $pic
bit depth: $bit_depth
chroma format: $chroma_format
EOF
echo >> config.log
......
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