Skip to content

Xcode 4.6 throws an error when compiling berkeley db 5.3.21, so here's a ptach

Notifications You must be signed in to change notification settings

narkoleptik/os-x-berkeleydb-patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

os-x-berkeleydb-patch

Xcode 4.6 throws an error when compiling berkeley db 5.3.21, so here's a ptach

When compiling, I got this error


{bmcduffi@breezy.local}{Tue Mar 12 12:49:44}{~/src/db-5.3.21/build_unix}
√ $ make
./libtool --mode=compile cc -c -I. -I../src  -O3  ../src/mutex/mut_tas.c
libtool: compile:  cc -c -I. -I../src -O3 ../src/mutex/mut_tas.c  -fno-common -DPIC -o .libs/mut_tas.o
In file included from ../src/mutex/mut_tas.c:11:
In file included from ./db_int.h:1113:
In file included from ../src/dbinc/mutex.h:15:
In file included from ../src/dbinc/mutex_int.h:12:
../src/dbinc/atomic.h:179:19: error: definition of builtin function '__atomic_compare_exchange'
static inline int __atomic_compare_exchange(
                   ^
1 error generated.
make: *** [mut_tas.lo] Error 1

I'm sure there are more elegant ways to patch this, but here are my steps:

  1. curl -O http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz
  2. tar -xvf db-5.3.21.tar.gz
  3. cd db-5.3.21/

We need to patch the code to make it compile on Xcode 4.6

  1. curl -OL https://raw.github.com/narkoleptik/os-x-berkeleydb-patch/master/atomic.patch
  2. patch src/dbinc/atomic.h < atomic.patch

Back to building BerkeleyDB

  1. cd build_unix
  2. ../dist/configure --prefix=/Users/bmcduffi
  3. make
  4. make install

About

Xcode 4.6 throws an error when compiling berkeley db 5.3.21, so here's a ptach

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published