[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: configure.ac: fix AC_PROG_LEX warning

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 17 04:09:21 UTC 2022



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
cacf92f3 by Alexandre Janniaux at 2022-11-15T22:37:17+01:00
configure.ac: fix AC_PROG_LEX warning

With autoconf 2.70, the following warnings are emitted:

configure.ac:56: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
configure.ac:56: the top level

The documentation[1] of autoconf now states:

> Prior to Autoconf 2.70, AC_PROG_LEX did not take any arguments, and
> its behavior was different from either of the above possibilities: it
> would search for a library that defines yywrap, and would set LEXLIB
> to that library if it finds one. However, if a library that defines
> this function could not be found, LEXLIB would be left empty and LEX
> would not be reset. This behavior was due to a bug, but several
> packages came to depend on it, so AC_PROG_LEX still does this if
> neither the yywrap nor the noyywrap option is given.
>
> Usage of AC_PROG_LEX without choosing one of the yywrap or noyywrap
> options is deprecated. It is usually better to use noyywrap and define
> the yywrap function yourself, as this almost always renders the LEXLIB
> unnecessary.

The behaviour of the argument on autoconf < 2.70 is to ignore the
argument, so there are no issues with adding the option.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/Particular-Programs.html#Particular-Programs

(cherry picked from commit 824b3d4551e6c19e34e31bedb6f8843cfda35ca0)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -
0a33447a by Alexandre Janniaux at 2022-11-15T23:07:27+01:00
configure.ac: fix deprecated mention with newer autoconf

(cherry picked from commit 7eb922bcb2cb9b4a023597a25871074c6fd9e42a)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -


1 changed file:

- configure.ac


Changes:

=====================================
configure.ac
=====================================
@@ -65,7 +65,7 @@ AC_PROG_EGREP
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AM_PROG_AS
-AC_PROG_LEX
+AC_PROG_LEX([noyywrap])
 AC_PROG_YACC
 
 AC_ARG_VAR([DESKTOP_FILE_VALIDATE], [Validator for desktop entry files])
@@ -711,15 +711,14 @@ dnl Check for struct sockaddr_storage
 AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
 AH_TEMPLATE(ss_family, [Define to `sa_family' if <sys/socket.h> does not define.]) dnl ` (fix VIM syntax highlight
 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_struct_sockaddr_storage,
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
      #if defined( _WIN32 )
      # include <winsock2.h>
      #else
      # include <sys/socket.h>
-     #endif], [struct sockaddr_storage addr;],
-     ac_cv_struct_sockaddr_storage=yes,
-     ac_cv_struct_sockaddr_storage=no)])
+     #endif]], [[struct sockaddr_storage addr;]])],
+     [ac_cv_struct_sockaddr_storage=yes],
+     [ac_cv_struct_sockaddr_storage=no])])
 AS_IF([test "${ac_cv_struct_sockaddr_storage}" = no], [
   AC_DEFINE(sockaddr_storage, sockaddr)
   AC_DEFINE(ss_family, sa_family)
@@ -861,8 +860,8 @@ AC_LANG_PUSH(C++)
 AC_CACHE_CHECK([if C++ headers define locale_t],
   [ac_cv_cxx_locale_t],
   [ac_cv_cxx_locale_t=no
-   AC_TRY_COMPILE([#include <locale>], [locale_t loc;],
-                    [ac_cv_cxx_locale_t=yes])])
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <locale>]], [[locale_t loc;]])],
+                        [ac_cv_cxx_locale_t=yes],[])])
 if test "${ac_cv_cxx_locale_t}" != "no"; then
   AC_DEFINE(HAVE_CXX_LOCALE_T, 1, Define to 1 if C++ headers define locale_t)
 fi
@@ -1198,7 +1197,7 @@ AH_BOTTOM([
 VLC_SAVE_FLAGS
 LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
 AC_CACHE_CHECK([if linker supports -Bsymbolic], [ac_cv_ld_bsymbolic], [
-  AC_TRY_LINK([],, [
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
     ac_cv_ld_bsymbolic="-Wl,-Bsymbolic"
   ], [
     ac_cv_ld_bsymbolic=""
@@ -1211,7 +1210,7 @@ AC_SUBST(SYMBOLIC_LDFLAGS)
 VLC_SAVE_FLAGS
 LDFLAGS="${LDFLAGS} -Wl,-z,defs"
 AC_CACHE_CHECK([if linker supports -z,defs], [ac_cv_ld_z_defs], [
-  AC_TRY_LINK([],, [
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
     ac_cv_ld_z_defs="yes"
   ], [
     ac_cv_ld_z_defs="no"
@@ -1223,8 +1222,9 @@ dnl Check for __attribute__((packed))
 AC_CACHE_CHECK([for __attribute__((packed))],
   [ac_cv_c_attribute_packed],
   [ac_cv_c_attribute_packed=no
-   AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b; (void)b;],
-                    [ac_cv_c_attribute_packed=yes])])
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
+                        [[struct __attribute__((__packed__)) foo { int a; } b; (void)b;]])],
+                     [ac_cv_c_attribute_packed=yes],[])])
 if test "${ac_cv_c_attribute_packed}" != "no"; then
   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
 fi
@@ -1583,10 +1583,14 @@ AS_IF([test "${enable_altivec}" = "yes"], [
   VLC_SAVE_FLAGS
   AC_CACHE_CHECK([if $CC groks AltiVec inline assembly],
     [ac_cv_altivec_inline],
-    [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
-         ac_cv_altivec_inline="yes",
-         [CFLAGS="${CFLAGS} -Wa,-maltivec"
-          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
+    [AC_COMPILE_IFELSE([
+        AC_LANG_PROGRAM([[]],
+            [[asm volatile("vperm 0,1,2,3");]])],
+     [ac_cv_altivec_inline="yes"],
+     [CFLAGS="${CFLAGS} -Wa,-maltivec"
+      AC_COMPILE_IFELSE([
+         AC_LANG_PROGRAM([[]],
+            [[asm volatile("vperm 0,1,2,3");]])],
             [ac_cv_altivec_inline="-Wa,-maltivec"],
             ac_cv_altivec_inline=no)
          ])])
@@ -1618,7 +1622,7 @@ AS_IF([test "${enable_altivec}" = "yes"], [
   LDFLAGS="${LDFLAGS} -Wl,-framework,vecLib"
   AC_CACHE_CHECK([if linker needs -framework vecLib],
     [ac_cv_ld_altivec],
-    [AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)])
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_ld_altivec=yes],[ac_cv_ld_altivec=no])])
   VLC_RESTORE_FLAGS
   AS_IF([test "${ac_cv_ld_altivec}" != "no"], [
     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,vecLib])



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/638a07dba08b4e20c7e574288bc4bfdc770664ee...0a33447a72c8b2aefcfc9af2a9e1d53306cff3e8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/638a07dba08b4e20c7e574288bc4bfdc770664ee...0a33447a72c8b2aefcfc9af2a9e1d53306cff3e8
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list