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