Commit 173c983b authored by Måns Rullgård's avatar Måns Rullgård

configure: use here-docs instead of echo for writing config.{h,mak}

Originally committed as revision 20426 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b4f93564
...@@ -2655,61 +2655,65 @@ echo "Creating config.mak and config.h..." ...@@ -2655,61 +2655,65 @@ echo "Creating config.mak and config.h..."
enabled stripping || strip="echo skipping strip" enabled stripping || strip="echo skipping strip"
echo "# Automatically generated by configure - do not modify!" > config.mak cat > config.mak <<EOF
echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak # Automatically generated by configure - do not modify!
echo "FFMPEG_CONFIG_MAK=1" >> config.mak ifndef FFMPEG_CONFIG_MAK
FFMPEG_CONFIG_MAK=1
echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
echo "prefix=$prefix" >> config.mak prefix=$prefix
echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak LIBDIR=\$(DESTDIR)$libdir
echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak SHLIBDIR=\$(DESTDIR)$shlibdir
echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak INCDIR=\$(DESTDIR)$incdir
echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak BINDIR=\$(DESTDIR)$bindir
echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak DATADIR=\$(DESTDIR)$datadir
echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak MANDIR=\$(DESTDIR)$mandir
echo "SRC_PATH=\"$source_path\"" >> config.mak SRC_PATH="$source_path"
echo "SRC_PATH_BARE=$source_path" >> config.mak SRC_PATH_BARE=$source_path
echo "BUILD_ROOT=\"$PWD\"" >> config.mak BUILD_ROOT="$PWD"
echo "CC=$cc" >> config.mak ARCH=$arch
echo "AS=$as" >> config.mak CC=$cc
echo "LD=$ld" >> config.mak AS=$as
echo "DEPCC=$dep_cc" >> config.mak LD=$ld
echo "YASM=$yasmexe" >> config.mak DEPCC=$dep_cc
echo "AR=$ar" >> config.mak YASM=$yasmexe
echo "RANLIB=$ranlib" >> config.mak AR=$ar
echo "LN_S=$ln_s" >> config.mak RANLIB=$ranlib
echo "STRIP=$strip" >> config.mak LN_S=$ln_s
echo "CPPFLAGS=$CPPFLAGS" >> config.mak STRIP=$strip
echo "CFLAGS=$CFLAGS" >> config.mak CPPFLAGS=$CPPFLAGS
echo "ASFLAGS=$ASFLAGS" >> config.mak CFLAGS=$CFLAGS
echo "CC_O=$CC_O" >> config.mak ASFLAGS=$ASFLAGS
echo "LDFLAGS=$LDFLAGS" >> config.mak CC_O=$CC_O
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak LDFLAGS=$LDFLAGS
echo "SHFLAGS=$SHFLAGS" >> config.mak FFSERVERLDFLAGS=$FFSERVERLDFLAGS
echo "YASMFLAGS=$YASMFLAGS" >> config.mak SHFLAGS=$SHFLAGS
echo "BUILDSUF=$build_suffix" >> config.mak YASMFLAGS=$YASMFLAGS
echo "FULLNAME=$FULLNAME" >> config.mak BUILDSUF=$build_suffix
echo "LIBPREF=$LIBPREF" >> config.mak FULLNAME=$FULLNAME
echo "LIBSUF=$LIBSUF" >> config.mak LIBPREF=$LIBPREF
echo "LIBNAME=$LIBNAME" >> config.mak LIBSUF=$LIBSUF
echo "SLIBPREF=$SLIBPREF" >> config.mak LIBNAME=$LIBNAME
echo "SLIBSUF=$SLIBSUF" >> config.mak SLIBPREF=$SLIBPREF
echo "EXESUF=$EXESUF" >> config.mak SLIBSUF=$SLIBSUF
echo "EXTRA_VERSION=$extra_version" >> config.mak EXESUF=$EXESUF
echo "DEPFLAGS=$DEPFLAGS" >> config.mak EXTRA_VERSION=$extra_version
echo "CCDEP=$CCDEP" >> config.mak DEPFLAGS=$DEPFLAGS
echo "ASDEP=$ASDEP" >> config.mak CCDEP=$CCDEP
echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak ASDEP=$ASDEP
echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak CC_DEPFLAGS=$CC_DEPFLAGS
echo "HOSTCC=$host_cc" >> config.mak AS_DEPFLAGS=$AS_DEPFLAGS
echo "HOSTCFLAGS=$host_cflags" >> config.mak HOSTCC=$host_cc
echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak HOSTCFLAGS=$host_cflags
echo "HOSTLDFLAGS=$host_ldflags" >> config.mak HOSTEXESUF=$HOSTEXESUF
echo "HOSTLIBS=$host_libs" >> config.mak HOSTLDFLAGS=$host_ldflags
echo "TARGET_EXEC=$target_exec" >> config.mak HOSTLIBS=$host_libs
echo "TARGET_PATH=$target_path" >> config.mak TARGET_EXEC=$target_exec
echo "SDL_LIBS=$sdl_libs" >> config.mak TARGET_PATH=$target_path
echo "SDL_CFLAGS=$sdl_cflags" >> config.mak SDL_LIBS=$sdl_libs
SDL_CFLAGS=$sdl_cflags
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
EOF
get_version(){ get_version(){
name=$1 name=$1
...@@ -2729,45 +2733,37 @@ get_version LIBAVFORMAT libavformat/avformat.h ...@@ -2729,45 +2733,37 @@ get_version LIBAVFORMAT libavformat/avformat.h
get_version LIBAVUTIL libavutil/avutil.h get_version LIBAVUTIL libavutil/avutil.h
get_version LIBAVFILTER libavfilter/avfilter.h get_version LIBAVFILTER libavfilter/avfilter.h
if enabled shared; then enabled shared && cat >> config.mak <<EOF
echo "LIBTARGET=${LIBTARGET}" >> config.mak LIBTARGET=${LIBTARGET}
echo "SLIBNAME=${SLIBNAME}" >> config.mak SLIBNAME=${SLIBNAME}
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
fi EOF
echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "EXTRALIBS=$extralibs" >> config.mak
echo "ARCH=$arch" >> config.mak
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
echo "#define CC_TYPE \"$cc_type\"" >> $TMPH enabled asmalign_pot || align_shift="1 <<"
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 if enabled small || disabled optimizations; then
echo "#define av_always_inline" >> $TMPH echo "#define av_always_inline" >> $TMPH
fi 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 ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST print_config HAVE_ $TMPH config.mak $HAVE_LIST
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment