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 GPL components
22 --enable-debug - Compile without optimizations support (default: off)
23 --disable-debug - Compile without debug support (default: on)
24 --disable-mmx - Compile without MMX support (default: on)
25 --disable-sse - Compile without SSE support (default: on)
26 --disable-sse2 - Compile without SSE2 support (default: on)
27 --arch='arch' - Compile for a specific architecture (default: none)
28 --cpu='cpu' - Compile for a specific CPU (default: none)
30 Module disable options:
34 for i in src/modules/*
36 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
38 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
41 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
48 echo "version=$version"
49 echo "soversion=$soversion"
52 echo "bindir=$prefix/bin"
53 echo "datadir=$datadir"
55 echo "targetos=$targetos"
57 [ "$mmx" = "true" ] &&
58 echo "MMX_FLAGS=-DUSE_MMX"
60 [ "$sse" = "true" ] &&
61 echo "SSE_FLAGS=-DUSE_SSE"
63 [ "$sse2" = "true" ] &&
64 echo "SSE2_FLAGS=-DUSE_SSE2"
66 [ "$debug" = "true" ] &&
69 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
71 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
72 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
73 if [ "$optimisations" = "true" ]
75 echo "OPTIMISATIONS=-O2 -pipe"
76 # Since gcc 4.6, this optimization enabled with -O1 causes filter_line_sse2 to crash.
77 echo "OPTIMISATIONS+=-fno-tree-dominator-opts"
78 # Since gcc 4.6, this optimization enabled with -O2 causes filter_line_sse2 to crash.
79 echo "OPTIMISATIONS+=-fno-tree-pre"
82 echo "CFLAGS+=-Wall -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
86 sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
87 echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
88 echo "SHFLAGS=-dynamiclib"
89 echo "LDFLAGS+=`sdl-config --libs`"
92 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
93 [ "$optimisations" = "true" ] &&
94 echo "OPTIMISATIONS+=-ffast-math"
95 echo "CFLAGS+=-fPIC -pthread"
96 echo "SHFLAGS=-shared"
98 echo "RDYNAMIC=-rdynamic"
99 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
102 [ "$(uname -m)" = "amd64" -o "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
103 [ "$optimisations" = "true" ] &&
104 echo "OPTIMISATIONS+=-ffast-math"
105 echo "CFLAGS+=-fPIC -pthread"
106 echo "SHFLAGS=-shared"
107 echo "RDYNAMIC=-rdynamic"
108 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
111 [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
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 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
121 [ "$optimisations" = "true" ] &&
122 echo "OPTIMISATIONS+=-ffast-math"
123 echo "SHFLAGS=-shared"
126 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
131 echo "LIBSUF=$LIBSUF"
134 echo "#!/bin/sh" > mlt-config
136 echo export version=$version
137 echo export prefix=$prefix
138 echo export libdir=$libdir
139 echo export bindir=$prefix/bin
142 cat < mlt-config-template >> mlt-config
144 echo -n > packages.dat
149 echo prefix="$prefix" > mlt-framework.pc
151 echo exec_prefix=$prefix
153 echo includedir=$prefix/include
154 echo datadir=$datadir
156 echo version=$version
157 echo cflags=`grep ^framework packages.dat | cut -f 2`
158 echo libs=`grep ^framework packages.dat | cut -f 3`
159 ) >> mlt-framework.pc
160 cat mlt-framework.pc.in >>mlt-framework.pc
162 echo prefix="$prefix" > mlt++.pc
164 echo exec_prefix=$prefix
166 echo includedir=$prefix/include
167 echo datadir=$datadir
169 echo version=$version
170 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
171 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
173 cat mlt++.pc.in >>mlt++.pc
179 # Define build directory for scripts called
180 export build_dir=`dirname $0`
181 export prefix=/usr/local
186 export optimisations=true
198 # Chose appropriate suffix for libraries
203 Linux|FreeBSD|NetBSD)
216 # Iterate through arguments
221 --prefix=* ) prefix="${i#--prefix=}" ;;
222 --libdir=* ) libdir="${i#--libdir=}" ;;
223 --datadir=* ) datadir="${i#--datadir=}" ;;
224 --mandir=* ) mandir="${i#--mandir=}" ;;
225 --enable-debug ) optimisations=false ;;
226 --disable-debug ) debug=false ;;
227 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
228 --disable-sse ) sse=false; sse2=false ;;
229 --disable-sse2 ) sse2=false ;;
230 --enable-gpl ) gpl=true ;;
231 --arch=* ) arch="${i#--arch=}" ;;
232 --cpu=* ) cpu="${i#--cpu=}" ;;
236 # Determine the libdir if it's not specified in the args
237 [ "$libdir" = "" ] && libdir=$prefix/lib
238 [ "$datadir" = "" ] && datadir=$prefix/share
239 [ "$mandir" = "" ] && mandir=$prefix/share/man
241 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
242 if [ "$mmx" = "true" ]
246 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
249 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
252 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
255 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
260 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
261 if [ "$sse" = "true" ]
265 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
268 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
271 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
274 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
279 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
280 if [ "$sse2" = "true" ]
284 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
287 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
290 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
293 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
298 # Show help if requested
303 # Log the configuration history
305 echo "$0 $@" >> config.log
310 # Iterate through each of the components
311 for i in framework modules melt mlt++ swig
313 if [ -x src/$i/configure ]
315 [ $help = 0 ] && echo "Configuring `basename $i`:"
319 [ $? != 0 ] && exit 1
324 # Build the pkg-config files
329 ( [ "$gpl" = "false" ] &&
330 echo "GPL Components are disabled" ||
331 echo "GPL License Used" )