[PATCH] xine_ui: fix libjpeg detection

Xavier Bachelot <[email protected]> Sat, 10 Nov 2018 16:01:07 +0100
Newsgroups gmane.comp.video.xine.devel
Message-ID <[email protected]>
Hi,

Here are 2 patches. First one fixes detection of libjpeg. While looking 
at configure.ac, I also fixed the trailing white spaces, this is the 
second patch.
There could probably be a lot more done about the formating of this 
file, but I'm really slowed down by my lack of mercurial skills in order 
to properly separate changes into smaller patches.

Regards,
Xavier

_______________________________________________
xine-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-devel
xine-ui-fix_libjpeg_detection.patch (text/x-patch, 1016 B)
# HG changeset patch
# User Xavier Bachelot <[email protected]>
# Date 1541690409 -3600
#      Thu Nov 08 16:20:09 2018 +0100
# Node ID 7c74368e8e093fd31c1f3d5dd58970162e9ce1fa
# Parent  f804447051a552636261b10d0f53a87759991398
Fix libjpeg detection

The test was missing a comma, and thus did not error out when the library was
not found.
Also, clean up the lines for legibility.

diff -r f804447051a5 -r 7c74368e8e09 configure.ac
--- a/configure.ac	Sat Oct 13 19:15:20 2018 +0300
+++ b/configure.ac	Thu Nov 08 16:20:09 2018 +0100
@@ -476,9 +476,10 @@
 saved_LIBS="$LIBS"
 CFLAGS="$CFLAGS $JPEG_CFLAGS"
 LIBS="$LIBS $JPEG_LIBS"
-AC_CHECK_LIB([jpeg], [jpeg_read_header],
-  [AC_CHECK_HEADER([jpeglib.h], [], [AC_MSG_ERROR([JPEG library is required])])
-  ], [$JPEG_LIBS])
+AC_CHECK_LIB([jpeg], [jpeg_read_header],,
+             [AC_CHECK_HEADER([jpeglib.h], [],
+                              [AC_MSG_ERROR([JPEG library is required])])],
+             [$JPEG_LIBS])
 CFLAGS="$saved_CFLAGS"
 LIBS="$saved_LIBS"
xine-ui-remove_trailing_white_spaces.patch (text/x-patch, 5.2 KB)
# HG changeset patch
# User Xavier Bachelot <[email protected]>
# Date 1541859336 -3600
#      Sat Nov 10 15:15:36 2018 +0100
# Node ID d03413d4909abc6e83ac155bb75c36ff917bdbb8
# Parent  7c74368e8e093fd31c1f3d5dd58970162e9ce1fa
Remove trailing white spaces

diff -r 7c74368e8e09 -r d03413d4909a configure.ac
--- a/configure.ac	Thu Nov 08 16:20:09 2018 +0100
+++ b/configure.ac	Sat Nov 10 15:15:36 2018 +0100
@@ -148,8 +148,8 @@
   XV_LIB=$XV_LIBS
   ac_have_xv="yes"
   AC_DEFINE(HAVE_XV, 1, [Define this if you have libXv installed])
