diff --git a/.hgignore b/.hgignore index 6a41d20..a9f54f9 100644 --- a/.hgignore +++ b/.hgignore @@ -7,6 +7,7 @@ syntax: glob *.pc libevent-*-stable/Makefile +libevent-*-stable/configure libevent-*-stable/config.h libevent-*-stable/config.log libevent-*-stable/config.status @@ -19,6 +20,7 @@ libevent-*-stable/**/.libs/ libevent-*-stable/*.lo libevent-*-stable/*.la +libevent-*-stable/autom4te.cache/ libevent-*-stable/include/event2/event-config.h libevent-*-stable/sample/dns-example libevent-*-stable/sample/event-test @@ -40,6 +42,8 @@ libevent-*-stable/test/test-ratelim libevent-*-stable/test/test-time libevent-*-stable/test/test-weof +libevent-*-stable/build/ + server/pep-json-server server/servertest server/*.a diff --git a/libevent-2.0.22-stable/configure b/libevent-2.0.22-stable/configure index a8b66d9..376bc24 100755 --- a/libevent-2.0.22-stable/configure +++ b/libevent-2.0.22-stable/configure @@ -763,6 +763,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -849,6 +850,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1101,6 +1103,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1238,7 +1249,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1391,6 +1402,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] diff --git a/server/Makefile b/server/Makefile index 1ac23ca..0dc036c 100644 --- a/server/Makefile +++ b/server/Makefile @@ -10,43 +10,36 @@ include Makefile.conf -#order does matter, hence I have to split it for static builds: +# Order does matter, hence I have to split it for static builds: LIBS1 = -levent -lpEpEngine -lasn1 -luuid -lgpgme -letpan LIBS2 = -lpthread -lz -ldl -BUILD_ON=$(shell uname) -BUILD_FOR=$(BUILD_ON) +BUILD_ON = $(shell uname) +BUILD_FOR = $(BUILD_ON) ifeq ($(BUILD_ON),Darwin) -ifeq ($(BUILD_FOR),Darwin) - -CXXFLAGS += -I/opt/local/include -I$(HOME)/include -Ijson_spirit -LDFLAGS += -L/opt/local/lib -L$(HOME)/lib $(LIBS1) -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt $(LIBS2) -endif - + ifeq ($(BUILD_FOR),Darwin) + CXXFLAGS += -I/opt/local/include -I$(HOME)/include -Ijson_spirit + LDFLAGS += -L/opt/local/lib -L$(HOME)/lib $(LIBS1) -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt $(LIBS2) + endif else - -CXXFLAGS += -I$(HOME)/include -I$(HOME)/local/include/ -Ijson_spirit -LDFLAGS += -L$(HOME)/lib -L$(HOME)/local/lib $(LIBS1) -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread $(LIBS2) - + CXXFLAGS += -I$(HOME)/include -I$(HOME)/local/include/ -Ijson_spirit + LDFLAGS += -L$(HOME)/lib -L$(HOME)/local/lib $(LIBS1) -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread $(LIBS2) endif -.PHONY: all clean install - +.PHONY: all all: pep-json-server servertest pep-json-server: main.o libjson-adapter.a $(CXX) -o $@ $^ $(LDFLAGS) - pep-json-server-static: main.o libjson-adapter.a $(CXX) -static -o $@ $^ $(LDFLAGS) - servertest: servertest.o - $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) - + $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) +# FIXME How about `%.o json_spirit/*.o`? How about using built-in rules? libjson-adapter.a: \ json_spirit/json_spirit_reader.o json_spirit/json_spirit_value.o json_spirit/json_spirit_writer.o \ json-adapter.o registry.o nfc.o json_rpc.o \ @@ -62,17 +55,19 @@ libjson-adapter.a: \ prefix-config.cc: Makefile echo '// This file is generated by make. Edit the Makefile, not this file!\n#include "prefix-config.hh" \nconst char* const html_directory = "'$(HTML_DIRECTORY)'";\n' > $@ -%.o : %.cc %.hh Makefile +%.o : %.cc %.hh Makefile $(CXX) $(CXXFLAGS) -c $< +.PHONY: install install: mkdir -v -p $(HTML_DIRECTORY) cp -v ../html/* $(HTML_DIRECTORY) +# FIXME Install binaries as well here +.PHONY: clean clean: rm -vf pep-json-server servertest rm -vf *.o rm -vf prefix-config.cc rm -vf json_spirit/*.o rm -vf *.a -