Add support for building on Mac OS X

This commit is contained in:
pooler 2012-02-28 18:16:40 +01:00
parent e560d53b76
commit ec59ed6d6d
3 changed files with 51 additions and 3 deletions

1
README
View file

@ -10,6 +10,7 @@ Dependencies:
Basic *nix build instructions:
./autogen.sh # only needed if building from git repo
./nomacro.pl # only needed if building on Mac OS X
./configure CFLAGS="-O3"
make

47
nomacro.pl Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/perl
# Copyright 2012 pooler@litecoinpool.org
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version. See COPYING for more details.
#
# nomacro.pl - convert assembler macros to C preprocessor macros.
use strict;
foreach my $f (<*.S>) {
rename $f, "$f.orig";
open FIN, "$f.orig";
open FOUT, ">$f";
my $inmacro = 0;
my %macros = ();
while (<FIN>) {
if (m/^\.macro\s+([_0-9A-Z]+)(?:\s*)(.*)$/i) {
print FOUT "#define $1($2) \\\n";
$macros{$1} = 1;
$inmacro = 1;
next;
}
if (m/^\.endm/) {
print FOUT "\n";
$inmacro = 0;
next;
}
for my $m (keys %macros) {
s/^([ \t]*)($m)(?:[ \t]+([^#\n]*))?([;\n])/\1\2(\3)\4/;
}
if ($inmacro) {
if (m/^\s*#if/) {
$_ = <FIN> while (!m/^\s*#endif/);
next;
}
next if (m/^\s*$/);
s/\\//g;
s/$/; \\/;
}
print FOUT;
}
close FOUT;
close FIN;
}

View file

@ -384,7 +384,7 @@
.endm
.text
.align 32
.p2align 5
gen_salsa8_core:
gen_salsa8_core_quadround
gen_salsa8_core_quadround
@ -392,7 +392,7 @@ gen_salsa8_core:
.text
.align 32
.p2align 5
.globl scrypt_core
.globl _scrypt_core
scrypt_core:
@ -675,7 +675,7 @@ gen_scrypt_core_loop2:
xmm_salsa8_core_doubleround
.endm
.align 32
.p2align 5
xmm_scrypt_core:
movl 20(%esp), %edi
movl 24(%esp), %esi