2002-10-18 21:18:33 +04:00
|
|
|
#!/bin/sh
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
|
|
|
# FLTK configuration utility.
|
|
|
|
#
|
2019-01-22 00:28:14 +03:00
|
|
|
# Copyright 2000-2024 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
|
|
|
|
#
|
2011-07-19 08:49:30 +04:00
|
|
|
# This library is free software. Distribution and use rights are outlined in
|
|
|
|
# the file "COPYING" which should have been included with this file. If this
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/COPYING.php
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# Please see the following page on how to report bugs and issues:
|
2005-04-16 04:13:17 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/bugs.php
|
2001-09-29 19:57:32 +04:00
|
|
|
#
|
|
|
|
|
2023-03-30 18:06:25 +03:00
|
|
|
# Variables and constants generated by configure or CMake:
|
|
|
|
|
|
|
|
# version numbers
|
2020-06-13 16:19:27 +03:00
|
|
|
MAJOR_VERSION=@FLTK_VERSION_MAJOR@
|
|
|
|
MINOR_VERSION=@FLTK_VERSION_MINOR@
|
|
|
|
PATCH_VERSION=@FLTK_VERSION_PATCH@
|
2023-03-30 18:06:25 +03:00
|
|
|
|
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
|
|
|
|
|
|
|
# compiler names
|
2005-08-10 16:35:20 +04:00
|
|
|
CC="@CC@"
|
2005-08-10 17:54:17 +04:00
|
|
|
CXX="@CXX@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# flags for C++ compiler:
|
2006-06-19 22:29:31 +04:00
|
|
|
ARCHFLAGS="@ARCHFLAGS@"
|
2007-02-05 21:39:27 +03:00
|
|
|
CFLAGS="@CFLAGS@ @LARGEFILE@ @PTHREAD_FLAGS@"
|
|
|
|
CXXFLAGS="@CXXFLAGS@ @LARGEFILE@ @PTHREAD_FLAGS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
LDFLAGS="@LDFLAGS@"
|
2003-03-26 03:47:14 +03:00
|
|
|
LDLIBS="@LIBS@"
|
2007-03-06 23:00:04 +03:00
|
|
|
OPTIM="@OPTIM@"
|
Cairo increment 2: Finer cairo granularity, less deps, new fltk_cairo lib
+ added new USE_CAIRO config preprocessor def.
to differentiate from HAVE_CAIRO so that we can use the cairo lib
without forcing the full fltk lib to be linked against it.
In that case, cairo autolink context functionality which needs fltk lib
instrumentation is disabled.
+ added new --enable-cairoext, which correspond to previous --enable-cairo.
now, --enable-cairo only adds HAVE_CAIRO def. and keeps fltk lib
from referencing cairo.
In both cases (--enable-cairo & --enable-cairoext), a new fltk_cairo lib is
created. This lib, similarly to local versions of png,jpeg and zlib,
is not generated if cairo is not enabled.
+ added cairo to fltk-config : now new --use-cairo flag is available
+ modified all unix like makefiles to now generate minimum cairo deps and also
new libfltk_cairo lib.
+ added new cairo subdir to permit conditional fltk_cairo lib generation.
+ vc2005 project minimum update to compile without be broken, but still needs
to create a similar fltk_cairo independent lib. For now, it works as before
with a dedicated cairo env. similar to --enable-cairoext context in unix.
+ regression tested ok with cairo disabled on win32, mac osx, mingw.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6462 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-19 05:42:35 +04:00
|
|
|
CAIROFLAGS="@CAIROFLAGS@"
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2023-03-30 18:06:25 +03:00
|
|
|
# BINARY_DIR: this is only set for CMake builds in the CMake build directory,
|
|
|
|
# otherwise it is an empty string
|
|
|
|
BINARY_DIR=@BINARY_DIR@
|
2004-09-06 15:20:53 +04:00
|
|
|
|
2024-08-12 17:37:43 +03:00
|
|
|
prefix="@prefix@"
|
|
|
|
exec_prefix="@exec_prefix@"
|
2023-03-30 18:06:25 +03:00
|
|
|
exec_prefix_set=no
|
2024-08-12 17:37:43 +03:00
|
|
|
includedir="@includedir@"
|
|
|
|
libdir="@libdir@"
|
|
|
|
srcdir="@srcdir@"
|
Cairo increment 2: Finer cairo granularity, less deps, new fltk_cairo lib
+ added new USE_CAIRO config preprocessor def.
to differentiate from HAVE_CAIRO so that we can use the cairo lib
without forcing the full fltk lib to be linked against it.
In that case, cairo autolink context functionality which needs fltk lib
instrumentation is disabled.
+ added new --enable-cairoext, which correspond to previous --enable-cairo.
now, --enable-cairo only adds HAVE_CAIRO def. and keeps fltk lib
from referencing cairo.
In both cases (--enable-cairo & --enable-cairoext), a new fltk_cairo lib is
created. This lib, similarly to local versions of png,jpeg and zlib,
is not generated if cairo is not enabled.
+ added cairo to fltk-config : now new --use-cairo flag is available
+ modified all unix like makefiles to now generate minimum cairo deps and also
new libfltk_cairo lib.
+ added new cairo subdir to permit conditional fltk_cairo lib generation.
+ vc2005 project minimum update to compile without be broken, but still needs
to create a similar fltk_cairo independent lib. For now, it works as before
with a dedicated cairo env. similar to --enable-cairoext context in unix.
+ regression tested ok with cairo disabled on win32, mac osx, mingw.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6462 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-19 05:42:35 +04:00
|
|
|
|
2023-04-10 23:02:57 +03:00
|
|
|
# BEGIN fltk-config code
|
|
|
|
|
|
|
|
# Check for local invocation (in FLTK source folder), and update paths accordingly...
|
|
|
|
selfdir=`dirname "$0"`
|
|
|
|
if test -f "$selfdir/FL/Fl_Window.H"; then
|
|
|
|
includedir="$selfdir"
|
|
|
|
libdir="$selfdir/lib"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libraries to link with (must be after 'prefix' stuff and after check for local invocation)
|
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@"
|
2008-12-29 20:10:12 +03:00
|
|
|
STATICIMAGELIBS="@STATICIMAGELIBS@"
|
2002-07-14 21:03:31 +04:00
|
|
|
SHAREDSUFFIX="@SHAREDSUFFIX@"
|
2023-03-30 18:06:25 +03:00
|
|
|
CAIROLIBS="@CAIROLIBS@"
|
|
|
|
GLLIBS="@GLLIBS@"
|
|
|
|
|
|
|
|
# Check bundled image libraries in source tree
|
|
|
|
if test -f "$libdir/libfltk_jpeg.a"; then
|
2024-08-12 17:37:43 +03:00
|
|
|
CFLAGS="-I'$includedir/jpeg' $CFLAGS"
|
|
|
|
CXXFLAGS="-I'$includedir/jpeg' $CXXFLAGS"
|
2023-03-30 18:06:25 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -f "$libdir/libfltk_z.a"; then
|
2024-08-12 17:37:43 +03:00
|
|
|
CFLAGS="-I'$includedir/zlib' $CFLAGS"
|
|
|
|
CXXFLAGS="-I'$includedir/zlib' $CXXFLAGS"
|
2023-03-30 18:06:25 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -f "$libdir/libfltk_png.a"; then
|
2024-08-12 17:37:43 +03:00
|
|
|
CFLAGS="-I'$includedir/png' $CFLAGS"
|
|
|
|
CXXFLAGS="-I'$includedir/png' $CXXFLAGS"
|
2023-03-30 18:06:25 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Check bundled image libraries in installation folder.
|
|
|
|
# Note: jpeg, png, and zlib headers are installed in FL/images
|
2024-08-12 17:37:43 +03:00
|
|
|
if test -d "$includedir/FL/images"; then
|
|
|
|
CFLAGS="-I'$includedir/FL/images' $CFLAGS"
|
|
|
|
CXXFLAGS="-I'$includedir/FL/images' $CXXFLAGS"
|
2023-03-30 18:06:25 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Cairo support
|
2023-04-10 01:45:55 +03:00
|
|
|
if test -n "$CAIROFLAGS"; then
|
2023-03-30 18:06:25 +03:00
|
|
|
CFLAGS="$CAIROFLAGS $CFLAGS"
|
|
|
|
CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
|
|
|
|
fi
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
echo "Usage: fltk-config [OPTIONS]
|
|
|
|
Options:
|
2023-03-30 18:06:25 +03:00
|
|
|
[--version]
|
|
|
|
[--api-version]
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
Options telling what we are doing:
|
2023-03-30 18:06:25 +03:00
|
|
|
[--use-gl] use GL
|
|
|
|
[--use-images] use extra image formats (PNG, JPEG)
|
|
|
|
[--use-glut] use glut compatibility layer
|
|
|
|
[--use-forms] use forms compatibility layer
|
|
|
|
[--use-cairo] use cairo graphics lib
|
2001-09-29 19:57:32 +04:00
|
|
|
|
2001-11-28 01:03:29 +03:00
|
|
|
Options telling what information we request:
|
2023-03-30 18:06:25 +03:00
|
|
|
[--cc] return C compiler used to compile FLTK
|
|
|
|
[--cxx] return C++ compiler used to compile FLTK
|
|
|
|
[--optim] return compiler optimization used to compile FLTK
|
|
|
|
[--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
|
2001-09-29 19:57:32 +04:00
|
|
|
even if there are DSOs installed
|
2023-03-30 18:06:25 +03:00
|
|
|
[--libs] return FLTK libraries full path for dependencies
|
|
|
|
[--prefix] return FLTK install time --prefix directory
|
|
|
|
[--includedir] return FLTK install time include directory
|
2001-11-28 01:03:29 +03:00
|
|
|
|
2008-07-14 01:39:07 +04:00
|
|
|
Options to compile and link an application:
|
2023-03-30 18:06:25 +03:00
|
|
|
[-g] compile the program with debugging information
|
|
|
|
[-Dname[=value]] compile the program with the given define
|
|
|
|
[--compile program.cxx ..] compile and link the program with optional
|
|
|
|
.. compiler flags, source files, and libraries
|
|
|
|
[--link flags and libs] additional linker flags and libraries
|
|
|
|
.. for --compile, added after all other libs
|
|
|
|
[--post program] prepare the program for desktop use (macOS)
|
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
|
|
|
|
|
2023-03-30 18:06:25 +03:00
|
|
|
# variables for parsing and generation of the commandline
|
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=
|
2023-03-30 18:06:25 +03:00
|
|
|
flags=
|
|
|
|
files=
|
|
|
|
use_link=
|
|
|
|
link=
|
2001-09-29 19:57:32 +04:00
|
|
|
|
|
|
|
# Parse command line options
|
2010-11-11 00:18:17 +03:00
|
|
|
while test $# -gt 0
|
2001-09-29 19:57:32 +04:00
|
|
|
do
|
2002-04-26 16:45:16 +04:00
|
|
|
case $1 in
|
2023-03-30 18:06:25 +03:00
|
|
|
--version)
|
|
|
|
echo $VERSION
|
|
|
|
;;
|
|
|
|
--api-version)
|
|
|
|
echo $APIVERSION
|
|
|
|
;;
|
|
|
|
--cc)
|
|
|
|
echo $CC
|
|
|
|
;;
|
|
|
|
--cxx)
|
|
|
|
echo $CXX
|
|
|
|
;;
|
|
|
|
--optim)
|
|
|
|
echo_optim=yes
|
|
|
|
;;
|
|
|
|
--use-gl | --use-glut)
|
|
|
|
use_gl=yes
|
|
|
|
;;
|
|
|
|
--use-forms)
|
|
|
|
use_forms=yes
|
|
|
|
;;
|
|
|
|
--use-images)
|
|
|
|
use_images=yes
|
|
|
|
;;
|
|
|
|
--use-cairo)
|
|
|
|
use_cairo=yes
|
|
|
|
;;
|
|
|
|
--cflags)
|
|
|
|
echo_cflags=yes
|
|
|
|
;;
|
|
|
|
--cxxflags)
|
|
|
|
echo_cxxflags=yes
|
|
|
|
;;
|
|
|
|
--ldflags)
|
|
|
|
echo_ldflags=yes
|
|
|
|
;;
|
|
|
|
--ldstaticflags)
|
|
|
|
echo_ldstaticflags=yes
|
|
|
|
;;
|
|
|
|
--libs)
|
|
|
|
echo_libs=yes
|
|
|
|
;;
|
|
|
|
--prefix)
|
|
|
|
echo_prefix=yes
|
|
|
|
;;
|
|
|
|
--includedir)
|
|
|
|
echo_includedir=yes
|
|
|
|
;;
|
|
|
|
-g)
|
|
|
|
debug=-g
|
|
|
|
;;
|
|
|
|
-D*)
|
|
|
|
CXXFLAGS="$CXXFLAGS $1"
|
|
|
|
;;
|
|
|
|
--compile)
|
|
|
|
compile="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--post)
|
|
|
|
post="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--link)
|
|
|
|
# linker flags and libs, allowed only after "--compile"
|
|
|
|
if test -n "$compile"; then
|
|
|
|
use_link=yes
|
|
|
|
else
|
|
|
|
echo_help=yes
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
# additional compiler flags, allowed only after "--compile"
|
|
|
|
if test -n "$compile"; then
|
|
|
|
if test -n "$use_link"; then
|
|
|
|
link="$link $1" # flags and libs after "--link"
|
|
|
|
else
|
|
|
|
flags="$flags $1" # compiler flags like "-I..."
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo_help=yes
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# additional source files or libs, allowed only after "--compile"
|
|
|
|
if test -n "$compile"; then
|
|
|
|
if test -n "$use_link"; then
|
|
|
|
link="$link $1" # linker flag or library
|
|
|
|
else
|
|
|
|
files="$files $1" # other (source) files
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo_help=yes
|
|
|
|
fi
|
|
|
|
;;
|
2002-04-26 16:45:16 +04:00
|
|
|
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
|
2024-08-12 17:37:43 +03: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
|
|
|
|
2023-03-30 18:06:25 +03:00
|
|
|
# prepend build directory for fltk-config in CMake build folder
|
|
|
|
if test -n "$BINARY_DIR"; then
|
2024-08-12 17:37:43 +03:00
|
|
|
includes="-I'$BINARY_DIR' $includes"
|
2015-07-13 01:32:30 +03:00
|
|
|
fi
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
|
2024-08-12 17:37:43 +03: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
|
2024-08-12 17:37:43 +03:00
|
|
|
LDSTATIC="'$libdir/libfltk.a' $LDLIBS"
|
2004-08-06 00:20:51 +04:00
|
|
|
LDLIBS="-lfltk$SHAREDSUFFIX $LDLIBS"
|
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"
|
2024-08-12 17:37:43 +03:00
|
|
|
LDSTATIC="'$libdir/libfltk_forms.a' $LDSTATIC"
|
2002-03-26 00:39:01 +03:00
|
|
|
fi
|
2023-03-30 18:06:25 +03:00
|
|
|
|
2002-03-26 00:39:01 +03:00
|
|
|
if test x$use_gl = xyes; then
|
2023-03-30 18:06:25 +03:00
|
|
|
LDLIBS="-lfltk_gl$SHAREDSUFFIX $GLLIBS $LDLIBS"
|
2024-08-12 17:37:43 +03:00
|
|
|
LDSTATIC="'$libdir/libfltk_gl.a' $GLLIBS $LDSTATIC"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
2023-03-30 18:06:25 +03:00
|
|
|
|
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"
|
2024-08-12 17:37:43 +03:00
|
|
|
LDSTATIC="'$libdir/libfltk_images.a' $STATICIMAGELIBS $LDSTATIC"
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2023-04-13 23:13:18 +03:00
|
|
|
if test x$use_cairo = xyes -a -n "$CAIROLIBS"; then
|
2023-03-09 14:21:49 +03:00
|
|
|
LDLIBS="$CAIROLIBS $LDLIBS"
|
|
|
|
LDSTATIC="$CAIROLIBS $LDSTATIC"
|
Cairo increment 2: Finer cairo granularity, less deps, new fltk_cairo lib
+ added new USE_CAIRO config preprocessor def.
to differentiate from HAVE_CAIRO so that we can use the cairo lib
without forcing the full fltk lib to be linked against it.
In that case, cairo autolink context functionality which needs fltk lib
instrumentation is disabled.
+ added new --enable-cairoext, which correspond to previous --enable-cairo.
now, --enable-cairo only adds HAVE_CAIRO def. and keeps fltk lib
from referencing cairo.
In both cases (--enable-cairo & --enable-cairoext), a new fltk_cairo lib is
created. This lib, similarly to local versions of png,jpeg and zlib,
is not generated if cairo is not enabled.
+ added cairo to fltk-config : now new --use-cairo flag is available
+ modified all unix like makefiles to now generate minimum cairo deps and also
new libfltk_cairo lib.
+ added new cairo subdir to permit conditional fltk_cairo lib generation.
+ vc2005 project minimum update to compile without be broken, but still needs
to create a similar fltk_cairo independent lib. For now, it works as before
with a dedicated cairo env. similar to --enable-cairoext context in unix.
+ regression tested ok with cairo disabled on win32, mac osx, mingw.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6462 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-19 05:42:35 +04:00
|
|
|
fi
|
|
|
|
|
2004-08-06 00:20:51 +04:00
|
|
|
LDLIBS="$DSOLINK $LDFLAGS $libs $LDLIBS"
|
2007-11-21 00:15:08 +03:00
|
|
|
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
|
2008-07-14 01:39:07 +04:00
|
|
|
case "$compile" in
|
2002-02-20 16:02:27 +03:00
|
|
|
*.cxx)
|
2008-08-29 13:15:26 +04:00
|
|
|
prog="`basename \"$compile\" .cxx`"
|
2023-03-30 18:06:25 +03:00
|
|
|
;;
|
2002-02-20 16:02:27 +03:00
|
|
|
*.cpp)
|
2008-08-29 13:15:26 +04:00
|
|
|
prog="`basename \"$compile\" .cpp`"
|
2023-03-30 18:06:25 +03:00
|
|
|
;;
|
2002-02-20 16:02:27 +03:00
|
|
|
*.cc)
|
2008-08-29 13:15:26 +04:00
|
|
|
prog="`basename \"$compile\" .cc`"
|
2023-03-30 18:06:25 +03:00
|
|
|
;;
|
2002-02-20 16:02:27 +03:00
|
|
|
*.C)
|
2008-08-29 13:15:26 +04:00
|
|
|
prog="`basename \"$compile\" .C`"
|
2023-03-30 18:06:25 +03:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: Unknown/bad C++ source file extension on \"$compile\"!"
|
|
|
|
exit 1
|
|
|
|
;;
|
2002-02-20 16:02:27 +03:00
|
|
|
esac
|
2001-11-28 01:03:29 +03:00
|
|
|
|
2008-07-14 01:39:07 +04:00
|
|
|
post="$prog"
|
2008-02-20 21:10:13 +03:00
|
|
|
|
2023-03-30 18:06:25 +03:00
|
|
|
command="$CXX $ARCHFLAGS $includes $CXXFLAGS $debug -o $prog $flags $compile $files $LDSTATIC $link"
|
|
|
|
|
|
|
|
echo $command
|
2024-08-12 17:37:43 +03:00
|
|
|
eval $command || exit 1
|
2001-11-28 01:03:29 +03:00
|
|
|
fi
|
|
|
|
|
2008-07-14 01:39:07 +04:00
|
|
|
if test -n "$post"; then
|
2016-12-19 17:35:08 +03:00
|
|
|
running=`uname`
|
|
|
|
if test "$running" = "Darwin"; then
|
2023-03-30 18:06:25 +03:00
|
|
|
# if FLTK targets macOS + X11, apps need not be bundled
|
|
|
|
if test `echo $LDLIBS | fgrep -c -e " -lX11"` = 1; then
|
|
|
|
running=""
|
|
|
|
fi
|
2016-12-19 17:35:08 +03:00
|
|
|
fi
|
|
|
|
case $running in
|
2023-03-30 18:06:25 +03:00
|
|
|
Darwin)
|
|
|
|
echo Creating "'$post.app'" bundle for desktop...
|
|
|
|
id=`echo $post | tr ' ' '_'`
|
|
|
|
|
|
|
|
# Make the bundle directory and move the executable there
|
|
|
|
rm -rf "$post.app/Contents/MacOS"
|
|
|
|
mkdir -p "$post.app/Contents/MacOS"
|
|
|
|
mv "$post" "$post.app/Contents/MacOS"
|
|
|
|
|
|
|
|
# Make a shell script that runs the bundled executable
|
|
|
|
echo "#!/bin/sh" >"$post"
|
|
|
|
echo 'dir="`dirname \"$0\"`"' >>"$post"
|
|
|
|
echo 'exec "$dir/'"$post.app/Contents/MacOS/$post"'" "$@"' >>"$post"
|
|
|
|
chmod +x "$post"
|
|
|
|
|
|
|
|
# Make the simplest Info.plist needed for an application
|
|
|
|
cat >"$post.app/Contents/Info.plist" <<EOF
|
2008-07-14 01:39:07 +04:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<plist version="0.9">
|
|
|
|
<dict>
|
2023-03-30 18:06:25 +03:00
|
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
|
|
<string>6.0</string>
|
|
|
|
<key>CFBundleExecutable</key>
|
|
|
|
<string>$post</string>
|
|
|
|
<key>CFBundleIdentifier</key>
|
|
|
|
<string>org.fltk.$id</string>
|
|
|
|
<key>CFBundleName</key>
|
|
|
|
<string>$post</string>
|
|
|
|
<key>CFBundlePackageType</key>
|
|
|
|
<string>APPL</string>
|
|
|
|
<key>NSHighResolutionCapable</key>
|
|
|
|
<true/>
|
2008-07-14 01:39:07 +04:00
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOF
|
2023-03-30 18:06:25 +03:00
|
|
|
;;
|
2008-07-14 01:39:07 +04:00
|
|
|
esac
|
2007-03-06 22:13:54 +03:00
|
|
|
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
|
|
|
|
|
2007-03-06 23:00:04 +03:00
|
|
|
if test "$echo_optim" = "yes"; then
|
|
|
|
echo $OPTIM
|
|
|
|
fi
|
|
|
|
|
2001-09-29 19:57:32 +04:00
|
|
|
if test "$echo_ldflags" = "yes"; then
|
2002-04-26 16:45:16 +04:00
|
|
|
my_libs=
|
2019-01-22 00:28:14 +03:00
|
|
|
libdirs="$libs"
|
2002-04-26 16:45:16 +04:00
|
|
|
|
|
|
|
for i in $LDLIBS ; do
|
2024-08-12 17:37:43 +03:00
|
|
|
if test $i != "-L'$libdir'" ; then
|
2023-03-30 18:06:25 +03:00
|
|
|
if test -z "$my_libs" ; then
|
|
|
|
my_libs="$i"
|
|
|
|
else
|
|
|
|
my_libs="$my_libs $i"
|
|
|
|
fi
|
|
|
|
fi
|
2002-04-26 16:45:16 +04:00
|
|
|
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
|
2024-08-12 17:37:43 +03:00
|
|
|
USELIBS="'$libdir/libfltk.a'"
|
2007-11-21 00:15:08 +03:00
|
|
|
|
|
|
|
if test x$use_forms = xyes; then
|
2024-08-12 17:37:43 +03:00
|
|
|
USELIBS="'$libdir/libfltk_forms.a' $USELIBS"
|
2007-11-21 00:15:08 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$use_gl = xyes; then
|
2024-08-12 17:37:43 +03:00
|
|
|
USELIBS="'$libdir/libfltk_gl.a' $USELIBS"
|
2007-11-21 00:15:08 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$use_images = xyes; then
|
2024-08-12 17:37:43 +03:00
|
|
|
USELIBS="'$libdir/libfltk_images.a' $USELIBS"
|
2007-11-21 00:15:08 +03:00
|
|
|
|
|
|
|
for lib in fltk_jpeg fltk_png fltk_z; do
|
2019-01-22 00:28:14 +03:00
|
|
|
if test -f "$libdir/lib$lib.a"; then
|
2024-08-12 17:37:43 +03:00
|
|
|
USELIBS="'$libdir/lib$lib.a' $USELIBS"
|
2007-11-21 00:15:08 +03:00
|
|
|
fi
|
2023-03-30 18:06:25 +03:00
|
|
|
done
|
2007-11-21 00:15:08 +03:00
|
|
|
fi
|
2010-11-11 00:18:17 +03:00
|
|
|
|
|
|
|
echo $USELIBS
|
2001-09-29 19:57:32 +04:00
|
|
|
fi
|
|
|
|
|
2010-11-13 19:47:47 +03:00
|
|
|
if test "$echo_prefix" = "yes"; then
|
|
|
|
echo $prefix
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$echo_includedir" = "yes"; then
|
|
|
|
echo $includedir
|
|
|
|
fi
|