fltk/configure.in
Michael R Sweet 027516a195 Removed SunOS Xdbe check...
git-svn-id: file:///fltk/svn/fltk/trunk@146 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
1998-12-07 14:57:26 +00:00

167 lines
4.5 KiB
Bash

dnl# -*- sh -*-
dnl# the "configure" script is made from this by running GNU "autoconf"
dnl#
dnl# "$Id: configure.in,v 1.15 1998/12/07 14:57:26 mike Exp $"
dnl#
dnl# Configuration script for the Fast Light Tool Kit (FLTK).
dnl#
dnl# Copyright 1998 by Bill Spitzak and others.
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#
AC_INIT(src/Fl.cxx)
AC_PROG_RANLIB
LIBNAME="libfltk.a"
if test "$RANLIB" != ":"; then
LIBCOMMAND="ar cr"
else
LIBCOMMAND="ar crs"
fi
DEBUGFLAG=""
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],if eval "test x$enable_debug = xyes"; then
DEBUGFLAG="-g"
fi)
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]],[
if eval "test x$enable_shared = xyes"; then
RANLIB=":"
case `uname` in
SunOS* | UNIX_S*)
LIBNAME="libfltk.so.1"
LIBCOMMAND="\$(CXX) -G $DEBUGFLAG -o"
;;
HP-UX*)
LIBNAME="libfltk.sl.1"
LIBCOMMAND="ld -b -z +h libfltk.sl.1 $DEBUGFLAGS -o"
;;
OSF1* | IRIX*)
LIBNAME="libfltk.so.1"
LIBCOMMAND="\$(CXX) -shared $DEBUGFLAG -o"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option to compiler."
LIBNAME="libfltk.so.1"
LIBCOMMAND="\$(CXX) -shared $DEBUGFLAG -o"
;;
esac
fi])
CFLAGS="$DEBUGFLAG $CFLAGS"
CXXFLAGS="$DEBUGFLAG $CXXFLAGS"
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
AC_DEFINE(U16,unsigned short)
fi
if test $ac_cv_sizeof_int -eq 4; then
AC_DEFINE(U32,unsigned)
else
if test $ac_cv_sizeof_long -eq 4; then
AC_DEFINE(U32,unsigned long)
fi
fi
if test $ac_cv_sizeof_int -eq 8; then
AC_DEFINE(U64,unsigned)
else
if test $ac_cv_sizeof_long -eq 8; then
AC_DEFINE(U64,unsigned long)
fi
fi
AC_HEADER_DIRENT
AC_CHECK_FUNCS(scandir)
AC_CHECK_FUNCS(vsnprintf)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsprintf)
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)
AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE))
AC_CACHE_CHECK("for X overlay visuals", ac_cv_have_overlay,
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)
if test "$ac_cv_have_overlay" = yes; then
AC_DEFINE(HAVE_OVERLAY)
fi
MAKEDEPEND="\$(CXX) -M"
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"
else
if test "`(uname) 2>/dev/null`" = IRIX; then
if expr "`(uname -r)`" \>= 6.2; then
dnl# Uncomment these if you don't have IDO 7.2 or higher
dnl# CXX="CC -n32"
dnl# CC="cc -n32"
dnl# LD="ld -n32"
MAKEDEPEND="CC -M"
# -woff 3322 is necessary due to errors in Xlib headers on IRIX
CFLAGS="-fullwarn $CFLAGS"
CXXFLAGS="-fullwarn -woff 1685 -woff 3322 $CXXFLAGS"
MAKEDEPEND="CC -M"
else
CXXFLAGS="+w +pp $CXXFLAGS"
fi
fi
fi
AC_SUBST(LIBNAME)
AC_SUBST(LIBCOMMAND)
AC_SUBST(MAKEDEPEND)
AC_CONFIG_HEADER(config.h:configh.in)
AC_OUTPUT(makeinclude)
dnl#
dnl# End of "$Id: configure.in,v 1.15 1998/12/07 14:57:26 mike Exp $".
dnl#