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 [ "$optimisations" = "true" ] &&
74 echo "OPTIMISATIONS=-O2 -pipe -fomit-frame-pointer"
76 echo "CFLAGS+=-Wall -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
80 sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
81 echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
82 echo "SHFLAGS=-dynamiclib"
83 echo "LDFLAGS+=`sdl-config --libs`"
86 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
87 [ "$optimisations" = "true" ] &&
88 echo "OPTIMISATIONS+=-ffast-math"
89 echo "CFLAGS+=-fPIC -pthread"
90 echo "SHFLAGS=-shared"
92 echo "RDYNAMIC=-rdynamic"
93 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
96 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
97 [ "$optimisations" = "true" ] &&
98 echo "OPTIMISATIONS+=-ffast-math"
99 echo "CFLAGS+=-fPIC -pthread"
100 echo "SHFLAGS=-shared"
101 echo "RDYNAMIC=-rdynamic"
102 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
105 [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
106 [ "$optimisations" = "true" ] &&
107 echo "OPTIMISATIONS+=-ffast-math"
108 echo "CFLAGS+=-pthread"
109 echo "SHFLAGS=-shared"
110 echo "RDYNAMIC=-rdynamic"
111 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
114 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
115 [ "$optimisations" = "true" ] &&
116 echo "OPTIMISATIONS+=-ffast-math"
117 echo "SHFLAGS=-shared"
120 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
125 echo "LIBSUF=$LIBSUF"
128 echo "#!/bin/sh" > mlt-config
130 echo export version=$version
131 echo export prefix=$prefix
132 echo export libdir=$libdir
133 echo export bindir=$prefix/bin
136 cat < mlt-config-template >> mlt-config
138 echo -n > packages.dat
143 echo prefix="$prefix" > mlt-framework.pc
145 echo exec_prefix=$prefix
147 echo includedir=$prefix/include
148 echo datadir=$datadir
150 echo version=$version
151 echo cflags=`grep ^framework packages.dat | cut -f 2`
152 echo libs=`grep ^framework packages.dat | cut -f 3`
153 ) >> mlt-framework.pc
154 cat mlt-framework.pc.in >>mlt-framework.pc
156 echo prefix="$prefix" > mlt++.pc
158 echo exec_prefix=$prefix
160 echo includedir=$prefix/include
161 echo datadir=$datadir
163 echo version=$version
164 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
165 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
167 cat mlt++.pc.in >>mlt++.pc
173 # Define build directory for scripts called
174 export build_dir=`dirname $0`
175 export prefix=/usr/local
180 export optimisations=true
192 # Chose appropriate suffix for libraries
197 Linux|FreeBSD|NetBSD)
210 # Iterate through arguments
215 --prefix=* ) prefix="${i#--prefix=}" ;;
216 --libdir=* ) libdir="${i#--libdir=}" ;;
217 --datadir=* ) datadir="${i#--datadir=}" ;;
218 --mandir=* ) mandir="${i#--mandir=}" ;;
219 --enable-debug ) optimisations=false ;;
220 --disable-debug ) debug=false ;;
221 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
222 --disable-sse ) sse=false; sse2=false ;;
223 --disable-sse2 ) sse2=false ;;
224 --enable-gpl ) gpl=true ;;
225 --arch=* ) arch="${i#--arch=}" ;;
226 --cpu=* ) cpu="${i#--cpu=}" ;;
230 # Determine the libdir if it's not specified in the args
231 [ "$libdir" = "" ] && libdir=$prefix/lib
232 [ "$datadir" = "" ] && datadir=$prefix/share
233 [ "$mandir" = "" ] && mandir=$prefix/share/man
235 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
236 if [ "$mmx" = "true" ]
240 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
243 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
246 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
249 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
254 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
255 if [ "$sse" = "true" ]
259 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
262 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
265 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
268 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
273 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
274 if [ "$sse2" = "true" ]
278 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
281 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
284 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
287 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
292 # Show help if requested
297 # Log the configuration history
299 echo "$0 $@" >> config.log
304 # Iterate through each of the components
305 for i in framework modules melt mlt++ swig
307 if [ -x src/$i/configure ]
309 [ $help = 0 ] && echo "Configuring `basename $i`:"
313 [ $? != 0 ] && exit 1
318 # Build the pkg-config files
323 ( [ "$gpl" = "false" ] &&
324 echo "GPL Components are disabled" ||
325 echo "GPL License Used" )