[Libreoffice-commits] core.git: configure.ac

Caolán McNamara caolanm at redhat.com
Wed Mar 15 12:40:26 UTC 2017


 configure.ac |  123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 122 insertions(+), 1 deletion(-)

New commits:
commit 1ebe6321460e799887ea2592f370de87847762eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 15 12:39:21 2017 +0000

    relevant hunk got lost between versions
    
    Change-Id: Id8985a6049f8ffe7494d04c535f981767ffc4456

diff --git a/configure.ac b/configure.ac
index 5895ce0..7d15f81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7490,6 +7490,127 @@ else
                 NASM="/opt/lo/bin/nasm"
             fi
         fi
+
+        if test -n "$NASM"; then
+            AC_MSG_CHECKING([for object file format of host system])
+            case "$host_os" in
+              cygwin* | mingw* | pw32* | interix*)
+                case "$host_cpu" in
+                  x86_64)
+                    objfmt='Win64-COFF'
+                    ;;
+                  *)
+                    objfmt='Win32-COFF'
+                    ;;
+                esac
+              ;;
+              msdosdjgpp* | go32*)
+                objfmt='COFF'
+              ;;
+              os2-emx*)			# not tested
+                objfmt='MSOMF'		# obj
+              ;;
+              linux*coff* | linux*oldld*)
+                objfmt='COFF'		# ???
+              ;;
+              linux*aout*)
+                objfmt='a.out'
+              ;;
+              linux*)
+                case "$host_cpu" in
+                  x86_64)
+                    objfmt='ELF64'
+                    ;;
+                  *)
+                    objfmt='ELF'
+                    ;;
+                esac
+              ;;
+              kfreebsd* | freebsd* | netbsd* | openbsd*)
+                if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+                  objfmt='BSD-a.out'
+                else
+                  case "$host_cpu" in
+                    x86_64 | amd64)
+                      objfmt='ELF64'
+                      ;;
+                    *)
+                      objfmt='ELF'
+                      ;;
+                  esac
+                fi
+              ;;
+              solaris* | sunos* | sysv* | sco*)
+                case "$host_cpu" in
+                  x86_64)
+                    objfmt='ELF64'
+                    ;;
+                  *)
+                    objfmt='ELF'
+                    ;;
+                esac
+              ;;
+              darwin* | rhapsody* | nextstep* | openstep* | macos*)
+                case "$host_cpu" in
+                  x86_64)
+                    objfmt='Mach-O64'
+                    ;;
+                  *)
+                    objfmt='Mach-O'
+                    ;;
+                esac
+              ;;
+              *)
+                objfmt='ELF ?'
+              ;;
+            esac
+
+            AC_MSG_RESULT([$objfmt])
+            if test "$objfmt" = 'ELF ?'; then
+              objfmt='ELF'
+              AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
+            fi
+
+            AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
+            case "$objfmt" in
+              MSOMF)      NAFLAGS='-fobj -DOBJ32';;
+              Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
+              Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
+              COFF)       NAFLAGS='-fcoff -DCOFF';;
+              a.out)      NAFLAGS='-faout -DAOUT';;
+              BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;
+              ELF)        NAFLAGS='-felf -DELF';;
+              ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;
+              RDF)        NAFLAGS='-frdf -DRDF';;
+              Mach-O)     NAFLAGS='-fmacho -DMACHO';;
+              Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
+            esac
+            AC_MSG_RESULT([$NAFLAGS])
+
+            AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
+            cat > conftest.asm << EOF
+            [%line __oline__ "configure"
+                    section .text
+                    global  _main,main
+            _main:
+            main:   xor     eax,eax
+                    ret
+            ]
+EOF
+            try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
+            if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
+              AC_MSG_RESULT(yes)
+            else
+              echo "configure: failed program was:" >&AC_FD_CC
+              cat conftest.asm >&AC_FD_CC
+              rm -rf conftest*
+              AC_MSG_RESULT(no)
+              AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
+              NASM=""
+            fi
+
+        fi
+
         if test -z "$NASM"; then
 cat << _EOS
 ****************************************************************************
@@ -7520,7 +7641,7 @@ consult http://svn.code.sf.net/p/libjpeg-turbo/code/trunk/BUILDING.txt
 
 _EOS
             fi
-            AC_MSG_WARN([no nasm (Netwide Assembler) found])
+            AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
         fi
         LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/jpeg-turbo"
         if test "$COM" = "MSC"; then


More information about the Libreoffice-commits mailing list