Skip to content

Commit bea841a

Browse files
committed
Fix libversion.sh for split version headers, to unbreak shared library builds
Signed-off-by: Martin Storsjö <[email protected]>
1 parent c834083 commit bea841a

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

ffbuild/library.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ $(LIBOBJS): CPPFLAGS += -DBUILDING_$(NAME)
5252
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
5353
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(EXTRALIBS-$$(*F)) $$(ELIBS)
5454

55-
$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h | $(SUBDIR)
56-
$$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$< > $$@
55+
$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h $(SUBDIR)version_major.h | $(SUBDIR)
56+
$$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$^ > $$@
5757

5858
$(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)version.h ffbuild/config.sh | $(SUBDIR)
5959
$$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"

ffbuild/libversion.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ toupper(){
55
name=lib$1
66
ucname=$(toupper ${name})
77
file=$2
8+
file2=$3
89

910
eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
11+
if [ -f "$file2" ]; then
12+
eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file2")
13+
fi
1014
eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO
1115
eval echo "${name}_VERSION=\$${ucname}_VERSION"
1216
eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR"

libavutil/version_major.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* This file is part of FFmpeg.
3+
*
4+
* FFmpeg is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* FFmpeg is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with FFmpeg; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef AVUTIL_VERSION_MAJOR_H
20+
#define AVUTIL_VERSION_MAJOR_H
21+
22+
/* This file is intentionally empty; it's only kept to fulfill make
23+
* dependencies for ffbuild/libversion.sh. It is not installed. */
24+
25+
#endif /* AVUTIL_VERSION_MAJOR_H */

0 commit comments

Comments
 (0)