This repository has been archived by the owner on Jul 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathautogen.sh
executable file
·73 lines (58 loc) · 2.14 KB
/
autogen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
autogen () {
type autoconf >/dev/null 2>&1 || { echo >&2 "Cannot find \`autoconf'. Aborting."; exit 1; }
type automake >/dev/null 2>&1 || { echo >&2 "Cannot find \`automake'. Aborting."; exit 1; }
type autoreconf >/dev/null 2>&1 || { echo >&2 "Cannot find \`autoreconf'. Aborting."; exit 1; }
mkdir -p include/build-aux
echo "running autoreconf"; autoreconf -if
test -x configure || { echo >&2 "\`configure' was not generated. Aborting."; exit 1; }
# use automake only to copy files
echo "copy needed files to include/build-aux"
automake --add-missing --copy 2>/dev/null >/dev/null
echo "running autoreconf on plugins/imagereader/libjpeg-turbo"
autoreconf --install plugins/imagereader/libjpeg-turbo 2>/dev/null >/dev/null
if [ ! -d ffmpeg ]; then
type git >/dev/null 2>&1 || { echo >&2 "Cannot find \`git'. Aborting."; exit 1; }
echo "cloning ffmpeg sources into ./ffmpeg"
git clone -q --depth 1 "https://github.com/FFmpeg/FFmpeg" --branch release/3.4 ffmpeg
#git clone -q --depth 1 "git://source.ffmpeg.org/ffmpeg.git" --branch release/3.4 ffmpeg
rm -rf ffmpeg/.git
fi
}
forcedelete="ffmpeg/"
cleanscript="autogen-cleanup.sh"
if [ -f $cleanscript ]; then
echo "warning: autogen clean-up script found!"
echo "run \`./$cleanscript' first"
exit 1
fi
find . > .autogen_sh_before
autogen
find . > .autogen_sh_after
diff -u .autogen_sh_before .autogen_sh_after | grep '^+\./' | sed 's|^+||g' | \
grep -v '^\.\/git\/' | \
grep -v '^\.\/hg\/' | \
grep -v '^\.\/svn\/' | \
grep -v '^\.\/bzr\/' | \
grep -v '^\.\/\.autogen_sh_' > .autogen_sh_files
cat <<EOF> $cleanscript
#!/bin/sh
# this script was automatically generated by $(basename $0)
if [ -f Makefile ] || [ -f GNUmakefile ]; then
(make maintainer-clean 2>/dev/null ||
make distclean 2>/dev/null ||
make clean 2>/dev/null) || true
fi
set -v
EOF
chmod a+x $cleanscript
for f in $(tac .autogen_sh_files); do
if [ -d $f ]; then
echo "rmdir $f 2>/dev/null || true" >> $cleanscript
else
echo "rm -f $f" >> $cleanscript
fi
done
echo "rm -rf $forcedelete" >> $cleanscript
echo "rm -f $cleanscript" >> $cleanscript
rm -f .autogen_sh_before .autogen_sh_after .autogen_sh_files