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.
22 --no-compat-dirs - Do not create compatibility, unversioned, files and 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 "compat_dirs=$compat_dirs"
61 echo "compat_nomelt=$compat_nomelt"
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=${libdir}/mlt-${soversion}"
136 echo "mltdatadir=${datadir}/mlt-${soversion}"
137 echo "meltname=${meltname}"
140 echo "#!/bin/sh" > mlt-config
142 echo export version=$version
143 echo export prefix=$prefix
144 echo export libdir=$libdir
145 echo export bindir=$prefix/bin
148 cat < mlt-config-template >> mlt-config
150 echo -n > packages.dat
155 echo prefix="$prefix" > mlt-framework.pc
157 echo exec_prefix=$prefix
159 echo includedir=$prefix/include
160 echo datadir=$datadir
162 echo version=$version
163 echo cflags=`grep ^framework packages.dat | cut -f 2`
164 echo libs=`grep ^framework packages.dat | cut -f 3`
165 echo moduledir=${libdir}/mlt-${soversion}
166 echo mltdatadir=${datadir}/mlt-${soversion}
167 echo meltbin=${prefix}/bin/${meltname}
168 ) >> mlt-framework.pc
169 cat mlt-framework.pc.in >>mlt-framework.pc
171 echo prefix="$prefix" > mlt++.pc
173 echo exec_prefix=$prefix
175 echo includedir=$prefix/include
176 echo datadir=$datadir
178 echo version=$version
179 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
180 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
182 cat mlt++.pc.in >>mlt++.pc
188 # Define build directory for scripts called
189 export build_dir=`dirname $0`
190 export prefix=/usr/local
195 export optimisations=true
204 export targetos=$(uname -s)
207 export compat_dirs=true
208 export compat_nomelt=false
210 # Define the compiler used in tests (gcc is not installed everywhere)
213 # Iterate through arguments
218 --prefix=* ) prefix="${i#--prefix=}" ;;
219 --libdir=* ) libdir="${i#--libdir=}" ;;
220 --datadir=* ) datadir="${i#--datadir=}" ;;
221 --mandir=* ) mandir="${i#--mandir=}" ;;
222 --rename-melt=* ) meltname="${i#--rename-melt=}"; compat_nomelt=true ;;
223 --no-compat-dirs ) compat_dirs=false ;;
224 --enable-debug ) optimisations=false ;;
225 --disable-debug ) debug=false ;;
226 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
227 --disable-sse ) sse=false; sse2=false ;;
228 --disable-sse2 ) sse2=false ;;
229 --enable-gpl ) gpl=true ;;
230 --enable-gpl3 ) gpl3=true ;;
231 --arch=* ) arch="${i#--arch=}" ;;
232 --cpu=* ) cpu="${i#--cpu=}" ;;
233 --target-os=* ) targetos="${i#--target-os=}" ;;
234 --target-arch=* ) targetarch="${i#--target-arch=}" ;;
238 if [ -z "${meltname}" ]
240 meltname=melt${soversion}
243 # Chose appropriate suffix for libraries
247 if [ "$targetarch" = "" ]
249 sysctl -a hw | grep "x86_64: 1" > /dev/null
250 [ "$?" = "0" ] && targetarch="amd64"
253 Linux|FreeBSD|NetBSD)
256 MINGW32_NT-*|MinGW|mingw)
266 # Determine if we are compiling for 64-bit Intel architecture
267 [ "$targetarch" = "" ] && targetarch=$(uname -m)
268 [ "$targetarch" = "amd64" -o "$targetarch" = "x86_64" ] && amd64=true
270 # Determine the libdir if it's not specified in the args
271 [ "$libdir" = "" ] && libdir=$prefix/lib
272 [ "$datadir" = "" ] && datadir=$prefix/share
273 [ "$mandir" = "" ] && mandir=$prefix/share/man
275 export moduledir=${libdir}/mlt-${soversion}
276 export mltdatadir=${datadir}/mlt-${soversion}
278 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
279 if [ "$mmx" = "true" ]
283 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
286 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
289 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
292 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
297 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
298 if [ "$sse" = "true" ]
302 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
305 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
308 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
311 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
316 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
317 if [ "$sse2" = "true" ]
321 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
324 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
327 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
330 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
335 # Show help if requested
340 # Log the configuration history
342 echo "$0 $@" >> config.log
347 # Iterate through each of the components
348 for i in framework modules melt mlt++ swig
350 if [ -x src/$i/configure ]
352 [ $help = 0 ] && echo "Configuring `basename $i`:"
355 CC="$CC" ./configure "$@"
356 [ $? != 0 ] && exit 1
361 # Build the pkg-config files
364 # Report license Usage
367 if [ "$gpl" = "false" ]
369 echo "LGPLv2.1 license used; GPL components disabled"
370 elif [ "$gpl3" = "false" ]
372 echo "GPLv2 license used; GPLv3 components disabled"
374 echo "GPLv3 license used"