summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/src/fltk-2/bin/fltk2-config
blob: 1abb3220d1e8a0d5f89175151568d8ab7e8a07f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
#!/bin/sh
#
# "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $"
# 
# FLTK configuration utility.
#
# Copyright 2000-2003 by Bill Spitzak and others.
# Original version Copyright 2000 by James Dean Palmer
# Adapted by Vincent Penne and Michael Sweet
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to "fltk-bugs@fltk.org".
#

MAJOR_VERSION=2
MINOR_VERSION=0
PATCH_VERSION=0
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
APIVERSION="$MAJOR_VERSION.$MINOR_VERSION"

### BEGIN fltk2-config

# First, we need to figure out where we are, in case we are in a non-installed invocation
# BUT to do that we need to check if we were called via a symlink or not...
# AND some systems (e.g. mingw) have neither symlinks, nor readlink, nor which...
HAVE_READLINK=`type -p readlink`
if test -z "$HAVE_READLINK"; then
# We don't have readlink, so just use local dir as selfdir
  selfdir=`dirname $0`
else
# We do have readlink - let us check if we were called via a symlink or not
  selfdir=`readlink $0`
  if test -n "$selfdir"; then
#   Was a symlink, find the real selfdir
    selfdir=`dirname $selfdir`
  else
#   Not a symlink, find the selfdir
    selfdir=`dirname $0`
  fi
fi

prefix=/home/bastian/studium/hiwi/fltk-2/
exec_prefix=${prefix}
exec_prefix_set=no
bindir=${exec_prefix}/bin
includedir=${prefix}/include
libdir=${exec_prefix}/lib
srcdir=.

# compiler names
CXX="gcc"
CC="gcc"

# post-process command (only needed for MacOS)
POSTBUILD=":"

# flags for C++ compiler:
CFLAGS=""
CXXFLAGS="-I/usr/include/freetype2  -Wno-non-virtual-dtor"
LDFLAGS=" "
LDLIBS="  -lX11 -lXi -lXinerama -lXft -lpthread -lm  -lXext  -lsupc++"

# libraries to link with:
LIBNAME="@LIBNAME@"
DSONAME="@DSONAME@"
DSOLINK=""
IMAGELIBS="-lpng -lfltk2_images -ljpeg -lz"
SHAREDSUFFIX=""

# Check for local invocation, and update paths accordingly...
if test -e "$selfdir/fltk/Window.h"; then
  bindir="$selfdir/fluid"
  includedir="$selfdir"
  libdir="$selfdir/lib"
  prefix="$selfdir"
	if test -f "$libdir/libfltk2_jpeg.a"; then
		CFLAGS="-I$includedir/images/jpeg $CFLAGS"
		CXXFLAGS="-I$includedir/images/jpeg $CXXFLAGS"
	fi

	if test -f "$libdir/libfltk2_z.a"; then
		CFLAGS="-I$includedir/images/zlib $CFLAGS"
		CXXFLAGS="-I$includedir/images/zlib $CXXFLAGS"
	fi

	if test -f "$libdir/libfltk2_png.a"; then
		CFLAGS="-I$includedir/images/png $CFLAGS"
		CXXFLAGS="-I$includedir/images/png $CXXFLAGS"
	fi
fi

usage ()
{
    echo "Usage: fltk2-config [OPTIONS]
Options:
	[--prefix[=DIR]]  return/set where FLTK is installed
	[--exec-prefix[=DIR]]
	[--version]
	[--api-version]

Options telling what we are doing:
	[--use-gl]        use GL
	[--use-images]    use extra image formats (PNG, JPEG)
	[--use-glut]      use glut compatibility layer
	[--use-forms]     use forms compatibility layer

Options telling what information we request:
	[--cflags]        return flags to compile C using FLTK
	[--cxxflags]      return flags to compile C++ using FLTK
	[--ldflags]       return flags to link against FLTK
	[--ldstaticflags] return flags to link against static FLTK library
                                          even if there are DSOs installed
	[--libs]          return FLTK libraries full path for dependencies
	[--cxx]           return name of C++ compiler used to build FLTK
	[--cc]            return name of C compiler used to build FLTK

Option to compile and link an application:
	[-g]              compile the program with debugging information
	[--compile program.cxx]
  [--post program]
"
    exit $1
}

if test $# -eq 0; then
    usage 1
fi

no_plugins=no
compile=
post=
debug=

# Parse command line options
while test $# -gt 0 
do
    case "$1" in
	-*=*) 
	    optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
	    ;;
	*)
	    optarg=
	    ;;
    esac

    case $1 in
	--prefix=*)
	    prefix=$optarg
	    if test $exec_prefix_set = no ; then
              exec_prefix=$optarg
	    fi
