Merge commit '9f57f134c19773d54269b6cb9ee455ff87c2e9e1'
* commit '9f57f134c19773d54269b6cb9ee455ff87c2e9e1': configure: ObjC support Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
@@ -18,7 +18,7 @@ ifndef SUBDIR
|
|||||||
ifndef V
|
ifndef V
|
||||||
Q = @
|
Q = @
|
||||||
ECHO = printf "$(1)\t%s\n" $(2)
|
ECHO = printf "$(1)\t%s\n" $(2)
|
||||||
BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
|
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
|
||||||
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
|
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
|
||||||
|
|
||||||
MSG = $@
|
MSG = $@
|
||||||
@@ -36,6 +36,8 @@ IFLAGS := -I. -I$(SRC_PATH)/
|
|||||||
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
|
||||||
CFLAGS += $(ECFLAGS)
|
CFLAGS += $(ECFLAGS)
|
||||||
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
|
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
|
||||||
|
OBJCFLAGS += $(EOBJCFLAGS)
|
||||||
|
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
|
||||||
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
|
||||||
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
|
CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
|
||||||
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
|
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
|
||||||
@@ -51,6 +53,7 @@ endef
|
|||||||
COMPILE_C = $(call COMPILE,CC)
|
COMPILE_C = $(call COMPILE,CC)
|
||||||
COMPILE_CXX = $(call COMPILE,CXX)
|
COMPILE_CXX = $(call COMPILE,CXX)
|
||||||
COMPILE_S = $(call COMPILE,AS)
|
COMPILE_S = $(call COMPILE,AS)
|
||||||
|
COMPILE_M = $(call COMPILE,OBJCC)
|
||||||
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@@ -60,7 +63,7 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
|
|||||||
$(COMPILE_CXX)
|
$(COMPILE_CXX)
|
||||||
|
|
||||||
%.o: %.m
|
%.o: %.m
|
||||||
$(COMPILE_C)
|
$(COMPILE_M)
|
||||||
|
|
||||||
%.s: %.c
|
%.s: %.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
|
$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
|
||||||
|
54
configure
vendored
54
configure
vendored
@@ -316,6 +316,7 @@ Toolchain options:
|
|||||||
--yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
|
--yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
|
||||||
--cc=CC use C compiler CC [$cc_default]
|
--cc=CC use C compiler CC [$cc_default]
|
||||||
--cxx=CXX use C compiler CXX [$cxx_default]
|
--cxx=CXX use C compiler CXX [$cxx_default]
|
||||||
|
--objcc=OCC use ObjC compiler OCC [$cc_default]
|
||||||
--dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
|
--dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
|
||||||
--ld=LD use linker LD [$ld_default]
|
--ld=LD use linker LD [$ld_default]
|
||||||
--pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
|
--pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
|
||||||
@@ -331,6 +332,7 @@ Toolchain options:
|
|||||||
--host-os=OS compiler host OS [$target_os]
|
--host-os=OS compiler host OS [$target_os]
|
||||||
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
|
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
|
||||||
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
|
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
|
||||||
|
--extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
|
||||||
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
|
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
|
||||||
--extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
|
--extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
|
||||||
--extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS]
|
--extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS]
|
||||||
@@ -805,6 +807,10 @@ add_asflags(){
|
|||||||
append ASFLAGS $($asflags_filter "$@")
|
append ASFLAGS $($asflags_filter "$@")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_objcflags(){
|
||||||
|
append OBJCFLAGS $($objcflags_filter "$@")
|
||||||
|
}
|
||||||
|
|
||||||
add_ldflags(){
|
add_ldflags(){
|
||||||
append LDFLAGS $($ldflags_filter "$@")
|
append LDFLAGS $($ldflags_filter "$@")
|
||||||
}
|
}
|
||||||
@@ -875,11 +881,11 @@ check_cxx(){
|
|||||||
check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
|
check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
|
||||||
}
|
}
|
||||||
|
|
||||||
check_oc(){
|
check_objcc(){
|
||||||
log check_oc "$@"
|
log check_objcc "$@"
|
||||||
cat > $TMPM
|
cat > $TMPM
|
||||||
log_file $TMPM
|
log_file $TMPM
|
||||||
check_cmd $cc -Werror=missing-prototypes $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPM
|
check_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
|
||||||
}
|
}
|
||||||
|
|
||||||
check_cpp(){
|
check_cpp(){
|
||||||
@@ -990,6 +996,19 @@ int x;
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_objcflags(){
|
||||||
|
log test_cflags "$@"
|
||||||
|
set -- $($cflags_filter "$@")
|
||||||
|
check_objcc "$@" <<EOF
|
||||||
|
int x;
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
check_objcflags(){
|
||||||
|
log check_cflags "$@"
|
||||||
|
test_objcflags "$@" && add_objcflags "$@"
|
||||||
|
}
|
||||||
|
|
||||||
test_ldflags(){
|
test_ldflags(){
|
||||||
log test_ldflags "$@"
|
log test_ldflags "$@"
|
||||||
check_ld "cc" "$@" <<EOF
|
check_ld "cc" "$@" <<EOF
|
||||||
@@ -1027,8 +1046,8 @@ int x;
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
check_header_oc(){
|
check_header_objcc(){
|
||||||
log check_header_oc "$@"
|
log check_header_objcc "$@"
|
||||||
rm -f -- "$TMPO"
|
rm -f -- "$TMPO"
|
||||||
header=$1
|
header=$1
|
||||||
shift
|
shift
|
||||||
@@ -1036,7 +1055,7 @@ check_header_oc(){
|
|||||||
{
|
{
|
||||||
echo "#include <$header>"
|
echo "#include <$header>"
|
||||||
echo "int main(void) { return 0; }"
|
echo "int main(void) { return 0; }"
|
||||||
} | check_oc && check_stat "$TMPO" && enable_safe $headers
|
} | check_objcc && check_stat "$TMPO" && enable_safe $headers
|
||||||
}
|
}
|
||||||
|
|
||||||
check_func(){
|
check_func(){
|
||||||
@@ -2061,6 +2080,7 @@ CMDLINE_SET="
|
|||||||
assert_level
|
assert_level
|
||||||
build_suffix
|
build_suffix
|
||||||
cc
|
cc
|
||||||
|
objcc
|
||||||
cpu
|
cpu
|
||||||
cross_prefix
|
cross_prefix
|
||||||
custom_allocator
|
custom_allocator
|
||||||
@@ -2105,6 +2125,7 @@ CMDLINE_SET="
|
|||||||
CMDLINE_APPEND="
|
CMDLINE_APPEND="
|
||||||
extra_cflags
|
extra_cflags
|
||||||
extra_cxxflags
|
extra_cxxflags
|
||||||
|
extra_objcflags
|
||||||
host_cppflags
|
host_cppflags
|
||||||
"
|
"
|
||||||
|
|
||||||
@@ -3026,6 +3047,9 @@ CC_E='-E -o $@'
|
|||||||
CC_O='-o $@'
|
CC_O='-o $@'
|
||||||
CXX_C='-c'
|
CXX_C='-c'
|
||||||
CXX_O='-o $@'
|
CXX_O='-o $@'
|
||||||
|
OBJCC_C='-c'
|
||||||
|
OBJCC_E='-E -o $@'
|
||||||
|
OBJCC_O='-o $@'
|
||||||
LD_O='-o $@'
|
LD_O='-o $@'
|
||||||
LD_LIB='-l%'
|
LD_LIB='-l%'
|
||||||
LD_PATH='-L'
|
LD_PATH='-L'
|
||||||
@@ -3850,16 +3874,22 @@ test -n "$cc_type" && enable $cc_type ||
|
|||||||
warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
|
warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
|
||||||
|
|
||||||
: ${as_default:=$cc}
|
: ${as_default:=$cc}
|
||||||
|
: ${objcc_default:=$cc}
|
||||||
: ${dep_cc_default:=$cc}
|
: ${dep_cc_default:=$cc}
|
||||||
: ${ld_default:=$cc}
|
: ${ld_default:=$cc}
|
||||||
: ${host_ld_default:=$host_cc}
|
: ${host_ld_default:=$host_cc}
|
||||||
set_default ar as dep_cc ld host_ld windres
|
set_default ar as objcc dep_cc ld host_ld windres
|
||||||
|
|
||||||
probe_cc as "$as"
|
probe_cc as "$as"
|
||||||
asflags_filter=$_flags_filter
|
asflags_filter=$_flags_filter
|
||||||
add_asflags $_flags $_cflags
|
add_asflags $_flags $_cflags
|
||||||
set_ccvars AS
|
set_ccvars AS
|
||||||
|
|
||||||
|
probe_cc objcc "$objcc"
|
||||||
|
objcflags_filter=$_flags_filter
|
||||||
|
add_objcflags $_flags $_cflags
|
||||||
|
set_ccvars OBJC
|
||||||
|
|
||||||
probe_cc ld "$ld"
|
probe_cc ld "$ld"
|
||||||
ldflags_filter=$_flags_filter
|
ldflags_filter=$_flags_filter
|
||||||
add_ldflags $_flags $_ldflags
|
add_ldflags $_flags $_ldflags
|
||||||
@@ -3899,6 +3929,7 @@ fi
|
|||||||
|
|
||||||
add_cflags $extra_cflags
|
add_cflags $extra_cflags
|
||||||
add_cxxflags $extra_cxxflags
|
add_cxxflags $extra_cxxflags
|
||||||
|
add_objcflags $extra_objcflags
|
||||||
add_asflags $extra_cflags
|
add_asflags $extra_cflags
|
||||||
|
|
||||||
if test -n "$sysroot"; then
|
if test -n "$sysroot"; then
|
||||||
@@ -5335,7 +5366,7 @@ for func in $COMPLEX_FUNCS; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# these are off by default, so fail if requested and not available
|
# these are off by default, so fail if requested and not available
|
||||||
enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
|
enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
|
||||||
enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
|
enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
|
||||||
check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
|
check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
|
||||||
enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
|
enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
|
||||||
@@ -5491,7 +5522,7 @@ enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -l
|
|||||||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
|
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
|
||||||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
|
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
|
||||||
die "ERROR: openssl not found"; }
|
die "ERROR: openssl not found"; }
|
||||||
enabled qtkit_indev && { check_header_oc QTKit/QTKit.h || disable qtkit_indev; }
|
enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; }
|
||||||
|
|
||||||
# libdc1394 check
|
# libdc1394 check
|
||||||
if enabled libdc1394; then
|
if enabled libdc1394; then
|
||||||
@@ -6154,6 +6185,7 @@ INTRINSICS=$intrinsics
|
|||||||
CC=$cc
|
CC=$cc
|
||||||
CXX=$cxx
|
CXX=$cxx
|
||||||
AS=$as
|
AS=$as
|
||||||
|
OBJCC=$objcc
|
||||||
LD=$ld
|
LD=$ld
|
||||||
DEPCC=$dep_cc
|
DEPCC=$dep_cc
|
||||||
DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
|
DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
|
||||||
@@ -6171,9 +6203,13 @@ LN_S=$ln_s
|
|||||||
CPPFLAGS=$CPPFLAGS
|
CPPFLAGS=$CPPFLAGS
|
||||||
CFLAGS=$CFLAGS
|
CFLAGS=$CFLAGS
|
||||||
CXXFLAGS=$CXXFLAGS
|
CXXFLAGS=$CXXFLAGS
|
||||||
|
OBJCFLAGS=$OBJCFLAGS
|
||||||
ASFLAGS=$ASFLAGS
|
ASFLAGS=$ASFLAGS
|
||||||
AS_C=$AS_C
|
AS_C=$AS_C
|
||||||
AS_O=$AS_O
|
AS_O=$AS_O
|
||||||
|
OBJCC_C=$OBJCC_C
|
||||||
|
OBJCC_E=$OBJCC_E
|
||||||
|
OBJCC_O=$OBJCC_O
|
||||||
CC_C=$CC_C
|
CC_C=$CC_C
|
||||||
CC_E=$CC_E
|
CC_E=$CC_E
|
||||||
CC_O=$CC_O
|
CC_O=$CC_O
|
||||||
|
Reference in New Issue
Block a user