LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 02-01-2018, 09:03 AM   #1
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Rep: Reputation: 12
jhalfs libvpx-1.6.1


Hi

I have been trying to build libvpx-1.6.1 from Beyond Linux® From Scratch Version 8.1
using jhalfs but get the error as below:


Code:
 [++++-make: *** [Makefile:836: 052-z-libvpx] Error 2         ] 0 min. 4 sec
 .......
     [CC] vpx_mem/vpx_mem.c.o
     In file included from ../vpx_mem/vpx_mem.c:11:0:
     ../vpx_mem/vpx_mem.h:14:10: fatal error: vpx_config.h: No such file or directory
      #include "vpx_config.h"
                ^~~~~~~~~~~~~~
                compilation terminated.
                make[2]: *** [Makefile:150: vpx_mem/vpx_mem.c.o] Error 1
                make[2]: *** Waiting for unfinished jobs....
                ../vpx/src/vpx_encoder.c:17:10: fatal error: vpx_config.h: No such file or directory
                 #include "vpx_config.h"
                           ^~~~~~~~~~~~~~
                           compilation terminated.
                           make[2]: *** [Makefile:150: vpx/src/vpx_encoder.c.o] Error 1
                           In file included from ../vpx/src/vpx_image.c:16:0:
                           ../vpx_mem/vpx_mem.h:14:10: fatal error: vpx_config.h: No such file or directory
                            #include "vpx_config.h"
                                      ^~~~~~~~~~~~~~
                                      compilation terminated.
                                      make[2]: *** [Makefile:150: vpx/src/vpx_image.c.o] Error 1
                                      ../vpx/src/vpx_codec.c:19:10: fatal error: vpx_version.h: No such file or directory
                                       #include "vpx_version.h"
                                                 ^~~~~~~~~~~~~~~
                                                 compilation terminated.
                                                 make[2]: *** [Makefile:150: vpx/src/vpx_codec.c.o] Error 1
                                                 make[1]: *** [Makefile:17: .DEFAULT] Error 2
                                                 make[1]: Leaving directory '/sources/libvpx/libvpx-1.6.1/libvpx-build'

..............................

This is a known bug https://bugzilla.redhat.com/show_bug.cgi?id=978415

A Workaround exists: which is to create an empty file with touch vpx_config.h

Newer versions do not have this file included anymore. But but this version demands it.

After trying for quite some and getting the same error I decicded to build libvpx-1.7.0 from 'blfs Version 2018-01-31'. This built sucessfully.

But when I return to jhalfs starting from 'blfs_root make' to continue the the build for 'Introduction to KDE' {which depends on libvpx} It still wants to build libvpx-1.6.1.

Any suggestions on how to resolve this.

percy
 
Old 02-01-2018, 11:55 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The Debian 10 source "libvpx_1.6.1.orig.tar.gz" seems to be OK
http://cdn-fastly.deb.debian.org/deb....1.orig.tar.gz

No errors, $ ./configure && make ( gcc, g++ version 7.3.0 ).

Requirements : nasm, yasm ( I don't know which one is actually used.)

-
 
1 members found this post helpful.
Old 02-02-2018, 03:42 AM   #3
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
EDIT:
I just looked at the libvpx source (1.6.1).

vpx_config is generated in the main source dir by the configure script. If the configure script fails or you do not run the configure script, then vpx_config.h will not exist, and as such, the build will fail.

Did you run ./configure before make? If so paste output of it.

Last edited by Syndacate; 02-02-2018 at 03:49 AM.
 
2 members found this post helpful.
Old 02-02-2018, 08:31 AM   #4
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Thanks for your prompt replies on this. This is what I have done using jhalfs.
........................................
cd /home/user/blfs_root
Code:
make  {select app to install}[*] Multimedia[*] Multimedia Libraries and Drivers[*] libvpx 1.6.1
exit
cd /home/user/blfs_root/work
../gen-makefile.sh
This produced /blfs_root/scripts/002-z-libvpx

Code:
#!/bin/bash
set -e

PKG_DIR=libvpx
SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
mkdir -p $SRC_DIR
mkdir -p $BUILD_DIR

cd $SRC_DIR

PACKAGE=libvpx-1.6.1.tar.bz2
if [[ ! -f $PACKAGE ]] ; then
if [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then
cp $SRC_ARCHIVE/$PACKAGE $PACKAGE
else
wget -T 30 -t 5 http://storage.googleapis.com/downlo...-1.6.1.tar.bz2 ||
wget -T 30 -t 5 ${FTP_SERVER}svn/l/$PACKAGE
fi
fi
echo "a19518c8111fa93bdabdd85259162611  $PACKAGE" | md5sum -c -
cd $BUILD_DIR
find . -maxdepth 1 -mindepth 1 -type d | xargs sudo rm -rf
case $PACKAGE in
*.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
tar -xvf $SRC_DIR/$PACKAGE > unpacked
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
;;
*.tar.lz)
bsdtar -xvf $SRC_DIR/$PACKAGE 2> unpacked
UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
;;
*.zip)
zipinfo -1 $SRC_DIR/$PACKAGE > unpacked
UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
if test $(wc -w <<< $UNPACKDIR) -eq 1; then
unzip $SRC_DIR/$PACKAGE
else
UNPACKDIR=${PACKAGE%.zip}
unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
fi
;;
*)
UNPACKDIR=$PKG_DIR-build
mkdir $UNPACKDIR
cp $SRC_DIR/$PACKAGE $UNPACKDIR
cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
;;
esac
cd $UNPACKDIR
sed -i 's/cp -p/cp/' build/make/Makefile &&
mkdir libvpx-build            &&
cd    libvpx-build            &&
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
              make

sudo -E sh << ROOT_EOF
make -j1 install
ROOT_EOF
sudo /sbin/ldconfig

cd $BUILD_DIR
[[ -n "$KEEP_FILES" ]] || sudo rm -rf $UNPACKDIR unpacked

exit
sudo make produces

Code:
Building target 002-z-libvpx

  [+ ++++++/make: *** [Makefile:36: 002-z-libvpx] Error 2      ] 0 min. 8 sec
cd logs

Code:
 002-z-libvpx

libvpx-1.6.1.tar.bz2: OK
enabling shared
disabling static
enabling vp8_encoder
enabling vp8_decoder
enabling vp9_encoder
enabling vp9_decoder
Configuring for target 'x86_64-linux-gcc'
enabling x86_64
enabling pic
enabling runtime_cpu_detect
enabling mmx
enabling sse
enabling sse2
enabling sse3
enabling ssse3
enabling sse4_1
enabling avx
enabling avx2
using yasm
enabling postproc
enabling unit_tests
enabling webm_io
enabling libyuv
Creating makefiles for x86_64-linux-gcc libs
Creating makefiles for x86_64-linux-gcc examples
Creating makefiles for x86_64-linux-gcc tools
Creating makefiles for x86_64-linux-gcc docs
make[1]: Entering directory '/sources/libvpx/libvpx-1.6.1/libvpx-build'
[CREATE] vpx_scale_rtcd.h
[CREATE] vpx_dsp_rtcd.h
[CREATE] vp8_rtcd.h
[CREATE] vp9_rtcd.h
[DEP] test/vp9_skip_loopfilter_test.cc.d
[DEP] test/vp9_lossless_test.cc.d
[DEP] test/vp9_frame_parallel_test.cc.d
[DEP] test/y4m_test.cc.d
[DEP] test/vp9_ethread_test.cc.d
In file included from ../test/vp9_skip_loopfilter_test.cc:13:0:
../test/codec_factory.h:13:10: fatal error: ./vpx_config.h: No such file or directory
#include "./vpx_config.h"
     ^~~~~~~~~~~~~~~~
