uftp-3.7_makefile.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. diff -Nuar uftp-3.7.orig//makefile uftp-3.7/makefile
  2. --- uftp-3.7.orig//makefile 2012-08-10 17:00:22.566403478 +0600
  3. +++ uftp-3.7/makefile 2012-08-10 17:04:47.523386683 +0600
  4. @@ -39,25 +39,26 @@
  5. endif
  6. # defaults
  7. -CC = gcc
  8. -OPTIONS=-g -Wall $(ENC_OPTS)
  9. +CC ?= gcc
  10. +OPTIONS=$(ENC_OPTS)
  11. LDLIBS=-lc -lm $(CRYPT_LIB)
  12. -CFLAGS=
  13. +CFLAGS?=
  14. +LDFLAGS?=
  15. # FreeBSD
  16. ifeq ("FreeBSD", "$(UNAME_S)")
  17. -OPTIONS=-g -Wall -DHAS_GETIFADDRS $(ENC_OPTS)
  18. +OPTIONS=-DHAS_GETIFADDRS $(ENC_OPTS)
  19. endif
  20. # OSX, aka Darwin
  21. ifeq ("Darwin", "$(UNAME_S)")
  22. -OPTIONS=-g -Wall -DHAS_GETIFADDRS $(ENC_OPTS)
  23. +OPTIONS=-DHAS_GETIFADDRS $(ENC_OPTS)
  24. endif
  25. # Sun
  26. ifeq ("SunOS", "$(UNAME_S)")
  27. -CC = cc
  28. -OPTIONS=-g -DBSD_COMP $(ENC_OPTS)
  29. +CC ?= cc
  30. +OPTIONS=-DBSD_COMP $(ENC_OPTS)
  31. LDLIBS=-lnsl -lsocket -lm $(CRYPT_LIB)
  32. CFLAGS=`getconf LFS_CFLAGS`
  33. OPENSSL=/usr/sfw
  34. @@ -65,9 +66,9 @@
  35. # Linux
  36. ifeq ("Linux", "$(UNAME_S)")
  37. -OPTIONS=-g -Wall -DHAS_GETIFADDRS $(ENC_OPTS)
  38. +OPTIONS=-DHAS_GETIFADDRS $(ENC_OPTS)
  39. LDLIBS=-lm $(CRYPT_LIB)
  40. -CFLAGS=`getconf LFS_CFLAGS`
  41. +CFLAGS?=`getconf LFS_CFLAGS`
  42. endif
  43. ifdef OPENSSL
  44. @@ -82,7 +83,7 @@
  45. testclient_multi.o: testclient_multi.c uftp.h uftp_common.h encryption.h
  46. testclient_multi: testclient_multi.o encrypt_openssl.o uftp_common.o
  47. - $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS)
  48. + $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS) $(LDFLAGS)
  49. clean:
  50. rm -f testclient_multi uftp uftpd uftpproxyd uftp_keymgt *.o
  51. @@ -176,16 +177,16 @@
  52. endif
  53. uftp: $(UFTP_OBJS)
  54. - $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS)
  55. + $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS) $(LDFLAGS)
  56. uftpd: $(UFTPD_OBJS)
  57. - $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS)
  58. + $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS) $(LDFLAGS)
  59. uftpproxyd: $(UFTPPROXYD_OBJS)
  60. - $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS)
  61. + $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS) $(LDFLAGS)
  62. uftp_keymgt: $(UFTP_KEYMGT_OBJS)
  63. - $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS)
  64. + $(CC) $(OPTIONS) $(LIB) -o $@ $^ $(LDLIBS) $(LDFLAGS)
  65. %.o: %.c
  66. $(CC) $(OPTIONS) $(INCLUDE) $(CFLAGS) -c $<