libkcapi/libkcapi-1.0.3-autotools_full_path.patch
2018-01-16 18:47:27 +01:00

198 lines
6.1 KiB
Diff

From b9bced05dae319c6a00c2adce8953d468404a95c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 13 Jan 2018 14:22:42 +0100
Subject: [PATCH] autotools: Use full path for external programs
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
Makefile.am | 68 +++++++++++++++++++++++++++++++++---------------------------
configure.ac | 35 ++++++++++++++++++-------------
2 files changed, 58 insertions(+), 45 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 66464e1..cbb1302 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -144,8 +144,11 @@ kcapi_hasher_links = sha1sum sha224sum sha256sum sha384sum sha512sum \
install-exec-hook:
(cd $(DESTDIR)$(bindir) && \
- ($(foreach link, $(kcapi_hasher_links), ln -f kcapi-hasher $(link);)) && \
- ($(foreach link, $(kcapi_hasher_links), openssl sha256 -hmac orboDeJITITejsirpADONivirpUkvarP $(link) > .$(link).hmac;)))
+ ($(foreach link, $(kcapi_hasher_links), $(LN) -f kcapi-hasher $(link);)))
+if HAVE_OPENSSL
+ (cd $(DESTDIR)$(bindir) && \
+ ($(foreach link, $(kcapi_hasher_links), $(OPENSSL) sha256 -hmac orboDeJITITejsirpADONivirpUkvarP $(link) > .$(link).hmac;)))
+endif
endif
if ENABLE_KCAPI_RNGAPP
@@ -195,7 +198,7 @@ MOSTLYCLEANFILES = $(analyze_plists)
$(analyze_plists): %.plist: %.c
@echo " CCSA " $@
- @clang --analyze $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -Ilib/ $< -o $@
+ @$(CLANG) --analyze $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -Ilib/ $< -o $@
scan: $(analyze_plists)
@@ -204,16 +207,19 @@ endif
if HAVE_CPPCHECK
cppcheck:
- cppcheck --enable=performance,warning,portability $(sort $(SCAN_FILES))
+ $(CPPCHECK) --enable=performance,warning,portability $(sort $(SCAN_FILES))
endif
if HAVE_MKTEMP
-TEMPFILE := $(shell mktemp)
+DOCPROC_TEMP := $(shell $(MKTEMP))
+else
+DOCPROC_TEMP := $(abs_top_builddir)/docproc.temp
+endif
%.xml: %.tmpl lib/doc/bin/docproc$(EXEEXT)
- $(SED) "s/@@LIBVERSION@@/$(VERSION)/" < $< > $(TEMPFILE)
- LIBVERSION=$(VERSION) SRCTREE=lib/ $(abs_top_builddir)/lib/doc/bin/docproc$(EXEEXT) doc $(TEMPFILE) > $@
- rm $(TEMPFILE)
+ $(SED) "s/@@LIBVERSION@@/$(VERSION)/" < $< > $(DOCPROC_TEMP)
+ LIBVERSION=$(VERSION) SRCTREE=lib/ $(abs_top_builddir)/lib/doc/bin/docproc$(EXEEXT) doc $(DOCPROC_TEMP) > $@
+ -rm $(DOCPROC_TEMP)
if HAVE_DB2PDF
DOC_TARGETS += pdf
@@ -221,10 +227,10 @@ DOC_TARGETS += pdf
pdf: pdf-stamp
pdf-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/pdf
- HOME=$(abs_top_builddir)/doc/pdf db2pdf -o doc/pdf $<
- mv doc/pdf/*.pdf doc
- rm -r doc/pdf
- touch $@
+ HOME=$(abs_top_builddir)/doc/pdf $(DB2PDF) -o doc/pdf $<
+ $(MV) doc/pdf/*.pdf doc
+ -rm -r doc/pdf
+ $(TOUCH) $@
endif
if HAVE_DB2PS
@@ -233,10 +239,10 @@ DOC_TARGETS += ps
ps: ps-stamp
ps-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/ps
- HOME=$(abs_top_builddir)/doc/ps db2ps -o doc/ps $<
- mv doc/ps/*.ps doc
- rm -r doc/ps
- touch $@
+ HOME=$(abs_top_builddir)/doc/ps $(DB2PS) -o doc/ps $<
+ $(MV) doc/ps/*.ps doc
+ -rm -r doc/ps
+ $(TOUCH) $@
endif
if HAVE_XMLTO
@@ -245,36 +251,36 @@ DOC_TARGETS += html
html: html-stamp
html-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) lib/doc/html
- xmlto html -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/html/ $< 2>/dev/null
- touch $@
+ $(XMLTO) html -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/html/ $< 2>/dev/null
+ $(TOUCH) $@
DOC_TARGETS += man
man: man-stamp
man-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) lib/doc/man
- xmlto man -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/man/ $< 2>/dev/null
- touch $@
+ $(XMLTO) man -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/man/ $< 2>/dev/null
+ $(TOUCH) $@
devel_manpages = lib/doc/man/*.3
man_MANS += $(devel_manpages)
$(devel_manpages): man
endif
-endif
doc: $(sort $(DOC_TARGETS))
clean-local:
- rm -f *-stamp
- rm -f lib/doc/*.xml
- rm -f lib/doc/*.pdf
- rm -f lib/doc/*.ps
- rm -rf lib/doc/man/
- rm -rf lib/doc/html/
- rm -rf doc/
- rm -rf bin/
+ -rm -f $(DOCPROC_TEMP)
+ -rm -f *-stamp
+ -rm -f lib/doc/*.xml
+ -rm -f lib/doc/*.pdf
+ -rm -f lib/doc/*.ps
+ -rm -rf lib/doc/man/
+ -rm -rf lib/doc/html/
+ -rm -rf doc/
+ -rm -rf bin/
distclean-local:
- rm -f lib/doc/Makefile*
- rm -rf autom4te.cache/
+ -rm -f lib/doc/Makefile*
+ -rm -rf autom4te.cache/
diff --git a/configure.ac b/configure.ac
index f3a2c97..6555c26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,26 +27,33 @@ AC_CONFIG_MACRO_DIR([m4])
AX_PROG_CC_FOR_BUILD
AX_CHECK_PIE
-AC_CHECK_PROG([CLANG], [clang], [yes])
-AC_CHECK_PROG([CPPCHECK], [cppcheck], [yes])
-AC_CHECK_PROG([XMLTO], [xmlto], [yes])
-AC_CHECK_PROG([DB2PDF], [db2pdf], [yes])
-AC_CHECK_PROG([DB2PS], [db2ps], [yes])
-AC_CHECK_PROG([MKTEMP], [mktemp], [yes])
+AC_PATH_PROG([OPENSSL], [openssl])
+AC_PATH_PROG([CLANG], [clang])
+AC_PATH_PROG([CPPCHECK], [cppcheck])
+AC_PATH_PROG([XMLTO], [xmlto])
+AC_PATH_PROG([DB2PDF], [db2pdf])
+AC_PATH_PROG([DB2PS], [db2ps])
+AC_PATH_PROG([MKTEMP], [mktemp])
AC_SEARCH_LIBS(clock_gettime,rt)
AC_PROG_MKDIR_P
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_LN_S
-
-AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" = "xyes" ])
-AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$CPPCHECK" = "xyes"])
-AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" = "xyes"])
-AM_CONDITIONAL([HAVE_DB2PDF], [test "x$DB2PDF" = "xyes"])
-AM_CONDITIONAL([HAVE_DB2PS], [test "x$DB2PS" = "xyes"])
-AM_CONDITIONAL([HAVE_MKTEMP], [test "x$MKTEMP" = "xyes"])
-
+AC_PATH_PROG([CP], [cp])
+AC_PATH_PROG([LN], [ln])
+AC_PATH_PROG([MV], [mv])
+AC_PATH_PROG([TOUCH], [touch])
+
+AM_CONDITIONAL([HAVE_OPENSSL], [test "x$OPENSSL" != "x"])
+AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" != "x"])
+AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$CPPCHECK" != "x"])
+AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
+AM_CONDITIONAL([HAVE_DB2PDF], [test "x$DB2PDF" != "x"])
+AM_CONDITIONAL([HAVE_DB2PS], [test "x$DB2PS" != "x"])
+AM_CONDITIONAL([HAVE_MKTEMP], [test "x$MKTEMP" != "x"])
+
+AM_COND_IF([HAVE_OPENSSL], [], [AC_MSG_WARN([openssl not installed])])
AM_COND_IF([HAVE_CLANG], [], [AC_MSG_WARN([clang not installed])])
AM_COND_IF([HAVE_CPPCHECK], [], [AC_MSG_WARN([cppcheck not installed])])
AM_COND_IF([HAVE_XMLTO], [], [AC_MSG_WARN([xmlto not installed])])