[FFmpeg-cvslog] r20426 - trunk/configure
mru
subversion
Sat Oct 31 16:59:04 CET 2009
Author: mru
Date: Sat Oct 31 16:59:03 2009
New Revision: 20426
Log:
configure: use here-docs instead of echo for writing config.{h,mak}
Modified:
trunk/configure
Modified: trunk/configure
==============================================================================
--- trunk/configure Sat Oct 31 16:58:57 2009 (r20425)
+++ trunk/configure Sat Oct 31 16:59:03 2009 (r20426)
@@ -2655,61 +2655,65 @@ echo "Creating config.mak and config.h..
enabled stripping || strip="echo skipping strip"
-echo "# Automatically generated by configure - do not modify!" > config.mak
-echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak
-echo "FFMPEG_CONFIG_MAK=1" >> config.mak
-
-echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
-echo "prefix=$prefix" >> config.mak
-echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
-echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
-echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
-echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
-echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak
-echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
-echo "SRC_PATH=\"$source_path\"" >> config.mak
-echo "SRC_PATH_BARE=$source_path" >> config.mak
-echo "BUILD_ROOT=\"$PWD\"" >> config.mak
-echo "CC=$cc" >> config.mak
-echo "AS=$as" >> config.mak
-echo "LD=$ld" >> config.mak
-echo "DEPCC=$dep_cc" >> config.mak
-echo "YASM=$yasmexe" >> config.mak
-echo "AR=$ar" >> config.mak
-echo "RANLIB=$ranlib" >> config.mak
-echo "LN_S=$ln_s" >> config.mak
-echo "STRIP=$strip" >> config.mak
-echo "CPPFLAGS=$CPPFLAGS" >> config.mak
-echo "CFLAGS=$CFLAGS" >> config.mak
-echo "ASFLAGS=$ASFLAGS" >> config.mak
-echo "CC_O=$CC_O" >> config.mak
-echo "LDFLAGS=$LDFLAGS" >> config.mak
-echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
-echo "SHFLAGS=$SHFLAGS" >> config.mak
-echo "YASMFLAGS=$YASMFLAGS" >> config.mak
-echo "BUILDSUF=$build_suffix" >> config.mak
-echo "FULLNAME=$FULLNAME" >> config.mak
-echo "LIBPREF=$LIBPREF" >> config.mak
-echo "LIBSUF=$LIBSUF" >> config.mak
-echo "LIBNAME=$LIBNAME" >> config.mak
-echo "SLIBPREF=$SLIBPREF" >> config.mak
-echo "SLIBSUF=$SLIBSUF" >> config.mak
-echo "EXESUF=$EXESUF" >> config.mak
-echo "EXTRA_VERSION=$extra_version" >> config.mak
-echo "DEPFLAGS=$DEPFLAGS" >> config.mak
-echo "CCDEP=$CCDEP" >> config.mak
-echo "ASDEP=$ASDEP" >> config.mak
-echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak
-echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak
-echo "HOSTCC=$host_cc" >> config.mak
-echo "HOSTCFLAGS=$host_cflags" >> config.mak
-echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
-echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
-echo "HOSTLIBS=$host_libs" >> config.mak
-echo "TARGET_EXEC=$target_exec" >> config.mak
-echo "TARGET_PATH=$target_path" >> config.mak
-echo "SDL_LIBS=$sdl_libs" >> config.mak
-echo "SDL_CFLAGS=$sdl_cflags" >> config.mak
+cat > config.mak <<EOF
+# Automatically generated by configure - do not modify!
+ifndef FFMPEG_CONFIG_MAK
+FFMPEG_CONFIG_MAK=1
+FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
+prefix=$prefix
+LIBDIR=\$(DESTDIR)$libdir
+SHLIBDIR=\$(DESTDIR)$shlibdir
+INCDIR=\$(DESTDIR)$incdir
+BINDIR=\$(DESTDIR)$bindir
+DATADIR=\$(DESTDIR)$datadir
+MANDIR=\$(DESTDIR)$mandir
+SRC_PATH="$source_path"
+SRC_PATH_BARE=$source_path
+BUILD_ROOT="$PWD"
+ARCH=$arch
+CC=$cc
+AS=$as
+LD=$ld
+DEPCC=$dep_cc
+YASM=$yasmexe
+AR=$ar
+RANLIB=$ranlib
+LN_S=$ln_s
+STRIP=$strip
+CPPFLAGS=$CPPFLAGS
+CFLAGS=$CFLAGS
+ASFLAGS=$ASFLAGS
+CC_O=$CC_O
+LDFLAGS=$LDFLAGS
+FFSERVERLDFLAGS=$FFSERVERLDFLAGS
+SHFLAGS=$SHFLAGS
+YASMFLAGS=$YASMFLAGS
+BUILDSUF=$build_suffix
+FULLNAME=$FULLNAME
+LIBPREF=$LIBPREF
+LIBSUF=$LIBSUF
+LIBNAME=$LIBNAME
+SLIBPREF=$SLIBPREF
+SLIBSUF=$SLIBSUF
+EXESUF=$EXESUF
+EXTRA_VERSION=$extra_version
+DEPFLAGS=$DEPFLAGS
+CCDEP=$CCDEP
+ASDEP=$ASDEP
+CC_DEPFLAGS=$CC_DEPFLAGS
+AS_DEPFLAGS=$AS_DEPFLAGS
+HOSTCC=$host_cc
+HOSTCFLAGS=$host_cflags
+HOSTEXESUF=$HOSTEXESUF
+HOSTLDFLAGS=$host_ldflags
+HOSTLIBS=$host_libs
+TARGET_EXEC=$target_exec
+TARGET_PATH=$target_path
+SDL_LIBS=$sdl_libs
+SDL_CFLAGS=$sdl_cflags
+LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
+EXTRALIBS=$extralibs
+EOF
get_version(){
name=$1
@@ -2729,45 +2733,37 @@ get_version LIBAVFORMAT libavformat/avfo
get_version LIBAVUTIL libavutil/avutil.h
get_version LIBAVFILTER libavfilter/avfilter.h
-if enabled shared; then
- echo "LIBTARGET=${LIBTARGET}" >> config.mak
- echo "SLIBNAME=${SLIBNAME}" >> config.mak
- echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
- echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
- echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
- echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
- echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
- echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
-fi
-echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
-echo "EXTRALIBS=$extralibs" >> config.mak
-
-echo "ARCH=$arch" >> config.mak
-
+enabled shared && cat >> config.mak <<EOF
+LIBTARGET=${LIBTARGET}
+SLIBNAME=${SLIBNAME}
+SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
+SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
+SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
+SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
+SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
+SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
+EOF
-echo "/* Automatically generated by configure - do not modify! */" > $TMPH
-echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
-echo "#define FFMPEG_CONFIG_H" >> $TMPH
-echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
-echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
+enabled asmalign_pot || align_shift="1 <<"
-echo "#define CC_TYPE \"$cc_type\"" >> $TMPH
-echo "#define CC_VERSION $cc_version" >> $TMPH
-echo "#define restrict $_restrict" >> $TMPH
+cat > $TMPH <<EOF
+/* Automatically generated by configure - do not modify! */
+#ifndef FFMPEG_CONFIG_H
+#define FFMPEG_CONFIG_H
+#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
+#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
+#define CC_TYPE "$cc_type"
+#define CC_VERSION $cc_version
+#define restrict $_restrict
+#define ASMALIGN(ZEROBITS) ".align $align_shift " #ZEROBITS "\\n\\t"
+#define EXTERN_PREFIX "${extern_prefix}"
+#define EXTERN_ASM ${extern_prefix}
+EOF
if enabled small || disabled optimizations; then
echo "#define av_always_inline" >> $TMPH
fi
-
-# Apparently it's not possible to portably echo a backslash.
-enabled asmalign_pot &&
- printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
- printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
-
-echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
-echo "#define EXTERN_ASM ${extern_prefix}" >> $TMPH
-
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
More information about the ffmpeg-cvslog
mailing list