open-iscsi-2.0.873-Makefiles.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. diff --git a/Makefile b/Makefile
  2. index c5d9700..4dbff18 100644
  3. --- a/Makefile
  4. +++ b/Makefile
  5. @@ -14,8 +14,8 @@ mandir = $(prefix)/share/man
  6. etcdir = /etc
  7. initddir = $(etcdir)/init.d
  8. -MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8
  9. -PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname
  10. +MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 doc/iscsistart.8 doc/iscsi-iname.8
  11. +PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname usr/iscsistart
  12. INSTALL = install
  13. ETCFILES = etc/iscsid.conf
  14. IFACEFILES = etc/iface.example
  15. @@ -84,11 +84,11 @@ install_programs: $(PROGRAMS)
  16. # ugh, auto-detection is evil
  17. # Gentoo maintains their own init.d stuff
  18. install_initd:
  19. - if [ -f /etc/debian_version ]; then \
  20. + if [ -f $(DESTDIR)$(etcdir)/debian_version ]; then \
  21. $(MAKE) install_initd_debian ; \
  22. - elif [ -f /etc/redhat-release ]; then \
  23. + elif [ -f $(DESTDIR)$(etcdir)/redhat-release ]; then \
  24. $(MAKE) install_initd_redhat ; \
  25. - elif [ -f /etc/SuSE-release ]; then \
  26. + elif [ -f $(DESTDIR)$(etcdir)/SuSE-release ]; then \
  27. $(MAKE) install_initd_suse ; \
  28. fi
  29. @@ -115,7 +115,7 @@ install_iface: $(IFACEFILES)
  30. $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces
  31. install_etc: $(ETCFILES)
  32. - if [ ! -f /etc/iscsi/iscsid.conf ]; then \
  33. + if [ ! -f $(DESTDIR)$(etcdir)/iscsi/iscsid.conf ]; then \
  34. $(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \
  35. $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \
  36. fi
  37. @@ -128,11 +128,11 @@ install_kernel:
  38. $(MAKE) -C kernel install_kernel
  39. install_iname:
  40. - if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then \
  41. - echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \
  42. + if [ ! -f $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ]; then \
  43. + echo "InitiatorName=`$(DESTDIR)$(sbindir)/iscsi-iname`" > $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi ; \
  44. echo "***************************************************" ; \
  45. - echo "Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \
  46. - echo "To override edit /etc/iscsi/initiatorname.iscsi" ; \
  47. + echo "Setting InitiatorName to `cat $(DESTDIR)$(etcdir)/iscsi/initiatorname.iscsi`" ; \
  48. + echo "To override edit $(etcdir)/iscsi/initiatorname.iscsi" ; \
  49. echo "***************************************************" ; \
  50. fi
  51. diff --git a/usr/Makefile b/usr/Makefile
  52. index 673b7f1..83507f3 100644
  53. --- a/usr/Makefile
  54. +++ b/usr/Makefile
  55. @@ -54,18 +54,18 @@ all: $(PROGRAMS)
  56. iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
  57. iscsid.o session_mgmt.o discoveryd.o
  58. - $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  59. + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  60. iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
  61. - $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  62. + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  63. iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
  64. iscsistart.o statics.o
  65. - $(CC) $(CFLAGS) -static $^ -o $@
  66. + $(CC) $(CFLAGS) -static $(LDFLAGS) $^ -o $@
  67. clean:
  68. - rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
  69. + $(RM) *.o $(PROGRAMS) .depend $(LIBSYS)
  70. depend:
  71. - gcc $(CFLAGS) -M `ls *.c` > .depend
  72. + $(CC) $(CFLAGS) -M `ls *.c` > .depend
  73. -include .depend
  74. diff --git a/utils/Makefile b/utils/Makefile
  75. index 2c7e891..62c49fa 100644
  76. --- a/utils/Makefile
  77. +++ b/utils/Makefile
  78. @@ -1,17 +1,18 @@
  79. # This Makefile will work only with GNU make.
  80. -CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
  81. +OPTFLAGS ?= -O2 -g
  82. +CFLAGS += $(OPTFLAGS) -fno-inline -Wall -Wstrict-prototypes
  83. PROGRAMS = iscsi-iname
  84. all: $(PROGRAMS)
  85. iscsi-iname: md5.o iscsi-iname.o
  86. - $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
  87. + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
  88. clean:
  89. - rm -f *.o $(PROGRAMS) .depend
  90. + $(RM) *.o $(PROGRAMS) .depend
  91. depend:
  92. - gcc $(CFLAGS) -M `ls *.c` > .depend
  93. + $(GCC) $(CFLAGS) -M `ls *.c` > .depend
  94. -include .depend
  95. diff --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
  96. index c72bb7f..a36c2d2 100644
  97. --- a/utils/fwparam_ibft/Makefile
  98. +++ b/utils/fwparam_ibft/Makefile
  99. @@ -26,18 +26,18 @@ OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
  100. OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
  101. CLEANFILES = $(OBJS) *.output *~
  102. -OPTFLAGS ?= -O2 -g -fPIC
  103. +OPTFLAGS ?= -O2 -g
  104. WARNFLAGS ?= -Wall -Wstrict-prototypes
  105. -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../../include -I../../usr -D_GNU_SOURCE
  106. +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fPIC -I../../include -I../../usr -D_GNU_SOURCE
  107. all: $(OBJS)
  108. clean:
  109. - rm -f *.o $(CLEANFILES) .depend
  110. + $(RM) *.o $(CLEANFILES) .depend
  111. $(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
  112. depend:
  113. - gcc $(CFLAGS) -M `ls *.c` > .depend
  114. + $(CC) $(CFLAGS) -M `ls *.c` > .depend
  115. -include .depend
  116. diff --git a/utils/sysdeps/Makefile b/utils/sysdeps/Makefile
  117. index 53c10e5..19cfe19 100644
  118. --- a/utils/sysdeps/Makefile
  119. +++ b/utils/sysdeps/Makefile
  120. @@ -1,15 +1,16 @@
  121. # This Makefile will work only with GNU make.
  122. -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g
  123. +OPTFLAGS ?= -O2 -g
  124. +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -fno-inline -Wall -Wstrict-prototypes
  125. SYSDEPS_OBJS=sysdeps.o
  126. all: $(SYSDEPS_OBJS)
  127. clean:
  128. - rm -f *.o .depend
  129. + $(RM) *.o .depend
  130. depend:
  131. - gcc $(CFLAGS) -M `ls *.c` > .depend
  132. + $(CC) $(CFLAGS) -M `ls *.c` > .depend
  133. -include .depend