From c7203c7a5a9d842bea9e050dcba0d0bcdd69fffe Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 1 Jun 2015 11:12:35 +0200 Subject: [PATCH] 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). --- Makefile | 8 +++++--- README | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index c353b039c..219c07669 100644 --- a/Makefile +++ b/Makefile @@ -613,9 +613,11 @@ BUILD_OPTIONS += $(call ignore_implicit,USE_DEVICEATLAS) endif ifneq ($(USE_51DEGREES),) -# Use 51DEGREES_INC and 51DEGREES_LIB to force path to 51degrees headers and libraries if needed. -51DEGREES_INC = -51DEGREES_LIB = +# Use 51DEGREES_SRC and possibly 51DEGREES_INC and 51DEGREES_LIB to force path +# to 51degrees headers and libraries if needed. +51DEGREES_SRC = +51DEGREES_INC = $(51DEGREES_SRC) +51DEGREES_LIB = $(51DEGREES_SRC) OPTIONS_CFLAGS += -DUSE_51DEGREES $(if $(51DEGREES_INC),-I$(51DEGREES_INC)) BUILD_OPTIONS += $(call ignore_implicit,USE_51DEGREES) OPTIONS_LDFLAGS += $(if $(51DEGREES_LIB),-L$(51DEGREES_LIB)) -lz diff --git a/README b/README index c372ce06c..3d7df12f2 100644 --- a/README +++ b/README @@ -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 headers as configurable parameters. -In order to enable 51Degrees get the 51Degrees source code -(https://github.com/51Degreesmobi/51Degrees-C) and then run make with -USE_51DEGREES and 51DEGREES_INC and 51DEGREES_SRC set. Make sure to replace +In order to enable 51Degrees get the 51Degrees source code from the official +github repository : + + 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. -51Degrees provide 2 different detection algorithms. - -1. Pattern - balances main memory usage and CPU. -2. Trie - a very high performance detection solution which uses more main - memory than Pattern. +51Degrees provide 2 different detection algorithms : + 1. Pattern - balances main memory usage and CPU. + 2. Trie - a very high performance detection solution which uses more main + memory than Pattern. 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. - $ 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 and their associated signatures is then needed. 51Degrees provide a free