compilation terminated.
[DEP] test/vp9_end_to_end_test.cc.d
../test/vp9_frame_parallel_test.cc:15:10: fatal error: ./vpx_config.h: No such file or directory
#include "./vpx_config.h"
     ^~~~~~~~~~~~~~~~
compilation terminated.
[DEP] test/user_priv_test.cc.d
In file included from ../test/vp9_end_to_end_test.cc:13:0:
../test/codec_factory.h:13:10: fatal error: ./vpx_config.h: No such file or directory
#include "./vpx_config.h"
     ^~~~~~~~~~~~~~~~
../test/y4m_test.cc:15:10: fatal error: ./vpx_config.h: No such file or directory
In file included from ../test/vp9_ethread_test.cc:14:0:
../test/codec_factory.h:13:10: fatal error: ./vpx_config.h: No such file or directory
 #include "./vpx_config.h"
      ^~~~~~~~~~~~~~~~
../test/vp9_lossless_test.cc:13:10: fatal error: ./vpx_config.h: No such file or directory
   #include "./vpx_config.h"
        ^~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
compilation terminated.
compilation terminated.
compilation terminated.
.
.
.
 
Old 02-02-2018, 10:32 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #4.
Quote:
This is what I have done ..
Well, then please read posts #2, #3 :
Plain ./configure is required to get a usable Makefile. Else no "vpx_config.h" !
I.e.
Code:
./configure --prefix=/usr --enable-shared --disable-static
  enabling shared
  disabling static
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'x86_64-linux-gcc'
  enabling x86_64
  enabling pic
  enabling runtime_cpu_detect
  enabling mmx
  enabling sse
  enabling sse2
  enabling sse3
  enabling ssse3
  enabling sse4_1
  enabling avx
  enabling avx2
  using yasm
  enabling postproc
  enabling unit_tests
  enabling webm_io
  enabling libyuv
Creating makefiles for x86_64-linux-gcc libs
Creating makefiles for x86_64-linux-gcc examples
Creating makefiles for x86_64-linux-gcc tools
Creating makefiles for x86_64-linux-gcc docs
 
2 members found this post helpful.
Old 02-02-2018, 03:02 PM   #6
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
Quote:
Originally Posted by knudfl View Post
Re #4.

Well, then please read posts #2, #3 :
Plain ./configure is required to get a usable Makefile. Else no "vpx_config.h" !
^ This

Quote:
Originally Posted by knudfl View Post
I.e.
Code:
./configure --prefix=/usr --enable-shared --disable-static
or even just this:
Code:
./configure
The point is you NEED to run configure for build to work. ./configure creates the vpx_config.h file.

Last edited by Syndacate; 02-02-2018 at 03:03 PM.
 
1 members found this post helpful.
Old 02-03-2018, 08:19 AM   #7
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Makefiles as requested.

Code:
./configure


##
##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
##  Use of this source code is governed by a BSD-style license
##  that can be found in the LICENSE file in the root of the source
##  tree. An additional intellectual property rights grant can be found
##  in the file PATENTS.  All contributing project authors may
##  be found in the AUTHORS file in the root of the source tree.
##


include config.mk
quiet?=true
ifeq ($(target),)
# If a target wasn't specified, invoke for all enabled targets.
.DEFAULT:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;

# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
# installed on cygwin, so we need to autodetect here.
md5sum := $(firstword $(wildcard \
          $(foreach e,md5sum openssl,\
          $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
          ))
md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))

TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
dist:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
        # Run configure for the user with the current toolchain.
	@if [ -d "$(DIST_DIR)/src" ]; then \
            mkdir -p "$(DIST_DIR)/build"; \
            cd "$(DIST_DIR)/build"; \
            echo "Rerunning configure $(CONFIGURE_ARGS)"; \
            ../src/configure $(CONFIGURE_ARGS); \
            $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
        fi
	@if [ -d "$(DIST_DIR)" ]; then \
            echo "    [MD5SUM] $(DIST_DIR)"; \
	    cd $(DIST_DIR) && \
	    $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
                | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
                > md5sums.txt;\
        fi
endif

# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
DIST_DIR?=dist
HOSTCC?=gcc
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
quiet:=$(if $(or $(verbose), $(V)),, yes)
qexec=$(if $(quiet),@)

# Cancel built-in implicit rules
%: %.o
%.asm:
%.a:
%: %.cc

#
# Common rules"
#
.PHONY: all
all:

.PHONY: clean
clean::
	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.S.o=.asm.S)
	rm -f $(CLEAN-OBJS)

.PHONY: clean
distclean: clean
	if [ -z "$(target)" ]; then \
      rm -f Makefile; \
      rm -f config.log config.mk; \
      rm -f vpx_config.[hc] vpx_config.asm; \
    else \
      rm -f $(target)-$(TOOLCHAIN).mk; \
    fi

.PHONY: dist
dist:
.PHONY: exampletest
exampletest:
.PHONY: install
install::
.PHONY: test
test::
.PHONY: testdata
testdata::
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:

# Force to realign stack always on OS/2
ifeq ($(TOOLCHAIN), x86-os2-gcc)
CFLAGS += -mstackrealign
endif

$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2

$(BUILD_PFX)%.c.d: %.c
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.c.o: %.c
	$(if $(quiet),@echo "    [CC] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cc.d: %.cc
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cc.o: %.cc
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cpp.d: %.cpp
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cpp.o: %.cpp
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.asm.d: %.asm
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.asm.o: %.asm
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

$(BUILD_PFX)%.S.d: %.S
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.S.o: %.S
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

.PRECIOUS: %.c.S
%.c.S: CFLAGS += -DINLINE_ASM
$(BUILD_PFX)%.c.S: %.c
	$(if $(quiet),@echo "    [GEN] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) -S $(CFLAGS) -o $@ $<

.PRECIOUS: %.asm.S
$(BUILD_PFX)%.asm.S: %.asm
	$(if $(quiet),@echo "    [ASM CONVERSION] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(ASM_CONVERSION) <$< >$@

# If we're in debug mode, pretend we don't have GNU strip, to fall back to
# the copy implementation
HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
ifeq ($(HAVE_GNU_STRIP),yes)
# Older binutils strip global symbols not needed for relocation processing
# when given --strip-unneeded. Using nm and awk to identify globals and
# keep them caused command line length issues under mingw and segfaults in
# test_libvpx were observed under OS/2: simply use --strip-debug.
%.a: %_g.a
	$(if $(quiet),@echo "    [STRIP] $@ < $<")
	$(qexec)$(STRIP) --strip-debug \
          -o $@ $<
else
%.a: %_g.a
	$(if $(quiet),@echo "    [CP] $@ < $<")
	$(qexec)cp $< $@
endif

#
# Utility functions
#
pairmap=$(if $(strip $(2)),\
    $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
    $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
)

enabled=$(filter-out $($(1)-no),$($(1)-yes))
cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))

find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o
objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))

install_map_templates=$(eval $(call install_map_template,$(1),$(2)))

not=$(subst yes,no,$(1))

ifeq ($(CONFIG_MSVS),yes)
lib_file_name=$(1).lib
else
lib_file_name=lib$(1).a
endif
#
# Rule Templates
#
define linker_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
define linkerxx_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
# make-3.80 has a bug with expanding large input strings to the eval function,
# which was triggered in some cases by the following component of
# linker_template:
#   $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
#                           $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
# This may be useful to revisit in the future (it tries to locate libraries
# in a search path and add them as prerequisites

