Bug 47878

Summary: [PATCH] libXvMC* are not being installed where they should
Product: Mesa Reporter: Alexandre Demers <alexandre.f.demers>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: ckoenig.leichtzumerken
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Possible fix.
XvMC installation directory fix

Description Alexandre Demers 2012-03-25 22:29:58 UTC
Even if I'm passing "--libdir=/usr/lib/x86_64-linux-gnu --includedir=/usr/include/x86_64-linux-gnu" when configuring the build, libXvMC* are being installed under "/usr/x86_64-linux-gnu". These are the files in the folder:

lrwxrwxrwx  1 root root      16 Mar 25 21:21 libXvMCr600.so -> libXvMCr600.so.1
lrwxrwxrwx  1 root root      18 Mar 25 21:21 libXvMCr600.so.1 -> libXvMCr600.so.1.0
-rwxr-xr-x  1 root root 5123275 Mar 25 14:16 libXvMCr600.so.1.0
lrwxrwxrwx  1 root root      20 Mar 25 21:21 libXvMCsoftpipe.so -> libXvMCsoftpipe.so.1
lrwxrwxrwx  1 root root      22 Mar 25 21:21 libXvMCsoftpipe.so.1 -> libXvMCsoftpipe.so.1.0
-rwxr-xr-x  1 root root 5616198 Mar 25 14:16 libXvMCsoftpipe.so.1.0

I always do the following before reconfiguring:
 git clean -dfx
 make realclean

So it shouldn't come from a left configuration or anything.
Comment 1 Alexandre Demers 2012-03-27 22:32:36 UTC
Makefile.xvmc points to:

install: default
	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
	$(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(LIB_GLOB) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)


According to "current" file under ./configs:
INSTALL_DIR = $(prefix)
and
prefix = /usr
and
LIB_DIR = x86_64-linux-gnu (in this case)

This explains why it is not installed correctly because it should point to ${libdir}/ or ${libdir}/xvmc instead, where libdir = /usr/lib/x86_64-linux-gnu (or similar according to what is defined).

The solution is to add a XVMC_INSTALL_DIR in Makefile.xvmc and generate that variable in the "current" file. I know "current" is automatically generated, but I still don't know how exactly (going through autogen.sh -> configure -> configure.ac -> configs/* and then ...) If someone could help me on this, I would suggest a patch soon.
Comment 2 Christian König 2012-03-28 02:39:45 UTC
Going to dig into it, but I don't have much experience with the install targets also so that could take a while.
Comment 3 Christian König 2012-03-28 07:41:09 UTC
Created attachment 59161 [details] [review]
Possible fix.

Fixing the bug in the short hand is actually pretty easy, just replace the obvious incorrect combination of "$(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)" with "$(DESTDIR)$(INSTALL_LIB_DIR)".

As an alternative you could also add an "--with-xvmc-libdir=" option, which then results in setting the XVMC_INSTALL_DIR variable.

For an good example how to do this take a look at the "--with-vdpau-libdir=" option and the resulting VDPAU_LIB_INSTALL_DIR variable in configure.ac.

Hope that helps,
Christian.
Comment 4 Alexandre Demers 2012-03-28 11:40:58 UTC
This seems a good solution. My only concern is about the folder: do we want a specific folder as for other trackers?

By the way, thank you for the info about configure.ac

(In reply to comment #3)
> Created attachment 59161 [details] [review] [review]
> Possible fix.
> 
> Fixing the bug in the short hand is actually pretty easy, just replace the
> obvious incorrect combination of "$(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)" with
> "$(DESTDIR)$(INSTALL_LIB_DIR)".
> 
> As an alternative you could also add an "--with-xvmc-libdir=" option, which
> then results in setting the XVMC_INSTALL_DIR variable.
> 
> For an good example how to do this take a look at the "--with-vdpau-libdir="
> option and the resulting VDPAU_LIB_INSTALL_DIR variable in configure.ac.
> 
> Hope that helps,
> Christian.
Comment 5 Christian König 2012-03-29 01:00:43 UTC
It at least sounds like a good idea if vdpau and va have a separate installation-dir parameter to give xvmc one also.

I just doesn't want to do the patch myself, so if you want to hack it together just leave me a note here and then send the patch to the list for review.

Otherwise I'm going to commit the simpler version and close this bugreport.
Comment 6 Alexandre Demers 2012-03-29 05:22:03 UTC
(In reply to comment #5)
> It at least sounds like a good idea if vdpau and va have a separate
> installation-dir parameter to give xvmc one also.
> 
> I just doesn't want to do the patch myself, so if you want to hack it together
> just leave me a note here and then send the patch to the list for review.
> 
> Otherwise I'm going to commit the simpler version and close this bugreport.

I'll do it in the next couple of days with the help of your explanations.
Comment 7 Alexandre Demers 2012-04-03 15:20:38 UTC
Created attachment 59455 [details] [review]
XvMC installation directory fix

Please review. This fixes the folder in which XvMC libraries are installed.
Comment 8 Alexandre Demers 2012-04-03 21:50:39 UTC
Could someone review and commit it if good please? XvMC libs were not installed in the good folder.
Comment 9 Christian König 2012-04-04 02:05:22 UTC
Reordered the new macros a bit and comitted the result (http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ea3695b0495a56d9946a292e0e7cad4e0fb2fe0).  Please try to use git's "format-patch" command the next time instead of just supplying a diff (I just hate to write commit messages).

Thanks for the help,
Christian.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.