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 --enable-gpl - Enable GPLv2 components
22 --enable-gpl3 - Enable GPLv3 components
23 --enable-debug - Compile without optimizations support (default: off)
24 --disable-debug - Compile without debug support (default: on)
25 --disable-mmx - Compile without MMX support (default: on)
26 --disable-sse - Compile without SSE support (default: on)
27 --disable-sse2 - Compile without SSE2 support (default: on)
28 --arch='arch' - Compile for a specific architecture (default: none)
29 --cpu='cpu' - Compile for a specific CPU (default: none)
30 --target-os='os' - Cross-compile to a specific OS (default: $(uname -s))
31 --target-arch='arch' - Cross-compile to a specific CPU architecture
33 Module disable options:
37 for i in src/modules/*
39 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
41 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
44 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
51 echo "version=$version"
52 echo "soversion=$soversion"
55 echo "bindir=$prefix/bin"
56 echo "datadir=$datadir"
58 echo "targetos=$targetos"
60 [ "$mmx" = "true" ] &&
61 echo "MMX_FLAGS=-DUSE_MMX"
63 [ "$sse" = "true" ] &&
64 echo "SSE_FLAGS=-DUSE_SSE"
66 [ "$sse2" = "true" ] &&
67 echo "SSE2_FLAGS=-DUSE_SSE2"
69 [ "$debug" = "true" ] &&
72 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
74 [ "$amd64" = "true" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
75 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
76 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
77 if [ "$optimisations" = "true" ]
79 echo "OPTIMISATIONS=-O2 -pipe"
80 # Since gcc 4.6, this optimization enabled with -O1 causes filter_line_sse2 to crash.
81 echo "OPTIMISATIONS+=-fno-tree-dominator-opts"
82 # Since gcc 4.6, this optimization enabled with -O2 causes filter_line_sse2 to crash.
83 echo "OPTIMISATIONS+=-fno-tree-pre"
86 echo "CFLAGS+=-Wall -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
90 echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
91 echo "SHFLAGS=-dynamiclib"
92 echo "LDFLAGS+=`sdl-config --libs`"
94 Linux|GNU/kFreeBSD|GNU)
95 [ "$optimisations" = "true" ] &&
96 echo "OPTIMISATIONS+=-ffast-math"
97 echo "CFLAGS+=-fPIC -pthread"
98 echo "SHFLAGS=-shared"
100 echo "RDYNAMIC=-rdynamic"
101 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
104 [ "$optimisations" = "true" ] &&
105 echo "OPTIMISATIONS+=-ffast-math"
106 echo "CFLAGS+=-fPIC -pthread"
107 echo "SHFLAGS=-shared"
108 echo "RDYNAMIC=-rdynamic"
109 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
112 [ "$optimisations" = "true" ] &&
113 echo "OPTIMISATIONS+=-ffast-math"
114 echo "CFLAGS+=-pthread"
115 echo "SHFLAGS=-shared"
116 echo "RDYNAMIC=-rdynamic"
117 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
120 [ "$optimisations" = "true" ] &&
121 echo "OPTIMISATIONS+=-ffast-math"
122 echo "SHFLAGS=-shared"
125 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
130 echo "LIBSUF=$LIBSUF"
133 echo "#!/bin/sh" > mlt-config
135 echo export version=$version
136 echo export prefix=$prefix
137 echo export libdir=$libdir
138 echo export bindir=$prefix/bin
141 cat < mlt-config-template >> mlt-config
143 echo -n > packages.dat
148 echo prefix="$prefix" > mlt-framework.pc
150 echo exec_prefix=$prefix
152 echo includedir=$prefix/include
153 echo datadir=$datadir
155 echo version=$version
156 echo cflags=`grep ^framework packages.dat | cut -f 2`
157 echo libs=`grep ^framework packages.dat | cut -f 3`
158 ) >> mlt-framework.pc
159 cat mlt-framework.pc.in >>mlt-framework.pc
161 echo prefix="$prefix" > mlt++.pc
163 echo exec_prefix=$prefix
165 echo includedir=$prefix/include
166 echo datadir=$datadir
168 echo version=$version
169 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
170 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
172 cat mlt++.pc.in >>mlt++.pc
178 # Define build directory for scripts called
179 export build_dir=`dirname $0`
180 export prefix=/usr/local
185 export optimisations=true
194 export targetos=$(uname -s)
198 # Define the compiler used in tests (gcc is not installed everywhere)
201 # Iterate through arguments
206 --prefix=* ) prefix="${i#--prefix=}" ;;
207 --libdir=* ) libdir="${i#--libdir=}" ;;
208 --datadir=* ) datadir="${i#--datadir=}" ;;
209 --mandir=* ) mandir="${i#--mandir=}" ;;
210 --enable-debug ) optimisations=false ;;
211 --disable-debug ) debug=false ;;
212 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
213 --disable-sse ) sse=false; sse2=false ;;
214 --disable-sse2 ) sse2=false ;;
215 --enable-gpl ) gpl=true ;;
216 --enable-gpl3 ) gpl3=true ;;
217 --arch=* ) arch="${i#--arch=}" ;;
218 --cpu=* ) cpu="${i#--cpu=}" ;;
219 --target-os=* ) targetos="${i#--target-os=}" ;;
220 --target-arch=* ) targetarch="${i#--target-arch=}" ;;
224 # Chose appropriate suffix for libraries
228 if [ "$targetarch" = "" ]
230 sysctl -a hw | grep "x86_64: 1" > /dev/null
231 [ "$?" = "0" ] && targetarch="amd64"
234 Linux|FreeBSD|NetBSD)
237 MINGW32_NT-*|MinGW|mingw)
247 # Determine if we are compiling for 64-bit Intel architecture
248 [ "$targetarch" = "" ] && targetarch=$(uname -m)
249 [ "$targetarch" = "amd64" -o "$targetarch" = "x86_64" ] && amd64=true
251 # Determine the libdir if it's not specified in the args
252 [ "$libdir" = "" ] && libdir=$prefix/lib
253 [ "$datadir" = "" ] && datadir=$prefix/share
254 [ "$mandir" = "" ] && mandir=$prefix/share/man
256 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
257 if [ "$mmx" = "true" ]
261 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
264 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
267 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
270 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
275 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
276 if [ "$sse" = "true" ]
280 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
283 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
286 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
289 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
294 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
295 if [ "$sse2" = "true" ]
299 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
302 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
305 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
308 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
313 # Show help if requested
318 # Log the configuration history
320 echo "$0 $@" >> config.log
325 # Iterate through each of the components
326 for i in framework modules melt mlt++ swig
328 if [ -x src/$i/configure ]
330 [ $help = 0 ] && echo "Configuring `basename $i`:"
333 CC="$CC" ./configure "$@"
334 [ $? != 0 ] && exit 1
339 # Build the pkg-config files
342 # Report license Usage
345 if [ "$gpl" = "false" ]
347 echo "LGPLv2.1 license used; GPL components disabled"
348 elif [ "$gpl3" = "false" ]
350 echo "GPLv2 license used; GPLv3 components disabled"
352 echo "GPLv3 license used"