Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adapt to new inets path to httpd.hrl

  • Loading branch information...
commit 10947a53547a40f654fd84e0a98c235f5d19a616 1 parent ad599bf
@tonyg authored
Showing with 18 additions and 1 deletion.
  1. +10 −1 Makefile
  2. +8 −0 src/rfc4627_jsonrpc_inets.erl
View
11 Makefile
@@ -5,13 +5,22 @@ INCLUDE_DIR=include
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.hrl)
SOURCES=$(wildcard $(SOURCE_DIR)/*.erl)
TARGETS=$(patsubst $(SOURCE_DIR)/%.erl, $(EBIN_DIR)/%.beam,$(SOURCES))
-ERLC_OPTS=-I $(INCLUDE_DIR) -o $(EBIN_DIR) -Wall +debug_info # +native -v
+ERLC_OPTS=-I $(INCLUDE_DIR) -o $(EBIN_DIR) $(INETS_DEF) -Wall +debug_info # +native -v
DIST_DIR=dist
SIGNING_KEY_ID=F8D7D525
VERSION=1.2.0
PACKAGE_NAME=rfc4627_jsonrpc
EZ_NAME=$(PACKAGE_NAME).ez
+## The path to httpd.hrl has changed in OTP R14A and newer. Detect the
+## change, and supply a compile-time macro definition to allow
+## rfc4627_jsonrpc_inets.erl to adapt to the new path.
+ifeq ($(shell test R14A \> $$(erl -noshell -eval 'io:format(erlang:system_info(otp_release)), halt().') && echo yes),yes)
+INETS_DEF=
+else
+INETS_DEF=-Dnew_inets
+endif
+
ifeq ($(shell uname -s),Darwin)
SED=gnused
else
View
8 src/rfc4627_jsonrpc_inets.erl
@@ -87,7 +87,15 @@
-module(rfc4627_jsonrpc_inets).
-include("rfc4627_jsonrpc.hrl").
+
+%% The path to httpd.hrl has changed in OTP R14A and newer. Our
+%% Makefile detects the change for us, and supplies a compile-time
+%% macro definition to allow us to adapt to the new path.
+-ifdef(new_inets).
+-include_lib("inets/src/http_server/httpd.hrl").
+-else.
-include_lib("inets/src/httpd.hrl").
+-endif.
-export([do/1, load/2]).
Please sign in to comment.
Something went wrong with that request. Please try again.