9 Non-autotool config script for Melted.
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 --enable-gpl - Enable GPL components
20 --disable-debug - Compile without debug support (default: on)
21 --disable-mmx - Compile without MMX support (default: on)
22 --disable-sse - Compile without SSE support (default: on)
23 --arch='arch' - Compile for a specific architecture (default: none)
24 --cpu='cpu' - Compile for a specific CPU (default: none)
26 Module disables options:
30 for i in src/modules/*
32 [ -d $i ] && [ "`basename $i`" != "CVS" ] && echo `basename $i` `[ -f $i/gpl ] && echo [GPL]`
34 awk '{ printf( " --disable-%-14.14s- Disable the %s module %s\n", $1, $1, $2 ); }'
37 echo " NOTE: libraries marked [GPL] will not be built unless --enable-gpl is stipulated."
44 echo "version=$version"
45 echo "soversion=$soversion"
48 echo "bindir=$prefix/bin"
49 echo "targetos=$targetos"
51 [ "$mmx" = "true" ] &&
52 echo "MMX_FLAGS=-DUSE_MMX"
54 [ "$sse" = "true" ] &&
55 echo "SSE_FLAGS=-DUSE_SSE"
57 [ "$debug" = "true" ] &&
60 echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
62 [ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
63 [ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
64 echo "OPTIMISATIONS=-O2 -pipe -fomit-frame-pointer"
66 echo "CFLAGS+=-Wall -fPIC -DPIC \$(TARGETARCH) \$(TARGETCPU) \$(OPTIMISATIONS) \$(MMX_FLAGS) \$(SSE_FLAGS) \$(DEBUG_FLAGS) \$(LARGE_FILE)"
70 sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
71 echo "CFLAGS+=-D__DARWIN__ `sdl-config --cflags`"
72 echo "SHFLAGS=-dynamiclib"
73 echo "LDFLAGS+=`sdl-config --libs`"
76 [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
77 echo "OPTIMISATIONS+=-ffast-math"
78 echo "CFLAGS+=-pthread"
79 echo "SHFLAGS=-shared"
81 echo "RDYNAMIC=-rdynamic"
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"
88 echo "RDYNAMIC=-rdynamic"
95 echo "CFLAGS += `pkg-config --cflags mlt-framework`"
96 echo "LDFLAGS += `pkg-config --libs mlt-framework`"
100 echo -n > packages.dat
105 for i in mvcp melted melted++
107 echo prefix="$prefix" > mlt-$i.pc
109 echo exec_prefix=$prefix
111 echo includedir=$prefix/include
112 echo version=$version
113 echo cflags=`grep ^$i packages.dat | cut -f 2`
114 echo libs=`grep ^$i packages.dat | cut -f 3`
116 cat mlt-$i.pc.in >>mlt-$i.pc
123 # Define build directory for scripts called
124 export build_dir=`dirname $0`
125 export prefix=/usr/local
138 # Chose appropriate suffix for libraries
152 # Iterate through arguments
157 --prefix=* ) prefix="${i#--prefix=}" ;;
158 --libdir=* ) libdir="${i#--libdir=}" ;;
159 --disable-debug ) debug=false ;;
160 --disable-mmx ) mmx=false; sse=false ;;
161 --disable-sse ) sse=false ;;
162 --enable-gpl ) gpl=true ;;
163 --arch=* ) arch="${i#--arch=}" ;;
164 --cpu=* ) cpu="${i#--cpu=}" ;;
168 # Determine the libdir if it's not specified in the args
169 [ "$libdir" = "" ] && libdir=$prefix/lib
171 # Double check MMX (Darwin, Linux and FreeBSD supported, may end up disabling MMX on other platforms incorrectly)
172 if [ "$mmx" = "true" ]
176 sysctl -a hw | grep "mmx: 1" > /dev/null || mmx=false
179 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
182 [ "$(make -V MACHINE_CPU:Mmmx)" ] || mmx=false
185 grep mmx /proc/cpuinfo > /dev/null 2>&1 || mmx=false
190 # Double check SSE (Darwin, Linux and FreeBSD supported, may end up disabling SSE on other platforms incorrectly)
191 if [ "$sse" = "true" ]
195 sysctl -a hw | grep "sse: 1" > /dev/null || sse=false
198 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
201 [ "$(make -V MACHINE_CPU:Msse)" ] || sse=false
204 grep sse /proc/cpuinfo > /dev/null 2>&1 || sse=false
209 # Show help if requested
214 # Log the configuration history
216 echo "$0 $@" >> config.log
221 # Iterate through each of the components
222 for i in mvcp melted melted++ mvcp-client modules
224 if [ "$gpl" = "true" -o ! -f src/$i/gpl ]
226 if [ -x src/$i/configure ]
228 [ $help = 0 ] && echo "Configuring `basename $i`:"
232 [ $? != 0 ] && exit 1
238 # Build the pkg-config files
243 ( [ "$gpl" = "false" ] &&
244 echo "GPL Components are disabled" ||
245 echo "GPL License Used" )