[FFmpeg-cvslog] makedef: Pass EXTERN_PREFIX from configure to makedef

Martin Storsjö git at videolan.org
Thu Nov 16 18:14:42 EET 2017


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Nov 16 09:32:15 2017 +0200| [bad7ce1d82f0b7da55086b8c6124eff0d35a1b1a] | committer: Martin Storsjö

makedef: Pass EXTERN_PREFIX from configure to makedef

This avoids having to use either "dumpbin -headers" to find out
the current architecture, or pass $ARCH from configure to deduce it.

When configuring with --disable-asm, ARCH is equal to "c", which doesn't
give any indication of what symbol prefix is to be used.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bad7ce1d82f0b7da55086b8c6124eff0d35a1b1a
---

 compat/windows/makedef | 28 +---------------------------
 configure              |  5 +++--
 2 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/compat/windows/makedef b/compat/windows/makedef
index 0cd169c15c..7258b94a92 100755
--- a/compat/windows/makedef
+++ b/compat/windows/makedef
@@ -58,33 +58,7 @@ fi
 IFS='
 '
 
-# Determine if we're building for x86 or x86_64 and
-# set the symbol prefix accordingly.
-prefix=""
-if [ -n "$NM" ]; then
-    case $ARCH in
-    *86)
-        prefix="_"
-        ;;
-    *)
-        ;;
-    esac
-else
-    arch=$(dumpbin -headers ${libname} |
-           tr '\t' ' ' |
-           grep '^ \+.\+machine \+(.\+)' |
-           head -1 |
-           sed -e 's/^ \{1,\}.\{1,\} \{1,\}machine \{1,\}(\(.\{3,5\}\)).*/\1/')
-
-    if [ "${arch}" = "x86" ]; then
-        prefix="_"
-    else
-        if [ "${arch}" != "ARM" ] && [ "${arch}" != "x64" ] && [ "${arch}" != "ARM64" ]; then
-            echo "Unknown machine type." >&2
-            exit 1
-        fi
-    fi
-fi
+prefix="$EXTERN_PREFIX"
 
 started=0
 regex="none"
diff --git a/configure b/configure
index 3bad7fb72c..fcffbce7f9 100755
--- a/configure
+++ b/configure
@@ -3898,7 +3898,7 @@ case $target_os in
         SLIB_INSTALL_LINKS=
         SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
         SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-        SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+        SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
         SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
         enabled x86_64 && objformat="win64" || objformat="win32"
         ranlib=:
@@ -3918,7 +3918,7 @@ case $target_os in
         SLIBSUF=".dll"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+        SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
         SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
         SLIB_INSTALL_LINKS=
         SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
@@ -5210,6 +5210,7 @@ SRC_PATH=$source_path
 CC_IDENT=$cc_ident
 ARCH=$arch
 INTRINSICS=$intrinsics
+EXTERN_PREFIX=$extern_prefix
 CC=$cc
 AS=$as
 OBJCC=$objcc



More information about the ffmpeg-cvslog mailing list