diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index 9eaf743b4b19cc55bb1132248d98691782978b51..b085eae126eee9c468be5d8b03dfa48851b53a3e 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -68,7 +68,7 @@ cglobal ac3_exponent_min_%1, 3,4,2, exp, reuse_blks, expn, offset
 %define LOOP_ALIGN
 INIT_MMX
 AC3_EXPONENT_MIN mmx
-%if HAVE_MMXEXT
+%if HAVE_MMXEXT_EXTERNAL
 %define PMINUB PMINUB_MMXEXT
 %define LOOP_ALIGN ALIGN 16
 AC3_EXPONENT_MIN mmxext
diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index a4ab08722a06d8cd2b67bf1056d25b5d620f23f9..6abdba2628efe4d3db15f4c1a551f2310a642392 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -390,7 +390,7 @@ cglobal deblock_h_luma_8, 5,9
 
 INIT_XMM sse2
 DEBLOCK_LUMA
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA
 %endif
@@ -511,7 +511,7 @@ INIT_MMX mmx2
 DEBLOCK_LUMA v8, 8
 INIT_XMM sse2
 DEBLOCK_LUMA v, 16
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA v, 16
 %endif
@@ -785,7 +785,7 @@ cglobal deblock_h_luma_intra_8, 2,4
 
 INIT_XMM sse2
 DEBLOCK_LUMA_INTRA v
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA_INTRA v
 %endif
diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm
index 8a6bbb9d9ec5c5107c2710da3fad472c9a91da50..051760586692b1a288d594b49ea586471ee09589 100644
--- a/libavcodec/x86/h264_deblock_10bit.asm
+++ b/libavcodec/x86/h264_deblock_10bit.asm
@@ -418,7 +418,7 @@ cglobal deblock_h_luma_10, 5,7,15
 
 INIT_XMM sse2
 DEBLOCK_LUMA_64
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA_64
 %endif
@@ -715,7 +715,7 @@ cglobal deblock_h_luma_intra_10, 4,7,16
 
 INIT_XMM sse2
 DEBLOCK_LUMA_INTRA_64
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA_INTRA_64
 %endif
@@ -802,7 +802,7 @@ DEBLOCK_LUMA_INTRA
 INIT_XMM sse2
 DEBLOCK_LUMA
 DEBLOCK_LUMA_INTRA
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_LUMA
 DEBLOCK_LUMA_INTRA
@@ -918,7 +918,7 @@ DEBLOCK_CHROMA
 %endif
 INIT_XMM sse2
 DEBLOCK_CHROMA
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEBLOCK_CHROMA
 %endif
diff --git a/libavcodec/x86/imdct36.asm b/libavcodec/x86/imdct36.asm
index 63cac10d2b02ba04ac7fb977a7379e08d2c27abe..50b6902490fce21d2a9c3c4a4b40aa34595e8f40 100644
--- a/libavcodec/x86/imdct36.asm
+++ b/libavcodec/x86/imdct36.asm
@@ -371,7 +371,7 @@ DEFINE_IMDCT
 INIT_XMM ssse3
 DEFINE_IMDCT
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEFINE_IMDCT
 %endif
@@ -719,7 +719,7 @@ cglobal four_imdct36_float, 5,5,16, out, buf, in, win, tmp
 INIT_XMM sse
 DEFINE_FOUR_IMDCT
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 DEFINE_FOUR_IMDCT
 %endif
diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
index d626fdce0805ceb3243ecdea207f0c7de44fc3be..41f10872a7ac0ccf73674eda0d0092989175f9ba 100644
--- a/libavcodec/x86/proresdsp.asm
+++ b/libavcodec/x86/proresdsp.asm
@@ -319,7 +319,7 @@ INIT_XMM sse2
 idct_put_fn 16
 INIT_XMM sse4
 idct_put_fn 16
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 idct_put_fn 16
 %endif
diff --git a/libavcodec/x86/v210.asm b/libavcodec/x86/v210.asm
index f39419e2b25bd42915e7cec94b38c72d3dbaa06e..b7b2b641e5d66536a0b9eb88e9998d983642c7c1 100644
--- a/libavcodec/x86/v210.asm
+++ b/libavcodec/x86/v210.asm
@@ -76,14 +76,14 @@ cglobal v210_planar_unpack_%1_%2, 5, 5
 
 INIT_XMM
 v210_planar_unpack unaligned, ssse3
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_AVX
 v210_planar_unpack unaligned, avx
 %endif
 
 INIT_XMM
 v210_planar_unpack aligned, ssse3
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_AVX
 v210_planar_unpack aligned, avx
 %endif
diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
index fcf856f9427589dc00de5f3423bd7ab1c77fa117..29701a594c531a8a14703d930f092e499f3b43e3 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -446,7 +446,7 @@ PACK_6CH float, int32, a, 2, 2, INT32_TO_FLOAT_N, INT32_TO_FLOAT_INIT
 PACK_6CH int32, float, u, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 PACK_6CH int32, float, a, 2, 2, FLOAT_TO_INT32_N, FLOAT_TO_INT32_INIT
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 PACK_6CH float, float, u, 2, 2, NOP_N, NOP_N
 PACK_6CH float, float, a, 2, 2, NOP_N, NOP_N
diff --git a/libswresample/x86/rematrix.asm b/libswresample/x86/rematrix.asm
index a11872face003a933189cf8dd1e501e4accdfdcf..d63545ff5e6c112a048a19f7ccdfc37773f3bc1d 100644
--- a/libswresample/x86/rematrix.asm
+++ b/libswresample/x86/rematrix.asm
@@ -243,7 +243,7 @@ MIX1_INT16 a
 MIX2_INT16 u
 MIX2_INT16 a
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_YMM avx
 MIX2_FLT u
 MIX2_FLT a
diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm
index c4174ee65ea29aca08708a116ad7492cc8fe721b..0124c66580dc25041e9cd0ebe6fa084b4d3f5918 100644
--- a/libswscale/x86/input.asm
+++ b/libswscale/x86/input.asm
@@ -304,7 +304,7 @@ RGB24_FUNCS 10, 12
 INIT_XMM ssse3
 RGB24_FUNCS 11, 13
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 RGB24_FUNCS 11, 13
 %endif
@@ -450,7 +450,7 @@ RGB32_FUNCS 0, 0
 INIT_XMM sse2
 RGB32_FUNCS 8, 12
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 RGB32_FUNCS 8, 12
 %endif
@@ -660,7 +660,7 @@ YUYV_TO_UV_FN 3, uyvy
 NVXX_TO_UV_FN 5, nv12
 NVXX_TO_UV_FN 5, nv21
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 ; in theory, we could write a yuy2-to-y using vpand (i.e. AVX), but
 ; that's not faster in practice
diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
index 01a946f7b381e92d24ea290112b5286b8c26dc20..851165a03da93fea57f00e90cee7480ac0201517 100644
--- a/libswscale/x86/output.asm
+++ b/libswscale/x86/output.asm
@@ -267,7 +267,7 @@ yuv2planeX_fn  9,  7, 5
 yuv2planeX_fn 10,  7, 5
 yuv2planeX_fn 16,  8, 5
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 yuv2planeX_fn  8, 10, 7
 yuv2planeX_fn  9,  7, 5
@@ -407,7 +407,7 @@ yuv2plane1_fn 16, 6, 3
 INIT_XMM sse4
 yuv2plane1_fn 16, 5, 3
 
-%if HAVE_AVX
+%if HAVE_AVX_EXTERNAL
 INIT_XMM avx
 yuv2plane1_fn  8, 5, 5
 yuv2plane1_fn  9, 5, 3