Commit 84e65c76 authored by Mans Rullgard's avatar Mans Rullgard
Browse files

build: simplify enabling of compat objects



Add a configure function to pull in a compat object and set up
redirects in one operation.  This avoids duplicating conditions
across configure and makefiles.
Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
parent 66a1ccd7
...@@ -641,6 +641,12 @@ add_host_ldflags(){ ...@@ -641,6 +641,12 @@ add_host_ldflags(){
append host_ldflags $($host_ldflags_filter "$@") append host_ldflags $($host_ldflags_filter "$@")
} }
add_compat(){
append compat_objs $1
shift
map 'add_cppflags -D$v' "$@"
}
check_cmd(){ check_cmd(){
log "$@" log "$@"
"$@" >> $logfile 2>&1 "$@" >> $logfile 2>&1
...@@ -2906,10 +2912,10 @@ elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then ...@@ -2906,10 +2912,10 @@ elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib libc_type=newlib
elif check_func_headers stdlib.h _get_doserrno; then elif check_func_headers stdlib.h _get_doserrno; then
libc_type=msvcrt libc_type=msvcrt
add_cflags -Dstrtod=avpriv_strtod add_compat strtod.o strtod=avpriv_strtod
add_cflags -Dsnprintf=avpriv_snprintf \ add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
-D_snprintf=avpriv_snprintf \ _snprintf=avpriv_snprintf \
-Dvsnprintf=avpriv_vsnprintf vsnprintf=avpriv_vsnprintf
elif check_cpp_condition stddef.h "defined __KLIBC__"; then elif check_cpp_condition stddef.h "defined __KLIBC__"; then
libc_type=klibc libc_type=klibc
fi fi
...@@ -3753,6 +3759,7 @@ CFLAGS-avplay=$sdl_cflags ...@@ -3753,6 +3759,7 @@ CFLAGS-avplay=$sdl_cflags
ZLIB=$($ldflags_filter -lz) ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
INSTALL=install INSTALL=install
LIBTARGET=${LIBTARGET} LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME} SLIBNAME=${SLIBNAME}
......
...@@ -88,8 +88,7 @@ OBJS = adler32.o \ ...@@ -88,8 +88,7 @@ OBJS = adler32.o \
utils.o \ utils.o \
xtea.o \ xtea.o \
OBJS-$(HAVE_MSVCRT) += ../compat/msvcrt/snprintf.o \ OBJS += $(COMPAT_OBJS:%=../compat/%)
../compat/strtod.o
SKIPHEADERS = old_pix_fmts.h SKIPHEADERS = old_pix_fmts.h
......
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