Mailing List Archive

config.h in dvdread
This is just a heads up of something that I encountered during some testing
that openSUSE seems to have a compile error with both master and fixes/32
if one has valgrind-devel installed.

dvdread/dvd_input.c: In function ‘dvdinput_setup’:
dvdread/dvd_input.c:292:36: error: ‘RTLD_LAZY’ undeclared (first use
in this function)
292 | dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
| ^~~~~~~~~

It appears openSUSE ships a config.h in /usr/include/valgrind/
which is used (rather than the mythtv one) due to the include order

The quick fix (may not be the correct fix) appears to be:

for master:

diff --git a/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
b/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
index 1513182a59..a691366d48 100644
--- a/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
+++ b/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
@@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

-#include "config.h" /* Required for HAVE_DVDCSS_DVDCSS_H */
+#include "libmythbase/mythconfig.h" /* Required for
HAVE_DVDCSS_DVDCSS_H */
#include <stdio.h> /* fprintf */
#include <stdlib.h> /* free */
#include <fcntl.h> /* open */


for fixes/32:

diff --git a/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
b/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
index 1513182a59..08a5e4d2a5 100644
--- a/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
+++ b/mythtv/external/libmythdvdnav/dvdread/dvd_input.c
@@ -19,7 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

-#include "config.h" /* Required for HAVE_DVDCSS_DVDCSS_H */
+#include "mythconfig.h" /* Required for
HAVE_DVDCSS_DVDCSS_H */
#include <stdio.h> /* fprintf */
#include <stdlib.h> /* free */
#include <fcntl.h> /* open */




Thanks.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: config.h in dvdread [ In reply to ]
On 9/22/22 23:10, Gary Buhrmaster wrote:
> This is just a heads up of something that I encountered during some testing
> that openSUSE seems to have a compile error with both master and fixes/32
> if one has valgrind-devel installed.
>
> dvdread/dvd_input.c: In function ‘dvdinput_setup’:
> dvdread/dvd_input.c:292:36: error: ‘RTLD_LAZY’ undeclared (first use
> in this function)
> 292 | dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
> | ^~~~~~~~~
>
> It appears openSUSE ships a config.h in/usr/include/valgrind/
> which is used (rather than the mythtv one) due to the include order

Try this instead (although I don't know why it would be in the INCLUDEPATH):
```
diff --git a/mythtv/external/libmythdvdnav/libmythdvdnav.pro
b/mythtv/external/libmythdvdnav/libmythdvdnav.pro
index fcc25f43ca..e918edec74 100644
--- a/mythtv/external/libmythdvdnav/libmythdvdnav.pro
+++ b/mythtv/external/libmythdvdnav/libmythdvdnav.pro
@@ -24,6 +24,10 @@ contains(INCLUDEPATH, /usr/X11R6/include) {
   POSTINC += /usr/X11R6/include
   INCLUDEPATH -= /usr/X11R6/include
 }
+contains(INCLUDEPATH, /usr/include/valgrind) {
+  POSTINC += /usr/include/valgrind
+  INCLUDEPATH -= /usr/include/valgrind
+}

 INCLUDEPATH += $$POSTINC

```

Other files `#include "config.h"` in libdvdread, although most don't
appear to use it.  Do you get a -Wundef from bswap.h? (Probably not due
to CONFIG += warn_off.)

It fails because HAVE_DLFCN_H is undefined: (lines 51-59)
```
/* dlopening libdvdcss */
# if defined(HAVE_DLFCN_H) && !defined(USING_BUILTIN_DLFCN)
#  include <dlfcn.h>
# else
#   if defined(WIN32)
/* Only needed on MINGW at the moment */
#    include "../msvc/contrib/dlfcn.c"
#   endif
# endif
```

A better method may be an empty config.h in the libmythdvdnav or
libdvdread folder and define the necessary values using only the .pro file.

This must be built only on POSIX compliant OSes, though, since our
config.h always defines HAVE_DLFCN_H.

Regards,

Scott
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org