define install_map_template
$(DIST_DIR)/$(1): $(2)
	$(if $(quiet),@echo "    [INSTALL] $$@")
	$(qexec)mkdir -p $$(dir $$@)
	$(qexec)cp -p $$< $$@
endef

define archive_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [AR] $$@")
	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef

define so_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
#
# This needs further abstraction for dealing with non-GNU linkers.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -shared $$(LDFLAGS) \
            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
            -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
            $$(filter %.o,$$^) $$(extralibs)
endef

define dl_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
	    -exported_symbols_list $$(EXPORTS_FILE) \
        -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs)
endef

define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef


#
# Get current configuration
#
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif

skip_deps := $(filter %clean,$(MAKECMDGOALS))
skip_deps += $(findstring testdata,$(MAKECMDGOALS))
ifeq ($(strip $(skip_deps)),)
  ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
    # Older versions of make don't like -include directives with no arguments
    ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
      -include $(filter %.d,$(OBJS-yes:.o=.d))
    endif
  endif
endif

#
# Configuration dependent rules
#
$(call pairmap,install_map_templates,$(INSTALL_MAPS))

DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
.docs: $(DOCS)
	@touch $@

INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
endif
.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
	@touch $@

clean::
	rm -f .docs .install-docs $(DOCS)

BINS=$(call enabled,BINS)
.bins: $(BINS)
	@touch $@

INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
endif
.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
	@touch $@

clean::
	rm -f .bins .install-bins $(BINS)

LIBS=$(call enabled,LIBS)
.libs: $(LIBS)
	@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))

INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
endif
.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
	@touch $@

clean::
	rm -f .libs .install-libs $(LIBS)

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
PROJECTS=$(call enabled,PROJECTS)
.projects: $(PROJECTS)
	@touch $@

INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
endif
.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
	@touch $@

clean::
	rm -f .projects .install-projects $(PROJECTS)
endif

# If there are any source files to be distributed, then include the build
# system too.
ifneq ($(call enabled,DIST-SRCS),)
    DIST-SRCS-yes            += configure
    DIST-SRCS-yes            += build/make/configure.sh
    DIST-SRCS-yes            += build/make/gen_asm_deps.sh
    DIST-SRCS-yes            += build/make/Makefile
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_def.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_sln.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_vcxproj.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/msvs_common.sh
    DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas_apple.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2armasm_ms.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/thumb.pm
    DIST-SRCS-yes            += $(target:-$(TOOLCHAIN)=).mk
endif
INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
endif
.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
	@touch $@

clean::
	rm -f .install-srcs

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
    BUILD_TARGETS += .projects
    INSTALL_TARGETS += .install-projects
endif
BUILD_TARGETS += .docs .libs .bins
INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::

.SUFFIXES:  # Delete default suffix rules

Code:
./configure --prefix=/usr --enable-shared --disable-static


##
##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
##  Use of this source code is governed by a BSD-style license
##  that can be found in the LICENSE file in the root of the source
##  tree. An additional intellectual property rights grant can be found
##  in the file PATENTS.  All contributing project authors may
##  be found in the AUTHORS file in the root of the source tree.
##


include config.mk
quiet?=true
ifeq ($(target),)
# If a target wasn't specified, invoke for all enabled targets.
.DEFAULT:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;

# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
# installed on cygwin, so we need to autodetect here.
md5sum := $(firstword $(wildcard \
          $(foreach e,md5sum openssl,\
          $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
          ))
md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))

TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
dist:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
        # Run configure for the user with the current toolchain.
	@if [ -d "$(DIST_DIR)/src" ]; then \
            mkdir -p "$(DIST_DIR)/build"; \
            cd "$(DIST_DIR)/build"; \
            echo "Rerunning configure $(CONFIGURE_ARGS)"; \
            ../src/configure $(CONFIGURE_ARGS); \
            $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
        fi
	@if [ -d "$(DIST_DIR)" ]; then \
            echo "    [MD5SUM] $(DIST_DIR)"; \
	    cd $(DIST_DIR) && \
	    $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
                | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
                > md5sums.txt;\
        fi
endif

# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
DIST_DIR?=dist
HOSTCC?=gcc
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
quiet:=$(if $(or $(verbose), $(V)),, yes)
qexec=$(if $(quiet),@)

# Cancel built-in implicit rules
%: %.o
%.asm:
%.a:
%: %.cc

#
# Common rules"
#
.PHONY: all
all:

.PHONY: clean
clean::
	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.S.o=.asm.S)
	rm -f $(CLEAN-OBJS)

.PHONY: clean
distclean: clean
	if [ -z "$(target)" ]; then \
      rm -f Makefile; \
      rm -f config.log config.mk; \
      rm -f vpx_config.[hc] vpx_config.asm; \
    else \
      rm -f $(target)-$(TOOLCHAIN).mk; \
    fi

.PHONY: dist
dist:
.PHONY: exampletest
exampletest:
.PHONY: install
install::
.PHONY: test
test::
.PHONY: testdata
testdata::
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:

# Force to realign stack always on OS/2
ifeq ($(TOOLCHAIN), x86-os2-gcc)
CFLAGS += -mstackrealign
endif

$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2

$(BUILD_PFX)%.c.d: %.c
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.c.o: %.c
	$(if $(quiet),@echo "    [CC] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cc.d: %.cc
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cc.o: %.cc
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cpp.d: %.cpp
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cpp.o: %.cpp
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.asm.d: %.asm
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.asm.o: %.asm
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

$(BUILD_PFX)%.S.d: %.S
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.S.o: %.S
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

.PRECIOUS: %.c.S
%.c.S: CFLAGS += -DINLINE_ASM
$(BUILD_PFX)%.c.S: %.c
	$(if $(quiet),@echo "    [GEN] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) -S $(CFLAGS) -o $@ $<

.PRECIOUS: %.asm.S
$(BUILD_PFX)%.asm.S: %.asm
	$(if $(quiet),@echo "    [ASM CONVERSION] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(ASM_CONVERSION) <$< >$@

# If we're in debug mode, pretend we don't have GNU strip, to fall back to
# the copy implementation
HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
ifeq ($(HAVE_GNU_STRIP),yes)
# Older binutils strip global symbols not needed for relocation processing
# when given --strip-unneeded. Using nm and awk to identify globals and
# keep them caused command line length issues under mingw and segfaults in
# test_libvpx were observed under OS/2: simply use --strip-debug.
%.a: %_g.a
	$(if $(quiet),@echo "    [STRIP] $@ < $<")
	$(qexec)$(STRIP) --strip-debug \
          -o $@ $<
else
%.a: %_g.a
	$(if $(quiet),@echo "    [CP] $@ < $<")
	$(qexec)cp $< $@
endif

#
# Utility functions
#
pairmap=$(if $(strip $(2)),\
    $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
    $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
)

enabled=$(filter-out $($(1)-no),$($(1)-yes))
cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))

find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o
objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))

install_map_templates=$(eval $(call install_map_template,$(1),$(2)))

not=$(subst yes,no,$(1))

ifeq ($(CONFIG_MSVS),yes)
lib_file_name=$(1).lib
else
lib_file_name=lib$(1).a
endif
#
# Rule Templates
#
define linker_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
define linkerxx_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
# make-3.80 has a bug with expanding large input strings to the eval function,
# which was triggered in some cases by the following component of
# linker_template:
#   $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
#                           $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
# This may be useful to revisit in the future (it tries to locate libraries
# in a search path and add them as prerequisites

define install_map_template
$(DIST_DIR)/$(1): $(2)
	$(if $(quiet),@echo "    [INSTALL] $$@")
	$(qexec)mkdir -p $$(dir $$@)
	$(qexec)cp -p $$< $$@
