2001-09-29 19:57:32 +04:00
|
|
|
#! /bin/sh
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
|
|
|
# "$Id: fltk-config.in,v 1.12.2.1 2001/09/29 15:57:32 easysw Exp $"
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2001-09-29 19:57:32 +04:00
|
|
|
# FLTK configuration utility.
|
|
|
|
#
|
|
|
|
# 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-09-29 19:57:32 +04:00
|
|
|
MAJOR_VERSION=1
|
|
|
|
MINOR_VERSION=1
|
2001-09-29 19:57:32 +04:00
|
|
|
PATCH_VERSION=0
|
|
|
|
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@"
|
|
|
|
|
|
|
|
# flags for C++ compiler:
|
|
|
|
CFLAGS="@CFLAGS@"
|
|
|
|
CXXFLAGS="@CXXFLAGS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
LDFLAGS="@LDFLAGS@"
|
|
|
|
LDLIBS="@LDFLAGS@ -lX11 -lXext @X_EXTRA_LIBS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# program to make the archive:
|
|
|
|
LIBNAME="@LIBNAME@"
|
2001-09-29 19:57:32 +04:00
|
|
|
DSONAME="@DSONAME@"
|
|
|
|
DSOLINK="@DSOLINK@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# libraries to link with:
|
2001-09-29 19:57:32 +04:00
|
|
|
IMAGELIBS="@IMAGELIBS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
echo "Usage: fltk-config [OPTIONS]
|
|
|
|
Options:
|
|
|
|
[--prefix[=DIR]] return/set where FLTK is installed
|
|
|
|
[--exec-prefix[=DIR]]
|
|
|
|
[--version]
|
2001-09-29 19:57:32 +04:00
|
|
|
[--api-version]
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
options telling what we are doing :
|
|
|
|
[--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
|
|
|
|
|
|
|
|
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
|
|
|
|
"
|
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
|
|
|
if test $# -eq 0; then usage 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
no_plugins=no
|
|
|
|
|
|
|
|
# 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
|
|
|
|
;;
|
|
|
|
--prefix)
|
|
|
|
echo_prefix=yes
|
|
|
|
;;
|
|
|
|
--exec-prefix=*)
|
|
|
|
exec_prefix=$optarg
|
|
|
|
exec_prefix_set=yes
|
|
|
|
;;
|
|
|
|
--exec-prefix)
|
|
|
|
echo_exec_prefix=yes
|
|
|
|
;;
|
|
|
|
--version)
|
|
|
|
echo $VERSION
|
|
|
|
;;
|
2001-09-29 19:57:32 +04:00
|
|
|
--api-version)
|
|
|
|
echo $APIVERSION
|
2001-09-29 19:57:32 +04:00
|
|
|
;;
|
2001-09-29 19:57:32 +04:00
|
|
|
--use-gl | --use-glut)
|
2001-09-29 19:57:32 +04:00
|
|
|
use_gl=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
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo_help=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$includedir" != /usr/include; then
|
|
|
|
includes=-I$includedir
|
|
|
|
else
|
|
|
|
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
|
|
|
|
libs=-L$libdir
|
|
|
|
else
|
|
|
|
libs=
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# Calculate needed libraries
|
|
|
|
LDSTATIC="$libdir/libfltk.a $LDLIBS"
|
|
|
|
LDLIBS="$libs -lfltk $LDLIBS"
|
|
|
|
LIBS="$LIBS $libdir/libfltk.a"
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$use_gl" = "yes"; then
|
2001-09-29 19:57:32 +04:00
|
|
|
LDLIBS="-lfltk_gl @GLLIB@ $LDLIBS"
|
|
|
|
LDSTATIC="$libdir/libfltk_gl.a @GLLIB@ $LDSTATIC"
|
|
|
|
LIBS="$LIBS $libdir/libfltk_gl.a"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
if test "$use_images" = "yes"; then
|
2001-09-29 19:57:32 +04:00
|
|
|
LDLIBS="$LDLIBS $IMAGELIBS"
|
|
|
|
LDSTATIC="$LDSTATIC $IMAGELIBS"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
LDLIBS="$DSOLINK $LDLIBS -lm"
|
|
|
|
LDSTATIC="$LDSTATIC -lm"
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
# Answer to user requests
|
|
|
|
if test -n "$echo_help"; then usage 1
|
|
|
|
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
|
2001-09-29 19:57:32 +04:00
|
|
|
echo $includes $CFLAGS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_cxxflags" = "yes"; then
|
2001-09-29 19:57:32 +04:00
|
|
|
echo $includes $CXXFLAGS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_ldflags" = "yes"; then
|
2001-09-29 19:57:32 +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
|
|
|
|
echo $LDSTATIC
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_libs" = "yes"; then
|
|
|
|
echo $LIBS
|
|
|
|
fi
|
|
|
|
|
|
|
|
# END of fltk-config
|