--nm=NM use nm tool NM [$nm_default]
--ar=AR use archive tool AR [$ar_default]
--as=AS use assembler AS [$as_default]
+ --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
--yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
--cc=CC use C compiler CC [$cc_default]
--cxx=CXX use C compiler CXX [$cxx_default]
add_extralibs $(get_safe ${pkg}_libs)
}
+require_libfreetype(){
+ log require_libfreetype "$@"
+ pkg="freetype2"
+ check_cmd $pkg_config --exists --print-errors $pkg \
+ || die "ERROR: $pkg not found"
+ pkg_cflags=$($pkg_config --cflags $pkg)
+ pkg_libs=$($pkg_config --libs $pkg)
+ {
+ echo "#include <ft2build.h>"
+ echo "#include FT_FREETYPE_H"
+ echo "long check_func(void) { return (long) FT_Init_FreeType; }"
+ echo "int main(void) { return 0; }"
+ } | check_ld "cc" $pkg_cflags $pkg_libs \
+ && set_safe ${pkg}_cflags $pkg_cflags \
+ && set_safe ${pkg}_libs $pkg_libs \
+ || die "ERROR: $pkg not found"
+ add_cflags $(get_safe ${pkg}_cflags)
+ add_extralibs $(get_safe ${pkg}_libs)
+}
+
hostcc_o(){
eval printf '%s\\n' $HOSTCC_O
}
gettimeofday
glob
gnu_as
+ gnu_windres
gsm_h
ibm_asm
inet_aton
jack_port_get_latency_range
kbhit
ldbrx
+ libc_msvcrt
libdc1394_1
libdc1394_2
local_aligned_16
mm_empty
mmap
mprotect
- msvcrt
nanosleep
openjpeg_1_5_openjpeg_h
PeekNamedPipe
symver_if_any="symver_asm_label symver_gnu_asm"
-log2_deps="!msvcrt"
+log2_deps="!libc_msvcrt"
# subsystems
dct_select="rdft"
# documentation
podpages_deps="perl"
manpages_deps="perl pod2man"
-htmlpages_deps="texi2html"
-txtpages_deps="makeinfo"
+htmlpages_deps="perl texi2html"
+txtpages_deps="perl makeinfo"
doc_deps_any="manpages htmlpages podpages txtpages"
# default parameters
ranlib="ranlib"
strip_default="strip"
yasmexe_default="yasm"
+windres_default="windres"
nogas=":"
pkg_config_default="${cross_prefix}${pkg_config_default}"
ranlib="${cross_prefix}${ranlib}"
strip_default="${cross_prefix}${strip_default}"
+windres_default="${cross_prefix}${windres_default}"
sysinclude_default="${sysroot}/usr/include"
: ${dep_cc_default:=$cc}
: ${ld_default:=$cc}
: ${host_ld_default:=$host_cc}
-set_default ar as dep_cc ld host_ld
+set_default ar as dep_cc ld host_ld windres
probe_cc as "$as"
asflags_filter=$_flags_filter
SHFLAGS='-shared -Wl,-h,$$(@F)'
enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
network_extralibs="-lsocket -lnsl"
- add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
# When using suncc to build, the Solaris linker will mark
# an executable with each instruction set encountered by
# the Solaris assembler. As our libraries contain their own
elif enabled arm; then
LIBTARGET=arm-wince
fi
+ enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
check_ldflags -Wl,--nxcompat
check_ldflags -Wl,--dynamicbase
shlibdir_default="$bindir_default"
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
objformat="win32"
enable dos_paths
+ enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
;;
*-dos|freedos|opendos)
network_extralibs="-lsocket"
elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
libc_type=newlib
add_cppflags -U__STRICT_ANSI__
-elif check_header _mingw.h; then
- libc_type=mingw
- check_cpp_condition _mingw.h \
- "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
- (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
- die "ERROR: MinGW runtime version must be >= 3.15."
- add_cppflags -U__STRICT_ANSI__
- if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \
- __MINGW64_VERSION_MAJOR < 3"; then
+# MinGW64 is backwards compatible with MinGW32, so check for it first.
+elif check_cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
+ libc_type=mingw64
+ if check_cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
add_compat msvcrt/snprintf.o
add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
else
add_cppflags -D__USE_MINGW_ANSI_STDIO=1
fi
-elif check_func_headers stdlib.h _get_doserrno; then
+ add_cppflags -U__STRICT_ANSI__
+elif check_cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
+ libc_type=mingw32
+ check_cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
+ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
+ die "ERROR: MinGW32 runtime version must be >= 3.15."
+ add_cppflags -U__STRICT_ANSI__
+elif check_cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
libc_type=msvcrt
- add_compat strtod.o strtod=avpriv_strtod
- add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
- _snprintf=avpriv_snprintf \
- vsnprintf=avpriv_vsnprintf
# The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
# 0x601 by default unless something else is set by the user.
# This can easily lead to us detecting functions only present
libc_type=klibc
elif check_cpp_condition sys/cdefs.h "defined __BIONIC__"; then
libc_type=bionic
- add_compat strtod.o strtod=avpriv_strtod
+elif check_cpp_condition sys/brand.h "defined SOLARIS_BRAND_NAME"; then
+ libc_type=solaris
+ add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
fi
-test -n "$libc_type" && enable $libc_type
+test -n "$libc_type" && enable libc_$libc_type
+
+case $libc_type in
+ bionic)
+ add_compat strtod.o strtod=avpriv_strtod
+ ;;
+ msvcrt)
+ add_compat strtod.o strtod=avpriv_strtod
+ add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
+ _snprintf=avpriv_snprintf \
+ vsnprintf=avpriv_vsnprintf
+ ;;
+esac
# hacks for compiler/libc/os combinations
-if enabled_all tms470 glibc; then
+if enabled_all tms470 libc_glibc; then
CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
add_cppflags -D__USER_LABEL_PREFIX__=
add_cppflags -D__builtin_memset=memset
add_cflags -pds=48 # incompatible redefinition of macro
fi
-if enabled_all ccc glibc; then
+if enabled_all ccc libc_glibc; then
add_ldflags -Wl,-z,now # calls to libots crash without this
fi
# do this before the optional library checks as some of them require pthreads
if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
enable pthreads
- if check_func pthread_join; then
+ if check_func pthread_join && check_func pthread_create; then
:
- elif check_func pthread_join -pthread; then
+ elif check_func pthread_join -pthread && check_func pthread_create -pthread; then
add_cflags -pthread
add_extralibs -pthread
- elif check_func pthread_join -pthreads; then
+ elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
add_cflags -pthreads
add_extralibs -pthreads
- elif check_func pthread_join -lpthreadGC2; then
+ elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
add_extralibs -lpthreadGC2
- elif ! check_lib pthread.h pthread_join -lpthread; then
+ elif ! check_lib pthread.h pthread_join -lpthread && ! check_lib pthread.h pthread_create -lpthread; then
disable pthreads
fi
fi
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
-enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
+enabled libfreetype && require_libfreetype
enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
echo "install prefix $prefix"
echo "source path $source_path"
echo "C compiler $cc"
+if test "$host_cc" != "$cc"; then
+ echo "host C compiler $host_cc"
+fi
+echo "C library $libc_type"
echo "ARCH $arch ($cpu)"
if test "$build_suffix" != ""; then
echo "build suffix $build_suffix"
LD_LIB=$LD_LIB
LD_PATH=$LD_PATH
DLLTOOL=$dlltool
+WINDRES=$windres
+DEPWINDRES=$dep_cc
LDFLAGS=$LDFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
ASMSTRIPFLAGS=$ASMSTRIPFLAGS
#define av_restrict $_restrict
#define EXTERN_PREFIX "${extern_prefix}"
#define EXTERN_ASM ${extern_prefix}
+#define BUILDSUF "$build_suffix"
#define SLIBSUF "$SLIBSUF"
#define HAVE_MMX2 HAVE_MMXEXT
EOF