Skip to content

Commit

Permalink
add support for native building on freebsd (#5)
Browse files Browse the repository at this point in the history
* changed shebang to be universal

* chris' changes to build on freebsd

* autobuild script for freebsd

* added note about freebsd building
  • Loading branch information
BloodyNora authored Aug 30, 2020
1 parent c4d7c74 commit 44e8ea9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ Compile on Linux
----------------

Please see [INSTALL](https://github.com/tpruvot/ccminer/blob/linux/INSTALL) file or [project Wiki](https://github.com/tpruvot/ccminer/wiki/Compatibility)


Compile on FreeBSD
------------------

Make sure you have `gmake` installed from the ports tree. Use `build-freebsd.sh`
16 changes: 16 additions & 0 deletions build-freebsd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Simple script to create the Makefile and build

# export PATH="$PATH:/usr/local/cuda/bin/"

make distclean || echo clean

rm -f Makefile.in
rm -f config.status
./autogen.sh || echo done

# CFLAGS="-O2" ./configure
./configure.sh

gmake -j $(sysctl hw.ncpu|awk '{print $2}')
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Simple script to create the Makefile and build

Expand Down
7 changes: 7 additions & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ static inline void le32enc(void *pp, uint32_t x)
}
#endif

#if defined(__FreeBSD__)
#define HAVE_DECL_BE16DEC 1
#define HAVE_DECL_LE16DEC 1
#define HAVE_DECL_BE16ENC 1
#define HAVE_DECL_LE16ENC 1
#endif

#if !HAVE_DECL_BE16DEC
static inline uint16_t be16dec(const void *pp)
{
Expand Down

0 comments on commit 44e8ea9

Please sign in to comment.