patch-src_Makefile 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. $OpenBSD: patch-src_Makefile,v 1.26 2016/11/01 09:07:19 dcoppa Exp $
  2. --- src/Makefile.orig Wed Oct 26 09:17:45 2016
  3. +++ src/Makefile Tue Nov 1 10:03:38 2016
  4. @@ -14,8 +14,8 @@
  5. release_hdr := $(shell sh -c './mkreleasehdr.sh')
  6. uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
  7. -OPTIMIZATION?=-O2
  8. -DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
  9. +# OPTIMIZATION?=-O2
  10. +DEPENDENCY_TARGETS=hiredis linenoise geohash-int
  11. # Default settings
  12. STD=-std=c99 -pedantic -DREDIS_STATIC=''
  13. @@ -24,6 +24,7 @@ OPT=$(OPTIMIZATION)
  14. PREFIX?=/usr/local
  15. INSTALL_BIN=$(PREFIX)/bin
  16. +INSTALL_SBIN=$(PREFIX)/sbin
  17. INSTALL=install
  18. # Default allocator
  19. @@ -56,7 +57,7 @@ endif
  20. FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
  21. FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
  22. FINAL_LIBS=-lm
  23. -DEBUG=-g -ggdb
  24. +# DEBUG=-g -ggdb
  25. ifeq ($(uname_S),SunOS)
  26. # SunOS
  27. @@ -90,7 +91,7 @@ endif
  28. endif
  29. endif
  30. # Include paths to dependencies
  31. -FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
  32. +FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I${MODLUA_INCL_DIR}
  33. ifeq ($(MALLOC),tcmalloc)
  34. FINAL_CFLAGS+= -DUSE_TCMALLOC
  35. @@ -112,6 +113,10 @@ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
  36. REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
  37. REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
  38. +ifndef INSTALL_DIR
  39. + INSTALL_DIR= mkdir -p
  40. +endif
  41. +
  42. CCCOLOR="\033[34m"
  43. LINKCOLOR="\033[34;1m"
  44. SRCCOLOR="\033[33m"
  45. @@ -127,7 +132,7 @@ endif
  46. REDIS_SERVER_NAME=redis-server
  47. REDIS_SENTINEL_NAME=redis-sentinel
  48. -REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
  49. +REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_struct.o lua_cmsgpack.o
  50. REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
  51. REDIS_CLI_NAME=redis-cli
  52. REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
  53. @@ -182,7 +187,7 @@ endif
  54. # redis-server
  55. $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
  56. - $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
  57. + $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS) -L${LOCALBASE}/lib ${MODLUA_LIB}
  58. # redis-sentinel
  59. $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
  60. @@ -222,7 +227,7 @@ distclean: clean
  61. .PHONY: distclean
  62. test: $(REDIS_SERVER_NAME) $(REDIS_CHECK_AOF_NAME)
  63. - @(cd ..; ./runtest)
  64. + @(cd ..; ulimit -Sn `ulimit -Hn`; ${TCL_BIN} tests/test_helper.tcl)
  65. test-sentinel: $(REDIS_SENTINEL_NAME)
  66. @(cd ..; ./runtest-sentinel)
  67. @@ -263,10 +268,11 @@ src/help.h:
  68. @../utils/generate-command-help.rb > help.h
  69. install: all
  70. - @mkdir -p $(INSTALL_BIN)
  71. - $(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_BIN)
  72. + $(INSTALL_DIR) $(INSTALL_BIN)
  73. + $(INSTALL_DIR) $(INSTALL_SBIN)
  74. + $(REDIS_INSTALL) $(REDIS_SERVER_NAME) $(INSTALL_SBIN)
  75. $(REDIS_INSTALL) $(REDIS_BENCHMARK_NAME) $(INSTALL_BIN)
  76. $(REDIS_INSTALL) $(REDIS_CLI_NAME) $(INSTALL_BIN)
  77. $(REDIS_INSTALL) $(REDIS_CHECK_RDB_NAME) $(INSTALL_BIN)
  78. $(REDIS_INSTALL) $(REDIS_CHECK_AOF_NAME) $(INSTALL_BIN)
  79. - @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_BIN)/$(REDIS_SENTINEL_NAME)
  80. + @ln -sf $(REDIS_SERVER_NAME) $(INSTALL_SBIN)/$(REDIS_SENTINEL_NAME)