/builders/dav1d-324778b2910dffc11ba9b0c24d1a31bdbc662d20/contrib/x86_64_linux_glibc_gcc.sh (e6007db4af07acdd743be19dfdebdf53329d70eb) (8022 bytes) (mode 100755) (type blob)
#!/bin/sh
# Canonical specialized, cheap build scripts for x86_64 gnu/linux distros.
# Look for "unset", you'll find the values you can override in $1 or
# $build_dir/local_conf.sh file, that in order to tune the script for your
# specific distro/needs.
# Usage, drop the script in the "contrib" dir at the top of the source tree,
# create somewhere else a build directory, cd into it, and call from there this
# script.
#===============================================================================
#===============================================================================
# build dir and src dir
build_dir=$(readlink -f .)
echo "build_dir=$build_dir"
# we are in contrib
src_dir=$(readlink -f $(dirname $0)/..)
echo "src_dir=$src_dir"
#===============================================================================
#===============================================================================
# the current configur-able variables may be individually overridden with the
# content of the file in $1 or $build_dir/local_conf.sh. Look for "unset"
# in those scripts to find what you can override to tune the build.
if test -f "$1"; then
. "$1"
else
if test -f $build_dir/local_conf.sh; then
. $build_dir/local_conf.sh
fi
fi
#===============================================================================
#===============================================================================
# all symbols are tagged hidden by default, then only the public symbol
# will be tagged public explicitely in the code (with extensions to C)
if test "${cc-unset}" = unset; then
cc="gcc -pipe -fPIC -O2 -c -static-libgcc \
-fvisibility=hidden \
-mpreferred-stack-boundary=6 -mincoming-stack-boundary=4 \
-fomit-frame-pointer -ffast-math \
-idirafter /nyan/glibc/current/include \
-idirafter /nyan/linux-headers/current/include"
fi
#===============================================================================
#===============================================================================
if test "${nasm-unset}" = unset; then
nasm="nasm"
fi
#===============================================================================
#===============================================================================
if test "${ar-unset}" = unset; then
ar='ar rcs'
fi
#===============================================================================
#===============================================================================
if test "${git_version-unset}" = unset; then
git_version="tamereenshort"
fi
#===============================================================================
#===============================================================================
# should be in sync with the code
version_major=5
version_minor=1
version_patch=1
cp -f $src_dir/include/dav1d/version.h.in $build_dir/version.h
sed -e "s:@DAV1D_API_VERSION_MAJOR@:$version_major:;\
s:@DAV1D_API_VERSION_MINOR@:$version_minor:;\
s:@DAV1D_API_VERSION_PATCH@:$version_patch:" -i $build_dir/version.h
#------------------------------------------------------------------------------
cp -f $src_dir/include/vcs_version.h.in $build_dir/vcs_version.h
sed -e "s:@VCS_TAG@:$git_version:" -i $build_dir/vcs_version.h
#===============================================================================
#===============================================================================
touch $build_dir/config.h
touch $build_dir/config.asm
#===============================================================================
#===============================================================================
# make it work with cpp _and_ nasm: '= 1' for the macros and an ending '/' for the
# paths
dav1d_cppflags="\
-DNDEBUG=1 \
-DHAVE_ASM=1 \
-DHAVE_AVX512ICL=1 \
-DCONFIG_8BPC=1 \
-DCONFIG_16BPC=1 \
-DARCH_X86=1 \
-DARCH_X86_64=1 \
-DPIC=1 \
-DSTACK_ALIGNMENT=32 \
\
-I$build_dir/ \
-I$src_dir/src/ \
-I$src_dir/ \
-I$src_dir/include/compat/gcc/ \
-I$src_dir/include/dav1d/ \
-I$src_dir/include/ \
"
glibc_cppflags="\
-DHAVE_POSIX_MEMALIGN=1 \
-DHAVE_DLSYM=1 \
-D_GNU_SOURCE=1 \
"
libdav1d_nobitdepth_generic_c_files="\
src/cdf.c \
src/cpu.c \
src/data.c \
src/decode.c \
src/dequant_tables.c \
src/getbits.c \
src/intra_edge.c \
src/itx_1d.c \
src/lf_mask.c \
src/log.c \
src/mem.c \
src/msac.c \
src/obu.c \
src/picture.c \
src/qm.c \
src/ref.c \
src/refmvs.c \
src/scan.c \
src/tables.c \
src/warpmv.c \
src/wedge.c \
"
libdav1d_nobitdepth_x86_c_files="\
src/x86/cpu.c \
src/x86/msac_init.c \
src/x86/refmvs_init.c \
"
libdav1d_bitdepth_generic_c_files="\
src/cdef_apply_tmpl.c \
src/cdef_tmpl.c \
src/fg_apply_tmpl.c \
src/film_grain_tmpl.c \
src/ipred_prepare_tmpl.c \
src/ipred_tmpl.c \
src/itx_tmpl.c \
src/lf_apply_tmpl.c \
src/loopfilter_tmpl.c \
src/looprestoration_tmpl.c \
src/lr_apply_tmpl.c \
src/mc_tmpl.c \
src/recon_tmpl.c \
"
libdav1d_bitdepth_x86_c_files="\
src/x86/cdef_init_tmpl.c \
src/x86/film_grain_init_tmpl.c \
src/x86/ipred_init_tmpl.c \
src/x86/itx_init_tmpl.c \
src/x86/loopfilter_init_tmpl.c \
src/x86/looprestoration_init_tmpl.c \
src/x86/mc_init_tmpl.c \
"
libdav1d_nobitdepth_x86_nasm_files="\
src/x86/cpuid.asm \
src/x86/msac.asm \
src/x86/refmvs.asm \
src/x86/cdef_avx2.asm \
src/x86/itx_avx2.asm \
src/x86/looprestoration_avx2.asm \
src/x86/cdef_sse.asm \
src/x86/itx_sse.asm \
"
libdav1d_8bitdepth_x86_nasm_files="\
src/x86/cdef_avx512.asm \
src/x86/mc_avx512.asm \
src/x86/mc_avx2.asm \
src/x86/film_grain_avx2.asm \
src/x86/ipred_avx2.asm \
src/x86/loopfilter_avx2.asm \
src/x86/film_grain_sse.asm \
src/x86/ipred_sse.asm \
src/x86/loopfilter_sse.asm \
src/x86/looprestoration_sse.asm \
src/x86/mc_sse.asm \
"
libdav1d_16bitdepth_x86_nasm_files="\
src/x86/cdef16_avx2.asm \
src/x86/film_grain16_avx2.asm \
src/x86/ipred16_avx2.asm \
src/x86/itx16_avx2.asm \
src/x86/loopfilter16_avx2.asm \
src/x86/looprestoration16_avx2.asm \
src/x86/mc16_avx2.asm \
src/x86/cdef16_sse.asm \
src/x86/film_grain16_sse.asm \
src/x86/ipred16_sse.asm \
src/x86/itx16_sse.asm \
src/x86/loopfilter16_sse.asm \
src/x86/looprestoration16_sse.asm \
src/x86/mc16_sse.asm \
"
libdav1d_entrypoints_c_files="\
src/lib.c \
src/thread_task.c \
"
#===============================================================================
#===============================================================================
for f in $libdav1d_nobitdepth_generic_c_files $libdav1d_nobitdepth_x86_c_files $libdav1d_entrypoints_c_files
do
mkdir -p $build_dir/$(dirname $f)
libdav1d_obj=$build_dir/$f.o
libdav1d_objs="$libdav1d_objs $libdav1d_obj"
$cc $dav1d_cppflags $glibc_cppflags $src_dir/$f -o $libdav1d_obj &
done
for f in $libdav1d_bitdepth_generic_c_files $libdav1d_bitdepth_x86_c_files
do
mkdir -p $build_dir/$(dirname $f)
libdav1d_8_obj=$build_dir/$f.8.o
libdav1d_16_obj=$build_dir/$f.16.o
libdav1d_objs="$libdav1d_objs $libdav1d_8_obj $libdav1d_16_obj"
$cc $dav1d_cppflags $glibc_cppflags $src_dir/$f -DBITDEPTH=8 -o $libdav1d_8_obj &
$cc $dav1d_cppflags $glibc_cppflags $src_dir/$f -DBITDEPTH=16 -o $libdav1d_16_obj &
done
for f in $libdav1d_nobitdepth_x86_nasm_files $libdav1d_8bitdepth_x86_nasm_files $libdav1d_16bitdepth_x86_nasm_files
do
mkdir -p $build_dir/$(dirname $f)
libdav1d_obj=$build_dir/$f.o
libdav1d_objs="$libdav1d_objs $libdav1d_obj"
$nasm -f elf64 \
-o $libdav1d_obj \
$dav1d_cppflags $glibc_cppflags \
-Dprivate_prefix=dav1d \
-DARCH_X86_32=0 $src_dir/$f &
done
#===============================================================================
#===============================================================================
wait
if test "${slib_link_cmd-unset}" = unset ; then
slib_link_cmd="gcc -o $build_dir/libdav1d.so.$version_major.$version_minor.$version_patch \
-Wl,-soname=libdav1d.so.$version_major \
-shared -static-libgcc \
-B/nyan/glibc/current/lib -L/nyan/glibc/current/lib -Wl,-rpath-link,/nyan/glibc/current/lib \
-Wl,--no-undefined,--gc-sections,-Bsymbolic \
$libdav1d_objs \
-Wl,--as-needed \
-lpthread \
-lm \
-ldl \
-Wl,--no-as-needed"
fi
eval $slib_link_cmd
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
5 |
8eba6c8dd4dcaf6166bd22285ed34625f38a84ff |
.gitignore |
100755 |
blob |
1587 |
57fa4264b9ee0ae0a6f678f2527a05d3b22dda78 |
00-bootstrap-build.sh |
100755 |
blob |
848 |
a30f443bf405d56682efe3b4c5d3a19d5f7eb45d |
01-re-bootstrap-build.sh |
100644 |
blob |
2142 |
f19c2d6b293244bb11a3f74ee77c10675cadc7d6 |
INSTALL |
100644 |
blob |
30 |
c9b735fa1332286f4b3f5f81fa10527fd7506b6e |
LICENSE |
040000 |
tree |
- |
6206458fcc1fcb717e9909ffa9b1bad28435ee85 |
builders |
100644 |
blob |
1773 |
ef1551089a803bde37e36edc8d61bb819d06f793 |
conf.bootstrap.sh |
100644 |
blob |
479 |
8cc15efe46965ac7750fe304460f5a2b0aa4201c |
conf.sh |
040000 |
tree |
- |
7f251574f7a78832ee5b4b8b8aa6de70a9ae4c0e |
files |
100755 |
blob |
333 |
06859f922e41c1e691c72ada1be3f981ef05f602 |
pkg-build |
100644 |
blob |
22800641 |
e9e6291054c857401f6835c728f31541dae4311e |
steam.tar.bz2 |
100644 |
blob |
173 |
2047af328b22f9d146585cd9e759edbc18122250 |
utils.sh |
040000 |
tree |
- |
b7a22de7f5cbd97650dd45412ef7d4246e395eb8 |
x86 |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/nyanlinux
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/nyanlinux
Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/nyanlinux
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main