home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
Linux
/
Divers
/
ImageMagick-4.0.6.tar.gz
/
ImageMagick-4.0.6.tar
/
ImageMagick-4.0.6
/
configure.in
< prev
next >
Wrap
Text File
|
1998-05-12
|
17KB
|
613 lines
dnl Process this file with autoconf to produce a configure script.
dnl Currently maintained by Bob Friesenhahn, bfriesen@simple.dallas.tx.us
AC_INIT(magick/magick.h)
AM_CONFIG_HEADER(magick/config.h)
AM_INIT_AUTOMAKE(ImageMagick,4.0.6)
VERSION_CURRENT=4
VERSION_REVISION=6
VERSION_AGE=0
AC_SUBST(VERSION_CURRENT)dnl
AC_SUBST(VERSION_REVISION)dnl
AC_SUBST(VERSION_AGE)dnl
dnl Check for programs
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_LN_S
dnl Configure libtool
AM_ENABLE_SHARED(no)
AM_ENABLE_STATIC(yes)
AM_PROG_LIBTOOL
dnl Check standard headers
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADER(elf.h,AC_DEFINE(SVR4))
AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/time.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd gethostname mkdir select strcspn strerror strtol)
dnl Check standard functions
AC_CHECK_FUNCS(strerror)
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK([extern char** sys_errlist;],[char** p = sys_errlist;],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST),AC_MSG_RESULT(no))
dnl Add configure option --enable-maintainer-mode which enables dependency
dnl checking and generation useful to package maintainers. This is made an
dnl option to avoid confusing end users.
AM_MAINTAINER_MODE
dnl Add configure option --with-dmalloc to enable malloc debugging.
dnl dmalloc is available at ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz
AM_WITH_DMALLOC
dnl Enable LZW compression.
AC_ARG_ENABLE(lzw,
[ --enable-lzw enable LZW support (default is no)],
[with_lzw=$enableval],
[with_lzw='no'])
test "$with_lzw" = 'yes' && AC_DEFINE(HasLZW)
dnl Enable 16-bit pixels.
AC_ARG_ENABLE(16bit-pixel,
[ --enable-16bit-pixel enable 16 bit pixels (default is no)],
[with_16_bit_pixel=$enableval],
[with_16_bit_pixel='no'])
test "$with_16_bit_pixel" = 'yes' && AC_DEFINE(QuantumLeap)
dnl Enable SOCKS version 5 proxy support
AC_ARG_ENABLE(socks,
[ --enable-socks enable SOCKS v5 proxy support (default is no)],
[with_socks=$enableval],
[with_socks='no'])
dnl Enable build/install of PerlMagick.
AC_ARG_WITH(perl,
[ --with-perl enable build/install of PerlMagick (default is no)],
[with_perl=$withval],
[with_perl='no'])
AM_CONDITIONAL(WITH_PERL, test "$with_perl" != 'no')
with_perl_static='no'
if test "$with_perl" != 'no' && ./libtool --features | grep 'disable shared'
then
with_perl_static='yes'
fi
with_perl_dynamic='no'
if test "$with_perl" != 'no' && ./libtool --features | grep 'enable shared'
then
with_perl_dynamic='yes'
fi
AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
dnl Enable Display Postscript.
AC_ARG_WITH(dps,
[ --with-dps enable Display Postscript (default is yes)],
[with_dps=$withval],
[with_dps='yes'])
dnl Enable FlashPIX.
AC_ARG_WITH(fpx,
[ --with-fpx enable FlashPIX (default is yes)],
[with_fpx=$withval],
[with_fpx='yes'])
dnl Enable HDF.
AC_ARG_WITH(hdf,
[ --with-hdf enable HDF (default is yes)],
[with_hdf=$withval],
[with_hdf='yes'])
dnl Enable JBIG.
AC_ARG_WITH(jbig,
[ --with-jbig enable JBIG (default is yes)],
[with_jbig=$withval],
[with_jbig='yes'])
dnl Enable JPEG.
AC_ARG_WITH(jpeg,
[ --with-jpeg enable JPEG (default is yes)],
[with_jpeg=$withval],
[with_jpeg='yes'])
dnl Enable MPEG.
AC_ARG_WITH(mpeg,
[ --with-mpeg enable MPEG (default is yes)],
[with_mpeg=$withval],
[with_mpeg='yes'])
dnl Enable PNG.
AC_ARG_WITH(png,
[ --with-png enable PNG (default is yes)],
[with_png=$withval],
[with_png='yes'])
dnl Enable TIFF.
AC_ARG_WITH(tiff,
[ --with-tiff enable TIFF (default is yes)],
[with_tiff=$withval],
[with_tiff='yes'])
dnl Enable TTF.
AC_ARG_WITH(ttf,
[ --with-ttf enable TrueType (default is yes)],
[with_ttf=$withval],
[with_ttf='yes'])
dnl Extend includedir to include magick subdirectory offset
includedir="$includedir/magick"
dnl Check for plug-in sub-directories and add -I & -L options as required.
dnl This presumes that plug-ins are installed as detailed in the ImageMagick
dnl README. If plug-ins are installed in a standard location where the
dnl compiler will automatically find them then these options should not be
dnl required.
srcdirfull=`cd $srcdir && pwd`
builddir=`pwd`
for dir in hdf/hdf/src jbig/libjbig jpeg mpeg zlib png tiff/libtiff ttf ttf/lib
do
if test -d "$builddir/$dir"
then
CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
LDFLAGS="$LDFLAGS -L$builddir/$dir"
else
if test -d "$srcdirfull/$dir"
then
CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
fi
fi
done
dnl Determine installation prefix
dnl Unfortunately, this depends on Autoconf internals that may change
PREFIX="$prefix"
test "x$PREFIX" = xNONE && PREFIX=$ac_default_prefix
libdir="$PREFIX/lib"
LIBS="$LIBS -L$libdir"
CPPFLAGS="$CPPFLAGS -I$PREFIX/include"
TRAILING_LIBS=''
dnl Find math library
AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
dnl Add math library at end of trailing library list
if test "$LIB_MATH"
then
TRAILING_LIBS="$TRAILING_LIBS $LIB_MATH"
fi
dnl Find the X11 include and library directories.
AC_PATH_XTRA
X11STUBSDIR=''
X11STUBSLA=''
X11STUBSLIB=''
if test "$with_x" != 'no'
then
LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_LIB(Xext,XShmAttach,LIBS="$LIBS -lXext",,)
AC_CHECK_LIB(Xext,XShmAttach,AC_DEFINE(HasSharedMemory),,)
AC_CHECK_LIB(Xext,XShapeCombineMask,AC_DEFINE(HasShape),,)
AC_CHECK_LIB(Xt,XtSetEventDispatcher,LIBS="$LIBS -lXt",,)
else
dnl Check for X11 stubs library
AC_MSG_CHECKING(for X11 stubs library)
if test -f "$srcdir/xlib/X11_stubs.c"
then
CPPFLAGS="$CPPFLAGS -I$srcdirfull/xlib"
X11STUBSDIR="$srcdir/xlib"
X11STUBSLANAME="libX11_stubs.la"
X11STUBSLA="$srcdir/xlib/$X11STUBSLANAME"
X11STUBSLIB="-lX11_stubs"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(ImageMagick requires X11 library or X11 stubs library to build)
fi
fi
AC_SUBST(X11STUBSDIR)
AC_SUBST(X11STUBSLANAME)
AC_SUBST(X11STUBSLA)
AC_SUBST(X11STUBSLIB)
dnl
dnl Find the X11 RGB database
dnl
AC_CACHE_CHECK(for X11 RGB database,im_cv_x_rgbdb,
[# Look for the header file in a standard set of common directories.
# Check X11 before X11Rn because it is often a symlink to the current release.
for ac_dir in \
/lib/usr/lib/X11 \
/usr/X11/lib \
/usr/X11R4/lib \
/usr/X11R5/lib \
/usr/X11R6/lib \
/usr/X386/lib \
/usr/XFree86/lib/X11 \
/usr/athena/lib \
/usr/lib \
/usr/lib/X11 \
/usr/lib/X11R4 \
/usr/lib/X11R5 \
/usr/lib/X11R6 \
/usr/local/X11/lib \
/usr/local/X11R4/lib \
/usr/local/X11R5/lib \
/usr/local/X11R6/lib \
/usr/local/lib \
/usr/local/lib/X11 \
/usr/local/lib/X11R4 \
/usr/local/lib/X11R5 \
/usr/local/lib/X11R6 \
/usr/local/x11r5/lib \
/usr/lpp/Xamples/lib \
/usr/openwin/lib \
/usr/openwin/share/lib \
/usr/unsupported/lib \
/usr/x386/lib \
; \
do
if test -f "$ac_dir/X11/rgb.txt"
then
im_cv_x_rgbdb="$ac_dir/X11/rgb.txt"
break
elif test -f "$ac_dir/rgb.txt"
then
im_cv_x_rgbdb="$ac_dir/rgb.txt"
break
fi
done])
AC_DEFINE_UNQUOTED(RGBColorDatabase,"$im_cv_x_rgbdb")
dnl Check for FlashPIX
LIB_FPX=''
if test "$with_fpx" != 'no'
then
AC_CHECKING(for FlashPIX components ...)
failed=0;
passed=0;
AC_CHECK_HEADER(fpx.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if FlashPIX package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_FPX='-lfpx'
LIBS="$LIBS $LIB_FPX"
AC_DEFINE(HasFPX)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for JBIG
LIB_JBIG=''
if test "$with_jbig" != 'no'
then
AC_CHECKING(for JBIG support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if JBIG package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_JBIG='-ljbig'
LIBS="$LIBS $LIB_JBIG"
AC_DEFINE(HasJBIG)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for JPEG
LIB_JPEG=''
if test "$with_jpeg" != 'no'
then
AC_CHECKING(for JPEG support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if JPEG package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_JPEG='-ljpeg'
LIBS="$LIBS $LIB_JPEG"
AC_DEFINE(HasJPEG)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for MPEG
LIB_MPEG=''
if test "$with_mpeg" != 'no'
then
AC_CHECKING(for MPEG support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(mpeg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(mpeg,GetMPEGInfo,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if MPEG package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_MPEG='-lmpeg'
LIBS="$LIBS $LIB_MPEG"
AC_DEFINE(HasMPEG)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for ZLIB
LIB_ZLIB=''
AC_CHECKING(for ZLIB support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if ZLIB package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_ZLIB='-lz'
dnl Other libs may depend on -lz and some linkers don't work very well so put -lz in trailing libs
TRAILING_LIBS="$LIB_ZLIB $TRAILING_LIBS"
AC_DEFINE(HasZLIB)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
dnl Check for HDF
LIB_HDF=''
if test "$with_hdf" != 'no'
then
AC_CHECKING(for HDF components ...)
failed=0;
passed=0;
AC_CHECK_HEADER(hdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(df,DFANputlabel,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if HDF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_HDF='-ldf'
LIBS="$LIBS $LIB_HDF"
AC_DEFINE(HasHDF)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for PNG
LIB_PNG=''
if test "$with_png" != 'no'
then
AC_CHECKING(for PNG support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_CHECK_HEADER(pngconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
AC_CHECK_LIB(png,png_info_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if PNG package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_PNG='-lpng'
LIBS="$LIBS $LIB_PNG"
AC_DEFINE(HasPNG)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for TIFF
LIB_TIFF=''
if test "$with_tiff" != 'no'
then
AC_CHECKING(for TIFF support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if TIFF package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_TIFF='-ltiff'
LIBS="$LIBS $LIB_TIFF"
AC_DEFINE(HasTIFF)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for TTF
LIB_TTF=''
if test "$with_ttf" != 'no'
then
AC_CHECKING(for TrueType Font support ...)
failed=0;
passed=0;
AC_CHECK_HEADER(freetype.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(ttf,TT_Init_FreeType,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_MSG_CHECKING(if FreeType package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
else
LIB_TTF='-lttf'
LIBS="$LIBS $LIB_TTF"
AC_DEFINE(HasTTF)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
fi
fi
dnl Check for Display Postscript
LIB_DPS=''
if test "$with_dps" != 'no' && test "$with_x" != 'no'
then
AC_CHECKING(for Display Postscript support ...)
failed=0;
passed=0;
O_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_HEADER(DPS/dpsXpreview.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
AC_CHECK_LIB(dps,DPSInitialize,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $TRAILING_LIBS)
AC_MSG_CHECKING(if DPS package is complete)
if test $passed -gt 0
then
if test $failed -gt 0
then
AC_MSG_RESULT(no -- some components failed test)
CPPFLAGS=$O_CPPFLAGS
else
LIB_DPS='-ldpstk -ldps'
LIBS="$LIBS $LIB_DPS"
AC_DEFINE(HasDPS)
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(no)
CPPFLAGS=$O_CPPFLAGS
fi
fi
dnl Add trailing libs to end of library list
if test "$TRAILING_LIBS"
then
LIBS="$LIBS $TRAILING_LIBS"
fi
dnl Look for PERL if PerlMagick requested
dnl If name/path of desired PERL interpreter is specified, look for that one first
if test "$with_perl" != 'no'
then
if test "$with_perl" != 'yes'
then
AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
else
AC_PATH_PROGS(PERL,perl perl5,)dnl
fi
fi
dnl Determine path to pick up ImageMagick library from for use with building PerlMagick
MAGICKLIB="-L$PREFIX/lib -L/usr/local/lib -lMagick"
if test $with_perl_static = 'yes'
then
MAGICKLIB="-L${builddir}/magick -lMagick"
fi
AC_SUBST(MAGICKLIB)dnl
dnl Check for networking libraries and definitions needed by xtp
XTP_LIBS=''
XTP_DEFS=''
XTP_FTP='ftp'
if test "$with_socks" = 'yes'
then
have_socks_header='no'
have_socks_lib='no'
AC_CHECK_HEADER(socks.h,have_socks_header='yes',have_socks_header='no')
AC_CHECK_LIB(socks5,SOCKSinit,have_socks_lib='yes',have_socks_lib='no',)
if test $have_socks_header = 'yes' && test $have_socks_lib = 'yes'
then
XTP_LIBS="$XTP_LIBS -lsocks5"
XTP_DEFS="$XTP_DEFS -DSOCKS"
fi
AC_PATH_PROGS(XTP_FTP,rftp ftp,,)
fi
XTP_DEFS="$XTP_DEFS -DXTP_FTP=\"\\\"$XTP_FTP\\\"\""
AC_CHECK_LIB(nsl,gethostbyname,XTP_LIBS="$XTP_LIBS -lnsl",,)
AC_CHECK_LIB(socket,socket,XTP_LIBS="$XTP_LIBS -lsocket",,)
AC_SUBST(XTP_LIBS)dnl
AC_SUBST(XTP_DEFS)dnl
AC_OUTPUT(Makefile magick/Makefile xtp/Makefile xlib/Makefile PerlMagick/Makefile.PL)