Commit 0e138745 authored by Nicolas George's avatar Nicolas George Committed by Michael Niedermayer

codec_names: invoke preprocessor on avcodec.h.

This fixes failures when codec IDs are defined conditionally,
for example when scheduling for a major bump.
Signed-off-by: 's avatarNicolas George <nicolas.george@normalesup.org>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9ab5e648
...@@ -756,5 +756,6 @@ endif ...@@ -756,5 +756,6 @@ endif
CODEC_NAMES_SH := $(SRC_PATH)/$(SUBDIR)codec_names.sh CODEC_NAMES_SH := $(SRC_PATH)/$(SUBDIR)codec_names.sh
AVCODEC_H := $(SRC_PATH)/$(SUBDIR)avcodec.h AVCODEC_H := $(SRC_PATH)/$(SUBDIR)avcodec.h
$(SUBDIR)codec_names.h: $(CODEC_NAMES_SH) config.h $(AVCODEC_H) $(SUBDIR)codec_names.h: $(CODEC_NAMES_SH) config.h $(AVCODEC_H)
$(M)$(CODEC_NAMES_SH) config.h $(AVCODEC_H) $@ $(CC) $(CPPFLAGS) $(CFLAGS) -E $(AVCODEC_H) | \
$(CODEC_NAMES_SH) config.h $@
$(SUBDIR)utils.o: $(SUBDIR)codec_names.h $(SUBDIR)utils.o: $(SUBDIR)codec_names.h
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
set -e set -e
config="$1" config="$1"
codecs="$2" out="$2"
out="$3"
test -n "$out" test -n "$out"
outval="" outval=""
...@@ -63,7 +62,7 @@ parse_enum_codecid () { ...@@ -63,7 +62,7 @@ parse_enum_codecid () {
while read line; do while read line; do
case "$line" in case "$line" in
"};") break;; "};") break;;
*CODEC_ID_FIRST*///*dummy*) ;; *CODEC_ID_FIRST*=*) ;;
CODEC_ID_*) define_codecid ${line%%[=,]*};; CODEC_ID_*) define_codecid ${line%%[=,]*};;
esac esac
done done
...@@ -78,7 +77,7 @@ parse_avcodec_h () { ...@@ -78,7 +77,7 @@ parse_avcodec_h () {
} }
parse_config_h < "$config" parse_config_h < "$config"
parse_avcodec_h < "$codecs" parse_avcodec_h # use stdin
sed -e '/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \ sed -e '/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
-e 's/extern avcodec /extern AVCodec /' > "$out" <<EOF -e 's/extern avcodec /extern AVCodec /' > "$out" <<EOF
$outval $outval
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment