-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-msvc-lgpl.sh
More file actions
executable file
·141 lines (118 loc) · 4.08 KB
/
Copy pathbuild-msvc-lgpl.sh
File metadata and controls
executable file
·141 lines (118 loc) · 4.08 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/sh -eux
# "THE BEER-WARE LICENSE" (Revision CS-42):
#
# This file was written by the CodeShop developers. As long as you
# retain this notice you can do whatever you want with it.
# If we meet some day, and you think this file is worth it, you can
# buy us a beer in return. Even if you do that, this file still
# comes WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Compiler: MSVC 14 (aka Visual Studio 2019)
# Resulting license: LGPL v2.1
# PLEASE NOTE: this script should be run under MSYS.
# ffmpeg does not support an MSVC build under Cygwin.
# Debug build
build_dir=bld64-msvc-14-lgpl/debug
install_dir=../../out64-msvc-14-lgpl/debug
nproc=${NUMBER_OF_PROCESSORS}
rm -rf ${build_dir}
mkdir -p ${build_dir}
cd ${build_dir}
../../configure \
--prefix=${install_dir} \
--disable-static \
--enable-shared \
--disable-autodetect \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--disable-hwaccels \
--toolchain=msvc \
--extra-cflags="-MDd -Z7" \
--extra-ldflags="-debug:full" \
--build-suffix=_usp \
--disable-debug \
--disable-optimizations \
--disable-stripping
make -j${nproc} V=1
make V=1 install
cd ../../
# Release build
build_dir=bld64-msvc-14-lgpl/release
install_dir=../../out64-msvc-14-lgpl/release
nproc=${NUMBER_OF_PROCESSORS}
rm -rf ${build_dir}
mkdir -p ${build_dir}
cd ${build_dir}
../../configure \
--prefix=${install_dir} \
--disable-static \
--enable-shared \
--disable-autodetect \
--disable-programs \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
--disable-hwaccels \
--toolchain=msvc \
--extra-cflags="-MD -Z7" \
--extra-ldflags="-debug:full" \
--build-suffix=_usp \
--disable-debug \
--disable-stripping
make -j${nproc} V=1
make V=1 install
cd ../../
# Sanity check include dirs: debug and release should be exactly identical.
diff -qr out64-msvc-14-lgpl/debug/include out64-msvc-14-lgpl/release/include
# We need only one copy of the headers.
rm -rf out64-msvc-14-lgpl/include out64-msvc-14-lgpl/debug/include
mv out64-msvc-14-lgpl/release/include out64-msvc-14-lgpl
# Move DLLs, import libs and def files from out64 subdirs.
mv \
out64-msvc-14-lgpl/debug/bin/*.dll \
out64-msvc-14-lgpl/debug/bin/*.lib \
out64-msvc-14-lgpl/debug/lib/*.def \
out64-msvc-14-lgpl/debug
mv \
out64-msvc-14-lgpl/release/bin/*.dll \
out64-msvc-14-lgpl/release/bin/*.lib \
out64-msvc-14-lgpl/release/lib/*.def \
out64-msvc-14-lgpl/release
# Cleanup out64 subdir leftovers that we don't want.
rm -rf \
out64-msvc-14-lgpl/debug/bin \
out64-msvc-14-lgpl/debug/lib \
out64-msvc-14-lgpl/debug/share \
out64-msvc-14-lgpl/release/bin \
out64-msvc-14-lgpl/release/lib \
out64-msvc-14-lgpl/release/share
# Copy pdb files from bld64 subdirs.
cp \
bld64-msvc-14-lgpl/debug/libavcodec/*.pdb \
bld64-msvc-14-lgpl/debug/libavdevice/*.pdb \
bld64-msvc-14-lgpl/debug/libavfilter/*.pdb \
bld64-msvc-14-lgpl/debug/libavformat/*.pdb \
bld64-msvc-14-lgpl/debug/libavutil/*.pdb \
bld64-msvc-14-lgpl/debug/libswresample/*.pdb \
bld64-msvc-14-lgpl/debug/libswscale/*.pdb \
out64-msvc-14-lgpl/debug
cp \
bld64-msvc-14-lgpl/release/libavcodec/*.pdb \
bld64-msvc-14-lgpl/release/libavdevice/*.pdb \
bld64-msvc-14-lgpl/release/libavfilter/*.pdb \
bld64-msvc-14-lgpl/release/libavformat/*.pdb \
bld64-msvc-14-lgpl/release/libavutil/*.pdb \
bld64-msvc-14-lgpl/release/libswresample/*.pdb \
bld64-msvc-14-lgpl/release/libswscale/*.pdb \
out64-msvc-14-lgpl/release
# Show end result.
ls -l \
out64-msvc-14-lgpl/include \
out64-msvc-14-lgpl/debug \
out64-msvc-14-lgpl/release