Skip to content

Commit

Permalink
Merge pull request #10 from lindig/version-script
Browse files Browse the repository at this point in the history
Fix: use latest meta data protocol, fix compilation on OS X, test scale "absolute"
  • Loading branch information
robhoes authored Sep 19, 2016
2 parents 2204b0c + 1a1a816 commit 3611b3b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@

NAME = rrd-client-lib
VERSION = 1.1.0
OS := $(shell uname)

CC = gcc
CFLAGS = -std=gnu99 -g -fpic -Wall
OBJ += librrd.o
OBJ += parson/parson.o
LIB += -lz

ifeq ($(OS),Darwin)
LDFLAGS = -shared -Wl
else
LDFLAGS = -shared -Wl,--version-script=version.script
endif

.PHONY: all
all: librrd.a librrd.so rrdtest rrdclient
Expand Down Expand Up @@ -68,7 +74,7 @@ librrd.a: $(OBJ)
ranlib $@

librrd.so: $(OBJ)
$(CC) -shared -Wl,--version-script=version.script -o $@ $(OBJ) $(LIB)
$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIB)

rrdtest: rrdtest.o librrd.a
$(CC) $(CFLAGS) -o $@ $^ $(LIB)
Expand Down
2 changes: 1 addition & 1 deletion librrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ json_for_source(RRD_SOURCE * source)
}
json_object_set_string(src, "value_type", value_type);

#define RRD_TRANSPORT_1_0_0
#define RRD_TRANSPORT_1_1_0
#ifdef RRD_TRANSPORT_1_1_0
#define GAUGE "gauge"
#define ABSOLUTE "absolute"
Expand Down
2 changes: 1 addition & 1 deletion rrdclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ main(int argc, char **argv)
src.owner_uuid = "931388d6-559e-11e6-ab0a-73658ca1c515";
src.rrd_units = "numbers";
src.type = RRD_INT64;
src.scale = RRD_GAUGE;
src.scale = RRD_ABSOLUTE;
src.min = "-inf";
src.max = "inf";
src.rrd_default = 0;
Expand Down
2 changes: 1 addition & 1 deletion rrdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ main(int argc, char **argv)
src[1].owner = RRD_HOST;
src[1].owner_uuid = "e8969702-5414-11e6-8cf5-47824be728c3";
src[1].rrd_units = "points";
src[1].scale = RRD_GAUGE;
src[1].scale = RRD_ABSOLUTE;
src[1].type = RRD_INT64;
src[1].min = "-inf";
src[1].max = "inf";
Expand Down
1 change: 1 addition & 0 deletions travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ make
make valgrind
make test
make test-integration
make clean

0 comments on commit 3611b3b

Please sign in to comment.