File Browser: Use QFileSystemWatcher to automatically refresh directories
[lmms/mlankhorst.git] / plugins / zynaddsubfx / fltk / fltk-config
blob10330bf6fd23113585dc44538c2f5bf1368b669a
1 #!/bin/sh
3 # "$Id: fltk-config.in 6614 2009-01-01 16:11:32Z matt $"
4 #
5 # FLTK configuration utility.
7 # Copyright 2000-2009 by Bill Spitzak and others.
8 # Original version Copyright 2000 by James Dean Palmer
9 # Adapted by Vincent Penne and Michael Sweet
11 # This library is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU Library General Public
13 # License as published by the Free Software Foundation; either
14 # version 2 of the License, or (at your option) any later version.
16 # This library is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # Library General Public License for more details.
21 # You should have received a copy of the GNU Library General Public
22 # License along with this library; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 # USA.
26 # Please report all bugs and problems on the following page:
28 # http://www.fltk.org/str.php
31 MAJOR_VERSION=1
32 MINOR_VERSION=3
33 PATCH_VERSION=0
34 VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
35 APIVERSION="$MAJOR_VERSION.$MINOR_VERSION"
37 ### BEGIN fltk-config
38 selfdir=`dirname "$0"`
40 prefix=/usr
41 exec_prefix=${prefix}
42 exec_prefix_set=no
43 bindir=${exec_prefix}/bin
44 includedir=${prefix}/include
45 libdir=${exec_prefix}/lib
46 srcdir=.
48 # compiler names
49 CC="gcc"
50 CXX="g++"
52 # flags for C++ compiler:
53 ARCHFLAGS=""
54 CFLAGS=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT"
55 CXXFLAGS="-I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT"
56 LDFLAGS=" "
57 LDLIBS="-lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 "
58 OPTIM=" -Os -Wall -Wunused -Wno-format-y2k -fno-exceptions -fno-strict-aliasing"
59 CAIROFLAGS=""
61 # Check for local invocation, and update paths accordingly...
62 if test -f "$selfdir/FL/Fl_Window.H"; then
63 bindir="$selfdir/fluid"
64 includedir="$selfdir"
65 libdir="$selfdir/lib"
67 if test -f "$libdir/libfltk_jpeg.a"; then
68 CFLAGS="-I$includedir/jpeg $CFLAGS"
69 CXXFLAGS="-I$includedir/jpeg $CXXFLAGS"
72 if test -f "$libdir/libfltk_z.a"; then
73 CFLAGS="-I$includedir/zlib $CFLAGS"
74 CXXFLAGS="-I$includedir/zlib $CXXFLAGS"
77 if test -f "$libdir/libfltk_png.a"; then
78 CFLAGS="-I$includedir/png $CFLAGS"
79 CXXFLAGS="-I$includedir/png $CXXFLAGS"
83 if test -d $includedir/FL/images; then
84 CFLAGS="-I$includedir/FL/images $CFLAGS"
85 CXXFLAGS="-I$includedir/FL/images $CXXFLAGS"
88 if test -f "$libdir/libfltk_cairo.a"; then
89 CFLAGS="$CAIROFLAGS $CFLAGS"
90 CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
93 # libraries to link with:
94 LIBNAME="../lib/libfltk.a"
95 DSONAME=""
96 DSOLINK=""
97 IMAGELIBS="-lpng -lz -ljpeg "
98 STATICIMAGELIBS="-lpng -lz -ljpeg "
99 CAIROLIBS=""
100 SHAREDSUFFIX=""
102 usage ()
104 echo "Usage: fltk-config [OPTIONS]
105 Options:
106 [--version]
107 [--api-version]
109 Options telling what we are doing:
110 [--use-gl] use GL
111 [--use-images] use extra image formats (PNG, JPEG)
112 [--use-glut] use glut compatibility layer
113 [--use-forms] use forms compatibility layer
114 [--use-cairo] use cairo graphics lib
116 Options telling what information we request:
117 [--cc] return C compiler used to compile FLTK
118 [--cxx] return C++ compiler used to compile FLTK
119 [--optim] return compiler optimization used to compile FLTK
120 [--cflags] return flags to compile C using FLTK
121 [--cxxflags] return flags to compile C++ using FLTK
122 [--ldflags] return flags to link against FLTK
123 [--ldstaticflags] return flags to link against static FLTK library
124 even if there are DSOs installed
125 [--libs] return FLTK libraries full path for dependencies
127 Options to compile and link an application:
128 [-g] compile the program with debugging information
129 [-Dname[=value]] compile the program with the given define
130 [--compile program.cxx]
131 [--post program] prepare the program for desktop use
133 exit $1
136 if test $# -eq 0; then
137 usage 1
140 no_plugins=no
141 compile=
142 post=
143 debug=
145 # Parse command line options
146 while test $# -gt 0
148 case "$1" in
149 -*=*)
150 optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
153 optarg=
155 esac
157 case $1 in
158 --version)
159 echo $VERSION
161 --api-version)
162 echo $APIVERSION
164 --cc)
165 echo $CC
167 --cxx)
168 echo $CXX
170 --optim)
171 echo_optim=yes
173 --use-gl | --use-glut)
174 use_gl=yes
176 --use-forms)
177 use_forms=yes
179 --use-images)
180 use_images=yes
182 --use-cairo)
183 use_cairo=yes
185 --cflags)
186 echo_cflags=yes
188 --cxxflags)
189 echo_cxxflags=yes
191 --ldflags)
192 echo_ldflags=yes
194 --ldstaticflags)
195 echo_ldstaticflags=yes
197 --libs)
198 echo_libs=yes
201 debug=-g
203 -D*)
204 CXXFLAGS="$CXXFLAGS $1"
206 --compile)
207 compile="$2"
208 shift
210 --post)
211 post="$2"
212 shift
215 echo_help=yes
217 esac
218 shift
219 done
221 if test "$includedir" != /usr/include; then
222 includes=-I$includedir
223 else
224 includes=
227 if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
228 libs=-L$libdir
229 else
230 libs=
233 # Calculate needed libraries
234 LDSTATIC="$libdir/libfltk.a $LDLIBS"
235 LDLIBS="-lfltk$SHAREDSUFFIX $LDLIBS"
237 if test x$use_forms = xyes; then
238 LDLIBS="-lfltk_forms$SHAREDSUFFIX $LDLIBS"
239 LDSTATIC="$libdir/libfltk_forms.a $LDSTATIC"
241 if test x$use_gl = xyes; then
242 LDLIBS="-lfltk_gl$SHAREDSUFFIX -lGLU -lGL $LDLIBS"
243 LDSTATIC="$libdir/libfltk_gl.a -lGLU -lGL $LDSTATIC"
245 if test x$use_images = xyes; then
246 LDLIBS="-lfltk_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
247 LDSTATIC="$libdir/libfltk_images.a $STATICIMAGELIBS $LDSTATIC"
250 if test x$use_cairo = xyes; then
251 LDLIBS="-lfltk_cairo$SHAREDSUFFIX $CAIROLIBS $LDLIBS"
252 LDSTATIC="$libdir/libfltk_cairo.a $CAIROLIBS $LDSTATIC"
255 LDLIBS="$DSOLINK $LDFLAGS $libs $LDLIBS"
256 LDSTATIC="$LDFLAGS $LDSTATIC"
258 # Answer to user requests
259 if test -n "$echo_help"; then
260 usage 1
263 if test -n "$compile"; then
264 case "$compile" in
265 *.cxx)
266 prog="`basename \"$compile\" .cxx`"
268 *.cpp)
269 prog="`basename \"$compile\" .cpp`"
271 *.cc)
272 prog="`basename \"$compile\" .cc`"
274 *.C)
275 prog="`basename \"$compile\" .C`"
278 echo "ERROR: Unknown/bad C++ source file extension on \"$compile\"!"
279 exit 1
281 esac
283 post="$prog"
285 echo $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o "'$prog'" "'$compile'" $LDSTATIC
286 $CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o "$prog" "$compile" $LDSTATIC || exit 1
289 if test -n "$post"; then
290 case "`uname`" in
291 Darwin)
292 echo Creating "'$post.app'" bundle for desktop...
293 id=`echo $post | tr ' ' '_'`
295 # Make the bundle directory and move the executable there
296 rm -rf "$post.app/Contents/MacOS"
297 mkdir -p "$post.app/Contents/MacOS"
298 mv "$post" "$post.app/Contents/MacOS"
300 # Make a shell script that runs the bundled executable
301 echo "#!/bin/sh" >"$post"
302 echo 'dir="`dirname '"'"'$0'"'"'`"' >>"$post"
303 echo 'exec "$dir/'"$post.app/Contents/MacOS/$post"'" "$@"' >>"$post"
304 chmod +x "$post"
306 # Make the simplest Info.plist needed for an application
307 cat >"$post.app/Contents/Info.plist" <<EOF
308 <?xml version="1.0" encoding="UTF-8"?>
309 <plist version="0.9">
310 <dict>
311 <key>CFBundleInfoDictionaryVersion</key>
312 <string>6.0</string>
313 <key>CFBundleExecutable</key>
314 <string>$post</string>
315 <key>CFBundleIdentifier</key>
316 <string>org.fltk.$id</string>
317 <key>CFBundleName</key>
318 <string>$post</string>
319 <key>CFBundlePackageType</key>
320 <string>APPL</string>
321 </dict>
322 </plist>
325 esac
328 if test "$echo_cflags" = "yes"; then
329 echo $includes $CFLAGS
332 if test "$echo_cxxflags" = "yes"; then
333 echo $includes $CXXFLAGS
336 if test "$echo_optim" = "yes"; then
337 echo $OPTIM
340 if test "$echo_ldflags" = "yes"; then
341 my_libs=
342 libdirs=$libs
344 for i in $LDLIBS ; do
345 if test $i != -L$libdir ; then
346 if test -z "$my_libs" ; then
347 my_libs="$i"
348 else
349 my_libs="$my_libs $i"
352 done
353 echo $libdirs $my_libs
356 if test "$echo_ldstaticflags" = "yes"; then
357 echo $LDSTATIC
360 if test "$echo_libs" = "yes"; then
361 echo $libdir/libfltk.a
363 if test x$use_forms = xyes; then
364 echo $libdir/libfltk_forms.a
367 if test x$use_gl = xyes; then
368 echo $libdir/libfltk_gl.a
371 if test x$use_cairo = xyes; then
372 echo $libdir/libfltk_cairo.a
375 if test x$use_images = xyes; then
376 echo $libdir/libfltk_images.a
378 for lib in fltk_jpeg fltk_png fltk_z; do
379 if test -f $libdir/lib$lib.a; then
380 echo $libdir/lib$lib.a
382 done
387 # End of "$Id: fltk-config.in 6614 2009-01-01 16:11:32Z matt $".