[mythtv-users] Apparent inconsistencies in --sysroot, --prefix, SYSROOT and PREFIX

Paul Bender pebender at san.rr.com
Wed Sep 16 15:43:01 UTC 2009


I am confused about the intention of the configure options --sysroot and 
--prefix as well as the build variables SYSROOT and PREFIX. The reason 
for my confusion is that they appear to be used differently in different 
parts of the Myth build system.

In the MythTV configure script, the value of --sysroot (sysroot) is used 
when looking for dependencies.  In addition, sysroot is prepended to the 
value of --prefix (prefix) when prefix is added to CONFIG_INCLUDEPATH. 
This would seem to imply that prefix is relative to sysroot. However, 
neither the configure script nor the build files prepend sysroot to 
prefix as part of the installation, implying that prefix is not relative 
to sysroot.

In addition, the MythTV configure script makes prefix available to the 
build files as PREFIX but does not make sysroot available to the build 
files.

As a result, when using the MythTV configuration script during cross 
compilation, --sysroot only has meaning to the configuration script and 
must be set to the root of the build tree and --prefix must be set to 
the full path to where MythTV is to be installed including the part of 
the path that is sysroot.

In the MythPlugins configure script, sysroot and prefix are treated the 
same as they are in the MythTV configure script with one exception, 
sysroot is prepended to prefix when looking for mythconfig.mak. Because 
of this, prefix must be set differently than when calling this script. 
Rather than being the full path it must be a path relative to sysroot.

In addition, the MythPlugins configure script does not make either 
prefix or sysroot available to the build files. Rather, it uses the 
PREFIX value in mythconfig.mak and has no SYSROOT value.

Unlike the MythTV build files, the MythPlugins build files prepends a 
variable SYSROOT when looking for includes and libraries. As SYSROOT is 
not set by any configure script, is is empty. Since the PREFIX value set 
by the MythTV configure script is the full path including sysroot, there 
is not problem locating MythTV installed files. However, there is a 
problem locating other files. For example, MythMusic adds 
$${SYSROOT}/usr/include/cdda to the the list of include paths.

In addition, oldthemes has both --sysroot and --prefix and uses them 
like MythPlugins, whereas themes has just --prefix and uses it like MythTV.

In my opinion, --prefix should be relative to --sysroot for installation 
purposes. This would require changing the MythTV configure script and 
build files so that the configure script writes out SYSROOT and so that 
the build files use it. In addition, this would require adding --sysroot 
to the themes configure script.

Finally, the include path for cdda files found in MythMusic should be 
moved to the configure script. This is where it belongs and would fix 
the broken compilation it causes.

Personally, I think that the change to MythTV to be too invasive for the 
0.22 release. Besides requiring a number of changes to MythTV's 
configure and *.pro files, it would break any third party plugins that 
do not use --sysroot or use it as MythTV uses it.

Therefore,  rather than doing that for 0.22 I would just (1) move the 
adding of the cdda include path from MythMusics *.pro file to 
MythPlugins configure script, (2) add --sysroot to the themes configure 
script, and (3) change the description of --prefix in MythPlugins, 
oldthemes and themes to reflect that --prefix is relative to --sysroot.

I am happy to create patches for any / all of these. However, I wanted 
to get feedback from others before bothering to do so. I would 
especially like feedback on the option of changing how MythTV treats 
--prefix and --sysroot as it is most invasive.



More information about the mythtv-users mailing list