From 3e288627cb67c81fee92f2450a802f9c0b5ad040 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 12 Dec 2007 09:02:31 -0800 Subject: [PATCH] autoconf: Optional assembly usage with --disable-asm Allow the user to disable use of assembly code through the --disable-asm option. This is only relevant on the platforms where assembly is normally enabled such as Linux and FreeBSD. --- configure.ac | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 94d84ec6c31..5db4af77eea 100644 --- a/configure.ac +++ b/configure.ac @@ -149,6 +149,13 @@ if test "x$enable_debug" = xyes; then CXXFLAGS="$CXXFLAGS -g" fi fi +dnl These will be used near the end in the arch specific options +AC_ARG_ENABLE(asm, + [AS_HELP_STRING([--disable-asm], + [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], + enable_asm="$enableval", + enable_asm=yes +) dnl dnl library names @@ -714,18 +721,24 @@ linux*) PIC_FLAGS="-fPIC" case "$host_cpu" in i*86) - ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" - ASM_SOURCES='$(X86_SOURCES)' - ASM_API='$(X86_API)' + if test "x$enable_asm" = xyes; then + ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" + ASM_SOURCES='$(X86_SOURCES)' + ASM_API='$(X86_API)' + fi ;; x86_64) - ASM_FLAGS="-DUSE_X86_64_ASM" - ASM_SOURCES='$(X86-64_SOURCES)' - ASM_API='$(X86-64_API)' + if test "x$enable_asm" = xyes; then + ASM_FLAGS="-DUSE_X86_64_ASM" + ASM_SOURCES='$(X86-64_SOURCES)' + ASM_API='$(X86-64_API)' + fi ;; powerpc) - ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" - ASM_SOURCES='$(PPC_SOURCES)' + if test "x$enable_asm" = xyes; then + ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM" + ASM_SOURCES='$(PPC_SOURCES)' + fi ;; esac ;; @@ -734,14 +747,18 @@ freebsd*) case "$host_os" in i*86) PIC_FLAGS="" - ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" - ASM_SOURCES='$(X86_SOURCES)' - ASM_API='$(X86_API)' + if test "x$enable_asm" = xyes; then + ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" + ASM_SOURCES='$(X86_SOURCES)' + ASM_API='$(X86_API)' + fi ;; x86_64) - ASM_FLAGS="-DUSE_X86_64_ASM" - ASM_SOURCES='$(X86-64_SOURCES)' - ASM_API='$(X86-64_API)' + if test "x$enable_asm" = xyes; then + ASM_FLAGS="-DUSE_X86_64_ASM" + ASM_SOURCES='$(X86-64_SOURCES)' + ASM_API='$(X86-64_API)' + fi ;; esac ;; -- 2.30.2