📄 configure.in
字号:
LDFLAGS="-mwindows $LDFLAGS"
LIBS="$LIBS -lole32 -luuid -lcomctl32 -lwsock32"
OPTIM="$OPTIM"
if test x$enable_gl != xno; then
AC_CHECK_HEADER(GL/gl.h,
AC_DEFINE(HAVE_GL)
GLLIB="-lopengl32")
AC_CHECK_HEADER(GL/glu.h,
AC_DEFINE(HAVE_GL_GLU_H)
GLLIB="-lglu32 $GLLIB")
else
LINKFLTKGL=""
GLLIBNAME=""
GLDSONAME=""
GLDEMOS=""
fi
if test x$have_pthread = xyes; then
AC_DEFINE(HAVE_PTHREAD)
THREADS="threads.exe"
fi
# Don't make symlinks since Windows is not case sensitive.
HLINKS="#"
;;
Darwin*)
# MacOS X uses Carbon for graphics...
LIBS="$LIBS -framework Carbon -framework ApplicationServices"
if test x$have_pthread = xyes; then
AC_DEFINE(HAVE_PTHREAD)
THREADS="threads"
fi
if test x$enable_gl != xno; then
AC_DEFINE(HAVE_GL)
AC_DEFINE(HAVE_GL_GLU_H)
GLLIB="-framework AGL -framework OpenGL"
else
LINKFLTKGL=""
GLLIBNAME=""
GLDSONAME=""
GLDEMOS=""
fi
# Don't make symlinks because HFS+ is not case sensitive...
HLINKS="#"
# Add a postbuild step after linking applications
POSTBUILD="/Developer/Tools/Rez -t APPL -o"
;;
*)
# All others are UNIX/X11...
if test x$have_pthread = xyes; then
AC_DEFINE(HAVE_PTHREAD)
THREADS="threads"
fi
dnl Check for X11...
AC_PATH_XTRA
if test x$no_x = xyes; then
AC_MSG_ERROR(Configure could not find required X11 libraries, aborting.)
fi
if test "x$X_PRE_LIBS" != x; then
AC_MSG_WARN(Ignoring libraries \"$X_PRE_LIBS\" requested by configure.)
fi
LIBS="$LIBS -lXext -lX11 $X_EXTRA_LIBS"
CFLAGS="$CFLAGS$X_CFLAGS"
CXXFLAGS="$CXXFLAGS$X_CFLAGS"
LDFLAGS="$X_LIBS $LDFLAGS"
if test "x$x_includes" != x; then
ac_cpp="$ac_cpp -I$x_includes"
fi
dnl Check for OpenGL unless disabled...
GLLIB=
if test x$enable_gl != xno; then
AC_SEARCH_LIBS(dlopen, dl)
AC_CHECK_HEADER(GL/gl.h,
AC_CHECK_LIB(GL, glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB="-lGL", \
AC_CHECK_LIB(MesaGL,glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lMesaGL",,\
-lm), \
-lm)
)
AC_CHECK_HEADER(GL/glu.h,
AC_DEFINE(HAVE_GL_GLU_H)
if test x$ac_cv_lib_GL_glXMakeCurrent = xyes; then
GLLIB="-lGLU $GLLIB"
fi
if test x$ac_cv_lib_MesaGL_glXMakeCurrent = xyes; then
GLLIB="-lMesaGLU $GLLIB"
fi
)
if test x$ac_cv_lib_GL_glXMakeCurrent != xyes -a x$ac_cv_lib_MesaGL_glXMakeCurrent != xyes; then
LINKFLTKGL=""
GLLIBNAME=""
GLDSONAME=""
GLDEMOS=""
fi
else
LINKFLTKGL=""
GLLIBNAME=""
GLDSONAME=""
GLDEMOS=""
fi
dnl Check for the Xft library unless disabled...
AC_ARG_ENABLE(xft, [ --enable-xft turn on Xft support [default=no]])
if test x$enable_xft = xyes; then
AC_CHECK_HEADER(X11/Xft/Xft.h,
AC_CHECK_LIB(Xft, XftDrawCreate,
AC_DEFINE(USE_XFT)
LIBS="-lXft $LIBS"))
fi
dnl Check for the Xdbe extension unless disabled...
AC_ARG_ENABLE(xdbe, [ --enable-xdbe turn on Xdbe support [default=no]])
if test x$enable_xdbe = xyes; then
AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE),,
[#include <X11/Xlib.h>])
fi
dnl Check for overlay visuals...
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 x$ac_cv_have_overlay = xyes; then
AC_DEFINE(HAVE_OVERLAY)
fi
;;
esac
AC_SUBST(GLDEMOS)
AC_SUBST(GLLIB)
AC_SUBST(HLINKS)
AC_SUBST(POSTBUILD)
AC_SUBST(THREADS)
dnl Figure out the appropriate formatted man page extension...
case "$uname" in
*BSD* | Darwin*)
# *BSD
CAT1EXT=0
CAT3EXT=0
;;
IRIX*)
# SGI IRIX
CAT1EXT=z
CAT3EXT=z
;;
*)
# All others
CAT1EXT=1
CAT3EXT=3
;;
esac
AC_SUBST(CAT1EXT)
AC_SUBST(CAT3EXT)
dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
case "$uname" in
*BSD* | Darwin* | Linux*)
# *BSD, Darwin, and Linux
mandir="\${prefix}/share/man"
;;
IRIX*)
# SGI IRIX
mandir="\${prefix}/share/catman"
;;
esac
fi
dnl Fix "libdir" variable...
if test "$prefix" = NONE; then
prefix=/usr/local
fi
if test "$exec_prefix" = NONE; then
exec_prefix="\${prefix}"
fi
if test "$uname" = "IRIX" -a $uversion -ge 62 -a "$libdir" = "\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; then
libdir="/usr/lib32"
fi
dnl Define the command used to update the dependencies (this option
dnl mainly for FLTK core developers - not necessary for users)
MAKEDEPEND="\$(CXX) -M"
AC_SUBST(MAKEDEPEND)
dnl Add warnings to compiler switches:
dnl do this last so messing with switches does not break tests
if test -n "$GCC"; then
# Starting with GCC 3.0, you must link C++ programs against either
# libstdc++ (shared by default), or libsupc++ (always static). If
# you care about binary portability between Linux distributions,
# you need to either 1) build your own GCC with static C++ libraries
# or 2) link using gcc and libsupc++. We choose the latter since
# CUPS doesn't (currently) use any of the stdc++ library.
#
# Also, GCC 3.0.x still has problems compiling some code. You may
# or may not have success with it. USE 3.0.x WITH EXTREME CAUTION!
#
# Previous versions of GCC do not have the reliance on the stdc++
# or g++ libraries, so the extra supc++ library is not needed.
AC_MSG_CHECKING(if libsupc++ is required)
SUPC="`$CXX -print-file-name=libsupc++.a 2>/dev/null`"
case "$SUPC" in
libsupc++.a*)
# Library not found, so this is and older GCC...
AC_MSG_RESULT(no)
;;
*)
# This is gcc 3.x, and it knows of libsupc++, so we need it
LIBS="$LIBS -lsupc++"
AC_MSG_RESULT(yes)
;;
esac
CXX="$CC"
# Show all standard warnings + unused variables when compiling...
OPTIM="-Wall -Wunused $OPTIM"
# The following additional warnings are useful for tracking down problems...
#OPTIM="-Wshadow -Wconversion -Winline $OPTIM"
# Set the default compiler optimizations...
if test -z "$DEBUGFLAG"; then
#
# Note: Can't use -fomit-frame-pointer - prevents tools like
# libsafe from working!
#
# Don't use -fforce-mem, -fforce-addr, or -fcaller-saves.
# They all seem to make either no difference or enlarge
# the code by a few hundred bytes.
#
# "-O2" seems to be the best compromise between speed and
# code size. "-O3" and higher seem to make no effective
# difference in the speed of the code, but does bloat the
# library 10+%.
#
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi
# Generate position-independent code when needed...
if test $PICFLAG = 1; then
OPTIM="$OPTIM -fPIC"
fi
# See if GCC supports -fno-exceptions...
AC_MSG_CHECKING(if GCC supports -fno-exceptions)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-exceptions"
AC_TRY_COMPILE(,,
OPTIM="$OPTIM -fno-exceptions"
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
# See if we are running Solaris; if so, try the -fpermissive option...
# This option is required on some versions of Solaris to work around
# bugs in the X headers up through Solaris 7.
#
# Unlike the other compiler/optimization settings, this one is placed
# in CFLAGS and CXXFLAGS so that fltk-config will provide the option
# to clients - otherwise client apps will not compile properly...
if test "$uname" = SunOS; then
AC_MSG_CHECKING(if GCC supports -fpermissive)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fpermissive"
AC_TRY_COMPILE(,,
CXXFLAGS="$CXXFLAGS -fpermissive"
AC_MSG_RESULT(yes),
CFLAGS="$OLDCFLAGS"
AC_MSG_RESULT(no))
fi
else
case "$uname" in
IRIX*)
# Running some flavor of IRIX; see which version and
# set things up according...
if test "$uversion" -ge 62; then
# 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 -mips3"
# CC="cc -n32 -mips3"
# LD="ld -n32 -mips3"
# MAKEDEPEND="CC -M"
if test "x`grep abi=n32 /etc/compiler.defaults`" = x; then
AC_MSG_WARN(FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI \"-n32 -mips3\")
fi
OPTIM="-fullwarn $OPTIM"
fi
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
if test $uversion -gt 62; then
OPTIM="-OPT:Olimit=4000 $OPTIM"
fi
fi
fi
;;
HP-UX*)
# Running HP-UX; these options should work for the HP compilers.
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="+O2 $OPTIM"
fi
fi
if test "x$with_optim" = x; then
OPTIM="$OPTIM +DAportable"
fi
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
fi
OPTIM="$OPTIM +W336,501,736,740,749,829"
;;
OSF1*)
# Running Digital/Tru64 UNIX; these options should work for the
# Digital/Compaq/NewHP compilers.
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi
;;
SunOS*)
# Solaris
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-xO3 $OPTIM"
fi
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
AIX*)
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
else
OPTIM="-O2 $OPTIM"
fi
fi
AC_MSG_WARN(The AIX C and C++ compilers are known not to correctly compile the FLTK library.)
;;
*)
# Running some other operating system; inform the user they
# should contribute the necessary options to fltk-bugs@fltk.org...
AC_MSG_WARN(Building FLTK with default compiler optimizations)
AC_MSG_WARN(Contact fltk-bugs@fltk.org with uname and compiler options.)
;;
esac
fi
OPTIM="$DEBUGFLAG $OPTIM"
dnl Define the FLTK documentation directory...
if test x$prefix = xNONE; then
AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "/usr/local/share/doc/fltk")
else
AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$prefix/share/doc/fltk")
fi
dnl Define the FLTK data directory...
if test x$prefix = xNONE; then
AC_DEFINE_UNQUOTED(FLTK_DATADIR, "/usr/local/share/fltk")
else
AC_DEFINE_UNQUOTED(FLTK_DATADIR, "$prefix/share/fltk")
fi
dnl Write all of the files...
AC_CONFIG_HEADER(config.h:configh.in)
AC_OUTPUT(makeinclude fltk.list fltk-config FL/Makefile)
dnl Make sure the fltk-config script is executable...
chmod +x fltk-config
dnl
dnl End of "$Id: configure.in,v 1.1.1.1 2003/06/03 22:25:27 agno Exp $".
dnl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -