[vlc-devel] [PATCH] configure: replace custom .exe detection by the standard AC_EXEEXT

Steve Lhomme robux4 at ycbcr.xyz
Tue Jun 5 15:40:43 CEST 2018


---
 configure.ac    | 24 +++++-------------------
 src/Makefile.am |  8 ++++----
 2 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0b2d8903ce..c50f7df064 100644
--- a/configure.ac
+++ b/configure.ac
@@ -328,21 +328,7 @@ AM_CONDITIONAL(HAVE_WIN64,   test "${HAVE_WIN64}" = "1") dnl Only used for the p
 AM_CONDITIONAL([HAVE_WINSTORE], [test "$vlc_winstore_app" = "1"])
 AM_CONDITIONAL([HAVE_WIN32_DESKTOP], [test "${SYS}" = "mingw32" -a "$vlc_winstore_app" = "0"])
 
-dnl
-dnl Sadly autoconf does not think about testing foo.exe when ask to test
-dnl for program foo on win32
-case "${build_os}" in
-    cygwin|msys|mingw32)
-        ac_executable_extensions=".exe"
-        BUILDEXEEXT=".exe"
-    ;;
-    os2*)
-        BUILDEXEEXT=".exe"
-    ;;
-    *)
-    ;;
-esac
-AC_SUBST(BUILDEXEEXT)
+AC_EXEEXT
 
 dnl Android is linux, but a bit different
 AS_IF([test "$SYS" = linux],[
@@ -425,13 +411,13 @@ AS_IF([test -n "${CONTRIB_DIR}"], [
 
   AS_IF([test -z "$LUAC"], [
     dnl Old contribs mixed cross-tools and cross-compiled executables
-    AS_IF([test -x "${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"], [
-      LUAC="${CONTRIB_DIR}/bin/luac${BUILDEXEEXT}"
+    AS_IF([test -x "${CONTRIB_DIR}/bin/luac${ac_cv_exeext}"], [
+      LUAC="${CONTRIB_DIR}/bin/luac${ac_cv_exeext}"
     ])
 
     dnl Newer contribs follow usual name space rules
-    AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"], [
-      LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${BUILDEXEEXT}"
+    AS_IF([test -x "${CONTRIB_DIR}/../bin/${host_alias}-luac${ac_cv_exeext}"], [
+      LUAC="${CONTRIB_DIR}/../bin/${host_alias}-luac${ac_cv_exeext}"
     ])
   ])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index a13a3147d0..3c0b407271 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -493,15 +493,15 @@ libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc $(top_srcdir)/extras/package/win32
 # FourCC tables
 BUILT_SOURCES += fourcc_tables.h
 EXTRA_DIST += misc/fourcc_gen.c
-MOSTLYCLEANFILES = fourcc_gen$(BUILDEXEEXT)
+MOSTLYCLEANFILES = fourcc_gen$(ac_cv_exeext)
 
-fourcc_gen$(BUILDEXEEXT): misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
+fourcc_gen$(ac_cv_exeext): misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
 	$(AM_V_at)rm -f -- $@
 	$(AM_V_CC)$(BUILDCC) -I$(srcdir) -o $@ $<
 
-fourcc_tables.h: fourcc_gen$(BUILDEXEEXT)
+fourcc_tables.h: fourcc_gen$(ac_cv_exeext)
 	$(AM_V_at)rm -f -- $@.tmp
-	$(AM_V_GEN)$(builddir)/fourcc_gen$(BUILDEXEEXT) > $@.tmp
+	$(AM_V_GEN)$(builddir)/fourcc_gen$(ac_cv_exeext) > $@.tmp
 	$(AM_V_at)mv -f -- $@.tmp $@
 
 # Unit/regression tests
-- 
2.17.0



More information about the vlc-devel mailing list