This commit is contained in:
Olivier Sirol 2000-11-14 14:34:59 +00:00
parent 74200861f7
commit 3dfa6ca748
2 changed files with 183 additions and 653 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,14 +6,14 @@
# Copyright (C) 1997, 2000 Czo <Olivier.Sirol@lip6.fr>
# License: GPL (http://www.gnu.org/copyleft/gpl.html)
# Started: Feb 1997
# Last Change: Friday 22 September 2000, 16:46
# Edit Time: 1:43:21
# Last Change: Tuesday 14 November 2000, 15:19
# Edit Time: 4:51:47
# Description: Alliance CAD system configure.in
#
# $Id: configure.in,v 1.21 2000/09/22 14:54:08 czo Exp $
# $Id: configure.in,v 1.22 2000/11/14 14:34:18 czo Exp $
#
AC_REVISION($Revision: 1.21 $)dnl
AC_REVISION($Revision: 1.22 $)dnl
AC_INIT(configure.in)
@ -405,234 +405,23 @@ CFLAGS=$OLD_CFLAGS
dnl ##### Check for libXpm.
XPM_CFLAGS_LOC=""
XPM_LIBS_LOC="-lXpm"
dnl from AfterStep-APPS-990329/ascdc-0.3/autoconf/aclocal.m4
dnl test to find the hard-to-find libXpm
dnl mostly copied from AC_PATH_X & AC_PATH_DIRECT, but explictly set
AC_DEFUN(VT_FIND_LIBXPM,
[
AC_REQUIRE_CPP()
# Initialize some more variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
# If we find XPM, set shell vars xpm_includes and xpm_libraries to the
# paths, otherwise set no_xpm=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
OLD_LIBS=$LIBS
OLD_CFLAGS=$CFLAGS
LIBS="$OLD_LIBS $XPM_LIBS_LOC $X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS -lXt -lX11"
CFLAGS="$OLD_CFLAGS $X_CFLAGS $XPM_CFLAGS_LOC"
AC_MSG_CHECKING(for libXpm)
AC_ARG_WITH(xpm_includes,
[ --with-xpm-includes=DIR use XPM includes in DIR],
xpm_includes="$withval", xpm_includes=NO)
AC_ARG_WITH(xpm_library,
[ --with-xpm-library=DIR use XPM library in DIR],
xpm_libraries="$withval", xpm_libraries=NO)
# --without-xpm overrides everything else, but does not touch the cache.
AC_ARG_WITH(xpm,
[ --with-xpm use XPM])
if test "$with_xpm" = no; then
have_xpm=disabled
else
AC_CACHE_VAL(ac_cv_have_xpm, [
vt_xpm_include_X11=no
if test -n "$xpm_includes"; then
vt_xpm_includes=$xpm_includes
else
vt_xpm_includes=NO
fi
if test -n "$xpm_libraries"; then
vt_xpm_libraries=$xpm_libraries
else
vt_xpm_libraries=NO
fi
VT_XPM_DIRECT
if test "$vt_xpm_includes" = NO -o "$vt_xpm_libraries" = NO; then
ac_cv_have_xpm="have_xpm=no"
else
ac_cv_have_xpm="have_xpm=yes \
vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \
vt_xpm_include_X11=$vt_xpm_include_X11"
fi])dnl
eval "$ac_cv_have_xpm"
fi
if test "$have_xpm" != yes; then
AC_MSG_RESULT($have_xpm)
no_xpm=yes
else
if test "$xpm_includes" != NO; then
if test "$xpm_includes" != "$vt_xpm_includes"; then
vt_xpm_include_X11=no
if test -z "$xpm_includes"; then
AC_TRY_CPP([#include <X11/xpm.h>],
vt_xpm_include_X11=yes)
else
if test -r "$xpm_includes/X11/xpm.h"; then
vt_xpm_include_X11=yes
fi
fi
fi
vt_xpm_includes=$xpm_includes
fi
if test "x$xpm_libraries" != xNO; then
vt_xpm_libraries=$xpm_libraries
fi
# Update the cache value to reflect the command line values.
ac_cv_have_xpm="have_xpm=yes \
vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \
vt_xpm_include_X11=$vt_xpm_include_X11"
eval "$ac_cv_have_xpm"
AC_MSG_RESULT([header:$vt_xpm_includes lib:$vt_xpm_libraries])
if test -n "$vt_xpm_includes"; then
HAVEXPM="NOXPM"
else
HAVEXPM="XPM"
fi
if test -n "$vt_xpm_includes"; then
XPM_CFLAGS="-I$vt_xpm_includes"
fi
XPM_LIBS="-lXpm"
if test -n "$vt_xpm_libraries"; then
XPM_LIBS="-L$vt_xpm_libraries $XPM_LIBS"
AUTO_HAS="$AUTO_HAS -DAUTO_HAS_XPM"
fi
fi
])
dnl Internal subroutine of VT_FIND_LIBXPM
dnl Set vt_xpm_include and vt_xpm_libr
# -------------- find xpm.h and Xpm.a/Xpm.so/Xpm.sl
AC_DEFUN(VT_XPM_DIRECT,
[if test "$vt_xpm_includes" = NO; then
# Guess where to find xpm.h
# First, try using that file with no special directory specified.
AC_TRY_CPP([#include <X11/xpm.h>],
[# We can compile using X headers with no special include directory.
vt_xpm_includes=
vt_xpm_include_X11=yes],
[# Look for the header file in a standard set of common directories.
for ac_dir in \
/usr/X11/include \
/usr/X11R6/include \
/usr/X11R5/include \
/usr/X11R4/include \
\
/usr/include/X11 \
/usr/include/X11R6 \
/usr/include/X11R5 \
/usr/include/X11R4 \
\
/usr/local/X11/include \
/usr/local/X11R6/include \
/usr/local/X11R5/include \
/usr/local/X11R4/include \
\
/usr/local/include/X11 \
/usr/local/include/X11R6 \
/usr/local/include/X11R5 \
/usr/local/include/X11R4 \
\
/usr/X386/include \
/usr/x386/include \
/usr/XFree86/include/X11 \
\
/usr/include \
/usr/local/include \
/usr/unsupported/include \
/usr/athena/include \
/usr/local/x11r5/include \
/usr/lpp/Xamples/include \
\
/usr/openwin/include \
/usr/openwin/share/include \
; \
do
if test -r "$ac_dir/X11/xpm.h"; then
vt_xpm_includes="$ac_dir"
vt_xpm_include_X11=yes
break
# Albert@dma.be: does not make sense because we #include <X11/xpm.h>
# else
# if test -r "$ac_dir/xpm.h"; then
# vt_xpm_includes=$ac_dir
# break
# fi
fi
done])
fi
if test "$vt_xpm_libraries" = NO; then
# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-lXpm $LIBS"
AC_TRY_LINK(, [XpmReadFileToPixmap()],
[LIBS="$ac_save_LIBS"
# We can link libXpm with no special library path.
vt_xpm_libraries=],
[LIBS="$ac_save_LIBS"
# First see if replacing the include by lib works.
for ac_dir in \
`echo "$vt_xpm_includes" | sed 's,include/X11,lib,;s,include,lib,'` \
/usr/X11/lib \
/usr/X11R6/lib \
/usr/X11R5/lib \
/usr/X11R4/lib \
\
/usr/lib/X11 \
/usr/lib/X11R6 \
/usr/lib/X11R5 \
/usr/lib/X11R4 \
\
/usr/local/X11/lib \
/usr/local/X11R6/lib \
/usr/local/X11R5/lib \
/usr/local/X11R4/lib \
\
/usr/local/lib/X11 \
/usr/local/lib/X11R6 \
/usr/local/lib/X11R5 \
/usr/local/lib/X11R4 \
\
/usr/X386/lib \
/usr/x386/lib \
/usr/XFree86/lib/X11 \
\
/usr/lib \
/usr/local/lib \
/usr/unsupported/lib \
/usr/athena/lib \
/usr/local/x11r5/lib \
/usr/lpp/Xamples/lib \
\
/usr/openwin/lib \
/usr/openwin/share/lib \
; \
do
dnl XXX Shouldn't this really use AC_TRY_LINK to be portable & robust??
for ac_extension in a so sl; do
if test -r $ac_dir/libXpm.$ac_extension; then
vt_xpm_libraries=$ac_dir
break 2
fi
done
done])
fi
])
VT_FIND_LIBXPM
XPM_CFLAGS_LOC="$XPM_CFLAGS"
XPM_LIBS_LOC="$XPM_LIBS"
AC_TRY_LINK([#include <stdio.h>
#include <stdlib.h>
#include <X11/xpm.h>],
[ XpmWriteFileFromPixmap( NULL, NULL, NULL, NULL, NULL );],
AC_MSG_RESULT(yes); AUTO_HAS="$AUTO_HAS -DAUTO_HAS_XPM",
AC_MSG_RESULT(no);XPM_CFLAGS_LOC="" ; XPM_LIBS_LOC=""
)
LIBS=$OLD_LIBS
CFLAGS=$OLD_CFLAGS
AC_SUBST(XPM_LIBS_LOC)
AC_SUBST(XPM_CFLAGS_LOC)