%endif
%endmacro
+; Name of the .rodata section. On OS X we cannot use .rodata because YASM
+; is unable to compute address offsets outside of .text so we use the .text
+; section instead until YASM is fixed.
+%macro SECTION_RODATA 0
+ %ifidn __OUTPUT_FORMAT__,macho64
+ SECTION .text align=16
+ %else
+ SECTION .rodata align=16
+ %endif
+%endmacro
+
%macro pad 1
%undef %1
%ifdef PREFIX
; Constants
;=============================================================================
-SECTION .rodata align=16
+SECTION_RODATA
pw_1: times 8 dw 1
pw_32: times 8 dw 32
%include "amd64inc.asm"
-SECTION .rodata align=16
+SECTION_RODATA
pb_01: times 16 db 0x01
pb_03: times 16 db 0x03
pb_a1: times 16 db 0xa1
; Constants
;=============================================================================
-SECTION .rodata
+SECTION_RODATA
-ALIGN 16
pw_4: times 4 dw 4
pw_8: times 4 dw 8
pw_32: times 4 dw 32
; Read only data
;=============================================================================
-SECTION .rodata align=16
+SECTION_RODATA
-ALIGN 16
pw_1: times 4 dw 1
pw_16: times 4 dw 16
pw_32: times 4 dw 32
%include "amd64inc.asm"
-SECTION .rodata align=16
+SECTION_RODATA
pw_1: times 8 dw 1
ssim_c1: times 4 dd 416 ; .01*.01*255*255*64
%endmacro
-SECTION .rodata align=16
+SECTION_RODATA
-ALIGN 16
pw_2: times 4 dw 2
pw_4: times 4 dw 4
pw_8: times 4 dw 8
%include "amd64inc.asm"
-SECTION .rodata
+SECTION_RODATA
pd_1: times 2 dd 1
SECTION .text
x86_64)
ARCH="X86_64"
AS="yasm"
- ASFLAGS="-f elf -m amd64"
+ if [ "$SYS" = MACOSX ];then
+ ASFLAGS="-f macho64 -m amd64 -D__PIC__ -DPREFIX"
+ CFLAGS="$CFLAGS -arch x86_64"
+ LDFLAGS="$LDFLAGS -arch x86_64"
+ else
+ ASFLAGS="-f elf -m amd64"
+ fi
;;
powerpc|powerpc64)
ARCH="PPC"