0001-cmake.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 25e12bb39eea3d433602de6390796fec8a8f3620 Mon Sep 17 00:00:00 2001
  2. From: Mike Gelfand <mikedld@mikedld.com>
  3. Date: Sun, 1 Jan 2017 16:23:21 +0300
  4. Subject: [PATCH] Remove Makefile, add Makefile.am and CMakeLists.txt
  5. Downloaded from transmission repo:
  6. https://github.com/transmission/dht/commit/25e12bb39eea3d433602de6390796fec8a8f3620
  7. Upstream status: rejected (https://github.com/jech/dht/pull/19)
  8. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  9. ---
  10. CMakeLists.txt | 9 +++++++++
  11. Makefile | 9 ---------
  12. Makefile.am | 11 +++++++++++
  13. 3 files changed, 20 insertions(+), 9 deletions(-)
  14. create mode 100644 CMakeLists.txt
  15. delete mode 100644 Makefile
  16. create mode 100644 Makefile.am
  17. diff --git a/CMakeLists.txt b/CMakeLists.txt
  18. new file mode 100644
  19. index 0000000..6d4aa99
  20. --- /dev/null
  21. +++ b/CMakeLists.txt
  22. @@ -0,0 +1,9 @@
  23. +cmake_minimum_required(VERSION 2.8)
  24. +project(dht C)
  25. +
  26. +add_library(${PROJECT_NAME} STATIC
  27. + dht.c
  28. +)
  29. +
  30. +install(TARGETS ${PROJECT_NAME} DESTINATION lib)
  31. +install(FILES dht.h DESTINATION include/dht)
  32. diff --git a/Makefile b/Makefile
  33. deleted file mode 100644
  34. index e012945..0000000
  35. --- a/Makefile
  36. +++ /dev/null
  37. @@ -1,9 +0,0 @@
  38. -CFLAGS = -g -Wall
  39. -LDLIBS = -lcrypt
  40. -
  41. -dht-example: dht-example.o dht.o
  42. -
  43. -all: dht-example
  44. -
  45. -clean:
  46. - -rm -f dht-example dht-example.o dht-example.id dht.o *~ core
  47. diff --git a/Makefile.am b/Makefile.am
  48. new file mode 100644
  49. index 0000000..2dba648
  50. --- /dev/null
  51. +++ b/Makefile.am
  52. @@ -0,0 +1,11 @@
  53. +AM_CFLAGS = @PTHREAD_CFLAGS@
  54. +
  55. +noinst_LIBRARIES = libdht.a
  56. +libdht_a_SOURCES = dht.c
  57. +libdht_a_DEPENDENCIES = $(builddir)/include/dht
  58. +noinst_HEADERS = dht.h
  59. +EXTRA_DIST = CHANGES CMakeLists.txt dht-example.c LICENCE README
  60. +
  61. +$(builddir)/include/dht:
  62. + $(MKDIR_P) $(builddir)/include
  63. + (cd $(builddir)/include && $(LN_S) $(abs_srcdir) dht)