Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To build: rebar complie To clean: rebar clean To bundle: mkdir -p libgeoip-1.0.3; cp -rp ebin priv libgeoip-1.0.3 --HG-- rename : src/libgeoip_app.app => src/libgeoip.app.src
- Loading branch information
Showing
12 changed files
with
48 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ syntax: glob | |
dist/ | ||
src/geoipport | ||
libgeoip-* | ||
priv/ | ||
ebin/ | ||
c_src/*.o |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.PHONY: dist clean | ||
|
||
## - if you have multiple versions, pick the highest one | ||
OTP_LIB_DIR:= $(shell erl -noshell -eval 'io:format("~s", [code:lib_dir()])' -s erlang halt) | ||
EI=$(shell ls -d $(OTP_LIB_DIR)/erl_interface* | sort -n |tail -1) | ||
LIBGEOIP=../priv/libgeoip | ||
|
||
## - default macports install location for libgeoip | ||
GEOIP_LIBS=/opt/local | ||
|
||
dist: $(LIBGEOIP) | ||
|
||
$(LIBGEOIP): geoipport.c erl_comm.c geohash.c Makefile | ||
@mkdir -p ../priv | ||
gcc -Wall -Os -L$(GEOIP_LIBS)/lib -I$(GEOIP_LIBS)/include \ | ||
-L$(EI)/lib/ -I$(EI)/include/ \ | ||
-o $(LIBGEOIP) erl_comm.c geoipport.c geohash.c -lerl_interface -lei -lGeoIP \ | ||
-lpthread | ||
|
||
## - Comments are fun | ||
|
||
clean: | ||
rm -f $(LIBGEOIP) |
File renamed without changes.
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
Binary file not shown.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{port_envs, [{"CFLAGS", "-Wall -I/opt/local/include "}, | ||
{"LDFLAGS", "-L/opt/local/lib "}]}. | ||
|
||
% This is a hack because I can't make rebar compile non-linked-in drivers. | ||
{port_pre_script, {"gmake -C c_src", "priv/libgeoip"}}. | ||
{port_cleanup_script, "gmake -C c_src clean"}. |
This file was deleted.
Oops, something went wrong.
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