Build fixes (#547)

* GNUmakefile-cross: Fix install target

The install target was not working: missing mkdir before copying files,
wrong dynamic library copied, missing ldconf.

The fix is mostly taken from the install target from GNUmakefile.

* Makefile: call 'ln -sf' instead of 'ln -sf -sf'
pull/552/head
zorun 2017-12-16 15:07:23 +01:00 committed by Jeffrey Walton
parent e56caf72ec
commit c3a85caf52
2 changed files with 10 additions and 7 deletions

View File

@ -869,7 +869,7 @@ ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR) $(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
@-$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX) @-$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
ifeq ($(HAS_SOLIB_VERSION),1) ifeq ($(HAS_SOLIB_VERSION),1)
-$(LN) -sf libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
$(LDCONF) $(DESTDIR)$(LIBDIR) $(LDCONF) $(DESTDIR)$(LIBDIR)
endif endif
endif endif

View File

@ -10,6 +10,7 @@ CHMOD ?= chmod
MKDIR ?= mkdir MKDIR ?= mkdir
EGREP ?= egrep EGREP ?= egrep
LN ?= ln -sf LN ?= ln -sf
LDCONF ?= /sbin/ldconfig -n
IS_i686 := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c 'i.86') IS_i686 := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c 'i.86')
IS_x86_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c 'x86_64|amd64') IS_x86_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c 'x86_64|amd64')
@ -350,30 +351,32 @@ distclean: clean
.PHONY: install .PHONY: install
install: install:
$(MKDIR) -p $(DESTDIR)$(INCLUDEDIR)/cryptopp @-$(MKDIR) -p $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp $(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
-$(CHMOD) 755 $(DESTDIR)$(INCLUDEDIR)/cryptopp -$(CHMOD) 755 $(DESTDIR)$(INCLUDEDIR)/cryptopp
-$(CHMOD) 644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h -$(CHMOD) 644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
ifneq ($(wildcard cryptest.exe),) ifneq ($(wildcard cryptest.exe),)
$(MKDIR) -p $(DESTDIR)$(BINDIR) @-$(MKDIR) -p $(DESTDIR)$(BINDIR)
$(CP) cryptest.exe $(DESTDIR)$(BINDIR) $(CP) cryptest.exe $(DESTDIR)$(BINDIR)
-$(CHMOD) 755 $(DESTDIR)$(BINDIR)/cryptest.exe -$(CHMOD) 755 $(DESTDIR)$(BINDIR)/cryptest.exe
endif endif
ifneq ($(wildcard libcryptopp.a),) ifneq ($(wildcard libcryptopp.a),)
$(MKDIR) -p $(DESTDIR)$(LIBDIR) @-$(MKDIR) -p $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR) $(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
-$(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcryptopp.a -$(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcryptopp.a
endif endif
ifneq ($(wildcard libcryptopp.dylib),) ifneq ($(wildcard libcryptopp.dylib),)
$(MKDIR) -p $(DESTDIR)$(LIBDIR) @-$(MKDIR) -p $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR) $(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
-$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib -$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
endif endif
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),) ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
$(CP) libcryptopp.so $(DESTDIR)$(LIBDIR) @-$(MKDIR) -p $(DESTDIR)$(LIBDIR)
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
-$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX) -$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
ifeq ($(HAS_SOLIB_VERSION),1) ifeq ($(HAS_SOLIB_VERSION),1)
-$(LN) -sf libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
$(LDCONF) $(DESTDIR)$(LIBDIR)
endif endif
endif endif