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 >
Text File  |  1998-05-12  |  17KB  |  613 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl Currently maintained by Bob Friesenhahn, bfriesen@simple.dallas.tx.us
  3.  
  4. AC_INIT(magick/magick.h)
  5. AM_CONFIG_HEADER(magick/config.h)
  6. AM_INIT_AUTOMAKE(ImageMagick,4.0.6)
  7. VERSION_CURRENT=4
  8. VERSION_REVISION=6
  9. VERSION_AGE=0
  10.  
  11. AC_SUBST(VERSION_CURRENT)dnl
  12. AC_SUBST(VERSION_REVISION)dnl
  13. AC_SUBST(VERSION_AGE)dnl
  14.  
  15. dnl Check for programs
  16. AC_PROG_CC
  17. AM_PROG_CC_STDC
  18. AC_PROG_CPP
  19. AC_PROG_LN_S
  20.  
  21. dnl Configure libtool
  22. AM_ENABLE_SHARED(no)
  23. AM_ENABLE_STATIC(yes)
  24. AM_PROG_LIBTOOL
  25.  
  26. dnl Check standard headers
  27. AC_HEADER_DIRENT
  28. AC_HEADER_STDC
  29. AC_HEADER_SYS_WAIT
  30. AC_CHECK_HEADER(elf.h,AC_DEFINE(SVR4))
  31. AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/time.h unistd.h)
  32.  
  33. dnl Checks for typedefs, structures, and compiler characteristics.
  34. AC_C_CONST
  35. AC_TYPE_MODE_T
  36. AC_TYPE_PID_T
  37. AC_TYPE_SIZE_T
  38. AC_HEADER_TIME
  39.  
  40. dnl Checks for library functions.
  41. AC_PROG_GCC_TRADITIONAL
  42. AC_FUNC_MEMCMP
  43. AC_TYPE_SIGNAL
  44. AC_FUNC_VPRINTF
  45. AC_CHECK_FUNCS(getcwd gethostname mkdir select strcspn strerror strtol)
  46.  
  47. dnl Check standard functions
  48. AC_CHECK_FUNCS(strerror)
  49. AC_MSG_CHECKING(for sys_errlist)
  50. AC_TRY_LINK([extern char** sys_errlist;],[char** p = sys_errlist;],
  51. AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST),AC_MSG_RESULT(no))
  52.  
  53. dnl Add configure option --enable-maintainer-mode which enables dependency
  54. dnl checking and generation useful to package maintainers.  This is made an
  55. dnl option to avoid confusing end users.
  56. AM_MAINTAINER_MODE
  57.  
  58. dnl Add configure option --with-dmalloc to enable malloc debugging.
  59. dnl dmalloc is available at ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz
  60. AM_WITH_DMALLOC
  61.  
  62. dnl Enable LZW compression.
  63. AC_ARG_ENABLE(lzw,
  64.           [  --enable-lzw            enable LZW support (default is no)],
  65.           [with_lzw=$enableval],
  66.           [with_lzw='no'])
  67. test "$with_lzw" = 'yes' && AC_DEFINE(HasLZW)
  68.  
  69. dnl Enable 16-bit pixels.
  70. AC_ARG_ENABLE(16bit-pixel,
  71.           [  --enable-16bit-pixel    enable 16 bit pixels (default is no)],
  72.           [with_16_bit_pixel=$enableval],
  73.           [with_16_bit_pixel='no'])
  74. test "$with_16_bit_pixel" = 'yes' && AC_DEFINE(QuantumLeap)
  75.  
  76. dnl Enable SOCKS version 5 proxy support
  77. AC_ARG_ENABLE(socks,
  78.           [  --enable-socks          enable SOCKS v5 proxy support (default is no)],
  79.           [with_socks=$enableval],
  80.           [with_socks='no'])
  81.  
  82. dnl Enable build/install of PerlMagick.
  83. AC_ARG_WITH(perl,
  84.           [  --with-perl             enable build/install of PerlMagick (default is no)],
  85.           [with_perl=$withval],
  86.           [with_perl='no'])
  87.  
  88. AM_CONDITIONAL(WITH_PERL, test "$with_perl" != 'no')
  89. with_perl_static='no'
  90. if test "$with_perl" != 'no' && ./libtool --features | grep 'disable shared'
  91. then
  92.   with_perl_static='yes'
  93. fi
  94. with_perl_dynamic='no'
  95. if test "$with_perl" != 'no' && ./libtool --features | grep 'enable shared'
  96. then
  97.   with_perl_dynamic='yes'
  98. fi
  99. AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
  100. AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
  101.  
  102. dnl Enable Display Postscript.
  103. AC_ARG_WITH(dps,
  104.           [  --with-dps              enable Display Postscript (default is yes)],
  105.           [with_dps=$withval],
  106.           [with_dps='yes'])
  107.  
  108. dnl Enable FlashPIX.
  109. AC_ARG_WITH(fpx,
  110.           [  --with-fpx              enable FlashPIX (default is yes)],
  111.           [with_fpx=$withval],
  112.           [with_fpx='yes'])
  113.  
  114. dnl Enable HDF.
  115. AC_ARG_WITH(hdf,
  116.           [  --with-hdf              enable HDF (default is yes)],
  117.           [with_hdf=$withval],
  118.           [with_hdf='yes'])
  119.  
  120. dnl Enable JBIG.
  121. AC_ARG_WITH(jbig,
  122.           [  --with-jbig             enable JBIG (default is yes)],
  123.           [with_jbig=$withval],
  124.           [with_jbig='yes'])
  125.  
  126. dnl Enable JPEG.
  127. AC_ARG_WITH(jpeg,
  128.           [  --with-jpeg             enable JPEG (default is yes)],
  129.           [with_jpeg=$withval],
  130.           [with_jpeg='yes'])
  131.  
  132. dnl Enable MPEG.
  133. AC_ARG_WITH(mpeg,
  134.           [  --with-mpeg             enable MPEG (default is yes)],
  135.           [with_mpeg=$withval],
  136.           [with_mpeg='yes'])
  137.  
  138. dnl Enable PNG.
  139. AC_ARG_WITH(png,
  140.           [  --with-png              enable PNG (default is yes)],
  141.           [with_png=$withval],
  142.           [with_png='yes'])
  143.  
  144. dnl Enable TIFF.
  145. AC_ARG_WITH(tiff,
  146.           [  --with-tiff             enable TIFF (default is yes)],
  147.           [with_tiff=$withval],
  148.           [with_tiff='yes'])
  149.  
  150. dnl Enable TTF.
  151. AC_ARG_WITH(ttf,
  152.           [  --with-ttf              enable TrueType (default is yes)],
  153.           [with_ttf=$withval],
  154.           [with_ttf='yes'])
  155.  
  156. dnl Extend includedir to include magick subdirectory offset
  157. includedir="$includedir/magick"
  158.  
  159. dnl Check for plug-in sub-directories and add -I & -L options as required.
  160. dnl This presumes that plug-ins are installed as detailed in the ImageMagick
  161. dnl README. If plug-ins are installed in a standard location where the
  162. dnl compiler will automatically find them then these options should not be
  163. dnl required.
  164.  
  165. srcdirfull=`cd $srcdir && pwd`
  166. builddir=`pwd`
  167. for dir in hdf/hdf/src jbig/libjbig jpeg mpeg zlib png tiff/libtiff ttf ttf/lib
  168. do
  169.   if test -d "$builddir/$dir"
  170.   then
  171.     CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
  172.     LDFLAGS="$LDFLAGS -L$builddir/$dir"
  173.   else
  174.     if test -d "$srcdirfull/$dir"
  175.     then
  176.       CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
  177.       LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
  178.     fi
  179.   fi
  180. done
  181.  
  182. dnl Determine installation prefix
  183. dnl Unfortunately, this depends on Autoconf internals that may change
  184. PREFIX="$prefix"
  185. test "x$PREFIX" = xNONE && PREFIX=$ac_default_prefix
  186.  
  187. libdir="$PREFIX/lib"
  188. LIBS="$LIBS -L$libdir"
  189.  
  190. CPPFLAGS="$CPPFLAGS -I$PREFIX/include"
  191. TRAILING_LIBS=''
  192.  
  193. dnl Find math library
  194. AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
  195.  
  196. dnl Add math library at end of trailing library list
  197. if test "$LIB_MATH"
  198. then
  199.     TRAILING_LIBS="$TRAILING_LIBS $LIB_MATH"
  200. fi
  201.  
  202.  
  203. dnl Find the X11 include and library directories.
  204. AC_PATH_XTRA
  205.  
  206. X11STUBSDIR=''
  207. X11STUBSLA=''
  208. X11STUBSLIB=''
  209. if test "$with_x" != 'no'
  210. then
  211.     LIBS="$LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
  212.     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  213.  
  214.     AC_CHECK_LIB(Xext,XShmAttach,LIBS="$LIBS -lXext",,)
  215.     AC_CHECK_LIB(Xext,XShmAttach,AC_DEFINE(HasSharedMemory),,)
  216.     AC_CHECK_LIB(Xext,XShapeCombineMask,AC_DEFINE(HasShape),,)
  217.  
  218.     AC_CHECK_LIB(Xt,XtSetEventDispatcher,LIBS="$LIBS -lXt",,)
  219. else
  220.     dnl Check for X11 stubs library
  221.     AC_MSG_CHECKING(for X11 stubs library)
  222.     if test -f "$srcdir/xlib/X11_stubs.c"
  223.     then
  224.     CPPFLAGS="$CPPFLAGS -I$srcdirfull/xlib"
  225.     X11STUBSDIR="$srcdir/xlib"
  226.     X11STUBSLANAME="libX11_stubs.la"
  227.     X11STUBSLA="$srcdir/xlib/$X11STUBSLANAME"
  228.     X11STUBSLIB="-lX11_stubs"
  229.     AC_MSG_RESULT(yes)
  230.     else
  231.     AC_MSG_RESULT(no)
  232.     AC_MSG_ERROR(ImageMagick requires X11 library or X11 stubs library to build)
  233.     fi
  234. fi
  235. AC_SUBST(X11STUBSDIR)
  236. AC_SUBST(X11STUBSLANAME)
  237. AC_SUBST(X11STUBSLA)
  238. AC_SUBST(X11STUBSLIB)
  239.  
  240.  
  241. dnl
  242. dnl Find the X11 RGB database
  243. dnl
  244. AC_CACHE_CHECK(for X11 RGB database,im_cv_x_rgbdb,
  245. [# Look for the header file in a standard set of common directories.
  246. # Check X11 before X11Rn because it is often a symlink to the current release.
  247.   for ac_dir in               \
  248.     /lib/usr/lib/X11      \
  249.     /usr/X11/lib          \
  250.     /usr/X11R4/lib        \
  251.     /usr/X11R5/lib        \
  252.     /usr/X11R6/lib        \
  253.     /usr/X386/lib         \
  254.     /usr/XFree86/lib/X11  \
  255.     /usr/athena/lib       \
  256.     /usr/lib              \
  257.     /usr/lib/X11          \
  258.     /usr/lib/X11R4        \
  259.     /usr/lib/X11R5        \
  260.     /usr/lib/X11R6        \
  261.     /usr/local/X11/lib    \
  262.     /usr/local/X11R4/lib  \
  263.     /usr/local/X11R5/lib  \
  264.     /usr/local/X11R6/lib  \
  265.     /usr/local/lib        \
  266.     /usr/local/lib/X11    \
  267.     /usr/local/lib/X11R4  \
  268.     /usr/local/lib/X11R5  \
  269.     /usr/local/lib/X11R6  \
  270.     /usr/local/x11r5/lib  \
  271.     /usr/lpp/Xamples/lib  \
  272.     /usr/openwin/lib      \
  273.     /usr/openwin/share/lib \
  274.     /usr/unsupported/lib  \
  275.     /usr/x386/lib         \
  276.     ; \
  277.   do
  278.     if test -f "$ac_dir/X11/rgb.txt"
  279.     then
  280.         im_cv_x_rgbdb="$ac_dir/X11/rgb.txt"
  281.     break
  282.     elif test -f "$ac_dir/rgb.txt"
  283.     then 
  284.         im_cv_x_rgbdb="$ac_dir/rgb.txt"
  285.         break
  286.     fi
  287.  
  288.   done])
  289. AC_DEFINE_UNQUOTED(RGBColorDatabase,"$im_cv_x_rgbdb")
  290.  
  291. dnl Check for FlashPIX
  292. LIB_FPX=''
  293. if test "$with_fpx" != 'no'
  294. then
  295.     AC_CHECKING(for FlashPIX components ...)
  296.     failed=0;
  297.     passed=0;
  298.     AC_CHECK_HEADER(fpx.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  299.     AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  300.     AC_MSG_CHECKING(if FlashPIX package is complete)
  301.     if test $passed -gt 0
  302.     then
  303.     if test $failed -gt 0
  304.     then
  305.     AC_MSG_RESULT(no -- some components failed test)
  306.     else
  307.     LIB_FPX='-lfpx'
  308.     LIBS="$LIBS $LIB_FPX"
  309.     AC_DEFINE(HasFPX)
  310.     AC_MSG_RESULT(yes)
  311.     fi
  312.     else
  313.     AC_MSG_RESULT(no)
  314.     fi
  315. fi
  316.  
  317. dnl Check for JBIG
  318. LIB_JBIG=''
  319. if test "$with_jbig" != 'no'
  320. then
  321.     AC_CHECKING(for JBIG support ...)
  322.     failed=0;
  323.     passed=0;
  324.     AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  325.     AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  326.     AC_MSG_CHECKING(if JBIG package is complete)
  327.     if test $passed -gt 0
  328.     then
  329.     if test $failed -gt 0
  330.     then
  331.     AC_MSG_RESULT(no -- some components failed test)
  332.     else
  333.     LIB_JBIG='-ljbig'
  334.     LIBS="$LIBS $LIB_JBIG"
  335.     AC_DEFINE(HasJBIG)
  336.     AC_MSG_RESULT(yes)
  337.     fi
  338.     else
  339.     AC_MSG_RESULT(no)
  340.     fi
  341. fi
  342.  
  343. dnl Check for JPEG
  344. LIB_JPEG=''
  345. if test "$with_jpeg" != 'no'
  346. then
  347.     AC_CHECKING(for JPEG support ...)
  348.     failed=0;
  349.     passed=0;
  350.     AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  351.     AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  352.     AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  353.     AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  354.     AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  355.     AC_MSG_CHECKING(if JPEG package is complete)
  356.     if test $passed -gt 0
  357.     then
  358.     if test $failed -gt 0
  359.     then
  360.     AC_MSG_RESULT(no -- some components failed test)
  361.     else
  362.     LIB_JPEG='-ljpeg'
  363.     LIBS="$LIBS $LIB_JPEG"
  364.     AC_DEFINE(HasJPEG)
  365.     AC_MSG_RESULT(yes)
  366.     fi
  367.     else
  368.     AC_MSG_RESULT(no)
  369.     fi
  370. fi
  371.  
  372. dnl Check for MPEG
  373. LIB_MPEG=''
  374. if test "$with_mpeg" != 'no'
  375. then
  376.     AC_CHECKING(for MPEG support ...)
  377.     failed=0;
  378.     passed=0;
  379.     AC_CHECK_HEADER(mpeg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  380.     AC_CHECK_LIB(mpeg,GetMPEGInfo,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  381.     AC_MSG_CHECKING(if MPEG package is complete)
  382.     if test $passed -gt 0
  383.     then
  384.     if test $failed -gt 0
  385.     then
  386.     AC_MSG_RESULT(no -- some components failed test)
  387.     else
  388.     LIB_MPEG='-lmpeg'
  389.     LIBS="$LIBS $LIB_MPEG"
  390.     AC_DEFINE(HasMPEG)
  391.     AC_MSG_RESULT(yes)
  392.     fi
  393.     else
  394.     AC_MSG_RESULT(no)
  395.     fi
  396. fi
  397.  
  398.  
  399. dnl Check for ZLIB
  400. LIB_ZLIB=''
  401. AC_CHECKING(for ZLIB support ...)
  402. failed=0;
  403. passed=0;
  404. AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  405. AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  406. AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  407. AC_MSG_CHECKING(if ZLIB package is complete)
  408. if test $passed -gt 0
  409. then
  410.     if test $failed -gt 0
  411.     then
  412.     AC_MSG_RESULT(no -- some components failed test)
  413.     else
  414.     LIB_ZLIB='-lz'
  415. dnl Other libs may depend on -lz and some linkers don't work very well so put -lz in trailing libs
  416.     TRAILING_LIBS="$LIB_ZLIB $TRAILING_LIBS"
  417.     AC_DEFINE(HasZLIB)
  418.     AC_MSG_RESULT(yes)
  419.     fi
  420. else
  421.     AC_MSG_RESULT(no)
  422. fi
  423.  
  424. dnl Check for HDF
  425. LIB_HDF=''
  426. if test "$with_hdf" != 'no'
  427. then
  428.     AC_CHECKING(for HDF components ...)
  429.     failed=0;
  430.     passed=0;
  431.     AC_CHECK_HEADER(hdf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  432.     AC_CHECK_LIB(df,DFANputlabel,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  433.     AC_MSG_CHECKING(if HDF package is complete)
  434.     if test $passed -gt 0
  435.     then
  436.     if test $failed -gt 0
  437.     then
  438.     AC_MSG_RESULT(no -- some components failed test)
  439.     else
  440.     LIB_HDF='-ldf'
  441.     LIBS="$LIBS $LIB_HDF"
  442.     AC_DEFINE(HasHDF)
  443.     AC_MSG_RESULT(yes)
  444.     fi
  445.     else
  446.     AC_MSG_RESULT(no)
  447.     fi
  448. fi
  449.  
  450. dnl Check for PNG
  451. LIB_PNG=''
  452. if test "$with_png" != 'no'
  453. then
  454.     AC_CHECKING(for PNG support ...)
  455.     failed=0;
  456.     passed=0;
  457.     AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  458.     AC_CHECK_HEADER(pngconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  459.     AC_CHECK_LIB(png,png_info_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  460.     AC_MSG_CHECKING(if PNG package is complete)
  461.     if test $passed -gt 0
  462.     then
  463.     if test $failed -gt 0
  464.     then
  465.     AC_MSG_RESULT(no -- some components failed test)
  466.     else
  467.     LIB_PNG='-lpng'
  468.     LIBS="$LIBS $LIB_PNG"
  469.     AC_DEFINE(HasPNG)
  470.     AC_MSG_RESULT(yes)
  471.     fi
  472.     else
  473.     AC_MSG_RESULT(no)
  474.     fi
  475. fi
  476.  
  477.  
  478. dnl Check for TIFF
  479. LIB_TIFF=''
  480. if test "$with_tiff" != 'no'
  481. then
  482.     AC_CHECKING(for TIFF support ...)
  483.     failed=0;
  484.     passed=0;
  485.     AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  486.     AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  487.     AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  488.     AC_MSG_CHECKING(if TIFF package is complete)
  489.     if test $passed -gt 0
  490.     then
  491.     if test $failed -gt 0
  492.     then
  493.     AC_MSG_RESULT(no -- some components failed test)
  494.     else
  495.     LIB_TIFF='-ltiff'
  496.     LIBS="$LIBS $LIB_TIFF"
  497.     AC_DEFINE(HasTIFF)
  498.     AC_MSG_RESULT(yes)
  499.     fi
  500.     else
  501.     AC_MSG_RESULT(no)
  502.     fi
  503. fi
  504.  
  505. dnl Check for TTF
  506. LIB_TTF=''
  507. if test "$with_ttf" != 'no'
  508. then
  509.     AC_CHECKING(for TrueType Font support ...)
  510.     failed=0;
  511.     passed=0;
  512.     AC_CHECK_HEADER(freetype.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  513.     AC_CHECK_LIB(ttf,TT_Init_FreeType,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  514.     AC_MSG_CHECKING(if FreeType package is complete)
  515.     if test $passed -gt 0
  516.     then
  517.     if test $failed -gt 0
  518.     then
  519.         AC_MSG_RESULT(no -- some components failed test)
  520.     else
  521.         LIB_TTF='-lttf'
  522.         LIBS="$LIBS $LIB_TTF"
  523.         AC_DEFINE(HasTTF)
  524.         AC_MSG_RESULT(yes)
  525.     fi
  526.     else
  527.     AC_MSG_RESULT(no)
  528.     fi
  529. fi
  530.  
  531. dnl Check for Display Postscript
  532. LIB_DPS=''
  533. if test "$with_dps" != 'no' && test "$with_x" != 'no'
  534. then
  535.     AC_CHECKING(for Display Postscript support ...)
  536.     failed=0;
  537.     passed=0;
  538.     O_CPPFLAGS=$CPPFLAGS
  539.     CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
  540.     AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  541.     AC_CHECK_HEADER(DPS/dpsXpreview.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  542.     AC_CHECK_LIB(dps,DPSInitialize,passed=`expr $passed + 1`,failed=`expr $failed + 1`,$TRAILING_LIBS)
  543.     AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $TRAILING_LIBS)
  544.     AC_MSG_CHECKING(if DPS package is complete)
  545.     if test $passed -gt 0
  546.     then
  547.     if test $failed -gt 0
  548.     then
  549.     AC_MSG_RESULT(no -- some components failed test)
  550.     CPPFLAGS=$O_CPPFLAGS
  551.     else
  552.     LIB_DPS='-ldpstk -ldps'
  553.     LIBS="$LIBS $LIB_DPS"
  554.     AC_DEFINE(HasDPS)
  555.     AC_MSG_RESULT(yes)
  556.     fi
  557.     else
  558.     AC_MSG_RESULT(no)
  559.     CPPFLAGS=$O_CPPFLAGS
  560.     fi
  561. fi
  562.  
  563. dnl Add trailing libs to end of library list
  564. if test "$TRAILING_LIBS"
  565. then
  566.     LIBS="$LIBS $TRAILING_LIBS"
  567. fi
  568.  
  569. dnl Look for PERL if PerlMagick requested
  570. dnl If name/path of desired PERL interpreter is specified, look for that one first
  571. if test "$with_perl" != 'no'
  572. then
  573.     if test "$with_perl" != 'yes'
  574.     then
  575.     AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
  576.     else
  577.     AC_PATH_PROGS(PERL,perl perl5,)dnl
  578.     fi
  579. fi
  580.  
  581. dnl Determine path to pick up ImageMagick library from for use with building PerlMagick
  582. MAGICKLIB="-L$PREFIX/lib -L/usr/local/lib -lMagick"
  583. if test $with_perl_static = 'yes'
  584. then
  585.   MAGICKLIB="-L${builddir}/magick -lMagick"
  586. fi
  587. AC_SUBST(MAGICKLIB)dnl
  588.  
  589. dnl Check for networking libraries and definitions needed by xtp
  590. XTP_LIBS=''
  591. XTP_DEFS=''
  592. XTP_FTP='ftp'
  593. if test "$with_socks" = 'yes'
  594. then
  595.   have_socks_header='no'
  596.   have_socks_lib='no'
  597.   AC_CHECK_HEADER(socks.h,have_socks_header='yes',have_socks_header='no')
  598.   AC_CHECK_LIB(socks5,SOCKSinit,have_socks_lib='yes',have_socks_lib='no',)
  599.   if test $have_socks_header = 'yes' && test $have_socks_lib = 'yes'
  600.   then
  601.     XTP_LIBS="$XTP_LIBS -lsocks5"
  602.     XTP_DEFS="$XTP_DEFS -DSOCKS"
  603.   fi
  604.   AC_PATH_PROGS(XTP_FTP,rftp ftp,,)
  605. fi
  606. XTP_DEFS="$XTP_DEFS -DXTP_FTP=\"\\\"$XTP_FTP\\\"\""
  607. AC_CHECK_LIB(nsl,gethostbyname,XTP_LIBS="$XTP_LIBS -lnsl",,)
  608. AC_CHECK_LIB(socket,socket,XTP_LIBS="$XTP_LIBS -lsocket",,)
  609. AC_SUBST(XTP_LIBS)dnl
  610. AC_SUBST(XTP_DEFS)dnl
  611.  
  612. AC_OUTPUT(Makefile magick/Makefile xtp/Makefile xlib/Makefile PerlMagick/Makefile.PL)
  613.