summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-09-29 15:57:32 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-09-29 15:57:32 +0000
commitddf259f2bb48006fc0ebe9630644fd768c9192bd (patch)
treee093da6c963315c602d1c122107e2e05ccfc2d8f
parent5a640915959c49086eceb964d0cfe63b7f5ffee7 (diff)
New fltk-config script for 1.1.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--Makefile8
-rw-r--r--configure.in40
-rwxr-xr-xfltk-config.in167
-rw-r--r--src/Makefile40
5 files changed, 129 insertions, 128 deletions
diff --git a/CHANGES b/CHANGES
index 932e079de..804fe2741 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0b2
+ - New fltk-config script.
+
- Fixed image/text label handling; in b1 the label
needed a non-blank text string to display the image.
This bug also caused all sorts of crashes and display
diff --git a/Makefile b/Makefile
index 4278c4d8e..2e2325cf4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile,v 1.12.2.6.2.4 2001/08/02 20:09:25 easysw Exp $"
+# "$Id: Makefile,v 1.12.2.6.2.5 2001/09/29 15:57:32 easysw Exp $"
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
@@ -38,6 +38,10 @@ install: makeinclude
(cd $$dir; $(MAKE) $(MFLAGS) install) || break;\
done
(cd documentation; $(MAKE) $(MFLAGS) install)
+ -mkdir -p $(bindir)
+ rm -f $(bindir)/fltk-config
+ -cp fltk-config $(bindir)
+ -chmod +x $(bindir)/fltk-config
depend: makeinclude
@for dir in $(DIRS); do\
@@ -67,5 +71,5 @@ configure: configure.in
autoconf
#
-# End of "$Id: Makefile,v 1.12.2.6.2.4 2001/08/02 20:09:25 easysw Exp $".
+# End of "$Id: Makefile,v 1.12.2.6.2.5 2001/09/29 15:57:32 easysw Exp $".
#
diff --git a/configure.in b/configure.in
index 606a47a97..2f1a90215 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl -*- sh -*-
dnl the "configure" script is made from this by running GNU "autoconf"
dnl
-dnl "$Id: configure.in,v 1.33.2.31.2.7 2001/08/11 16:09:26 easysw Exp $"
+dnl "$Id: configure.in,v 1.33.2.31.2.8 2001/09/29 15:57:32 easysw Exp $"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
@@ -30,11 +30,11 @@ AC_INIT(src/Fl.cxx)
AC_PROG_RANLIB
LINKFLTK="-lfltk"
-LINKFLTKGL="-lfltkgl"
+LINKFLTKGL="-lfltk_gl"
GLDEMOS="gldemos"
LIBNAME="../lib/libfltk.a"
-GLLIBNAME="../lib/libfltkgl.a"
+GLLIBNAME="../lib/libfltk_gl.a"
if test "$RANLIB" != ":"; then
LIBCOMMAND="ar cr"
else
@@ -64,39 +64,53 @@ AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
fi])
AC_ARG_ENABLE(gl, [ --enable-gl turn on OpenGL support [default=yes]])
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]],[
+DSOLINK=""
+AC_SUBST(DSOLINK)
if eval "test x$enable_shared = xyes"; then
PICFLAG=1
case $uname in
SunOS* | UNIX_S*)
DSONAME="libfltk.so.1.1"
- GLDSONAME="libfltkgl.so.1.1"
+ GLDSONAME="libfltk_gl.so.1.1"
DSOCOMMAND="\$(CXX) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
+ if test "$libdir" != "/usr/lib"; then
+ DSOLINK="-R$libdir"
+ fi
;;
HP-UX*)
DSONAME="libfltk.sl.1.1"
- GLDSONAME="libfltkgl.sl.1.1"
+ GLDSONAME="libfltk_gl.sl.1.1"
DSOCOMMAND="ld -b -z +h \$@ $DEBUGFLAG -o"
+ if test "$libdir" != "/usr/lib"; then
+ DSOLINK="-Wl,-rpath,$libdir"
+ fi
;;
IRIX* | OSF1*)
DSONAME="libfltk.so.1.1"
- GLDSONAME="libfltkgl.so.1.1"
+ GLDSONAME="libfltk_gl.so.1.1"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
+ if test "$libdir" != "/usr/lib" - a "$libdir" != "/usr/lib32"; then
+ DSOLINK="-Wl,-rpath,$libdir"
+ fi
;;
- FreeBSD* | NetBSD* | OpenBSD*)
+ FreeBSD* | NetBSD* | OpenBSD* | Linux*)
DSONAME="libfltk.so.1.1"
- GLDSONAME="libfltkgl.so.1.1"
+ GLDSONAME="libfltk_gl.so.1.1"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
+ if test "$libdir" != "/usr/lib"; then
+ DSOLINK="-Wl,-rpath,$libdir"
+ fi
;;
AIX*)
DSONAME="libfltk_s.a"
- GLDSONAME="libfltkgl_s.a"
+ GLDSONAME="libfltk_gl_s.a"
DSOCOMMAND="\$(CXX) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
DSONAME="libfltk.so.1.1"
- GLDSONAME="libfltkgl.so.1.1"
+ GLDSONAME="libfltk_gl.so.1.1"
DSOCOMMAND="\$(CXX) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
;;
esac
@@ -442,8 +456,10 @@ else
fi
AC_CONFIG_HEADER(config.h:configh.in)
-AC_OUTPUT(makeinclude)
+AC_OUTPUT(makeinclude fltk-config)
+
+chmod +x fltk-config
dnl
-dnl End of "$Id: configure.in,v 1.33.2.31.2.7 2001/08/11 16:09:26 easysw Exp $".
+dnl End of "$Id: configure.in,v 1.33.2.31.2.8 2001/09/29 15:57:32 easysw Exp $".
dnl
diff --git a/fltk-config.in b/fltk-config.in
index 24253987e..1f350c03b 100755
--- a/fltk-config.in
+++ b/fltk-config.in
@@ -1,24 +1,39 @@
#! /bin/sh
+#
+# "$Id: fltk-config.in,v 1.12.2.1 2001/09/29 15:57:32 easysw Exp $"
#
-# fltk-config
+# 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.
#
-# original version by James Dean Palmer, adapted by Vincent Penne
+# 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.
#
-# "$Id: fltk-config.in,v 1.12 2001/08/05 10:48:38 spitzak Exp $"
+# 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
+MAJOR_VERSION=1
+MINOR_VERSION=1
PATCH_VERSION=0
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
+APIVERSION="$MAJOR_VERSION.$MINOR_VERSION"
### BEGIN fltk-config
-# Calculate the prefix from the location of *this* file
-prefix=`echo "$0" | sed 's/\/bin\/fltk-config//
-s/\/fltk-config//'`
-
-#prefix=@prefix@
+prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
bindir=@bindir@
@@ -33,23 +48,16 @@ CC="@CC@"
# flags for C++ compiler:
CFLAGS="@CFLAGS@"
CXXFLAGS="@CXXFLAGS@"
+LDFLAGS="@LDFLAGS@"
+LDLIBS="@LDFLAGS@ -lX11 -lXext @X_EXTRA_LIBS@"
# program to make the archive:
LIBNAME="@LIBNAME@"
-LIBCOMMAND="@LIBCOMMAND@"
-RANLIB="@RANLIB@"
-DSOLIBNAME="@DSOLIBNAME@"
-DSOCOMMAND="@DSOCOMMAND@"
-
-# flags for the linker
-LD_PLUGIN_FLAGS="@LD_PLUGIN_FLAGS@"
+DSONAME="@DSONAME@"
+DSOLINK="@DSOLINK@"
# libraries to link with:
-IMAGELIBS="@LIBPNG@ @LIBJPEG@"
-
-# programs to make archive and build DSOs
-RANLIB="@RANLIB@"
-DSOCOMMAND="@DSOCOMMAND@"
+IMAGELIBS="@IMAGELIBS@"
usage ()
{
@@ -58,15 +66,12 @@ 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-images] use extra image formats (PNG, JPEG)
[--use-glut] use glut compatibility layer
- [--use-forms] use forms compatibility layer
- [--multithread] build a multithreaded program
- [--build-plugin] build a plugin
- [--no-plugins] build a program unable to load plugins (Linux only)
options telling what information we request
[--cflags] return flags to compile C using FLTK
@@ -112,28 +117,15 @@ do
--version)
echo $VERSION
;;
- --use-gl)
- use_gl=yes
+ --api-version)
+ echo $APIVERSION
;;
- --use-glut)
- use_glut=yes
+ --use-gl | --use-glut)
use_gl=yes
;;
--use-images)
use_images=yes
;;
- --use-forms)
- use_forms=yes
- ;;
- --multithread)
- use_threads=yes
- ;;
- --build-plugin)
- build_plugin=yes
- ;;
- --no-plugins)
- no_plugins=yes
- ;;
--cflags)
echo_cflags=yes
;;
@@ -156,46 +148,36 @@ do
shift
done
-# Calculate needed libraries
-LDLIBS=""
-LDSTATIC=""
-LIBS=""
-if test "$use_forms" = "yes"; then
- LDLIBS="$LDLIBS -lfltk_forms"
- LDSTATIC="$LDSTATIC $prefix/lib/libfltk_forms.a"
- LIBS="$LIBS $prefix/lib/libfltk_forms.a"
+if test "$includedir" != /usr/include; then
+ includes=-I$includedir
+else
+ includes=
fi
-if test "$use_glut" = "yes"; then
- LDLIBS="$LDLIBS -lfltk_glut"
- LDSTATIC="$LDSTATIC $prefix/lib/libfltk_glut.a"
- LIBS="$LIBS $prefix/lib/libfltk_glut.a"
+
+if test "$libdir" != /usr/lib -a "$libdir" != /usr/lib32; then
+ libs=-L$libdir
+else
+ libs=
fi
+
+# Calculate needed libraries
+LDSTATIC="$libdir/libfltk.a $LDLIBS"
+LDLIBS="$libs -lfltk $LDLIBS"
+LIBS="$LIBS $libdir/libfltk.a"
+
if test "$use_gl" = "yes"; then
- LDLIBS="$LDLIBS -lfltk_gl @GLLIB@"
- LDSTATIC="$LDSTATIC $prefix/lib/libfltk_gl.a @GLLIB@"
- LIBS="$LIBS $prefix/lib/libfltk_gl.a"
+ LDLIBS="-lfltk_gl @GLLIB@ $LDLIBS"
+ LDSTATIC="$libdir/libfltk_gl.a @GLLIB@ $LDSTATIC"
+ LIBS="$LIBS $libdir/libfltk_gl.a"
fi
if test "$use_images" = "yes"; then
- LDLIBS="$LDLIBS -lfltk_images $IMAGELIBS"
- LDSTATIC="$LDSTATIC $prefix/lib/libfltk_images.a $IMAGELIBS"
- LIBS="$LIBS $prefix/lib/libfltk_images.a"
-fi
-if test "$build_plugin" = "yes"; then
- LDLIBS="$LDLIBS $LD_PLUGIN_FLAGS"
- LDSTATIC="$LDSTATIC $LD_PLUGIN_FLAGS"
-fi
-LDLIBS="$LDLIBS -lfltk @LDFLAGS@ @LIBS@ @LDLIBS@ -lm"
-LDSTATIC="$LDSTATIC $prefix/lib/libfltk.a @LDFLAGS@ @LIBS@ @LDLIBS@ -lm"
-LIBS="$LIBS $prefix/lib/libfltk.a"
-if test "$use_threads" = "yes"; then
- LDLIBS="$LDLIBS @THREADSLIBS@"
- LDSTATIC="$LDSTATIC @THREADSLIBS@"
-fi
-if test "$no_plugins" = "no"; then
- LDLIBS="$LDLIBS @LD_DLOPEN_FLAGS@"
- LDSTATIC="$LDSTATIC @LD_DLOPEN_FLAGS@"
+ LDLIBS="$LDLIBS $IMAGELIBS"
+ LDSTATIC="$LDSTATIC $IMAGELIBS"
fi
+LDLIBS="$DSOLINK $LDLIBS -lm"
+LDSTATIC="$LDSTATIC -lm"
+
# Answer to user requests
if test -n "$echo_help"; then usage 1
fi
@@ -209,30 +191,27 @@ if test "$echo_exec_prefix" = "yes"; then
fi
if test "$echo_cflags" = "yes"; then
- includes=-I`echo "$0" | sed 's/\/bin\/fltk-config/\/include/
-s/\/fltk-config//'`
- echo $includes $CFLAGS
+ echo $includes $CFLAGS
fi
if test "$echo_cxxflags" = "yes"; then
- includes=-I`echo "$0" | sed 's/\/bin\/fltk-config/\/include/
-s/\/fltk-config//'`
- echo $includes $CXXFLAGS
+ echo $includes $CXXFLAGS
fi
if test "$echo_ldflags" = "yes"; then
- my_libs=
- libdirs=-L${exec_prefix}/lib
- for i in $LDLIBS ; do
- if test $i != -L${exec_prefix}/lib ; then
- if test -z "$my_libs" ; then
- my_libs="$i"
- else
- my_libs="$my_libs $i"
- fi
- fi
- done
- echo $libdirs $my_libs
+ 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
diff --git a/src/Makefile b/src/Makefile
index 1f3982d48..a80060fa0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile,v 1.18.2.14.2.10 2001/09/29 14:38:59 easysw Exp $"
+# "$Id: Makefile,v 1.18.2.14.2.11 2001/09/29 15:57:32 easysw Exp $"
#
# Library makefile for the Fast Light Tool Kit (FLTK).
#
@@ -189,16 +189,16 @@ $(GLLIBNAME): $(GLOBJECTS)
$(LIBCOMMAND) $@ $(GLOBJECTS)
$(RANLIB) $@
-libfltkgl.so.1.1 libfltkgl.sl.1.1: $(GLOBJECTS)
+libfltk_gl.so.1.1 libfltk_gl.sl.1.1: $(GLOBJECTS)
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(GLOBJECTS)
-libfltkgl_s.a: $(GLOBJECTS)
- echo $(DSOCOMMAND) libfltkgl_s.o ...
- $(DSOCOMMAND) libfltkgl_s.o $(GLOBJECTS)
- echo $(LIBCOMMAND) libfltkgl_s.a libfltkgl_s.o
- $(LIBCOMMAND) libfltkgl_s.a libfltkgl_s.o
- chmod +x libfltkgl_s.a
+libfltk_gl_s.a: $(GLOBJECTS)
+ echo $(DSOCOMMAND) libfltk_gl_s.o ...
+ $(DSOCOMMAND) libfltk_gl_s.o $(GLOBJECTS)
+ echo $(LIBCOMMAND) libfltk_gl_s.a libfltk_gl_s.o
+ $(LIBCOMMAND) libfltk_gl_s.a libfltk_gl_s.o
+ chmod +x libfltk_gl_s.a
clean :
-@ rm -f *.o *.do $(DSONAME) $(LIBRARY) $(CLEAN) core *~ ../include/*~ makedepend cmap
@@ -231,19 +231,19 @@ install: $(LIBNAME) $(DSONAME) $(GLLIBNAME) $(GLDSONAME)
rm -f $(libdir)/libfltk_s.a;\
cp libfltk_s.a $(libdir); \
fi
- if test x$(GLDSONAME) = xlibfltkgl.so.1.1; then\
- rm -f $(libdir)/libfltkgl.so*;\
- cp libfltkgl.so.1.1 $(libdir); \
- ln -s libfltkgl.so.1.1 $(libdir)/libfltkgl.so;\
+ if test x$(GLDSONAME) = xlibfltk_gl.so.1.1; then\
+ rm -f $(libdir)/libfltk_gl.so*;\
+ cp libfltk_gl.so.1.1 $(libdir); \
+ ln -s libfltk_gl.so.1.1 $(libdir)/libfltk_gl.so;\
fi
- if test x$(GLDSONAME) = xlibfltkgl.sl.1.1; then\
- rm -f $(libdir)/libfltkgl.sl*;\
- cp libfltkgl.sl.1.1 $(libdir); \
- ln -s libfltkgl.sl.1.1 $(libdir)/libfltkgl.sl;\
+ if test x$(GLDSONAME) = xlibfltk_gl.sl.1.1; then\
+ rm -f $(libdir)/libfltk_gl.sl*;\
+ cp libfltk_gl.sl.1.1 $(libdir); \
+ ln -s libfltk_gl.sl.1.1 $(libdir)/libfltk_gl.sl;\
fi
- if test x$(GLDSONAME) = xlibfltkgl_s.a; then\
- rm -f $(libdir)/libfltkgl_s.a;\
- cp libfltkgl_s.a $(libdir); \
+ if test x$(GLDSONAME) = xlibfltk_gl_s.a; then\
+ rm -f $(libdir)/libfltk_gl_s.a;\
+ cp libfltk_gl_s.a $(libdir); \
fi
echo "Installing include files..."
-mkdir -p $(includedir)
@@ -258,5 +258,5 @@ install: $(LIBNAME) $(DSONAME) $(GLLIBNAME) $(GLDSONAME)
ln -s FL $(includedir)/Fl
#
-# End of "$Id: Makefile,v 1.18.2.14.2.10 2001/09/29 14:38:59 easysw Exp $".
+# End of "$Id: Makefile,v 1.18.2.14.2.11 2001/09/29 15:57:32 easysw Exp $".
#