| 1 | dnl Process this file with autoconf to produce a configure script.
|
|---|
| 2 |
|
|---|
| 3 | AC_INIT(libmng.h)
|
|---|
| 4 |
|
|---|
| 5 | dnl this call will define PACKAGE and VERSION
|
|---|
| 6 | dnl please use this as the primary reference for the version number
|
|---|
| 7 | AM_INIT_AUTOMAKE(libmng, 1.0.4)
|
|---|
| 8 |
|
|---|
| 9 | dnl pass the version string on the the makefiles
|
|---|
| 10 | AC_SUBST(PACKAGE)
|
|---|
| 11 | AC_SUBST(VERSION)
|
|---|
| 12 |
|
|---|
| 13 | dnl Checks for programs.
|
|---|
| 14 | AC_PROG_CC
|
|---|
| 15 | AC_ISC_POSIX
|
|---|
| 16 | AM_C_PROTOTYPES
|
|---|
| 17 | if test "x$U" != "x"; then
|
|---|
| 18 | AC_MSG_ERROR(Compiler not ANSI compliant)
|
|---|
| 19 | fi
|
|---|
| 20 | AM_PROG_LIBTOOL
|
|---|
| 21 | AC_PROG_INSTALL
|
|---|
| 22 |
|
|---|
| 23 | dnl support for files >2GB
|
|---|
| 24 | AC_SYS_LARGEFILE
|
|---|
| 25 |
|
|---|
| 26 | dnl Check for required header files
|
|---|
| 27 | AC_HEADER_STDC
|
|---|
| 28 |
|
|---|
| 29 | dnl Checks for typedefs, structures, and compiler characteristics.
|
|---|
| 30 | AC_C_CONST
|
|---|
| 31 |
|
|---|
| 32 | dnl need pow and fabs
|
|---|
| 33 | AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm"))
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | dnl what functionality we want to add (read, write, display).
|
|---|
| 37 | dnl all on by default. see libmng_conf.h for full descriptions
|
|---|
| 38 |
|
|---|
| 39 | dnl we only support the full mng spec for not (no LC or VLC)
|
|---|
| 40 | AC_DEFINE(MNG_SUPPORT_FULL)
|
|---|
| 41 |
|
|---|
| 42 | dnl remove support in library to read images?
|
|---|
| 43 | AC_ARG_ENABLE(read,
|
|---|
| 44 | [ --disable-read remove read support from library])
|
|---|
| 45 | if test "x$enable_read" != "xno"; then
|
|---|
| 46 | AC_DEFINE(MNG_SUPPORT_READ)
|
|---|
| 47 | fi
|
|---|
| 48 |
|
|---|
| 49 | dnl remove support in library to write images?
|
|---|
| 50 | AC_ARG_ENABLE(write,
|
|---|
| 51 | [ --disable-write remove write support from library])
|
|---|
| 52 | if test "x$enable_write" != "xno"; then
|
|---|
| 53 | AC_DEFINE(MNG_SUPPORT_WRITE)
|
|---|
| 54 | fi
|
|---|
| 55 |
|
|---|
| 56 | dnl remove support in library to display images?
|
|---|
| 57 | AC_ARG_ENABLE(display,
|
|---|
| 58 | [ --disable-display remove display support from library])
|
|---|
| 59 | if test "x$enable_display" != "xno"; then
|
|---|
| 60 | AC_DEFINE(MNG_SUPPORT_DISPLAY)
|
|---|
| 61 | fi
|
|---|
| 62 |
|
|---|
| 63 | dnl remove support in library to access chunks?
|
|---|
| 64 | AC_ARG_ENABLE(chunks,
|
|---|
| 65 | [ --disable-chunks remove support for chunk access])
|
|---|
| 66 | if test "x$enable_chunks" != "xno"; then
|
|---|
| 67 | AC_DEFINE(MNG_ACCESS_CHUNKS)
|
|---|
| 68 | fi
|
|---|
| 69 |
|
|---|
| 70 | dnl disable support for accessing chunks that have been previously read?
|
|---|
| 71 | AC_ARG_ENABLE(storechunks,
|
|---|
| 72 | [ --disable-storechunks remove support for access of previous chunks],[
|
|---|
| 73 | if test "x$enable_storechunks" != "xno"; then
|
|---|
| 74 | AC_DEFINE(MNG_STORE_CHUNKS)
|
|---|
| 75 | fi
|
|---|
| 76 | ])
|
|---|
| 77 |
|
|---|
| 78 | dnl enable support for debug tracing callbacks and messages?
|
|---|
| 79 | AC_ARG_ENABLE(trace,
|
|---|
| 80 | [ --enable-trace include support for debug tracing callbacks],[
|
|---|
| 81 | if test "x$enable_trace" = "xyes"; then
|
|---|
| 82 | AC_DEFINE(MNG_SUPPORT_TRACE)
|
|---|
| 83 | AC_DEFINE(MNG_TRACE_TELLTALE)
|
|---|
| 84 | fi
|
|---|
| 85 | ])
|
|---|
| 86 |
|
|---|
| 87 | dnl verbose error text
|
|---|
| 88 | dnl this should always be on
|
|---|
| 89 | AC_DEFINE(MNG_ERROR_TELLTALE)
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 | dnl libz is required.
|
|---|
| 93 | AC_ARG_WITH(zlib,
|
|---|
| 94 | [ --with-zlib[=DIR] use zlib include/library files in DIR],[
|
|---|
| 95 | if test -d "$withval"; then
|
|---|
| 96 | CPPFLAGS="$CPPFLAGS -I$withval/include"
|
|---|
| 97 | LDFLAGS="$LDFLAGS -L$withval/lib"
|
|---|
| 98 | fi
|
|---|
| 99 | ])
|
|---|
| 100 | AC_CHECK_HEADER(zlib.h,
|
|---|
| 101 | AC_CHECK_LIB(z, gzread, , AC_MSG_ERROR(zlib library not found)),
|
|---|
| 102 | AC_MSG_ERROR(zlib header not found)
|
|---|
| 103 | )
|
|---|
| 104 |
|
|---|
| 105 | dnl check for jpeg library
|
|---|
| 106 | AC_ARG_WITH(jpeg,
|
|---|
| 107 | [ --with-jpeg[=DIR] use jpeg include/library files in DIR],
|
|---|
| 108 | [with_jpeg=$withval],[with_jpeg=_auto])
|
|---|
| 109 |
|
|---|
| 110 | if test "x$with_jpeg" != "xno" -a "x$with_jpeg" != "xyes" -a \
|
|---|
| 111 | "x$with_jpeg" != "x_auto"; then
|
|---|
| 112 | # Save in case test with directory specified fails
|
|---|
| 113 | _cppflags=${CPPFLAGS}
|
|---|
| 114 | _ldflags=${LDFLAGS}
|
|---|
| 115 | _restore=1
|
|---|
| 116 |
|
|---|
| 117 | CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
|---|
| 118 | LDFLAGS="${LDFLAGS} -L$withval/lib"
|
|---|
| 119 | else
|
|---|
| 120 | _restore=0
|
|---|
| 121 | fi
|
|---|
| 122 |
|
|---|
| 123 | if test "x$with_jpeg" != "xno"; then
|
|---|
| 124 | AC_CHECK_HEADER(jpeglib.h,
|
|---|
| 125 | AC_CHECK_LIB(jpeg, jpeg_read_header, [
|
|---|
| 126 | LIBS="$LIBS -ljpeg"
|
|---|
| 127 | AC_DEFINE(HAVE_LIBJPEG)
|
|---|
| 128 | _restore=0
|
|---|
| 129 | ],
|
|---|
| 130 | AC_MSG_WARN(jpeg library not found)),
|
|---|
| 131 | AC_MSG_WARN(jpeg header not found)
|
|---|
| 132 | )
|
|---|
| 133 | fi
|
|---|
| 134 |
|
|---|
| 135 | test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
|
|---|
| 136 |
|
|---|
| 137 | dnl check for lcms library
|
|---|
| 138 | AC_ARG_WITH(lcms,
|
|---|
| 139 | [ --with-lcms[=DIR] use lcms include/library files in DIR],
|
|---|
| 140 | [with_lcms=$withval],[with_lcms=_auto])
|
|---|
| 141 |
|
|---|
| 142 | if test "x$with_lcms" != "xno" -a "x$with_lcms" != "xyes" -a \
|
|---|
| 143 | "x$with_lcms" != "x_auto"; then
|
|---|
| 144 | # Save in case test with directory specified fails
|
|---|
| 145 | _cppflags=$CPPFLAGS
|
|---|
| 146 | _ldflags=$LDFLAGS
|
|---|
| 147 | _restore=1
|
|---|
| 148 |
|
|---|
| 149 | CPPFLAGS="$CPPFLAGS -I$withval/include"
|
|---|
| 150 | LDFLAGS="$LDFLAGS -L$withval/lib"
|
|---|
| 151 | else
|
|---|
| 152 | _restore=0
|
|---|
| 153 | fi
|
|---|
| 154 |
|
|---|
| 155 | if test "x$with_lcms" != "xno"; then
|
|---|
| 156 | AC_CHECK_HEADER(lcms.h, [
|
|---|
| 157 | have_lcms=yes
|
|---|
| 158 | AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
|
|---|
| 159 | LIBS="$LIBS -llcms"
|
|---|
| 160 | AC_DEFINE(HAVE_LIBLCMS)
|
|---|
| 161 | dnl for now this implies MNG_INCLUDE_LCMS in the headers:
|
|---|
| 162 | AC_DEFINE(MNG_FULL_CMS)
|
|---|
| 163 | _restore=0
|
|---|
| 164 | have_lcms=yes
|
|---|
| 165 | ],[
|
|---|
| 166 | have_lcms=no
|
|---|
| 167 | ])
|
|---|
| 168 | ])
|
|---|
| 169 | dnl give feedback only if the user asked specifically for lcms
|
|---|
| 170 | if test "x$with_lcms" != "x_auto" -a "x$have_lcms" != "xyes"; then
|
|---|
| 171 | AC_MSG_WARN([lcms not found... disabling CMS support])
|
|---|
| 172 | fi
|
|---|
| 173 | fi
|
|---|
| 174 |
|
|---|
| 175 | test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
|
|---|
| 176 |
|
|---|
| 177 | AC_OUTPUT(Makefile)
|
|---|