Skip to content

Commit

Permalink
Close #476. update makefile to add support for arm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bbinet authored and jvshahid committed May 24, 2014
1 parent 9ccc4af commit 4e10062
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### Bugfixes

### Features

- [Issue #476](https://github.com/influxdb/influxdb/issues/476). Support ARM architecture

## v0.7.0 [2014-05-23]

### Bugfixes
Expand All @@ -15,7 +19,7 @@
- [Issue #537](https://github.com/influxdb/influxdb/issues/537). Incorrect query syntax causes internal error
- [Issue #565](https://github.com/influxdb/influxdb/issues/565). Empty series names shouldn't cause a panic
- [Issue #575](https://github.com/influxdb/influxdb/issues/575). Single point select doesn't interpret timestamps correctly
g- [Issue #576](https://github.com/influxdb/influxdb/issues/576). We shouldn't set timestamps and sequence numbers when listing cq
- [Issue #576](https://github.com/influxdb/influxdb/issues/576). We shouldn't set timestamps and sequence numbers when listing cq
- [Issue #560](https://github.com/influxdb/influxdb/issues/560). Use /dev/urandom instead of /dev/random
- [Issue #502](https://github.com/influxdb/influxdb/issues/502). Fix a
race condition in assigning id to db+series+field (Thanks @ohurvitz
Expand Down
43 changes: 35 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL = /bin/bash
PROTOC = @PROTOC@
GO = @GO@
GOROOT = @GOROOT@
# or 386
# or 386, arm
arch = amd64
CGO_ENABLED = 1

Expand All @@ -14,9 +14,33 @@ endif
cflags =
ifeq ($(arch),386)
cflags = -m32
else
ifeq ($(arch),arm)
cflags = -fpic
endif
endif

ifneq ($(arch),)
GOARCH = $(arch)
endif

ifneq ($(CROSS_COMPILE),)
export CXX=$(CROSS_COMPILE)-g++
export CC=$(CROSS_COMPILE)-gcc
export AS=$(CROSS_COMPILE)-as
export AR=$(CROSS_COMPILE)-ar
export NM=$(CROSS_COMPILE)-nm
export LD=$(CROSS_COMPILE)-ld
export OBJDUMP=$(CROSS_COMPILE)-objdump
export OBJCOPY=$(CROSS_COMPILE)-objcopy
export RANLIB=$(CROSS_COMPILE)-ranlib
export STRIP=$(CROSS_COMPILE)-strip
export CXX_FOR_TARGET=$(CROSS_COMPILE)-g++
export CC_FOR_TARGET=$(CROSS_COMPILE)-gcc
GO_BUILD_OPTIONS += -ldflags="-extld=$(CC)"
cross_flags = --host=$(arch)
endif

export GOARCH
export CGO_ENABLED

Expand Down Expand Up @@ -55,7 +79,7 @@ leveldb_deps = $(leveldb_dir)/libleveldb.a
profile=off
ifneq ($(profile),off)
CGO_LDFLAGS += -ltcmalloc -lprofiler
GO_BUILD_OPTIONS = -tags profile
GO_BUILD_OPTIONS += -tags profile
endif

# levigo flags
Expand All @@ -81,7 +105,7 @@ ifeq ($(uname_S),Linux)
bash -c "cd $(snappy_dir); \
wget https://snappy.googlecode.com/files/$(snappy_file); \
tar --strip-components=1 -xvzf $(snappy_file); \
CFLAGS=$(cflags) CXXFLAGS=$(cflags) ./configure; \
CFLAGS=$(cflags) CXXFLAGS=$(cflags) ./configure $(cross_flags); \
$(MAKE)"
endif

Expand Down Expand Up @@ -183,9 +207,12 @@ source_package = packages/influxdb-$(version).src.tar.gz
binary_package = packages/influxdb-$(version).$(arch).tar.gz
ifeq ($(arch),386)
rpm_package = packages/influxdb-$(package_version)-1.i686.rpm
debian_package = packages/influxdb_$(version)_i386.deb
rpm_args = setarch i386
deb_args = -a i386
debian_package = packages/influxdb_$(version)_i686.deb
arch_args = -a i686
else ifeq ($(arch),arm)
rpm_package = packages/influxdb-$(package_version)-1.armhf.rpm
debian_package = packages/influxdb_$(version)_armhf.deb
arch_args = -a armhf
else
rpm_package = packages/influxdb-$(package_version)-1.x86_64.rpm
debian_package = packages/influxdb_$(version)_amd64.deb
Expand All @@ -212,14 +239,14 @@ $(rpm_package): $(admin_dir)/build build
rm -rf out_rpm
mkdir -p out_rpm/opt/influxdb/versions/$(version)
cp -r build/* out_rpm/opt/influxdb/versions/$(version)
rvm 1.9.3@influxdb do bash -c "pushd out_rpm; $(rpm_args) fpm -s dir -t rpm --after-install ../scripts/post_install.sh -n influxdb -v $(version) .; popd"
rvm 1.9.3@influxdb do bash -c "pushd out_rpm; fpm -s dir -t rpm $(arch_args) --after-install ../scripts/post_install.sh -n influxdb -v $(version) .; popd"
mv out_rpm/$(shell basename $(rpm_package)) packages/

$(debian_package): $(admin_dir)/build build
rm -rf out_rpm
mkdir -p out_rpm/opt/influxdb/versions/$(version)
cp -r build/* out_rpm/opt/influxdb/versions/$(version)
rvm 1.9.3@influxdb do bash -c "pushd out_rpm; fpm -s dir -t deb $(deb_args) --after-install ../scripts/post_install.sh -n influxdb -v $(version) .; popd"
rvm 1.9.3@influxdb do bash -c "pushd out_rpm; fpm -s dir -t deb $(arch_args) --after-install ../scripts/post_install.sh -n influxdb -v $(version) .; popd"
mv out_rpm/$(shell basename $(debian_package)) packages/

$(source_package): dependencies
Expand Down
1 change: 1 addition & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fi
make clean
make package version=$version
make package version=$version arch=386
make arch=arm CROSS_COMPILE=arm-linux-gnueabihf package version=$version
# rpm convention is not to have dashes in the package, or at least
# that's what fpm is claiming
rpm_version=${version/-/_}
Expand Down

0 comments on commit 4e10062

Please sign in to comment.