BUILD: make 51D easier to build by defaulting to 51DEGREES_SRC

Till now 3 paths were needed, 51DEGREES_SRC, 51DEGREES_INC, and
51DEGREES_LIB.  Let's make the last two default to 51DEGREES_SRC since
it's the same location, and fix the doc to reflect this (all three were
documented but inconsistently).
This commit is contained in:
Willy Tarreau 2015-06-01 11:12:35 +02:00
parent f95aaf6af1
commit c7203c7a5a
2 changed files with 19 additions and 13 deletions

View File

@ -613,9 +613,11 @@ BUILD_OPTIONS += $(call ignore_implicit,USE_DEVICEATLAS)
endif endif
ifneq ($(USE_51DEGREES),) ifneq ($(USE_51DEGREES),)
# Use 51DEGREES_INC and 51DEGREES_LIB to force path to 51degrees headers and libraries if needed. # Use 51DEGREES_SRC and possibly 51DEGREES_INC and 51DEGREES_LIB to force path
51DEGREES_INC = # to 51degrees headers and libraries if needed.
51DEGREES_LIB = 51DEGREES_SRC =
51DEGREES_INC = $(51DEGREES_SRC)
51DEGREES_LIB = $(51DEGREES_SRC)
OPTIONS_CFLAGS += -DUSE_51DEGREES $(if $(51DEGREES_INC),-I$(51DEGREES_INC)) OPTIONS_CFLAGS += -DUSE_51DEGREES $(if $(51DEGREES_INC),-I$(51DEGREES_INC))
BUILD_OPTIONS += $(call ignore_implicit,USE_51DEGREES) BUILD_OPTIONS += $(call ignore_implicit,USE_51DEGREES)
OPTIONS_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) -lz OPTIONS_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) -lz

24
README
View File

@ -245,24 +245,28 @@ making it easier for customers to get to the information or services they
need. Theses attributes of the device making a web request can be added to HTTP need. Theses attributes of the device making a web request can be added to HTTP
headers as configurable parameters. headers as configurable parameters.
In order to enable 51Degrees get the 51Degrees source code In order to enable 51Degrees get the 51Degrees source code from the official
(https://github.com/51Degreesmobi/51Degrees-C) and then run make with github repository :
USE_51DEGREES and 51DEGREES_INC and 51DEGREES_SRC set. Make sure to replace
git clone https://github.com/51Degreesmobi/51Degrees-C
then run 'make' with USE_51DEGREES and 51DEGREES_SRC set. Both 51DEGREES_INC
and 51DEGREES_LIB may additionally be used to force specific different paths
for .o and .h, but will default to 51DEGREES_SRC. Make sure to replace
'51D_REPO_PATH' with the path to the 51Degrees repository. '51D_REPO_PATH' with the path to the 51Degrees repository.
51Degrees provide 2 different detection algorithms. 51Degrees provide 2 different detection algorithms :
1. Pattern - balances main memory usage and CPU.
1. Pattern - balances main memory usage and CPU. 2. Trie - a very high performance detection solution which uses more main
2. Trie - a very high performance detection solution which uses more main memory than Pattern.
memory than Pattern.
To make with 51Degrees Pattern algorithm use the following command line. To make with 51Degrees Pattern algorithm use the following command line.
$ make TARGET=linux26 USE_51DEGREES=1 51DEGREES_INC='51D_REPO_PATH'/src/pattern 51DEGREES_LIB='51D_REPO_PATH'/src/pattern $ make TARGET=linux26 USE_51DEGREES=1 51DEGREES_SRC='51D_REPO_PATH'/src/pattern
To use the 51Degrees Trie algorithm use the following command line. To use the 51Degrees Trie algorithm use the following command line.
$ make TARGET=linux26 USE_51DEGREES=1 51DEGREES_INC='51D_REPO_PATH'/src/trie 51DEGREES_LIB='51D_REPO_PATH'/src/trie $ make TARGET=linux26 USE_51DEGREES=1 51DEGREES_SRC='51D_REPO_PATH'/src/trie
A data file containing information about devices, browsers, operating systems A data file containing information about devices, browsers, operating systems
and their associated signatures is then needed. 51Degrees provide a free and their associated signatures is then needed. 51Degrees provide a free