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 --disable-debug - Compile without debug support (default: on)
23 --disable-mmx - Compile without MMX support (default: on)
24 --disable-sse - Compile without SSE support (default: on)
25 --disable-sse2 - Compile without SSE2 support (default: on)
26 --arch='arch' - Compile for a specific architecture (default: none)
27 --cpu='cpu' - Compile for a specific CPU (default: none)
29 Module disable options:
33 for i in src/modules/*
35 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
37 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
40 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
47 echo "version=$version"
48 echo "soversion=$soversion"
51 echo "bindir=$prefix/bin"
52 echo "datadir=$datadir"
54 echo "targetos=$targetos"
56 [ "$mmx" = "true" ] &&
57 echo "MMX_FLAGS=-DUSE_MMX"
59 [ "$sse" = "true" ] &&
60 echo "SSE_FLAGS=-DUSE_SSE"
62 [ "$sse2" = "true" ] &&
63 echo "SSE2_FLAGS=-DUSE_SSE2"
65 [ "$debug" = "true" ] &&
68 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
70 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
71 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
72 echo "OPTIMISATIONS=-O2 -pipe -fomit-frame-pointer"
74 echo "CFLAGS+=-Wall -fPIC -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(SSE2_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
78 sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
79 echo "CFLAGS+=-D__DARWIN__ `sdl-config --cflags`"
80 echo "SHFLAGS=-dynamiclib"
81 echo "LDFLAGS+=`sdl-config --libs`"
84 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
85 echo "OPTIMISATIONS+=-ffast-math"
86 echo "CFLAGS+=-pthread"
87 echo "SHFLAGS=-shared"
89 echo "RDYNAMIC=-rdynamic"
90 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
93 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
94 echo "OPTIMISATIONS+=-ffast-math"
95 echo "CFLAGS+=-pthread"
96 echo "SHFLAGS=-shared"
97 echo "RDYNAMIC=-rdynamic"
98 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
101 [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
102 echo "OPTIMISATIONS+=-ffast-math"
103 echo "CFLAGS+=-pthread"
104 echo "SHFLAGS=-shared"
105 echo "RDYNAMIC=-rdynamic"
106 echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
111 echo "LIBSUF=$LIBSUF"
114 echo "#!/bin/sh" > mlt-config
116 echo export version=$version
117 echo export prefix=$prefix
118 echo export libdir=$libdir
119 echo export bindir=$prefix/bin
122 cat < mlt-config-template >> mlt-config
124 echo -n > packages.dat
129 echo prefix="$prefix" > mlt-framework.pc
131 echo exec_prefix=$prefix
133 echo includedir=$prefix/include
134 echo datadir=$datadir
136 echo version=$version
137 echo cflags=`grep ^framework packages.dat | cut -f 2`
138 echo libs=`grep ^framework packages.dat | cut -f 3`
139 ) >> mlt-framework.pc
140 cat mlt-framework.pc.in >>mlt-framework.pc
142 echo prefix="$prefix" > mlt++.pc
144 echo exec_prefix=$prefix
146 echo includedir=$prefix/include
147 echo datadir=$datadir
149 echo version=$version
150 echo cflags=`grep ^mlt++ packages.dat | cut -f 2`
151 echo libs=`grep ^mlt++ packages.dat | cut -f 3`
153 cat mlt++.pc.in >>mlt++.pc
159 # Define build directory for scripts called
160 export build_dir=`dirname $0`
161 export prefix=/usr/local
177 # Chose appropriate suffix for libraries
182 Linux|FreeBSD|NetBSD)
191 # Iterate through arguments
196 --prefix=* ) prefix="${i#--prefix=}" ;;
197 --libdir=* ) libdir="${i#--libdir=}" ;;
198 --datadir=* ) datadir="${i#--datadir=}" ;;
199 --mandir=* ) mandir="${i#--mandir=}" ;;
200 --disable-debug ) debug=false ;;
201 --disable-mmx ) mmx=false; sse=false; sse2=false ;;
202 --disable-sse ) sse=false; sse2=false ;;
203 --disable-sse2 ) sse2=false ;;
204 --enable-gpl ) gpl=true ;;
205 --arch=* ) arch="${i#--arch=}" ;;
206 --cpu=* ) cpu="${i#--cpu=}" ;;
210 # Determine the libdir if it's not specified in the args
211 [ "$libdir" = "" ] && libdir=$prefix/lib
212 [ "$datadir" = "" ] && datadir=$prefix/share
213 [ "$mandir" = "" ] && mandir=$prefix/share/man
215 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
216 if [ "$mmx" = "true" ]
220 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
223 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
226 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
229 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
234 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
235 if [ "$sse" = "true" ]
239 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
242 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
245 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
248 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
253 # Double check SSE2 (Darwin, Linux and FreeBSD supported, may end up disabling SSE2 on other platforms incorrectly)
254 if [ "$sse2" = "true" ]
258 sysctl -a hw | grep "sse2: 1" > /dev/null || sse2=false
261 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
264 [ "$(make -V MACHINE_CPU:Msse2)" ] || sse2=false
267 grep sse2 /proc/cpuinfo > /dev/null 2>&1 || sse2=false
272 # Show help if requested
277 # Log the configuration history
279 echo "$0 $@" >> config.log
284 # Iterate through each of the components
285 for i in framework modules melt mlt++ swig
287 if [ -x src/$i/configure ]
289 [ $help = 0 ] && echo "Configuring `basename $i`:"
293 [ $? != 0 ] && exit 1
298 # Build the pkg-config files
303 ( [ "$gpl" = "false" ] &&
304 echo "GPL Components are disabled" ||
305 echo "GPL License Used" )