unrar-5.5.5-honor-flags.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Makefile: Honor {LD,CXX}FLAGS, add LIBFLAGS
  2. - append -pthread to LDFLAGS instead of replacing them
  3. - use CXXFLAGS when linking
  4. - append LIBFLAGS to the individual targets instead of the final link
  5. Gentoo-Bug: https://bugs.gentoo.org/461806
  6. --- a/makefile
  7. +++ b/makefile
  8. @@ -8,7 +8,7 @@ LIBFLAGS=-fPIC
  9. DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
  10. STRIP=strip
  11. AR=ar
  12. -LDFLAGS=-pthread
  13. +LDFLAGS+=-pthread
  14. DESTDIR=/usr
  15. # Linux using LCC
  16. @@ -145,18 +145,19 @@ clean:
  17. @rm -f libunrar.a
  18. unrar: $(OBJECTS) $(UNRAR_OBJ)
  19. - $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
  20. + $(LINK) -o unrar $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
  21. $(STRIP) unrar
  22. sfx: WHAT=SFX_MODULE
  23. sfx: $(OBJECTS)
  24. - $(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
  25. + $(LINK) -o default.sfx $(CXXFLAGS) $(LDFLAGS) $(OBJECTS)
  26. $(STRIP) default.sfx
  27. +$(OBJECTS) $(LIB_OBJ): CXXFLAGS+=$(LIBFLAGS)
  28. +
  29. lib: WHAT=RARDLL
  30. -lib: CXXFLAGS+=$(LIBFLAGS)
  31. lib: $(OBJECTS) $(LIB_OBJ)
  32. - $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
  33. + $(LINK) -shared -o libunrar.so $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
  34. $(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
  35. install-unrar:
  36. --
  37. 2.13.1