1998-10-06 22:21:25 +04:00
|
|
|
dnl# -*- sh -*-
|
|
|
|
dnl# the "configure" script is made from this by running GNU "autoconf"
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|
1999-08-09 17:35:04 +04:00
|
|
|
dnl# "$Id: configure.in,v 1.33.2.5 1999/08/09 13:35:04 mike Exp $"
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|
1998-11-05 19:17:39 +03:00
|
|
|
dnl# Configuration script for the Fast Light Tool Kit (FLTK).
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|
1999-01-07 22:18:01 +03:00
|
|
|
dnl# Copyright 1998-1999 by Bill Spitzak and others.
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|
|
|
|
dnl# This library is free software; you can redistribute it and/or
|
|
|
|
dnl# modify it under the terms of the GNU Library General Public
|
|
|
|
dnl# License as published by the Free Software Foundation; either
|
|
|
|
dnl# version 2 of the License, or (at your option) any later version.
|
|
|
|
dnl#
|
|
|
|
dnl# This library is distributed in the hope that it will be useful,
|
|
|
|
dnl# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
dnl# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
dnl# Library General Public License for more details.
|
|
|
|
dnl#
|
|
|
|
dnl# You should have received a copy of the GNU Library General Public
|
|
|
|
dnl# License along with this library; if not, write to the Free Software
|
|
|
|
dnl# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
dnl# USA.
|
|
|
|
dnl#
|
|
|
|
dnl# Please report all bugs and problems to "fltk-bugs@easysw.com".
|
|
|
|
dnl#
|
1998-10-06 22:21:25 +04:00
|
|
|
|
1998-12-07 17:35:53 +03:00
|
|
|
AC_INIT(src/Fl.cxx)
|
1998-10-20 20:41:24 +04:00
|
|
|
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
|
|
|
LIBNAME="libfltk.a"
|
|
|
|
if test "$RANLIB" != ":"; then
|
1998-11-05 19:04:53 +03:00
|
|
|
LIBCOMMAND="ar cr"
|
1998-10-20 20:41:24 +04:00
|
|
|
else
|
1998-11-05 19:04:53 +03:00
|
|
|
LIBCOMMAND="ar crs"
|
1998-10-20 20:41:24 +04:00
|
|
|
fi
|
1999-03-09 22:24:42 +03:00
|
|
|
DSOCOMMAND="echo"
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME=""
|
1998-10-20 20:41:24 +04:00
|
|
|
|
1999-02-22 23:53:35 +03:00
|
|
|
dnl# Get the operating system and version number...
|
|
|
|
|
|
|
|
uname=`uname`
|
1999-08-09 17:35:04 +04:00
|
|
|
uversion=`uname -r | sed -e '1,$s/[[-.A-Za-z]]//g'`
|
1999-02-22 23:53:35 +03:00
|
|
|
if test "$uname" = "IRIX64"; then
|
|
|
|
uname="IRIX"
|
|
|
|
fi
|
|
|
|
|
1999-02-01 22:40:25 +03:00
|
|
|
dnl# Clear debugging flags and only enable debugging if the user asks for
|
1999-02-18 16:00:21 +03:00
|
|
|
dnl# it.
|
1999-02-01 22:40:25 +03:00
|
|
|
|
1998-12-02 18:39:39 +03:00
|
|
|
DEBUGFLAG=""
|
1999-03-04 17:48:08 +03:00
|
|
|
PICFLAG=0
|
1999-02-01 22:40:25 +03:00
|
|
|
CFLAGS="${CFLAGS:=}"
|
|
|
|
CXXFLAGS="${CXXFLAGS:=}"
|
1998-10-20 20:41:24 +04:00
|
|
|
|
1999-02-01 22:40:25 +03:00
|
|
|
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],[if eval "test x$enable_debug = xyes"; then
|
1999-01-31 10:43:16 +03:00
|
|
|
DEBUGFLAG="-g "
|
1999-02-01 22:40:25 +03:00
|
|
|
fi])
|
1998-10-21 18:00:53 +04:00
|
|
|
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]],[
|
|
|
|
if eval "test x$enable_shared = xyes"; then
|
1999-03-04 17:48:08 +03:00
|
|
|
PICFLAG=1
|
1999-02-22 23:53:35 +03:00
|
|
|
case $uname in
|
1998-10-20 20:41:24 +04:00
|
|
|
SunOS* | UNIX_S*)
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME="libfltk.so.1"
|
|
|
|
DSOCOMMAND="\$(CXX) -Wl,-h,libfltk.so.1 \$(LDLIBS) -G $DEBUGFLAG -o"
|
1998-10-20 20:41:24 +04:00
|
|
|
;;
|
|
|
|
HP-UX*)
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME="libfltk.sl.1"
|
1999-03-10 17:22:29 +03:00
|
|
|
DSOCOMMAND="ld -b -z +h libfltk.sl.1 $DEBUGFLAG -o"
|
1998-10-20 20:41:24 +04:00
|
|
|
;;
|
1999-03-09 20:55:05 +03:00
|
|
|
OSF1*)
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME="libfltk.so.1"
|
|
|
|
DSOCOMMAND="\$(CXX) -Wl,-soname,libfltk.so.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
|
1999-03-09 20:55:05 +03:00
|
|
|
;;
|
|
|
|
IRIX*)
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME="libfltk.so.1"
|
|
|
|
DSOCOMMAND="\$(CXX) -soname libfltk.so.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
|
1998-10-21 18:00:53 +04:00
|
|
|
;;
|
1998-10-20 20:41:24 +04:00
|
|
|
*)
|
|
|
|
echo "Warning: shared libraries may not be supported. Trying -shared"
|
1999-03-09 20:18:05 +03:00
|
|
|
echo " option with compiler."
|
1999-03-25 18:26:44 +03:00
|
|
|
DSONAME="libfltk.so.1"
|
|
|
|
DSOCOMMAND="\$(CXX) -Wl,-soname,libfltk.so.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
|
1998-10-20 20:41:24 +04:00
|
|
|
;;
|
|
|
|
esac
|
1998-10-21 18:00:53 +04:00
|
|
|
fi])
|
1998-10-20 20:41:24 +04:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
|
|
|
dnl# AC_PROG_INSTALL
|
|
|
|
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
AC_CHECK_SIZEOF(short, 2)
|
|
|
|
AC_CHECK_SIZEOF(int, 4)
|
|
|
|
AC_CHECK_SIZEOF(long, 4)
|
|
|
|
if test $ac_cv_sizeof_short -eq 2; then
|
1999-02-18 18:05:50 +03:00
|
|
|
AC_DEFINE(U16,unsigned short)
|
1998-10-06 22:21:25 +04:00
|
|
|
fi
|
|
|
|
if test $ac_cv_sizeof_int -eq 4; then
|
1999-02-18 18:05:50 +03:00
|
|
|
AC_DEFINE(U32,unsigned)
|
1998-10-06 22:21:25 +04:00
|
|
|
else
|
1999-02-18 18:05:50 +03:00
|
|
|
if test $ac_cv_sizeof_long -eq 4; then
|
|
|
|
AC_DEFINE(U32,unsigned long)
|
|
|
|
fi
|
1998-10-06 22:21:25 +04:00
|
|
|
fi
|
|
|
|
if test $ac_cv_sizeof_int -eq 8; then
|
1999-02-18 18:05:50 +03:00
|
|
|
AC_DEFINE(U64,unsigned)
|
1998-10-06 22:21:25 +04:00
|
|
|
else
|
1999-02-18 18:05:50 +03:00
|
|
|
if test $ac_cv_sizeof_long -eq 8; then
|
|
|
|
AC_DEFINE(U64,unsigned long)
|
|
|
|
fi
|
1998-10-06 22:21:25 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_HEADER_DIRENT
|
1999-01-27 20:52:25 +03:00
|
|
|
AC_CHECK_HEADER(sys/select.h)
|
1999-08-09 17:35:04 +04:00
|
|
|
AC_CHECK_FUNC(scandir,
|
|
|
|
if test "$uname" = "SunOS"; then
|
|
|
|
echo Not using Solaris scandir BSD emulation function.
|
|
|
|
else
|
1999-02-18 18:05:50 +03:00
|
|
|
AC_DEFINE(HAVE_SCANDIR)
|
|
|
|
fi)
|
1999-08-09 17:35:04 +04:00
|
|
|
AC_CHECK_FUNC(vsnprintf,
|
|
|
|
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
|
|
|
|
echo Not using built-in vsnprintf function because you are running HP-UX 10.20.
|
|
|
|
else
|
1999-02-22 23:53:35 +03:00
|
|
|
AC_DEFINE(HAVE_VSNPRINTF)
|
|
|
|
fi)
|
1999-08-09 17:35:04 +04:00
|
|
|
AC_CHECK_FUNC(snprintf,
|
|
|
|
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
|
|
|
|
echo Not using built-in snprintf function because you are running HP-UX 10.20.
|
|
|
|
else
|
1999-02-22 23:53:35 +03:00
|
|
|
AC_DEFINE(HAVE_SNPRINTF)
|
|
|
|
fi)
|
1998-11-05 19:04:53 +03:00
|
|
|
AC_CHECK_FUNCS(vsprintf)
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
AC_PATH_XTRA
|
|
|
|
echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure."
|
|
|
|
dnl# LIBS="$LIBS$X_LIBS$X_PRE_LIBS"
|
|
|
|
LIBS="$LIBS$X_LIBS"
|
|
|
|
CFLAGS="$CFLAGS $X_CFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
|
|
|
|
|
|
|
dnl# My test to see if OpenGL is on this machine:
|
|
|
|
GLLIB=
|
|
|
|
AC_CHECK_LIB(GL, glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lGLU -lGL", \
|
|
|
|
AC_CHECK_LIB(MesaGL,glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lMesaGLU -lMesaGL",,\
|
|
|
|
-lX11 -lXext $X_EXTRA_LIBS -lm), \
|
|
|
|
-lX11 -lXext $X_EXTRA_LIBS -lm)
|
|
|
|
AC_SUBST(GLLIB)
|
|
|
|
|
1999-02-22 23:53:35 +03:00
|
|
|
AC_CHECK_HEADER(X11/extensions/Xdbe.h, \
|
1999-04-30 10:41:11 +04:00
|
|
|
if test "$uname" != "SunOS"; then
|
1999-02-22 23:53:35 +03:00
|
|
|
AC_DEFINE(HAVE_XDBE)
|
|
|
|
fi)
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
AC_CACHE_CHECK("for X overlay visuals", ac_cv_have_overlay,
|
1998-12-02 18:39:39 +03:00
|
|
|
if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then
|
|
|
|
ac_cv_have_overlay=yes
|
|
|
|
else
|
|
|
|
ac_cv_have_overlay=no
|
|
|
|
fi)
|
1998-10-06 22:21:25 +04:00
|
|
|
if test "$ac_cv_have_overlay" = yes; then
|
|
|
|
AC_DEFINE(HAVE_OVERLAY)
|
|
|
|
fi
|
|
|
|
|
|
|
|
MAKEDEPEND="\$(CXX) -M"
|
|
|
|
|
1998-11-05 19:04:53 +03:00
|
|
|
dnl# add warnings to compiler switches:
|
|
|
|
dnl# do this last so messing with switches does not break tests
|
|
|
|
if test -n "$GXX"; then
|
|
|
|
CFLAGS="-Wall $CFLAGS"
|
|
|
|
CXXFLAGS="-Wall -Wno-return-type $CXXFLAGS"
|
1999-02-01 22:40:25 +03:00
|
|
|
if test -z "$DEBUGFLAG"; then
|
1999-02-25 22:47:31 +03:00
|
|
|
CFLAGS="-O2 $CFLAGS"
|
|
|
|
CXXFLAGS="-O2 $CXXFLAGS"
|
1999-02-01 22:40:25 +03:00
|
|
|
fi
|
1999-03-04 17:48:08 +03:00
|
|
|
if test $PICFLAG = 1; then
|
|
|
|
CFLAGS="-fPIC $CFLAGS"
|
|
|
|
CXXFLAGS="-fPIC $CXXFLAGS"
|
|
|
|
fi
|
1998-11-05 19:04:53 +03:00
|
|
|
else
|
1999-02-01 22:40:25 +03:00
|
|
|
case `(uname) 2>/dev/null` in
|
|
|
|
IRIX*)
|
|
|
|
# Running some flavor of IRIX; see which version and
|
|
|
|
# set things up according...
|
1999-02-22 23:53:35 +03:00
|
|
|
if test "$uversion" -ge 62; then
|
1999-02-01 22:40:25 +03:00
|
|
|
# We are running IRIX 6.2 or higher; uncomment the following
|
|
|
|
# lines if you don't have IDO 7.2 or higher:
|
|
|
|
#
|
|
|
|
# CXX="CC -n32"
|
|
|
|
# CC="cc -n32"
|
|
|
|
# LD="ld -n32"
|
|
|
|
# MAKEDEPEND="CC -M"
|
|
|
|
|
1999-05-14 13:08:05 +04:00
|
|
|
echo "FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI -n32"
|
1999-02-01 22:40:25 +03:00
|
|
|
# -woff 3322 is necessary due to errors in Xlib headers on IRIX
|
|
|
|
CFLAGS="-fullwarn $CFLAGS"
|
1999-05-14 13:08:05 +04:00
|
|
|
CXXFLAGS="-fullwarn -woff 1685,3322 $CXXFLAGS"
|
1999-02-01 22:40:25 +03:00
|
|
|
else
|
|
|
|
CXXFLAGS="+w +pp $CXXFLAGS"
|
1999-02-18 16:42:08 +03:00
|
|
|
fi
|
|
|
|
if test -z "$DEBUGFLAG"; then
|
|
|
|
CFLAGS="-O2 $CFLAGS"
|
|
|
|
CXXFLAGS="-O2 $CXXFLAGS"
|
1999-02-01 22:40:25 +03:00
|
|
|
fi
|
|
|
|
;;
|
1999-02-22 23:53:35 +03:00
|
|
|
HP-UX*)
|
1999-02-01 22:40:25 +03:00
|
|
|
# Running HP-UX; these options should work for the HP compilers.
|
|
|
|
if test -z "$DEBUGFLAG"; then
|
|
|
|
CFLAGS="+O2 $CFLAGS"
|
1999-02-22 23:53:35 +03:00
|
|
|
CXXFLAGS="+O2 +W336,501,736,740,749,829 $CXXFLAGS"
|
1999-02-01 22:40:25 +03:00
|
|
|
fi
|
|
|
|
;;
|
1999-05-19 23:07:15 +04:00
|
|
|
SunOS*)
|
|
|
|
# Solaris
|
|
|
|
if test -z "$DEBUGFLAG"; then
|
|
|
|
CFLAGS="-O"
|
|
|
|
CXXFLAGS="-O"
|
|
|
|
fi
|
|
|
|
if test $PICFLAG = 1; then
|
|
|
|
CFLAGS="-KPIC $CFLAGS"
|
|
|
|
CXXFLAGS="-PIC $CXXFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
1999-02-01 22:40:25 +03:00
|
|
|
*)
|
|
|
|
# Running some other operating system; inform the user they
|
|
|
|
# should contribute the necessary options to fltk-bugs@easysw.com...
|
|
|
|
echo "Building FLTK with default compiler optimizations; contact"
|
|
|
|
echo "fltk-bugs@easysw.com with uname and compiler options needed"
|
|
|
|
echo "for your platform, or set the CFLAGS and CXXFLAGS options"
|
|
|
|
echo "before running configure."
|
|
|
|
;;
|
|
|
|
esac
|
1998-11-05 19:04:53 +03:00
|
|
|
fi
|
|
|
|
|
1999-02-01 22:40:25 +03:00
|
|
|
CFLAGS="$DEBUGFLAG $CFLAGS"
|
|
|
|
CXXFLAGS="$DEBUGFLAG $CXXFLAGS"
|
1999-01-31 10:43:16 +03:00
|
|
|
|
1999-03-25 18:26:44 +03:00
|
|
|
AC_SUBST(DSONAME)
|
1999-03-09 22:24:42 +03:00
|
|
|
AC_SUBST(DSOCOMMAND)
|
1998-10-20 20:41:24 +04:00
|
|
|
AC_SUBST(LIBNAME)
|
|
|
|
AC_SUBST(LIBCOMMAND)
|
1998-10-06 22:21:25 +04:00
|
|
|
AC_SUBST(MAKEDEPEND)
|
|
|
|
AC_CONFIG_HEADER(config.h:configh.in)
|
1998-10-20 20:41:24 +04:00
|
|
|
AC_OUTPUT(makeinclude)
|
1998-10-06 22:21:25 +04:00
|
|
|
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|
1999-08-09 17:35:04 +04:00
|
|
|
dnl# End of "$Id: configure.in,v 1.33.2.5 1999/08/09 13:35:04 mike Exp $".
|
1998-10-20 20:41:24 +04:00
|
|
|
dnl#
|