-], [  
-  AC_CHECK_LIB(Xv, XvQueryExtension, 
+], [
+  AC_CHECK_LIB(Xv, XvQueryExtension,
             [ XV_LIB="-lXv"
 	      AC_DEFINE(HAVE_XV, 1, [Define this if you have libXv installed])
             ],, [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
@@ -175,11 +175,11 @@
 dnl the checks for XShm
 if test "x$enable_shm" != "xno"; then
   dnl Check for the Xext library (needed for XShm extension)
-  AC_CHECK_LIB(Xext, XShmAttach, 
-      X_LIBS="-lXext $X_LIBS", 
+  AC_CHECK_LIB(Xext, XShmAttach,
+      X_LIBS="-lXext $X_LIBS",
       dnl On AIX, it is in XextSam instead, but we still need -lXext
-      AC_CHECK_LIB(XextSam, XShmAttach, 
-          [X_LIBS="-lXextSam -lXext $X_LIBS"], 
+      AC_CHECK_LIB(XextSam, XShmAttach,
+          [X_LIBS="-lXextSam -lXext $X_LIBS"],
           no_xshm_ext=yes; have_shm=no, $X_LIBS),
       $X_LIBS)
 
@@ -240,12 +240,12 @@
    AS_HELP_STRING([--disable-xinerama], [Do not build support for xinerama (default: check)]))
 if test "x$enable_xinerama" != "xno"; then
   PKG_CHECK_MODULES([XINERAMA], [xinerama], [ac_have_xinerama="yes"], [
-    AC_CHECK_LIB(Xinerama, XineramaQueryExtension, 
+    AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
                XINERAMA_LIBS="-lXinerama"
                ac_have_xinerama="yes",,
                $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
   ])
-  
+
   if test "x$ac_have_xinerama" = "xyes"; then
      X_PRE_LIBS="$X_PRE_LIBS $XINERAMA_LIBS"
      AC_DEFINE(HAVE_XINERAMA,,[Define this if you have libXinerama installed])
@@ -258,7 +258,7 @@
 dnl Checks for XF86VidMode extension
 dnl
 PKG_CHECK_MODULES([XXF86VM], [xxf86vm], [ac_have_xf86vidmode="yes"], [
-  AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, 
+  AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
              XXF86VM_LIBS="-lXxf86vm"
              ac_have_xf86vidmode="yes",,
              $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
@@ -276,7 +276,7 @@
 dnl XTest Extension
 dnl
 PKG_CHECK_MODULES([XTEST], [xtst], [ac_have_xtest="yes"], [
-  AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, 
+  AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
              XTEST_LIBS="-lXtst"
 	     ac_have_xtest="yes",, $X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS)
 ])
@@ -325,7 +325,7 @@
 
 if test x"$with_curl" != xno; then
    PKG_CHECK_MODULES([CURL], [libcurl >= 7.10.2], have_curl="yes", have_curl="no")
-   
+
    if test "x$have_curl" = "xyes"; then
       AC_DEFINE([HAVE_CURL], [1], [Define this if you have libcurl installed])
    else
@@ -359,9 +359,9 @@
 fi
 AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes")
 
-dnl 
+dnl
 dnl checks for Color AsCii Art library
-dnl 
+dnl
 AC_ARG_WITH([caca],
   AS_HELP_STRING([--without-caca], [Do not build CACA support]))
 
@@ -377,9 +377,9 @@
    if test "x$have_caca" = "xyes"; then
      AM_DL()
    fi
-   AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <caca.h> 
-                                        caca_event_t ev;]], 
-                                        [[ev.type = 0;]] 
+   AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <caca.h>
+                                        caca_event_t ev;]],
+                                        [[ev.type = 0;]]
                        )],
                        [],
                        [AC_DEFINE(CACA_EVENT_OPAQUE, [1], ["Define if struct caca_event is opaque and must not be accessed directly"])]
@@ -410,18 +410,18 @@
   CFLAGS="$CFLAGS $XFT_CFLAGS"
   LIBS="$LIBS $XFT_LIBS"
   AC_TRY_LINK([
-#include <X11/Xft/Xft.h>], [ XftFontClose(0, 0); return 1; ], 
+#include <X11/Xft/Xft.h>], [ XftFontClose(0, 0); return 1; ],
     [
       AC_DEFINE(WITH_XFT, 1, [font antialiasing support])
       AC_MSG_CHECKING([Xft UTF-8 support])
       AC_TRY_LINK([
 #include <X11/Xft/Xft.h>
-        ], [ 
-XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0; 
+        ], [
+XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0;
         ],
           AC_DEFINE(HAVE_XFT_UTF8_STRING, 1, "Xft UTF8 support")
           AC_MSG_RESULT(yes),
-          AC_MSG_RESULT(no)) 
+          AC_MSG_RESULT(no))
     ],
     [
       AC_MSG_RESULT([***Could not link with Xft. Install Xft if you want support for it***])
@@ -625,14 +625,14 @@
   int c;
 
   opterr = 0;
-  while((c = getopt_long(argc, argv, "?hv", 
+  while((c = getopt_long(argc, argv, "?hv",
 			 long_options, &option_index)) != EOF) {
   }
   return 0;
 }
-], [AC_MSG_RESULT(yes); 
-	ac_getopt_long=yes; 
-	AC_DEFINE(HAVE_GETOPT_LONG,,[Define this if you have GNU getopt_long() implemented])], 
+], [AC_MSG_RESULT(yes);
+	ac_getopt_long=yes;
+	AC_DEFINE(HAVE_GETOPT_LONG,,[Define this if you have GNU getopt_long() implemented])],
    [AC_MSG_RESULT(no); ac_getopt_long=no],
    [AC_MSG_RESULT(no); ac_getopt_long=no])
 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x"$ac_getopt_long" = "xyes")