2002-10-18 21:18:33 +04:00
|
|
|
#!/bin/sh
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2004-07-29 22:13:11 +04:00
|
|
|
# "$Id: fltk-config.in,v 1.12.2.24 2004/07/29 18:13:10 easysw Exp $"
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2001-09-29 19:57:32 +04:00
|
|
|
# FLTK configuration utility.
|
|
|
|
#
|
2004-04-11 08:39:01 +04:00
|
|
|
# Copyright 2000-2004 by Bill Spitzak and others.
|
2001-09-29 19:57:32 +04:00
|
|
|
# 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.
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2001-09-29 19:57:32 +04:00
|
|
|
# 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.
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2001-09-29 19:57:32 +04:00
|
|
|
# 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".
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
MAJOR_VERSION=@FL_MAJOR_VERSION@
|
|
|
|
MINOR_VERSION=@FL_MINOR_VERSION@
|
|
|
|
PATCH_VERSION=@FL_PATCH_VERSION@
|
2001-09-29 19:57:32 +04:00
|
|
|
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
|
2001-09-29 19:57:32 +04:00
|
|
|
APIVERSION="$MAJOR_VERSION.$MINOR_VERSION"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
### BEGIN fltk-config
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
prefix=@prefix@
|
2001-09-29 19:57:32 +04:00
|
|
|
exec_prefix=@exec_prefix@
|
|
|
|
exec_prefix_set=no
|
|
|
|
bindir=@bindir@
|
|
|
|
includedir=@includedir@
|
|
|
|
libdir=@libdir@
|
|
|
|
srcdir=@srcdir@
|
|
|
|
|
|
|
|
# compiler names
|
|
|
|
CXX="@CXX@"
|
|
|
|
CC="@CC@"
|
|
|
|
|
2001-12-14 22:34:30 +03:00
|
|
|
# post-process command (only needed for MacOS)
|
|
|
|
POSTBUILD="@POSTBUILD@"
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
# flags for C++ compiler:
|
|
|
|
CFLAGS="@CFLAGS@"
|
|
|
|
CXXFLAGS="@CXXFLAGS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
LDFLAGS="@LDFLAGS@"
|
2003-03-26 03:47:14 +03:00
|
|
|
LDLIBS="@LIBS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-12-14 22:34:30 +03:00
|
|
|
# libraries to link with:
|
2001-09-29 19:57:32 +04:00
|
|
|
LIBNAME="@LIBNAME@"
|
2001-09-29 19:57:32 +04:00
|
|
|
DSONAME="@DSONAME@"
|
|
|
|
DSOLINK="@DSOLINK@"
|
2004-07-29 22:13:11 +04:00
|
|
|
IMAGELIBS="@IMAGELIBS@"
|
2002-07-14 21:03:31 +04:00
|
|
|
SHAREDSUFFIX="@SHAREDSUFFIX@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
echo "Usage: fltk-config [OPTIONS]
|
|
|
|
Options:
|
|
|
|
[--version]
|
2001-09-29 19:57:32 +04:00
|
|
|
[--api-version]
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
Options telling what we are doing:
|
2001-09-29 19:57:32 +04:00
|
|
|
[--use-gl] use GL
|
2001-09-29 19:57:32 +04:00
|
|
|
[--use-images] use extra image formats (PNG, JPEG)
|
2001-09-29 19:57:32 +04:00
|
|
|
[--use-glut] use glut compatibility layer
|
2002-03-26 00:39:01 +03:00
|
|
|
[--use-forms] use forms compatibility layer
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
Options telling what information we request:
|
2001-09-29 19:57:32 +04:00
|
|
|
[--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
|
2001-11-28 01:03:29 +03:00
|
|
|
|
|
|
|
Option to compile and link an application:
|
2002-04-24 16:14:57 +04:00
|
|
|
[-g] compile the program with debugging information
|
2001-11-28 01:03:29 +03:00
|
|
|
[--compile program.cxx]
|
2001-12-14 22:34:30 +03:00
|
|
|
[--post program]
|
2001-09-29 19:57:32 +04:00
|
|
|
"
|
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
2002-04-26 16:45:16 +04:00
|
|
|
if test $# -eq 0; then
|
|
|
|
usage 1
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
no_plugins=no
|
2001-11-28 01:03:29 +03:00
|
|
|
compile=
|
2001-12-14 22:34:30 +03:00
|
|
|
post=
|
2002-04-24 16:14:57 +04:00
|
|
|
debug=
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# Parse command line options
|
|
|
|
while test $# -gt 0
|
|
|
|
do
|
2002-04-26 16:45:16 +04:00
|
|
|
case "$1" in
|
|
|
|
-*=*)
|
|
|
|
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
optarg=
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
--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
|
|
|
|
;;
|
|
|
|
--post)
|
|
|
|
post=$2
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo_help=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
2001-09-29 19:57:32 +04:00
|
|
|
done
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$includedir" != /usr/include; then
|
2002-04-26 16:45:16 +04:00
|
|
|
includes=-I$includedir
|
2001-09-29 19:57:32 +04:00
|
|
|
else
|
2002-04-26 16:45:16 +04:00
|
|
|
includes=
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
|
2002-04-26 16:45:16 +04:00
|
|
|
libs=-L$libdir
|
2001-09-29 19:57:32 +04:00
|
|
|
else
|
2002-04-26 16:45:16 +04:00
|
|
|
libs=
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# Calculate needed libraries
|
2004-07-26 21:46:36 +04:00
|
|
|
LDSTATIC="$libs $libdir/libfltk.a $LDLIBS"
|
2002-07-14 21:03:31 +04:00
|
|
|
LDLIBS="$libs -lfltk$SHAREDSUFFIX $LDLIBS"
|
2004-06-01 18:49:51 +04:00
|
|
|
LIBS="$LIBS $libs $libdir/libfltk.a"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2002-03-26 00:39:01 +03:00
|
|
|
if test x$use_forms = xyes; then
|
2002-07-14 21:03:31 +04:00
|
|
|
LDLIBS="-lfltk_forms$SHAREDSUFFIX $LDLIBS"
|
2002-03-26 00:39:01 +03:00
|
|
|
LDSTATIC="$libdir/libfltk_forms.a $LDSTATIC"
|
|
|
|
LIBS="$LIBS $libdir/libfltk_forms.a"
|
|
|
|
fi
|
|
|
|
if test x$use_gl = xyes; then
|
2002-07-14 21:03:31 +04:00
|
|
|
LDLIBS="-lfltk_gl$SHAREDSUFFIX @GLLIB@ $LDLIBS"
|
2001-09-29 19:57:32 +04:00
|
|
|
LDSTATIC="$libdir/libfltk_gl.a @GLLIB@ $LDSTATIC"
|
|
|
|
LIBS="$LIBS $libdir/libfltk_gl.a"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
2002-03-26 00:39:01 +03:00
|
|
|
if test x$use_images = xyes; then
|
2002-07-14 21:03:31 +04:00
|
|
|
LDLIBS="-lfltk_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
|
2002-06-29 01:04:37 +04:00
|
|
|
LDSTATIC="$libdir/libfltk_images.a $IMAGELIBS $LDSTATIC"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2003-03-26 03:47:14 +03:00
|
|
|
LDLIBS="$DSOLINK $LDFLAGS $LDLIBS"
|
|
|
|
LDSTATIC="$LDFLAGS $LDSTATIC"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
# Answer to user requests
|
2002-04-26 16:45:16 +04:00
|
|
|
if test -n "$echo_help"; then
|
|
|
|
usage 1
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
if test -n "$compile"; then
|
2002-02-20 16:02:27 +03:00
|
|
|
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
|
|
|
|
|
2001-12-14 22:34:30 +03:00
|
|
|
post=$prog
|
2001-11-28 01:03:29 +03:00
|
|
|
|
2002-10-07 17:19:22 +04:00
|
|
|
echo $CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
|
|
|
|
$CXX $includes $CXXFLAGS $debug -o $prog $compile $LDSTATIC
|
2001-11-28 01:03:29 +03:00
|
|
|
fi
|
|
|
|
|
2001-12-14 22:34:30 +03:00
|
|
|
if test -n "$post" -a "$POSTBUILD" != ":"; then
|
|
|
|
echo $POSTBUILD $post $includedir/FL/mac.r
|
|
|
|
$POSTBUILD $post $includedir/FL/mac.r
|
|
|
|
fi
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$echo_cflags" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
echo $includes $CFLAGS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_cxxflags" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
echo $includes $CXXFLAGS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_ldflags" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
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
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_ldstaticflags" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
echo $LDSTATIC
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_libs" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
echo $LIBS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2002-04-26 16:45:16 +04:00
|
|
|
#
|
2004-07-29 22:13:11 +04:00
|
|
|
# End of "$Id: fltk-config.in,v 1.12.2.24 2004/07/29 18:13:10 easysw Exp $".
|
2002-04-26 16:45:16 +04:00
|
|
|
#
|