This repository has been archived by the owner. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix static build
When built statically the nif couldn't be loaded. This patch fix the following: - make sure that the patches are applied. - fix LDFLAGS order While I am here add a unitest to fix the lib.
- Loading branch information
Showing
7 changed files
with
687 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,4 @@ | ||
ebin | ||
t/*.beam | ||
.dists | ||
.libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,28 @@ | ||
ERL ?= erl | ||
ERLC ?= erlc | ||
REBAR ?= rebar | ||
|
||
all: compile | ||
|
||
static: | ||
@USE_STATIC_ICU="1" COUCHDB_STATIC="1" $(REBAR) compile | ||
|
||
|
||
compile: | ||
@$(REBAR) compile | ||
|
||
clean: | ||
@$(REBAR) clean | ||
@rm -f t/*.beam | ||
|
||
test: | ||
@$(ERLC) -o t/ t/etap.erl | ||
prove t/*.t | ||
|
||
verbose-test: | ||
@$(ERLC) -o t/ t/etap.erl | ||
prove -v t/*.t | ||
|
||
cover: test | ||
@ERL_FLAGS="-pa ./ebin -pa ./t" \ | ||
$(ERL) -detached -noshell -eval 'etap_report:create()' -s init stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env escript | ||
%% -*- erlang -*- | ||
%%! -pa ./ebin -pa ./t | ||
|
||
% Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
% use this file except in compliance with the License. You may obtain a copy of | ||
% the License at | ||
% | ||
% http://www.apache.org/licenses/LICENSE-2.0 | ||
% | ||
% Unless required by applicable law or agreed to in writing, software | ||
% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
% License for the specific language governing permissions and limitations under | ||
% the License. | ||
|
||
main(_) -> | ||
etap:plan(2), | ||
test(), | ||
etap:end_tests(). | ||
|
||
test() -> | ||
etap:is( | ||
couch_collate:collate(<<"foo">>, <<"bar">>), | ||
1, | ||
"Can collate stuff" | ||
), | ||
etap:is( | ||
couch_collate:collate(<<"A">>, <<"aa">>), | ||
-1, | ||
"Collate's non-ascii style." | ||
), | ||
ok. |
Oops, something went wrong.