Fixed bug 2360 - Wrong -rpath setting includes DESTDIR rather that only the libdir
authorSam Lantinga <slouken@libsdl.org>
Mon, 14 Aug 2017 14:10:48 -0700
changeset 11291a153a5c6d413
parent 11290 ef96b05151c5
child 11292 df399ea01ee5
Fixed bug 2360 - Wrong -rpath setting includes DESTDIR rather that only the libdir

Marcus von Appen

The LT_LDFLAGS in Makefile.in contain the $(DESTDIR) in -rpath, which instructs libtool to take a wrong path into account for linking.

The issue arises, if DESTDIR is passed at build time and installation time.
-rpath only should use $(libdir) for both SDL 1.2 and SDL 2.x.
Makefile.in
     1.1 --- a/Makefile.in	Mon Aug 14 13:48:13 2017 -0700
     1.2 +++ b/Makefile.in	Mon Aug 14 14:10:48 2017 -0700
     1.3 @@ -121,7 +121,7 @@
     1.4  LT_CURRENT  = @LT_CURRENT@
     1.5  LT_RELEASE  = @LT_RELEASE@
     1.6  LT_REVISION = @LT_REVISION@
     1.7 -LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
     1.8 +LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
     1.9  
    1.10  all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
    1.11  
    1.12 @@ -145,10 +145,10 @@
    1.13  	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
    1.14  
    1.15  $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
    1.16 -	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(DESTDIR)$(libdir)
    1.17 +	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
    1.18  
    1.19  $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
    1.20 -	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(DESTDIR)$(libdir)
    1.21 +	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
    1.22  
    1.23  install: all install-bin install-hdrs install-lib install-data
    1.24  install-bin: