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)
31 Module disable options:
35 for i in src/modules/*
37 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
39 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
42 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
49 echo "version=$version"
50 echo "soversion=$soversion"
53 echo "bindir=$prefix/bin"
54 echo "datadir=$datadir"
56 echo "targetos=$targetos"
58 [ "$mmx" = "true" ] &&
59 echo "MMX_FLAGS=-DUSE_MMX"
61 [ "$sse" = "true" ] &&
62 echo "SSE_FLAGS=-DUSE_SSE"
64 [ "$sse2" = "true" ] &&
65 echo "SSE2_FLAGS=-DUSE_SSE2"
67 [ "$debug" = "true" ] &&
70 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
72 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
73 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
74 if [ "$optimisations" = "true" ]
76 echo "OPTIMISATIONS=-O2 -pipe"
77 # Since gcc 4.6, this optimization enabled with -O1 causes filter_line_sse2 to crash.
78 echo "OPTIMISATIONS+=-fno-tree-dominator-opts"
79 # Since gcc 4.6, this optimization enabled with -O2 causes filter_line_sse2 to crash.
80 echo "OPTIMISATIONS+=-fno-tree-pre"
83 echo "CFLAGS+=-Wall -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
87 sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
88 echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
89 echo "SHFLAGS=-dynamiclib"
90 echo "LDFLAGS+=`sdl-config --libs`"
92 Linux|GNU/kFreeBSD|GNU)
93 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
94 [ "$optimisations" = "true" ] &&
95 echo "OPTIMISATIONS+=-ffast-math"
96 echo "CFLAGS+=-fPIC -pthread"
97 echo "SHFLAGS=-shared"
99 echo "RDYNAMIC=-rdynamic"
100 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
103 [ "$(uname -m)" = "amd64" -o "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
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 [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
113 [ "$optimisations" = "true" ] &&
114 echo "OPTIMISATIONS+=-ffast-math"
115 echo "CFLAGS+=-pthread"
116 echo "SHFLAGS=-shared"
117 echo "RDYNAMIC=-rdynamic"
118 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
121 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
122 [ "$optimisations" = "true" ] &&
123 echo "OPTIMISATIONS+=-ffast-math"
124 echo "SHFLAGS=-shared"
127 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
132 echo "LIBSUF=$LIBSUF"
135 echo "#!/bin/sh" > mlt-config
137 echo export version=$version
138 echo export prefix=$prefix
139 echo export libdir=$libdir
140 echo export bindir=$prefix/bin
143 cat < mlt-config-template >> mlt-config
145 echo -n > packages.dat
150 echo prefix="$prefix" > mlt-framework.pc
152 echo exec_prefix=$prefix
154 echo includedir=$prefix/include
155 echo datadir=$datadir
157 echo version=$version
158 echo cflags=`grep ^framework packages.dat | cut -f 2`
159 echo libs=`grep ^framework packages.dat | cut -f 3`
160 ) >> mlt-framework.pc
161 cat mlt-framework.pc.in >>mlt-framework.pc
163 echo prefix="$prefix" > mlt++.pc
165 echo exec_prefix=$prefix
167 echo includedir=$prefix/include
168 echo datadir=$datadir
170 echo version=$version
171 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
172 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
174 cat mlt++.pc.in >>mlt++.pc
180 # Define build directory for scripts called
181 export build_dir=`dirname $0`
182 export prefix=/usr/local
187 export optimisations=true
200 # Chose appropriate suffix for libraries
205 Linux|FreeBSD|NetBSD)
218 # Iterate through arguments
223 --prefix=* ) prefix="${i#--prefix=}" ;;
224 --libdir=* ) libdir="${i#--libdir=}" ;;
225 --datadir=* ) datadir="${i#--datadir=}" ;;
226 --mandir=* ) mandir="${i#--mandir=}" ;;
227 --enable-debug ) optimisations=false ;;
228 --disable-debug ) debug=false ;;
229 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
230 --disable-sse ) sse=false; sse2=false ;;
231 --disable-sse2 ) sse2=false ;;
232 --enable-gpl ) gpl=true ;;
233 --enable-gpl3 ) gpl3=true ;;
234 --arch=* ) arch="${i#--arch=}" ;;
235 --cpu=* ) cpu="${i#--cpu=}" ;;
239 # Determine the libdir if it's not specified in the args
240 [ "$libdir" = "" ] && libdir=$prefix/lib
241 [ "$datadir" = "" ] && datadir=$prefix/share
242 [ "$mandir" = "" ] && mandir=$prefix/share/man
244 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
245 if [ "$mmx" = "true" ]
249 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
252 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
255 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
258 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
263 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
264 if [ "$sse" = "true" ]
268 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
271 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
274 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
277 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
282 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
283 if [ "$sse2" = "true" ]
287 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
290 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
293 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
296 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
301 # Show help if requested
306 # Log the configuration history
308 echo "$0 $@" >> config.log
313 # Iterate through each of the components
314 for i in framework modules melt mlt++ swig
316 if [ -x src/$i/configure ]
318 [ $help = 0 ] && echo "Configuring `basename $i`:"
322 [ $? != 0 ] && exit 1
327 # Build the pkg-config files
330 # Report license Usage
333 if [ "$gpl" = "false" ]
335 echo "LGPLv2.1 license used; GPL components disabled"
336 elif [ "$gpl3" = "false" ]
338 echo "GPLv2 license used; GPLv3 components disabled"
340 echo "GPLv3 license used"