9 Non-autotool config script for MLT.
13 --help - this information
15 General build options:
17 --prefix=directory - install prefix for path (default: $prefix)
18 --libdir=directory - lib directory (default: $prefix/lib)
19 --datadir=directory - data directory (default: $prefix/share)
20 --mandir=directory - man documentation directory (default: $prefix/share/man)
21 --rename-melt - Give melt executable a different name (it will not be versioned)
22 --enable-extra-versioning - Version melt and the data and modules directories
23 --enable-gpl - Enable GPLv2 components
24 --enable-gpl3 - Enable GPLv3 components
25 --enable-debug - Compile without optimizations support (default: off)
26 --disable-debug - Compile without debug support (default: on)
27 --disable-mmx - Compile without MMX support (default: on)
28 --disable-sse - Compile without SSE support (default: on)
29 --disable-sse2 - Compile without SSE2 support (default: on)
30 --arch='arch' - Compile for a specific architecture (default: none)
31 --cpu='cpu' - Compile for a specific CPU (default: none)
32 --target-os='os' - Cross-compile to a specific OS (default: $(uname -s))
33 --target-arch='arch' - Cross-compile to a specific CPU architecture
35 Module disable options:
39 for i in src/modules/*
41 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
43 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
46 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
53 echo "version=$version"
54 echo "soversion=$soversion"
57 echo "bindir=$prefix/bin"
58 echo "datadir=$datadir"
60 echo "extra_versioning=$extra_versioning"
61 echo "melt_noversion=$melt_noversion"
62 echo "targetos=$targetos"
64 [ "$mmx" = "true" ] &&
65 echo "MMX_FLAGS=-DUSE_MMX"
67 [ "$sse" = "true" ] &&
68 echo "SSE_FLAGS=-DUSE_SSE"
70 [ "$sse2" = "true" ] &&
71 echo "SSE2_FLAGS=-DUSE_SSE2"
73 [ "$debug" = "true" ] &&
76 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
78 [ "$amd64" = "true" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
79 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
80 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
81 if [ "$optimisations" = "true" ]
83 echo "OPTIMISATIONS=-O2 -pipe"
84 # Since gcc 4.6, this optimization enabled with -O1 causes filter_line_sse2 to crash.
85 echo "OPTIMISATIONS+=-fno-tree-dominator-opts"
86 # Since gcc 4.6, this optimization enabled with -O2 causes filter_line_sse2 to crash.
87 echo "OPTIMISATIONS+=-fno-tree-pre"
90 echo "CFLAGS+=-Wall -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
94 echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
95 echo "SHFLAGS=-dynamiclib"
96 echo "LDFLAGS+=`sdl-config --libs`"
98 Linux|GNU/kFreeBSD|GNU)
99 [ "$optimisations" = "true" ] &&
100 echo "OPTIMISATIONS+=-ffast-math"
101 echo "CFLAGS+=-fPIC -pthread"
102 echo "SHFLAGS=-shared"
104 echo "RDYNAMIC=-rdynamic"
105 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
108 [ "$optimisations" = "true" ] &&
109 echo "OPTIMISATIONS+=-ffast-math"
110 echo "CFLAGS+=-fPIC -pthread"
111 echo "SHFLAGS=-shared"
112 echo "RDYNAMIC=-rdynamic"
113 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
116 [ "$optimisations" = "true" ] &&
117 echo "OPTIMISATIONS+=-ffast-math"
118 echo "CFLAGS+=-fPIC -pthread"
119 echo "SHFLAGS=-shared"
120 echo "RDYNAMIC=-rdynamic"
121 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
124 [ "$optimisations" = "true" ] &&
125 echo "OPTIMISATIONS+=-ffast-math"
126 echo "SHFLAGS=-shared"
129 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
134 echo "LIBSUF=$LIBSUF"
135 echo "moduledir=${moduledir}"
136 echo "mltdatadir=${mltdatadir}"
137 echo "unversionedmoduledir=${unversionedmoduledir}"
138 echo "unversionedmltdatadir=${unversionedmltdatadir}"
139 echo "meltname=${meltname}"
142 echo "#!/bin/sh" > mlt-config
144 echo export version=$version
145 echo export prefix=$prefix
146 echo export libdir=$libdir
147 echo export bindir=$prefix/bin
150 cat < mlt-config-template >> mlt-config
152 echo -n > packages.dat
157 echo prefix="$prefix" > mlt-framework.pc
159 echo exec_prefix=$prefix
161 echo includedir=$prefix/include
162 echo datadir=$datadir
164 echo version=$version
165 echo cflags=`grep ^framework packages.dat | cut -f 2`
166 echo libs=`grep ^framework packages.dat | cut -f 3`
167 echo moduledir=${moduledir}
168 echo mltdatadir=${mltdatadir}
169 echo meltbin=${prefix}/bin/${meltname}
170 ) >> mlt-framework.pc
171 cat mlt-framework.pc.in >>mlt-framework.pc
173 echo prefix="$prefix" > mlt++.pc
175 echo exec_prefix=$prefix
177 echo includedir=$prefix/include
178 echo datadir=$datadir
180 echo version=$version
181 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
182 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
184 cat mlt++.pc.in >>mlt++.pc
190 # Define build directory for scripts called
191 export build_dir=`dirname $0`
192 export prefix=/usr/local
197 export optimisations=true
206 export targetos=$(uname -s)
209 export extra_versioning=false
210 export melt_noversion=false
212 # Define the compiler used in tests (gcc is not installed everywhere)
215 # Iterate through arguments
220 --prefix=* ) prefix="${i#--prefix=}" ;;
221 --libdir=* ) libdir="${i#--libdir=}" ;;
222 --datadir=* ) datadir="${i#--datadir=}" ;;
223 --mandir=* ) mandir="${i#--mandir=}" ;;
224 --rename-melt=* ) meltname="${i#--rename-melt=}"; melt_noversion=true ;;
225 --enable-extra-versioning ) extra_versioning=true ;;
226 --enable-debug ) optimisations=false ;;
227 --disable-debug ) debug=false ;;
228 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
229 --disable-sse ) sse=false; sse2=false ;;
230 --disable-sse2 ) sse2=false ;;
231 --enable-gpl ) gpl=true ;;
232 --enable-gpl3 ) gpl3=true ;;
233 --arch=* ) arch="${i#--arch=}" ;;
234 --cpu=* ) cpu="${i#--cpu=}" ;;
235 --target-os=* ) targetos="${i#--target-os=}" ;;
236 --target-arch=* ) targetarch="${i#--target-arch=}" ;;
240 if [ -z "${meltname}" ]
242 if [ "$extra_versioning" = "false" ]
246 meltname=melt${soversion}
250 # Chose appropriate suffix for libraries
254 if [ "$targetarch" = "" ]
256 sysctl -a hw | grep "x86_64: 1" > /dev/null
257 [ "$?" = "0" ] && targetarch="amd64"
260 Linux|FreeBSD|NetBSD)
263 MINGW32_NT-*|MinGW|mingw)
273 # Determine if we are compiling for 64-bit Intel architecture
274 [ "$targetarch" = "" ] && targetarch=$(uname -m)
275 [ "$targetarch" = "amd64" -o "$targetarch" = "x86_64" ] && amd64=true
277 # Determine the libdir if it's not specified in the args
278 [ "$libdir" = "" ] && libdir=$prefix/lib
279 [ "$datadir" = "" ] && datadir=$prefix/share
280 [ "$mandir" = "" ] && mandir=$prefix/share/man
282 export unversionedmoduledir=${libdir}/mlt
283 export unversionedmltdatadir=${datadir}/mlt
284 if [ "$extra_versioning" = "false" ]
286 export moduledir=${libdir}/mlt
287 export mltdatadir=${datadir}/mlt
289 export moduledir=${libdir}/mlt-${soversion}
290 export mltdatadir=${datadir}/mlt-${soversion}
293 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
294 if [ "$mmx" = "true" ]
298 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
301 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
304 [ "$(make -V MACHINE_CPU:Mmmx -f /dev/null)" ] || mmx=false
307 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
312 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
313 if [ "$sse" = "true" ]
317 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
320 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
323 [ "$(make -V MACHINE_CPU:Msse -f /dev/null)" ] || sse=false
326 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
331 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
332 if [ "$sse2" = "true" ]
336 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
339 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
342 [ "$(make -V MACHINE_CPU:Msse2 -f /dev/null)" ] || sse2=false
345 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
350 # Show help if requested
355 # Log the configuration history
357 echo "$0 $@" >> config.log
362 # Iterate through each of the components
363 for i in framework modules melt mlt++ swig
365 if [ -x src/$i/configure ]
367 [ $help = 0 ] && echo "Configuring `basename $i`:"
370 CC="$CC" ./configure "$@"
371 [ $? != 0 ] && exit 1
376 # Build the pkg-config files
379 # Report license Usage
382 if [ "$gpl" = "false" ]
384 echo "LGPLv2.1 license used; GPL components disabled"
385 elif [ "$gpl3" = "false" ]
387 echo "GPLv2 license used; GPLv3 components disabled"
389 echo "GPLv3 license used"