endef

define archive_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [AR] $$@")
	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef

define so_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
#
# This needs further abstraction for dealing with non-GNU linkers.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -shared $$(LDFLAGS) \
            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
            -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
            $$(filter %.o,$$^) $$(extralibs)
endef

define dl_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
	    -exported_symbols_list $$(EXPORTS_FILE) \
        -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs)
endef

define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef


#
# Get current configuration
#
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif

skip_deps := $(filter %clean,$(MAKECMDGOALS))
skip_deps += $(findstring testdata,$(MAKECMDGOALS))
ifeq ($(strip $(skip_deps)),)
  ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
    # Older versions of make don't like -include directives with no arguments
    ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
      -include $(filter %.d,$(OBJS-yes:.o=.d))
    endif
  endif
endif

#
# Configuration dependent rules
#
$(call pairmap,install_map_templates,$(INSTALL_MAPS))

DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
.docs: $(DOCS)
	@touch $@

INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
endif
.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
	@touch $@

clean::
	rm -f .docs .install-docs $(DOCS)

BINS=$(call enabled,BINS)
.bins: $(BINS)
	@touch $@

INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
endif
.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
	@touch $@

clean::
	rm -f .bins .install-bins $(BINS)

LIBS=$(call enabled,LIBS)
.libs: $(LIBS)
	@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))

INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
endif
.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
	@touch $@

clean::
	rm -f .libs .install-libs $(LIBS)

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
PROJECTS=$(call enabled,PROJECTS)
.projects: $(PROJECTS)
	@touch $@

INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
endif
.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
	@touch $@

clean::
	rm -f .projects .install-projects $(PROJECTS)
endif

# If there are any source files to be distributed, then include the build
# system too.
ifneq ($(call enabled,DIST-SRCS),)
    DIST-SRCS-yes            += configure
    DIST-SRCS-yes            += build/make/configure.sh
    DIST-SRCS-yes            += build/make/gen_asm_deps.sh
    DIST-SRCS-yes            += build/make/Makefile
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_def.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_sln.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_vcxproj.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/msvs_common.sh
    DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas_apple.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2armasm_ms.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/thumb.pm
    DIST-SRCS-yes            += $(target:-$(TOOLCHAIN)=).mk
endif
INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
endif
.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
	@touch $@

clean::
	rm -f .install-srcs

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
    BUILD_TARGETS += .projects
    INSTALL_TARGETS += .install-projects
endif
BUILD_TARGETS += .docs .libs .bins
INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::

.SUFFIXES:  # Delete default suffix rules
 
Old 02-03-2018, 02:56 PM   #8
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
Quote:
Originally Posted by percy_vere_uk View Post
Makefiles as requested.
What configure puts in the Makefile isn't important (it is, but not in this issue). The configure script should put the vpx_config.h file there.

Via I believe this line in the configure script:
Code:
write_common_target_config_h ${BUILD_PFX}vpx_config.h
The configure script shouldn't even run a second time because of this check:
Code:
if [ -f "${source_path}/vpx_config.h" ]; then
    die "source directory already configured; run 'make distclean' there first"
  fi
So after you run ./configure, irrespective of the Makefile, the vpx_config.h file should be in its directory. So you're saying after you run ./configure no vpx_config.h file exists at vpx_mem/include/vpx_config.h ? (check manually)
 
1 members found this post helpful.
Old 02-04-2018, 07:14 AM   #9
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Syndacate

Thank you for your quick reply

I checked both of these manually from the file system

Built from jhalfs

Code:
/sources/libvpx-1.6.1/test/codec_factory.h    {line 13    #include "./vpx_config.h"}
/sources/libvpx-1.6.1/test/                   {vpx_config.h   not present}
Built from book

Code:
sources/libvpx-1.7.0/vpx_mem/include/         {vpx_config.h  not present but this built successfully}

As I said earlier #1

This is a known bug https://bugzilla.redhat.com/show_bug.cgi?id=978415

A Workaround exists: which is to create an empty file with touch vpx_config.h

Newer versions do not have this file included anymore. But but this version demands it.

After trying for quite some time and getting the same error I decided to build libvpx-1.7.0 from book 'blfs Version 2018-01-31'. This built sucessfully.

But when I return to jhalfs starting from:

cd /home/user/blfs_root/work
sudo make

to continue the the build for 'Introduction to KDE' {which depends on libvpx} It still wants to build libvpx-1.6.1.

I tried touch vpx_config.h in /sources/libvpx-1.6.1/test/

Code:
cd /home/user/blfs_root/work
sudo  make
Which produces the following script: But when run it deletes /sources/libvpx-1.6.1/test/vpx_config.h


002-z-libvpx
Code:
#!/bin/bash
set -e

PKG_DIR=libvpx
SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
mkdir -p $SRC_DIR
mkdir -p $BUILD_DIR

cd $SRC_DIR

PACKAGE=libvpx-1.6.1.tar.bz2
if [[ ! -f $PACKAGE ]] ; then
  if [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then
    cp $SRC_ARCHIVE/$PACKAGE $PACKAGE
  else
    wget -T 30 -t 5 http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.6.1.tar.bz2 ||
    wget -T 30 -t 5 ${FTP_SERVER}svn/l/$PACKAGE
  fi
fi
echo "a19518c8111fa93bdabdd85259162611  $PACKAGE" | md5sum -c -


cd $BUILD_DIR
find . -maxdepth 1 -mindepth 1 -type d | xargs sudo rm -rf
case $PACKAGE in
  *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
     tar -xvf $SRC_DIR/$PACKAGE > unpacked
     UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
     ;;
  *.tar.lz)
     bsdtar -xvf $SRC_DIR/$PACKAGE 2> unpacked
     UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
     ;;
  *.zip)
     zipinfo -1 $SRC_DIR/$PACKAGE > unpacked
     UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
     if test $(wc -w <<< $UNPACKDIR) -eq 1; then
       unzip $SRC_DIR/$PACKAGE
     else
       UNPACKDIR=${PACKAGE%.zip}
       unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
     fi
     ;;
  *)
     UNPACKDIR=$PKG_DIR-build
     mkdir $UNPACKDIR
     cp $SRC_DIR/$PACKAGE $UNPACKDIR
     cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
     ;;
esac
cd $UNPACKDIR

sed -i 's/cp -p/cp/' build/make/Makefile &&

mkdir libvpx-build            &&
cd    libvpx-build            &&

../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make
sudo -E sh << ROOT_EOF
make -j1 install
ROOT_EOF
sudo /sbin/ldconfig

cd $BUILD_DIR
[[ -n "$KEEP_FILES" ]] || sudo rm -rf $UNPACKDIR unpacked

exit

Is there a way of adding /sources/libvpx-1.6.1/test/ touch vpx_config.h to this script if so how?
 
Old 02-04-2018, 03:37 PM   #10
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
Quote:
Originally Posted by percy_vere_uk View Post
Syndacate

Thank you for your quick reply

I checked both of these manually from the file system

Built from jhalfs

Code:
/sources/libvpx-1.6.1/test/codec_factory.h    {line 13    #include "./vpx_config.h"}
/sources/libvpx-1.6.1/test/                   {vpx_config.h   not present}
Built from book

Code:
sources/libvpx-1.7.0/vpx_mem/include/         {vpx_config.h  not present but this built successfully}

As I said earlier #1

This is a known bug https://bugzilla.redhat.com/show_bug.cgi?id=978415
I don't think this bug is representing the same problem you are having.

First of all, he was not building VP9 on his own, he was building it as part of some other package, and you don't know the state of the file system at build time, what parameters were provided to configure, what environment vars were designed, or even if the library was modified. Furthermore, that person is relying on the vp9 header that came with redhat, which may or may not be playing nice with the package he's trying to build.

Secondly, even if all of that were the same, it doesn't look like the same issue. Not only his issue when building the decoder, but his is related to environment defines. If his env defines were different, he wouldn't be have this issue. Most of the places vpx_config.h is included are unconditional. It includes them everywhere. In my 1.6.0 source the condition he is talking about (HAVE_CONFIG) simply doesn't exist.

Thirdly, even if you go back to version 1.5.0, the code he's speaking about doesn't exist. Inside vpx/vpx_codec.h , where he's saying the error is, the include for vpx_config.h happens always, irrespective of environment variables. There's no indication of what version he's using so I can't check that.

Quote:
Originally Posted by percy_vere_uk View Post
A Workaround exists: which is to create an empty file with touch vpx_config.h
Yeah, that should resolve it, assuming there's no dependencies it needs in there (which is likely there will be). If so it'll just error out in another place. So what happens when you try that (instructions at bottom)?

Quote:
Originally Posted by percy_vere_uk View Post
Newer versions do not have this file included anymore. But but this version demands it.
That is simply not true. The latest tag is version 1.7.0 and in vpx/vpx_mem.h, where yours is erroring, right there on line 14 is a big fat:
Code:
#include "vpx_config.h"
I literally just copied and pasted that from latest release. So saying new versions don't have this isn't true. As far as I can tell they all use it. My local version (1.6.0) uses it, too.

Looks like I was wrong about where it creates vpx_config.h. I checked my local copy, which is on windows, at the moment. vpx_config.h was generated inside the build directory, at the root level of it. I thought it was the source root. So check there. I'm using 1.6.0.

Quote:
Originally Posted by percy_vere_uk View Post
After trying for quite some time and getting the same error I decided to build libvpx-1.7.0 from book 'blfs Version 2018-01-31'. This built sucessfully.

But when I return to jhalfs starting from:

cd /home/user/blfs_root/work
sudo make

to continue the the build for 'Introduction to KDE' {which depends on libvpx} It still wants to build libvpx-1.6.1.

I tried touch vpx_config.h in /sources/libvpx-1.6.1/test/

Code:
cd /home/user/blfs_root/work
sudo  make
Which produces the following script: But when run it deletes /sources/libvpx-1.6.1/test/vpx_config.h


002-z-libvpx
Code:
#!/bin/bash
set -e

PKG_DIR=libvpx
SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
mkdir -p $SRC_DIR
mkdir -p $BUILD_DIR

cd $SRC_DIR

PACKAGE=libvpx-1.6.1.tar.bz2
if [[ ! -f $PACKAGE ]] ; then
  if [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then
    cp $SRC_ARCHIVE/$PACKAGE $PACKAGE
  else
    wget -T 30 -t 5 http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.6.1.tar.bz2 ||
    wget -T 30 -t 5 ${FTP_SERVER}svn/l/$PACKAGE
  fi
fi
echo "a19518c8111fa93bdabdd85259162611  $PACKAGE" | md5sum -c -


cd $BUILD_DIR
find . -maxdepth 1 -mindepth 1 -type d | xargs sudo rm -rf
case $PACKAGE in
  *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
     tar -xvf $SRC_DIR/$PACKAGE > unpacked
     UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
     ;;
  *.tar.lz)
     bsdtar -xvf $SRC_DIR/$PACKAGE 2> unpacked
     UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
     ;;
  *.zip)
     zipinfo -1 $SRC_DIR/$PACKAGE > unpacked
     UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
     if test $(wc -w <<< $UNPACKDIR) -eq 1; then
       unzip $SRC_DIR/$PACKAGE
     else
       UNPACKDIR=${PACKAGE%.zip}
       unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
     fi
     ;;
  *)
     UNPACKDIR=$PKG_DIR-build
     mkdir $UNPACKDIR
     cp $SRC_DIR/$PACKAGE $UNPACKDIR
     cp $(find . -mindepth 1 -maxdepth 1 -type l) $UNPACKDIR
     ;;
esac
cd $UNPACKDIR

sed -i 's/cp -p/cp/' build/make/Makefile &&

mkdir libvpx-build            &&
cd    libvpx-build            &&

../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make
sudo -E sh << ROOT_EOF
make -j1 install
ROOT_EOF
sudo /sbin/ldconfig

cd $BUILD_DIR
[[ -n "$KEEP_FILES" ]] || sudo rm -rf $UNPACKDIR unpacked

exit
What script is this? (the name) If you're running this script to build, and since the 'make' is after the 'configure', it should definitely exist at build time.

It clears out the build dir, here:
Code:
find . -maxdepth 1 -mindepth 1 -type d | xargs sudo rm -rf
Though later it also should generate a new vpx_config.h file here:
Code:
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make
Quote:
Originally Posted by percy_vere_uk View Post
Is there a way of adding /sources/libvpx-1.6.1/test/ touch vpx_config.h to this script if so how?
If you really want to hack a workaround change this to this:
Code:
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make
Code:
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
touch vpx_config.h            &&
make
Though there's about 1000 defines in there. So while this will fix the exact problem you're having, I'm pretty sure it'll blow up later in the build process with an error along the lines of:
"X not defined"
 
1 members found this post helpful.
Old 02-05-2018, 08:51 AM   #11
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Syndacate

Thanks for all this information. Which I am still working through.

But using this modified configure has made no difference.

Code:
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
touch vpx_config.h            &&
make



Quote:
What script is this? (the name)
blfs_root is the directory created for jhalfs and contains all its files.

002-z-libvpx is the build script created by jhalfs and is produced by:

Code:
$ cd /home/user/blfs_root
$ make  {select app to install}[*] Multimedia[*] Multimedia Libraries and Drivers[*] libvpx 1.6.1
exit  {from the menu}
$ cd /home/user/blfs_root/work
$ ../gen-makefile.sh 
$ sudo  make
 
Old 02-05-2018, 04:37 PM   #12
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
Quote:
Originally Posted by percy_vere_uk View Post
Syndacate

Thanks for all this information. Which I am still working through.

But using this modified configure has made no difference.

Code:
../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
touch vpx_config.h            &&
make
OK

Quote:
Originally Posted by percy_vere_uk View Post
blfs_root is the directory created for jhalfs and contains all its files.

002-z-libvpx is the build script created by jhalfs and is produced by:

Code:
$ cd /home/user/blfs_root
$ make  {select app to install}[*] Multimedia[*] Multimedia Libraries and Drivers[*] libvpx 1.6.1
exit  {from the menu}
$ cd /home/user/blfs_root/work
$ ../gen-makefile.sh 
$ sudo  make
I'm not entirely familiar with blfs, I've done the typical LFS stuff before, but not dived into the 'beyond' portion. When is the 'configure' script being ran? Since that's responsible for generating the missing file, I'm most concerned about that.

This gen-makefile.sh, is this part of LFS? I do not see it in the normal libvpx 1.6.1 repo, but I may be missing it. The configure script is needed to generate that vpx_config.h file, and I don't see it. Also, the makefile for libvpx is already generated, so I'm not entirely sure what gen-makefile.sh is doing.

I feel like 'configure' isn't being ran or at least ran properly.

EDIT:

