blob: daefcf2b31dfd081b085dc13f8f35db8a1561d36 [file] [log] [blame]
From: Meena Shanmugam
Date: Wed, 04 Aug 2021
Subject: With crbug/985180 all unprefixed compilers have been blocked.
So pkg-config, gcc, rm commnads cannot be directly used. So modify the Makefiles to
use -lsystemd, $GCC, $RM.
--- a/libopeniscsiusr/Makefile
+++ b/libopeniscsiusr/Makefile
@@ -44,7 +44,7 @@ EXTRA_MAN_FILES = libopeniscsiusr.h.3
OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
+CFLAGS += -Wall -Wextra -fvisibility=hidden -fPIC
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -35,7 +35,7 @@ endif
PKG_CONFIG = /usr/bin/pkg-config
CFLAGS ?= -O2 -g
-WARNFLAGS ?= -Wall -Wextra -Werror -Wstrict-prototypes -fno-common
+WARNFLAGS ?= -Wall -Wextra -Wstrict-prototypes -fno-common
CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
-I$(TOPDIR)/libopeniscsiusr
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
@@ -76,9 +76,9 @@ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
iscsistart.o statics.o
$(CC) $(CFLAGS) $^ -o $@ -lcrypto -lrt $(LDFLAGS) $(ISCSI_LIB)
clean:
- rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+ $(RM) *.o $(PROGRAMS) .depend $(LIBSYS)
depend:
- gcc $(CFLAGS) -M `ls *.c` > .depend
+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-include .depend
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -10,9 +10,9 @@ iscsi-iname: md5.o iscsi-iname.o
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@
clean:
- rm -f *.o $(PROGRAMS) .depend
+ $(RM) *.o $(PROGRAMS) .depend
depend:
- gcc $(CFLAGS) -M `ls *.c` > .depend
+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-include .depend
--- a/utils/fwparam_ibft/Makefile
+++ b/utils/fwparam_ibft/Makefile
@@ -41,11 +41,11 @@ LDFLAGS += -L$(TOPDIR)/libopeniscsiusr -liscsiusr
all: $(OBJS)
clean:
- rm -f *.o $(CLEANFILES) .depend
+ $(RM) *.o $(CLEANFILES) .depend
$(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
depend:
- gcc $(CFLAGS) -M `ls *.c` > .depend
+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-include .depend
--- a/utils/sysdeps/Makefile
+++ b/utils/sysdeps/Makefile
@@ -8,9 +8,9 @@ SYSDEPS_OBJS=sysdeps.o
all: $(SYSDEPS_OBJS)
clean:
- rm -f *.o .depend
+ $(RM) *.o .depend
depend:
- gcc $(CFLAGS) -M `ls *.c` > .depend
+ $(CC) $(CFLAGS) -M `ls *.c` > .depend
-include .depend
diff --git a/usr/Makefile b/usr/Makefile
index 21bb154..e5fcf14 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -42,7 +42,8 @@ CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
ifeq ($(NO_SYSTEMD),)
-LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
+#LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
+LDFLAGS += -lsystemd
endif
PROGRAMS = iscsid iscsiadm iscsistart
diff --git a/iscsiuio/src/unix/Makefile.am b/iscsiuio/src/unix/Makefile.am
index a989ef0..6ffc607 100644
--- a/iscsiuio/src/unix/Makefile.am
+++ b/iscsiuio/src/unix/Makefile.am
@@ -31,7 +31,8 @@ iscsiuio_LDFLAGS= $(AM_LDADD) \
-ldl \
-rdynamic \
$(LIBNL_LIBS) \
- -lpthread
+ -lpthread \
+ -lsystemd
iscsiuio_LDADD = ${top_srcdir}/src/uip/lib_iscsi_uip.a \
${top_srcdir}/src/apps/dhcpc/lib_apps_dhcpc.a\
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
index 8099f09..e1e7947 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
@@ -67,10 +67,10 @@ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
AC_ARG_WITH([systemd],
AS_HELP_STRING([--without-systemd], [Build without systemd]),
[case "${withval}" in
- yes) LDFLAGS="`pkg-config --libs libsystemd`" ;;
+ yes) LDFLAGS="-lsystemd" ;;
no) CFLAGS="${CFLAGS} -DNO_SYSTEMD" ;;
*) AC_MSG_ERROR([bad value $withval for --with-systemd]) ;;
- esac],[LDFLAGS="`pkg-config --libs libsystemd`"])
+ esac],[LDFLAGS="-lsystemd"])
AC_CONFIG_COMMANDS([default],[[
if [ -n "$SOURCE_DATE_EPOCH" ] ; then