## FIXME
#     This fixes --prefix=<path> bug - fltk2-config didn't return proper stuff
      bindir=${exec_prefix}
      includedir=${prefix}/include
      libdir=${prefix}/lib
      DSOLINK="-Wl,-rpath,${prefix}/lib"
	    ;;
	--prefix)
	    echo_prefix=yes
	    ;;
	--exec-prefix=*)
	    exec_prefix=$optarg
	    exec_prefix_set=yes
	    ;;
	--exec-prefix)
	    echo_exec_prefix=yes
	    ;;
	--version)
	    echo $VERSION
	    ;;
	--api-version)
	    echo $APIVERSION
	    ;;
	--use-gl | --use-glut)
	    use_gl=yes
	    ;;
	--use-forms)
	    use_forms=yes
	    ;;
	--use-images)
	    use_images=yes
	    ;;
	--cflags)
	    echo_cflags=yes
	    ;;
	--cxxflags)
	    echo_cxxflags=yes
	    ;;
	--ldflags)
	    echo_ldflags=yes
	    ;;
	--ldstaticflags)
	    echo_ldstaticflags=yes
	    ;;
	--libs)
	    echo_libs=yes
	    ;;
	-g)
	    debug=-g
	    ;;
	--compile)
	    compile=$2
	    post=$2
	    shift
	    ;;
	--cxx)
	    echo_cxx_name=yes
	    ;;
	--cc)
	    echo_cc_name=yes
	    ;;	    
	--post)
	    post=$2
	    shift
	    ;;
	*)
	    echo_help=yes
	    ;;
    esac
    shift
done

if test "$includedir" != /usr/include; then
    includes=-I$includedir
else
    includes=
fi

if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
    libs=-L$libdir
else
    libs=
fi

###
# Some MinGW variants still need -I/usr/include and -L/usr/lib ...
#
case `uname -s` in
    MINGW*)
	if test "$includedir" == /usr/include; then
	  includes=-I$includedir
	fi
	if test "$libdir" == /usr/lib; then
	  libs=-L$libdir
	fi
	;;
esac
LDSTATIC_PATHS=$libs
LDLIBS_PATHS=$libs 

# Calculate needed libraries
LDSTATIC="$libdir/libfltk2.a $LDLIBS"
LDLIBS="$libs -lfltk2$SHAREDSUFFIX $LDLIBS"
LIBS="$LIBS $libdir/libfltk2.a"

if test x$use_forms = xyes; then
    LDLIBS="-lfltk2_forms$SHAREDSUFFIX $LDLIBS"
    LDSTATIC="$libdir/libfltk2_forms.a $LDSTATIC"
    LIBS="$LIBS $libdir/libfltk2_forms.a"
fi
if test x$use_gl = xyes; then
    LDLIBS="-lfltk2_gl$SHAREDSUFFIX -lGLU -lGL $LDLIBS"
    LDSTATIC="$libdir/libfltk2_gl.a -lGLU -lGL $LDSTATIC"
    LIBS="$LIBS $libdir/libfltk2_gl.a"
fi
if test x$use_images = xyes; then
    LDLIBS="-lfltk2_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
    LDSTATIC="$libdir/libfltk2_images.a $LDSTATIC $IMAGELIBS"
fi

LDLIBS="$DSOLINK $LDLIBS"
LDSTATIC="$LDSTATIC_PATHS $LDSTATIC"

# Answer to user requests
if test -n "$echo_help"; then
    usage 1
fi

if test -n "$compile"; then
    case $compile in
        *.cxx)
            prog=`basename $compile .cxx`
	    ;;
        *.cpp)
            prog=`basename $compile .cpp`
	    ;;
        *.cc)
            prog=`basename $compile .cc`
	    ;;
        *.C)
            prog=`basename $compile .C`
	    ;;
	*)
	    echo "ERROR: Unknown/bad C++ source file extension on \"$compile\"!"
	    exit 1
	    ;;
    esac
	    
    post=$prog

    echo $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
    $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
fi

if test -n "$post" -a "$POSTBUILD" != ":"; then
    echo $POSTBUILD $post $includedir/fltk/mac.r
    $POSTBUILD $post $includedir/fltk/mac.r
fi

if test "$echo_prefix" = "yes"; then
    echo $prefix
fi

if test "$echo_exec_prefix" = "yes"; then
    echo $exec_prefix
fi

if test "$echo_cflags" = "yes"; then
    echo $includes $CFLAGS
fi

if test "$echo_cxxflags" = "yes"; then
    echo $includes $CXXFLAGS
fi

if test "$echo_ldflags" = "yes"; then
    my_libs=
    libdirs=$libs

    for i in $LDLIBS ; do
	if test $i != -L$libdir ; then
	    if test -z "$my_libs" ; then
		my_libs="$i"
	    else
		my_libs="$my_libs $i"
	    fi
	fi
    done
    echo $libdirs $my_libs
fi

if test "$echo_ldstaticflags" = "yes"; then
    echo $LDSTATIC
fi

if test "$echo_libs" = "yes"; then
    echo $LIBS
fi

if test "$echo_cc_name" = "yes"; then
    echo $CC
fi

if test "$echo_cxx_name" = "yes"; then
    echo $CXX
fi

#
# End of "$Id: fltk2-config.in 4958 2006-04-15 17:43:12Z fabien $".
#