Ahh nvm. I see what the gen-makefile.sh is doing now and what that script is, OK, so that's a LFS piece.
So what happens when you run 'configure' manually? Just do exactly what the makefile is doing and post the output:
Code:
../configure --prefix=/usr --enable-shared --disable-static
Also, I'm not sure if configure uses your current directory (`pwd`), so maybe also try executing from current directory, ie.:
Code:
cd ..
./configure --prefix=/usr --enable-shared --disable-static
Make sure the 'libvpx-build' directory exists, which configure would generate, I would think.

Last edited by Syndacate; 02-05-2018 at 04:42 PM.
 
1 members found this post helpful.
Old 02-06-2018, 08:43 AM   #13
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Quote:
So what happens when you run 'configure' manually? Just do exactly what the makefile is doing and post the output:
Building directly from blfs 8.1 book {bypassing jhalfs}

The build instructions are:

Installation of libvpx

Install libvpx by running the following commands:

Code:
sed -i 's/cp -p/cp/' build/make/Makefile &&

mkdir libvpx-build            &&
cd    libvpx-build            &&

../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make

This package does not come with a test suite.

Now, as the root user:

make install
libvpx-1.6.1 builds successfully

I also built gst-plugins-good-1.12.2 from book which depends on libvpx-1.6.1 and is the next build script in the jhalfs list. This builds successfully as well. I do not see why jhalfs is wanting to build libvpx. I assume that re-building the blfs_root directory means that it will see that libvpx-1.6.1 is already built.

Returning to jhalfs having now re-built jhalfs blfs_root directory for a clean start.


Code:
cd /home/graham/blfs_root
make  {select app to install}     KDE  --->  Introduction to KDE  --->  *selected all
exit
cd /home/graham/blfs_root/work
../gen-makefile.sh
sudo  make
Part error log as there are many references to missing ./vpx_config.h :

Code:
In file included from ../test/vp9_skip_loopfilter_test.cc:13:0:
../test/codec_factory.h:13:10: fatal error: ./vpx_config.h: No such file or directory
 #include "./vpx_config.h"
            ^~~~~~~~~~~~~~~~
I have used this standard format for jhalfs builds many times before and never experienced a problem other than minor script changes.


/sources/libvpx-1.6.1/libvpx-build/Makefile As built from book

Code:
##
##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
##  Use of this source code is governed by a BSD-style license
##  that can be found in the LICENSE file in the root of the source
##  tree. An additional intellectual property rights grant can be found
##  in the file PATENTS.  All contributing project authors may
##  be found in the AUTHORS file in the root of the source tree.
##


include config.mk
quiet?=true
ifeq ($(target),)
# If a target wasn't specified, invoke for all enabled targets.
.DEFAULT:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;

# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
# installed on cygwin, so we need to autodetect here.
md5sum := $(firstword $(wildcard \
          $(foreach e,md5sum openssl,\
          $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
          ))
md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))

TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
dist:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
        # Run configure for the user with the current toolchain.
	@if [ -d "$(DIST_DIR)/src" ]; then \
            mkdir -p "$(DIST_DIR)/build"; \
            cd "$(DIST_DIR)/build"; \
            echo "Rerunning configure $(CONFIGURE_ARGS)"; \
            ../src/configure $(CONFIGURE_ARGS); \
            $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
        fi
	@if [ -d "$(DIST_DIR)" ]; then \
            echo "    [MD5SUM] $(DIST_DIR)"; \
	    cd $(DIST_DIR) && \
	    $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
                | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
                > md5sums.txt;\
        fi
endif

# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
DIST_DIR?=dist
HOSTCC?=gcc
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
quiet:=$(if $(or $(verbose), $(V)),, yes)
qexec=$(if $(quiet),@)

# Cancel built-in implicit rules
%: %.o
%.asm:
%.a:
%: %.cc

#
# Common rules"
#
.PHONY: all
all:

.PHONY: clean
clean::
	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.S.o=.asm.S)
	rm -f $(CLEAN-OBJS)

.PHONY: clean
distclean: clean
	if [ -z "$(target)" ]; then \
      rm -f Makefile; \
      rm -f config.log config.mk; \
      rm -f vpx_config.[hc] vpx_config.asm; \
    else \
      rm -f $(target)-$(TOOLCHAIN).mk; \
    fi

.PHONY: dist
dist:
.PHONY: exampletest
exampletest:
.PHONY: install
install::
.PHONY: test
test::
.PHONY: testdata
testdata::
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:

# Force to realign stack always on OS/2
ifeq ($(TOOLCHAIN), x86-os2-gcc)
CFLAGS += -mstackrealign
endif

$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2

$(BUILD_PFX)%.c.d: %.c
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.c.o: %.c
	$(if $(quiet),@echo "    [CC] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cc.d: %.cc
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cc.o: %.cc
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cpp.d: %.cpp
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cpp.o: %.cpp
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.asm.d: %.asm
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.asm.o: %.asm
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

$(BUILD_PFX)%.S.d: %.S
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.S.o: %.S
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

.PRECIOUS: %.c.S
%.c.S: CFLAGS += -DINLINE_ASM
$(BUILD_PFX)%.c.S: %.c
	$(if $(quiet),@echo "    [GEN] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) -S $(CFLAGS) -o $@ $<

.PRECIOUS: %.asm.S
$(BUILD_PFX)%.asm.S: %.asm
	$(if $(quiet),@echo "    [ASM CONVERSION] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(ASM_CONVERSION) <$< >$@

# If we're in debug mode, pretend we don't have GNU strip, to fall back to
# the copy implementation
HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
ifeq ($(HAVE_GNU_STRIP),yes)
# Older binutils strip global symbols not needed for relocation processing
# when given --strip-unneeded. Using nm and awk to identify globals and
# keep them caused command line length issues under mingw and segfaults in
# test_libvpx were observed under OS/2: simply use --strip-debug.
%.a: %_g.a
	$(if $(quiet),@echo "    [STRIP] $@ < $<")
	$(qexec)$(STRIP) --strip-debug \
          -o $@ $<
else
%.a: %_g.a
	$(if $(quiet),@echo "    [CP] $@ < $<")
	$(qexec)cp $< $@
endif

#
# Utility functions
#
pairmap=$(if $(strip $(2)),\
    $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
    $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
)

enabled=$(filter-out $($(1)-no),$($(1)-yes))
cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))

find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o
objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))

install_map_templates=$(eval $(call install_map_template,$(1),$(2)))

not=$(subst yes,no,$(1))

ifeq ($(CONFIG_MSVS),yes)
lib_file_name=$(1).lib
else
lib_file_name=lib$(1).a
endif
#
# Rule Templates
#
define linker_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
define linkerxx_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
# make-3.80 has a bug with expanding large input strings to the eval function,
# which was triggered in some cases by the following component of
# linker_template:
#   $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
#                           $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
# This may be useful to revisit in the future (it tries to locate libraries
# in a search path and add them as prerequisites

define install_map_template
$(DIST_DIR)/$(1): $(2)
	$(if $(quiet),@echo "    [INSTALL] $$@")
	$(qexec)mkdir -p $$(dir $$@)
	$(qexec)cp $$< $$@
endef

define archive_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [AR] $$@")
	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef

define so_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
#
# This needs further abstraction for dealing with non-GNU linkers.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -shared $$(LDFLAGS) \
            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
            -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
            $$(filter %.o,$$^) $$(extralibs)
endef

define dl_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
	    -exported_symbols_list $$(EXPORTS_FILE) \
        -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs)
endef

define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef


#
# Get current configuration
#
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif

skip_deps := $(filter %clean,$(MAKECMDGOALS))
skip_deps += $(findstring testdata,$(MAKECMDGOALS))
ifeq ($(strip $(skip_deps)),)
  ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
    # Older versions of make don't like -include directives with no arguments
    ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
      -include $(filter %.d,$(OBJS-yes:.o=.d))
    endif
  endif
