configure.ac 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. #
  2. # LittleCMS 2 configure script
  3. #
  4. AC_PREREQ(2.60)
  5. #
  6. # Set the package name and version
  7. #
  8. AC_INIT(lcms2,2.5)
  9. #
  10. # Libtool library revision control info
  11. # See the libtool documentation under the heading "Libtool's versioning
  12. # system" in order to understand the meaning of these fields
  13. #
  14. # Here are a set of rules to help you update your library version
  15. # information:
  16. #
  17. # 1. Start with version information of `0:0:0' for each libtool library.
  18. # 2. Update the version information only immediately before a public
  19. # release of your software. More frequent updates are unnecessary, and
  20. # only guarantee that the current interface number gets larger faster.
  21. # 3. If the library source code has changed at all since the last update,
  22. # then increment revision (`c:r:a' becomes `c:r+1:a').
  23. # 4. If any interfaces have been added, removed, or changed since the last
  24. # update, increment current, and set revision to 0.
  25. # 5. If any interfaces have been added since the last public release, then
  26. # increment age.
  27. # 6. If any interfaces have been removed since the last public release,
  28. # then set age to 0.
  29. #
  30. LIBRARY_CURRENT=2
  31. LIBRARY_REVISION=5
  32. LIBRARY_AGE=0
  33. AC_SUBST(LIBRARY_CURRENT)dnl
  34. AC_SUBST(LIBRARY_REVISION)dnl
  35. AC_SUBST(LIBRARY_AGE)dnl
  36. # Obtain system type by running config.guess
  37. AC_CANONICAL_HOST
  38. AM_INIT_AUTOMAKE([foreign 1.7.2 no-define dist-zip])
  39. # Disable JPEG.
  40. AC_ARG_WITH(jpeg,
  41. [ --without-jpeg disable JPEG support],
  42. [with_jpeg=$withval],
  43. [with_jpeg='yes'])
  44. # Disable TIFF.
  45. AC_ARG_WITH(tiff,
  46. [ --without-tiff disable TIFF support],
  47. [with_tiff=$withval],
  48. [with_tiff='yes'])
  49. # Disable ZLIB
  50. AC_ARG_WITH(zlib,
  51. [ --without-zlib disable ZLIB support],
  52. [with_zlib=$withval],
  53. [with_zlib='yes'])
  54. # Check for programs
  55. AC_PROG_CC_STDC
  56. AC_PROG_CPP
  57. AC_PROG_CXX
  58. #AM_PROG_LD
  59. #AC_SUBST(LD)
  60. #AC_PROG_INSTALL
  61. #AC_PROG_MAKE_SET
  62. #AC_PROG_LN_S
  63. #
  64. # Tests for Windows
  65. #
  66. AC_EXEEXT
  67. AC_OBJEXT
  68. # Configure libtool
  69. AC_ENABLE_SHARED
  70. AC_ENABLE_STATIC
  71. AC_LIBTOOL_WIN32_DLL
  72. AC_LIBTOOL_SETUP
  73. AC_PROG_LIBTOOL
  74. AC_SUBST(LIBTOOL_DEPS)
  75. # Add configure option --enable-maintainer-mode which enables dependency
  76. # checking and generation useful to package maintainers. This is made an
  77. # option to avoid confusing end users.
  78. AM_MAINTAINER_MODE
  79. # If the C compiler supports the keyword inline, do nothing. Otherwise
  80. # define inline to __inline__ or __inline if it accepts one of those,
  81. # otherwise define inline to be empty.
  82. AC_C_INLINE
  83. AC_SUBST(inline)
  84. # If words are stored with the most significant byte first (like
  85. # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
  86. AC_C_BIGENDIAN
  87. #
  88. # Find math library
  89. #
  90. LIB_MATH=''
  91. AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
  92. LIBS="$LIB_MATH $LIBS"
  93. AC_SUBST(LIB_MATH)
  94. #
  95. # Check for JPEG
  96. #
  97. have_jpeg='no'
  98. LIB_JPEG=''
  99. if test ! "$with_jpeg" = 'no'
  100. then
  101. AC_MSG_CHECKING(for JPEG support )
  102. AC_MSG_RESULT()
  103. failed=0;
  104. passed=0;
  105. AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  106. AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  107. AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  108. AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  109. AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  110. # Test for compatible JPEG library
  111. if test ! "$ac_cv_jpeg_version_ok" = 'yes' ; then
  112. AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
  113. [AC_TRY_COMPILE(
  114. #include <stdio.h>
  115. #include <stdlib.h>
  116. #include <jpeglib.h>
  117. ,
  118. changequote(<<, >>)dnl
  119. <<
  120. #if JPEG_LIB_VERSION < 62
  121. #error IJG JPEG library must be version 6b or newer!
  122. #endif
  123. return 0;
  124. >>,
  125. changequote([, ])dnl
  126. ac_cv_jpeg_version_ok='yes',
  127. ac_cv_jpeg_version_ok='no')])
  128. if test "$ac_cv_jpeg_version_ok" = 'yes' ; then
  129. AC_MSG_RESULT(yes)
  130. passed=`expr $passed + 1`
  131. else
  132. AC_MSG_RESULT(no)
  133. failed=`expr $failed + 1`
  134. fi
  135. fi
  136. AC_MSG_CHECKING(if JPEG package is complete)
  137. if test $passed -gt 0
  138. then
  139. if test $failed -gt 0
  140. then
  141. AC_MSG_RESULT(no -- some components failed test)
  142. have_jpeg='no (failed tests)'
  143. else
  144. LIB_JPEG='-ljpeg'
  145. LIBS="$LIB_JPEG $LIBS"
  146. AC_DEFINE(HasJPEG,1,Define if you have JPEG library)
  147. AC_MSG_RESULT(yes)
  148. have_jpeg='yes'
  149. fi
  150. else
  151. AC_MSG_RESULT(no)
  152. fi
  153. fi
  154. AM_CONDITIONAL(HasJPEG, test "$have_jpeg" = 'yes')
  155. AC_SUBST(LIB_JPEG)
  156. #
  157. # Check for ZLIB
  158. #
  159. have_zlib='no'
  160. dnl PNG requires zlib so enable zlib check if PNG is requested
  161. if test ! "$with_zlib" = 'no' || test ! "$with_png" = 'no'
  162. then
  163. LIB_ZLIB=''
  164. AC_MSG_CHECKING(for ZLIB support )
  165. AC_MSG_RESULT()
  166. failed=0;
  167. passed=0;
  168. AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  169. AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  170. AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  171. AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  172. AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  173. AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  174. AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  175. AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  176. AC_MSG_CHECKING(if ZLIB package is complete)
  177. if test $passed -gt 0
  178. then
  179. if test $failed -gt 0
  180. then
  181. AC_MSG_RESULT(no -- some components failed test)
  182. have_zlib='no (failed tests)'
  183. else
  184. LIB_ZLIB='-lz'
  185. LIBS="$LIB_ZLIB $LIBS"
  186. AC_DEFINE(HasZLIB,1,Define if you have zlib compression library)
  187. AC_MSG_RESULT(yes)
  188. have_zlib='yes'
  189. fi
  190. else
  191. AC_MSG_RESULT(no)
  192. fi
  193. fi
  194. AM_CONDITIONAL(HasZLIB, test "$have_zlib" = 'yes')
  195. AC_SUBST(LIB_ZLIB)
  196. #
  197. # Check for TIFF
  198. #
  199. have_tiff='no'
  200. LIB_TIFF=''
  201. if test ! "$with_tiff" = 'no'
  202. then
  203. AC_MSG_CHECKING(for TIFF support )
  204. AC_MSG_RESULT()
  205. failed=0;
  206. passed=0;
  207. AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  208. AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
  209. AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  210. AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  211. AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
  212. AC_MSG_CHECKING(if TIFF package is complete)
  213. if test $passed -gt 0
  214. then
  215. if test $failed -gt 0
  216. then
  217. AC_MSG_RESULT(no -- some components failed test)
  218. have_tiff='no (failed tests)'
  219. else
  220. LIB_TIFF='-ltiff'
  221. LIBS="$LIB_TIFF $LIBS"
  222. AC_DEFINE(HasTIFF,1,Define if you have TIFF library)
  223. AC_MSG_RESULT(yes)
  224. have_tiff='yes'
  225. AC_CHECK_HEADERS(tiffconf.h)
  226. fi
  227. else
  228. AC_MSG_RESULT(no)
  229. fi
  230. fi
  231. AM_CONDITIONAL(HasTIFF, test "$have_tiff" = 'yes')
  232. AC_SUBST(LIB_TIFF)
  233. # Libraries that the LCMS library depends on
  234. LCMS_LIB_DEPLIBS="$LIB_MATH"
  235. LCMS_LIB_DEPLIBS=`echo $LCMS_LIB_DEPLIBS | sed -e 's/ */ /g'`
  236. AC_SUBST(LCMS_LIB_DEPLIBS)
  237. # Libraries that the jpegicc program depends on
  238. JPEGICC_DEPLIBS="$LIB_JPEG $LIB_MATH"
  239. JPEGICC_DEPLIBS=`echo $JPEGICC_DEPLIBS | sed -e 's/ */ /g'`
  240. AC_SUBST(JPEGICC_DEPLIBS)
  241. # Libraries that the tifficc program depends on
  242. TIFFICC_DEPLIBS="$LIB_TIFF $LIB_JPEG $LIB_ZLIB $LIB_MATH"
  243. TIFFICC_DEPLIBS=`echo $TIFFICC_DEPLIBS | sed -e 's/ */ /g'`
  244. AC_SUBST(TIFFICC_DEPLIBS)
  245. LIBS=''
  246. #
  247. # Perform substitutions
  248. #
  249. AC_CONFIG_FILES([Makefile])
  250. AC_CONFIG_FILES([lcms2.pc])
  251. AC_CONFIG_FILES([include/Makefile])
  252. AC_CONFIG_FILES([src/Makefile])
  253. AC_CONFIG_FILES([utils/tificc/Makefile])
  254. AC_CONFIG_FILES([utils/transicc/Makefile])
  255. AC_CONFIG_FILES([utils/linkicc/Makefile])
  256. AC_CONFIG_FILES([utils/jpgicc/Makefile])
  257. AC_CONFIG_FILES([utils/psicc/Makefile])
  258. AC_CONFIG_FILES([testbed/Makefile])
  259. AC_OUTPUT