endif

#
# Configuration dependent rules
#
$(call pairmap,install_map_templates,$(INSTALL_MAPS))

DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
.docs: $(DOCS)
	@touch $@

INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
endif
.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
	@touch $@

clean::
	rm -f .docs .install-docs $(DOCS)

BINS=$(call enabled,BINS)
.bins: $(BINS)
	@touch $@

INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
endif
.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
	@touch $@

clean::
	rm -f .bins .install-bins $(BINS)

LIBS=$(call enabled,LIBS)
.libs: $(LIBS)
	@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))

INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
endif
.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
	@touch $@

clean::
	rm -f .libs .install-libs $(LIBS)

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
PROJECTS=$(call enabled,PROJECTS)
.projects: $(PROJECTS)
	@touch $@

INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
endif
.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
	@touch $@

clean::
	rm -f .projects .install-projects $(PROJECTS)
endif

# If there are any source files to be distributed, then include the build
# system too.
ifneq ($(call enabled,DIST-SRCS),)
    DIST-SRCS-yes            += configure
    DIST-SRCS-yes            += build/make/configure.sh
    DIST-SRCS-yes            += build/make/gen_asm_deps.sh
    DIST-SRCS-yes            += build/make/Makefile
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_def.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_sln.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_vcxproj.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/msvs_common.sh
    DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas_apple.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2armasm_ms.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/thumb.pm
    DIST-SRCS-yes            += $(target:-$(TOOLCHAIN)=).mk
endif
INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
endif
.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
	@touch $@

clean::
	rm -f .install-srcs

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
    BUILD_TARGETS += .projects
    INSTALL_TARGETS += .install-projects
endif
BUILD_TARGETS += .docs .libs .bins
INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::

.SUFFIXES:  # Delete default suffix rules
 
Old 02-07-2018, 03:49 AM   #14
Syndacate
Member
 
Registered: Aug 2008
Location: Santa Clara, CA
Distribution: Ubuntu, mainly. Too much stuff works out of the box O.o
Posts: 71

Rep: Reputation: 52
Quote:
Originally Posted by percy_vere_uk View Post
Building directly from blfs 8.1 book {bypassing jhalfs}

The build instructions are:

Installation of libvpx

Install libvpx by running the following commands:

Code:
sed -i 's/cp -p/cp/' build/make/Makefile &&

mkdir libvpx-build            &&
cd    libvpx-build            &&

../configure --prefix=/usr    \
             --enable-shared  \
             --disable-static &&
make

This package does not come with a test suite.

Now, as the root user:

make install
libvpx-1.6.1 builds successfully

I also built gst-plugins-good-1.12.2 from book which depends on libvpx-1.6.1 and is the next build script in the jhalfs list. This builds successfully as well. I do not see why jhalfs is wanting to build libvpx. I assume that re-building the blfs_root directory means that it will see that libvpx-1.6.1 is already built.

Returning to jhalfs having now re-built jhalfs blfs_root directory for a clean start.


Code:
cd /home/graham/blfs_root
make  {select app to install}     KDE  --->  Introduction to KDE  --->  *selected all
exit
cd /home/graham/blfs_root/work
../gen-makefile.sh
sudo  make
Part error log as there are many references to missing ./vpx_config.h :

Code:
In file included from ../test/vp9_skip_loopfilter_test.cc:13:0:
../test/codec_factory.h:13:10: fatal error: ./vpx_config.h: No such file or directory
 #include "./vpx_config.h"
            ^~~~~~~~~~~~~~~~
I have used this standard format for jhalfs builds many times before and never experienced a problem other than minor script changes.


/sources/libvpx-1.6.1/libvpx-build/Makefile As built from book

Code:
##
##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
##  Use of this source code is governed by a BSD-style license
##  that can be found in the LICENSE file in the root of the source
##  tree. An additional intellectual property rights grant can be found
##  in the file PATENTS.  All contributing project authors may
##  be found in the AUTHORS file in the root of the source tree.
##


include config.mk
quiet?=true
ifeq ($(target),)
# If a target wasn't specified, invoke for all enabled targets.
.DEFAULT:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;

# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
# installed on cygwin, so we need to autodetect here.
md5sum := $(firstword $(wildcard \
          $(foreach e,md5sum openssl,\
          $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
          ))
md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))

TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
dist:
	@for t in $(ALL_TARGETS); do \
	     $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
        done
        # Run configure for the user with the current toolchain.
	@if [ -d "$(DIST_DIR)/src" ]; then \
            mkdir -p "$(DIST_DIR)/build"; \
            cd "$(DIST_DIR)/build"; \
            echo "Rerunning configure $(CONFIGURE_ARGS)"; \
            ../src/configure $(CONFIGURE_ARGS); \
            $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
        fi
	@if [ -d "$(DIST_DIR)" ]; then \
            echo "    [MD5SUM] $(DIST_DIR)"; \
	    cd $(DIST_DIR) && \
	    $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
                | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2  \1/' \
                > md5sums.txt;\
        fi
endif

# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
DIST_DIR?=dist
HOSTCC?=gcc
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
quiet:=$(if $(or $(verbose), $(V)),, yes)
qexec=$(if $(quiet),@)

# Cancel built-in implicit rules
%: %.o
%.asm:
%.a:
%: %.cc

#
# Common rules"
#
.PHONY: all
all:

.PHONY: clean
clean::
	rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.S.o=.asm.S)
	rm -f $(CLEAN-OBJS)

.PHONY: clean
distclean: clean
	if [ -z "$(target)" ]; then \
      rm -f Makefile; \
      rm -f config.log config.mk; \
      rm -f vpx_config.[hc] vpx_config.asm; \
    else \
      rm -f $(target)-$(TOOLCHAIN).mk; \
    fi

.PHONY: dist
dist:
.PHONY: exampletest
exampletest:
.PHONY: install
install::
.PHONY: test
test::
.PHONY: testdata
testdata::
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:

# Force to realign stack always on OS/2
ifeq ($(TOOLCHAIN), x86-os2-gcc)
CFLAGS += -mstackrealign
endif

$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2

$(BUILD_PFX)%.c.d: %.c
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.c.o: %.c
	$(if $(quiet),@echo "    [CC] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cc.d: %.cc
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cc.o: %.cc
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.cpp.d: %.cpp
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@

$(BUILD_PFX)%.cpp.o: %.cpp
	$(if $(quiet),@echo "    [CXX] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<

$(BUILD_PFX)%.asm.d: %.asm
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.asm.o: %.asm
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

$(BUILD_PFX)%.S.d: %.S
	$(if $(quiet),@echo "    [DEP] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
            --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@

$(BUILD_PFX)%.S.o: %.S
	$(if $(quiet),@echo "    [AS] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(AS) $(ASFLAGS) -o $@ $<

.PRECIOUS: %.c.S
%.c.S: CFLAGS += -DINLINE_ASM
$(BUILD_PFX)%.c.S: %.c
	$(if $(quiet),@echo "    [GEN] $@")
	$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
	$(qexec)$(CC) -S $(CFLAGS) -o $@ $<

.PRECIOUS: %.asm.S
$(BUILD_PFX)%.asm.S: %.asm
	$(if $(quiet),@echo "    [ASM CONVERSION] $@")
	$(qexec)mkdir -p $(dir $@)
	$(qexec)$(ASM_CONVERSION) <$< >$@

# If we're in debug mode, pretend we don't have GNU strip, to fall back to
# the copy implementation
HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
ifeq ($(HAVE_GNU_STRIP),yes)
# Older binutils strip global symbols not needed for relocation processing
# when given --strip-unneeded. Using nm and awk to identify globals and
# keep them caused command line length issues under mingw and segfaults in
# test_libvpx were observed under OS/2: simply use --strip-debug.
%.a: %_g.a
	$(if $(quiet),@echo "    [STRIP] $@ < $<")
	$(qexec)$(STRIP) --strip-debug \
          -o $@ $<
else
%.a: %_g.a
	$(if $(quiet),@echo "    [CP] $@ < $<")
	$(qexec)cp $< $@
endif

#
# Utility functions
#
pairmap=$(if $(strip $(2)),\
    $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
    $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
)

enabled=$(filter-out $($(1)-no),$($(1)-yes))
cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))

find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o .cpp=.cpp.o
objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))

install_map_templates=$(eval $(call install_map_template,$(1),$(2)))

not=$(subst yes,no,$(1))

ifeq ($(CONFIG_MSVS),yes)
lib_file_name=$(1).lib
else
lib_file_name=lib$(1).a
endif
#
# Rule Templates
#
define linker_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
define linkerxx_template
$(1): $(filter-out -%,$(2))
$(1):
	$(if $(quiet),@echo    "    [LD] $$@")
	$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
# make-3.80 has a bug with expanding large input strings to the eval function,
# which was triggered in some cases by the following component of
# linker_template:
#   $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
#                           $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
# This may be useful to revisit in the future (it tries to locate libraries
# in a search path and add them as prerequisites

define install_map_template
$(DIST_DIR)/$(1): $(2)
	$(if $(quiet),@echo "    [INSTALL] $$@")
	$(qexec)mkdir -p $$(dir $$@)
	$(qexec)cp $$< $$@
endef

define archive_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [AR] $$@")
	$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef

define so_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
#
# This needs further abstraction for dealing with non-GNU linkers.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -shared $$(LDFLAGS) \
            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
            -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
            $$(filter %.o,$$^) $$(extralibs)
endef

define dl_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
	    -exported_symbols_list $$(EXPORTS_FILE) \
        -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs)
endef

define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
	$(if $(quiet),@echo "    [LD] $$@")
	$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
        -o $$@ \
        $$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef


#
# Get current configuration
#
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif

skip_deps := $(filter %clean,$(MAKECMDGOALS))
skip_deps += $(findstring testdata,$(MAKECMDGOALS))
ifeq ($(strip $(skip_deps)),)
  ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
    # Older versions of make don't like -include directives with no arguments
    ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
      -include $(filter %.d,$(OBJS-yes:.o=.d))
    endif
  endif
endif

#
# Configuration dependent rules
#
$(call pairmap,install_map_templates,$(INSTALL_MAPS))

DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
.docs: $(DOCS)
	@touch $@

INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
endif
.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
	@touch $@

clean::
	rm -f .docs .install-docs $(DOCS)

BINS=$(call enabled,BINS)
.bins: $(BINS)
	@touch $@

INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
endif
.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
	@touch $@

clean::
	rm -f .bins .install-bins $(BINS)

LIBS=$(call enabled,LIBS)
.libs: $(LIBS)
	@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))

INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
endif
.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
	@touch $@

clean::
	rm -f .libs .install-libs $(LIBS)

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
PROJECTS=$(call enabled,PROJECTS)
.projects: $(PROJECTS)
	@touch $@

INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
endif
.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
	@touch $@

clean::
	rm -f .projects .install-projects $(PROJECTS)
endif

# If there are any source files to be distributed, then include the build
# system too.
ifneq ($(call enabled,DIST-SRCS),)
    DIST-SRCS-yes            += configure
    DIST-SRCS-yes            += build/make/configure.sh
    DIST-SRCS-yes            += build/make/gen_asm_deps.sh
    DIST-SRCS-yes            += build/make/Makefile
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_def.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_sln.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/gen_msvs_vcxproj.sh
    DIST-SRCS-$(CONFIG_MSVS)  += build/make/msvs_common.sh
    DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2gas_apple.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/ads2armasm_ms.pl
    DIST-SRCS-$(ARCH_ARM)    += build/make/thumb.pm
    DIST-SRCS-yes            += $(target:-$(TOOLCHAIN)=).mk
endif
INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
ifeq ($(MAKECMDGOALS),dist)
INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
endif
.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
	@touch $@

clean::
	rm -f .install-srcs

ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
    BUILD_TARGETS += .projects
    INSTALL_TARGETS += .install-projects
endif
BUILD_TARGETS += .docs .libs .bins
INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::

.SUFFIXES:  # Delete default suffix rules
I'm sure the makefile is fine and the build process is fine.

What I meant was run the configure script manually and post the output it prints to the terminal, not the Makefile. Only run the configure portion by itself, not the whole 002-z-libvpx script, then investigate the aftermath.

So just in the libvpx source dir run the following:
Code:
./configure --prefix=/usr --enable-shared --disable-static
Let's see what it prints to the terminal, since this is what will generate the vpx_config.h file.

Perhaps it's failing for some reason before it's getting to generate the vpx_config.h file, or something of that nature. There should be some info there as to why the file isn't generated. If it works, it may just be a problem with the way configure is being called from 002-z-libvpx and may need a small tweak.

Last edited by Syndacate; 02-07-2018 at 03:50 AM.
 
Old 02-07-2018, 01:53 PM   #15
percy_vere_uk
Member
 
Registered: Oct 2008
Location: Dorset, UK
Distribution: Arch, Lfs, Gentoo, Debian, Slackware
Posts: 98

Original Poster
Rep: Reputation: 12
Quote:
So just in the libvpx source dir run the following:
Code:

./configure --prefix=/usr --enable-shared --disable-static

Let's see what it prints to the terminal, since this is what will generate the vpx_config.h file.

Perhaps it's failing for some reason before it's getting to generate the vpx_config.h file, or something of that nature.
There should be some info there as to why the file isn't generated. If it works, it may just be a problem with the way configure is being called from 002-z-libvpx and may need a small tweak.

Code:
/sources/libvpx-1.6.1

$ ./configure --prefix=/usr --enable-shared --disable-static

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.iso88591"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
enabling shared
disabling static
enabling vp8_encoder
enabling vp8_decoder
enabling vp9_encoder
enabling vp9_decoder
Configuring for target 'x86_64-linux-gcc'
enabling x86_64
enabling pic
enabling runtime_cpu_detect
enabling mmx
enabling sse
enabling sse2
enabling sse3
enabling ssse3
enabling sse4_1
enabling avx
enabling avx2
using yasm
enabling postproc
enabling unit_tests
enabling webm_io
enabling libyuv
Creating makefiles for x86_64-linux-gcc libs
Creating makefiles for x86_64-linux-gcc examples
Creating makefiles for x86_64-linux-gcc tools
Creating makefiles for x86_64-linux-gcc docs
/sources/libvpx-1.6.1_old3 ]$[
 
  


Reply

Tags
libvpx



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] build problem with libvpx justwantin Slackware - ARM 7 05-20-2015 03:50 PM
[SOLVED] Problems with ffmpeg and libvpx lancherider Linux - Software 4 01-10-2014 09:07 AM
[slackbuilds.org, slack14.0]: libvpx compile failed h-warp Slackware 2 10-21-2012 08:39 AM
Error when cross-compile libvpx 0.9.1 for ARM - Contex A9 on QEMU hero132 Linux - Distributions 0 08-27-2010 09:23 AM
Help again with jhalfs please bines Linux From Scratch 5 03-17-2009 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration