"Fossies" - the Fresh Open Source Software Archive

Member "libgeotiff-1.6.0/configure.ac" (22 Apr 2020, 12679 Bytes) of package /linux/privat/libgeotiff-1.6.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.5.1_vs_1.6.0.

    1 
    2 
    3 m4_define([VERSION_MAJOR], [1])
    4 m4_define([VERSION_MINOR], [6])
    5 m4_define([VERSION_POINT], [0])
    6 m4_define([GEOTIFF_VERSION],
    7           [VERSION_MAJOR.VERSION_MINOR.VERSION_POINT])
    8 
    9 m4_include([m4/ax_prog_doxygen.m4])
   10 
   11 AC_PREREQ([2.59])
   12 AC_INIT([libgeotiff], [GEOTIFF_VERSION], [warmerdam@pobox.com])
   13 AC_CANONICAL_BUILD
   14 
   15 AC_CONFIG_MACRO_DIR([m4])
   16 
   17 RELEASE_VERSION=GEOTIFF_VERSION
   18 AC_SUBST([RELEASE_VERSION])
   19 AC_CONFIG_HEADER(geo_config.h)
   20 
   21 dnl #########################################################################
   22 dnl Checks for programs.
   23 dnl #########################################################################
   24 
   25 AM_INIT_AUTOMAKE
   26 AM_MAINTAINER_MODE
   27 AC_PROG_CC
   28 AC_PROG_INSTALL
   29 AC_PROG_LN_S
   30 AC_PROG_MAKE_SET
   31 AC_PROG_LIBTOOL
   32 
   33 dnl #########################################################################
   34 dnl Default compilation flags
   35 dnl #########################################################################
   36 
   37 m4_define([debug_default],[no])
   38 
   39 CFLAGS="$CFLAGS"
   40 
   41 dnl We want to honor the users wishes with regard to linking.
   42 LIBS="$LDFLAGS $LIBS"
   43 
   44 dnl #########################################################################
   45 dnl Checks for header files.
   46 dnl #########################################################################
   47 
   48 AC_CHECK_HEADERS([string.h],[HAVE_STRING_H=1], [AC_MSG_ERROR([cannot find string.h, bailing out])])
   49 AC_CHECK_HEADERS([stdio.h],, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
   50 AC_CHECK_HEADERS([stdlib.h],, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
   51 
   52 AC_CHECK_HEADERS([locale.h])
   53 
   54 LIBS="${LIBS}"
   55 
   56 dnl #########################################################################
   57 dnl Definiion of custom Autoconf macros
   58 dnl #########################################################################
   59 
   60 AC_DEFUN([LOC_MSG],[
   61 echo "$1"
   62 ])
   63 
   64 dnl #########################################################################
   65 dnl Build mode configuration (debug/optimized)
   66 dnl #########################################################################
   67 
   68 AC_ARG_ENABLE([debug],
   69     AC_HELP_STRING([--enable-debug=ARG], [Enable debug compilation mode @<:@yes|no@:>@, default=debug_default]),,)
   70 
   71 AC_MSG_CHECKING([for debug enabled])
   72 
   73 if test "x$enable_debug" = "xyes"; then
   74     CFLAGS="$CFLAGS -g -DDEBUG -Wall"
   75     AC_MSG_RESULT(yes)
   76 else
   77     CFLAGS="$CFLAGS -O3 -DNDEBUG"
   78     AC_MSG_RESULT(no)
   79 fi
   80 
   81 
   82 dnl Checks for libraries.
   83 AC_CHECK_LIB(m,exp,,,)
   84 
   85 
   86 dnl #########################################################################
   87 dnl Add option to include libz in library list for use of libtiff.
   88 dnl #########################################################################
   89 
   90 AC_ARG_WITH([zip],
   91     AC_HELP_STRING([--with-zip=ARG], [zlib library to use (yes or path)]),,)
   92 
   93 AC_ARG_WITH([zlib],
   94     AC_HELP_STRING([--with-zlib=ARG], [ alias for --with-zip]),,)
   95 
   96 AC_ARG_WITH([libz],
   97     AC_HELP_STRING([--with-libz=ARG], [ alias for --with-zip]),,)
   98 
   99 HAVE_ZIP="no"
  100 ZIP_CONFIG="no"
  101 
  102 # Implement aliasing...
  103 
  104 if test "$with_zlib" != "" ; then
  105   with_zip=$with_zlib
  106 fi
  107 if test "$with_libz" != "" ; then
  108   with_zip=$with_libz
  109 fi
  110 
  111 
  112 if test "$with_zip" != "" -a "x$with_zip" != "xno" ; then
  113     AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR([cannot find zlib.h, bailing out])])
  114     AC_SEARCH_LIBS([inflateInit_], [z],
  115                  [ZIP_CONFIG=yes], [ZIP_CONFIG=no],
  116                  [-L$with_zip/lib -lm])
  117 
  118 else
  119     AC_MSG_CHECKING([for zlib])
  120     AC_MSG_RESULT([no])
  121 fi
  122 
  123 if test "${ZIP_CONFIG}" != "no" ; then
  124 
  125     if test "${ZIP_CONFIG}" = "yes" ; then
  126         if test -d ${with_zip}/include ; then
  127             ZIP_INC="-I$with_zip/include"
  128             AC_MSG_RESULT([using zlib from $with_zip/include]) 
  129             HAVE_ZLIB="yes"
  130             ZIP_CONFIG="yes"
  131             LIBS="-L${with_zip}/lib -lz $LIBS"
  132         fi
  133     fi
  134 
  135 fi
  136 
  137 AC_SUBST([ZIP_INC])
  138 AC_SUBST([ZIP_PREFIX])
  139 AM_CONDITIONAL([ZIP_IS_CONFIG], [test ! x$ZIP_CONFIG = xno])
  140 
  141 
  142 
  143 dnl #########################################################################
  144 dnl Add option to include libjpeg in library list for use of libtiff.
  145 dnl #########################################################################
  146 
  147 AC_ARG_WITH([jpeg],
  148     AC_HELP_STRING([--with-jpeg=ARG], [jpeg library to use (yes or path)]),,)
  149 
  150 HAVE_JPEG="no"
  151 JPEG_CONFIG="no"
  152 
  153 if test "$with_jpeg" = "no" -o "$with_jpeg" = "" ; then
  154     AC_MSG_CHECKING([for jpeg])
  155     AC_MSG_RESULT([no])
  156 else
  157     AC_SEARCH_LIBS([jinit_compress_master], [jpeg],
  158                  [JPEG_CONFIG=yes], [JPEG_CONFIG=no],
  159                  [-L$with_jpeg/lib -lm])
  160 fi
  161 
  162 if test "${JPEG_CONFIG}" != "no" ; then
  163 
  164     if test "${JPEG_CONFIG}" = "yes" ; then
  165         if test -d ${with_jpeg}/include ; then
  166             JPEG_INC="-I$with_jpeg/include"
  167             LIBS="-L$with_jpeg/lib $LIBS"
  168             AC_MSG_RESULT([using jpeg from $with_jpeg/include]) 
  169         fi
  170     fi
  171     HAVE_JPEG="yes"
  172     JPEG_CONFIG="yes"
  173 fi
  174 
  175 AC_SUBST([JPEG_INC])
  176 AC_SUBST([JPEG_PREFIX])
  177 AM_CONDITIONAL([JPEG_IS_CONFIG], [test ! x$JPEG_CONFIG = xno])
  178 
  179 
  180 dnl #########################################################################
  181 dnl Special logic to try and find a user specified libtiff tree.  If not
  182 dnl available check if the system directories have the library, _and_ the
  183 dnl required private include files.  Normally these private include files
  184 dnl (tiffiop.h) are not installed with the public interface.
  185 dnl #########################################################################
  186 
  187 TIFF_CONFIG="no"
  188 
  189 AC_ARG_WITH(libtiff, [  --with-libtiff=dir      Use libtiff in directory dir],,)
  190 
  191 if test "$with_libtiff" != "" ; then
  192   if test -f $with_libtiff/include/tiffio.h -a -d $with_libtiff/lib ; then
  193     LIBS="-L$with_libtiff/lib -ltiff $LIBS"
  194     TIFF_INC=-I$with_libtiff/include
  195   else
  196     LIBS="-L$with_libtiff -ltiff $LIBS"
  197     TIFF_INC=-I$with_libtiff
  198   fi
  199   LIBS_SAVED="$LIBS"
  200   AC_CHECK_LIB(tiff,TIFFOpen,[TIFF_CONFIG=yes],
  201                AC_MSG_ERROR([failed to link with -ltiff to find TIFFOpen]),-lm)
  202   AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,[TIFF_CONFIG=yes],
  203                AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of
  204 libgeotiff. Please upgrade or use an older version of libgeotiff.]),-lm)
  205   LIBS="$LIBS_SAVED"
  206 else
  207   PKG_CHECK_MODULES(LIBTIFF, libtiff-4,
  208                     [TIFF_INC="$LIBTIFF_CFLAGS" LIBS="$LIBS $LIBTIFF_LIBS" TIFF_CONFIG="yes"],
  209                     [AC_CHECK_LIB(tiff,TIFFOpen,[TIFF_CONFIG=yes],
  210                                   AC_MSG_ERROR([You will need to substantially rewrite libxtiff to
  211 build libgeotiff without libtiff]),-lm)
  212                     LIBS_SAVED="$LIBS"
  213                     AC_CHECK_LIB(tiff,TIFFMergeFieldInfo,[TIFF_CONFIG=yes],
  214                                  AC_MSG_ERROR([Libtiff 3.6.0 Beta or later required for this version of
  215 libgeotiff. Please upgrade libtiff or use an older version of libgeotiff.]),-lm)
  216                     LIBS="$LIBS -ltiff"
  217                     TIFF_INC=
  218                     TIFF_CONFIG="yes"])
  219 fi
  220 
  221 
  222 AC_SUBST([TIFF_INC])
  223 AC_SUBST([TIFF_PREFIX])
  224 AM_CONDITIONAL([TIFF_IS_CONFIG], [test ! x$TIFF_CONFIG = xno])
  225 
  226 dnl ---------------------------------------------------------------------------
  227 dnl PROJ.6 related stuff
  228 dnl ---------------------------------------------------------------------------
  229 
  230 AC_MSG_CHECKING([for PROJ >= 6 library])
  231 
  232 AC_ARG_WITH(proj,[  --with-proj=ARG Compile with PROJ.x (ARG=yes or path)],,)
  233 
  234 PROJ_INCLUDE=""
  235 if test "x$with_proj" = "xno" ; then
  236 
  237   AC_MSG_ERROR([PROJ 6 is a required dependency.])
  238 
  239 else
  240 
  241   if test "x$with_proj" = "xyes" -o "x$with_proj" = "x"; then
  242     PKG_CHECK_MODULES(PROJ, proj, [LIBS="$LIBS $PROJ_LIBS" PROJ_FOUND=yes], [PROJ_FOUND=no])
  243     if test "$PROJ_FOUND" = "no"; then
  244         ORIG_LIBS="$LIBS"
  245         LIBS="-lproj $ORIG_LIBS"
  246         AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  247     fi
  248     if test "$PROJ_FOUND" = "no"; then
  249         AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  250         if test "$PROJ_FOUND" = "yes"; then
  251             PROJ_INCLUDE="-DPROJ_RENAME_SYMBOLS"
  252         fi
  253     fi
  254     if test "$PROJ_FOUND" = "no"; then
  255         LIBS="-linternalproj $ORIG_LIBS"
  256         AC_CHECK_LIB(internalproj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  257         if test "$PROJ_FOUND" = "yes"; then
  258             PROJ_INCLUDE="-DPROJ_RENAME_SYMBOLS"
  259         fi
  260     fi
  261     if test "$PROJ_FOUND" = "no"; then
  262         AC_MSG_ERROR([PROJ 6 symbols not found])
  263     fi
  264     AC_CHECK_HEADERS([proj.h])
  265     if test "$ac_cv_header_proj_h" = "yes" ; then
  266         AC_MSG_NOTICE([proj.h found])
  267     else
  268         AC_MSG_ERROR([proj.h not found])
  269     fi
  270   else
  271 
  272     ORIG_LIBS="$LIBS"
  273     LIBS="-L$with_proj/lib -lproj $ORIG_LIBS"
  274     AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  275     if test "$PROJ_FOUND" = "no"; then
  276         LIBS="-L$with_proj/lib -lproj -lsqlite3 $ORIG_LIBS"
  277         unset ac_cv_lib_proj_proj_create_from_wkt
  278         AC_CHECK_LIB(proj,proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  279     fi
  280     if test "$PROJ_FOUND" = "no"; then
  281         LIBS="-L$with_proj/lib -lproj $ORIG_LIBS"
  282         AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  283         if test "$PROJ_FOUND" = "no"; then
  284             LIBS="-L$with_proj/lib -lproj -lsqlite3 $ORIG_LIBS"
  285             unset ac_cv_lib_proj_internal_proj_create_from_wkt
  286             AC_CHECK_LIB(proj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  287         fi
  288         if test "$PROJ_FOUND" = "yes"; then
  289             PROJ_INCLUDE="-DPROJ_RENAME_SYMBOLS"
  290         fi
  291     fi
  292     if test "$PROJ_FOUND" = "no"; then
  293         LIBS="-L$with_proj/lib -linternalproj $ORIG_LIBS"
  294         AC_CHECK_LIB(internalproj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  295         if test "$PROJ_FOUND" = "no"; then
  296             LIBS="-L$with_proj/lib -linternalproj -lsqlite3 $ORIG_LIBS"
  297             unset ac_cv_lib_internal_proj_internal_proj_create_from_wkt
  298             AC_CHECK_LIB(internalproj,internal_proj_create_from_wkt,PROJ_FOUND=yes,PROJ_FOUND=no,)
  299         fi
  300         if test "$PROJ_FOUND" = "yes"; then
  301             PROJ_INCLUDE="-DPROJ_RENAME_SYMBOLS"
  302         fi
  303     fi
  304     if test "$PROJ_FOUND" = "no"; then
  305         AC_MSG_ERROR([PROJ 6 symbols not found])
  306     fi
  307     if test -r "$with_proj/include/proj.h" ; then
  308         PROJ_INCLUDE="$PROJ_INCLUDE -I$with_proj/include"
  309         AC_MSG_NOTICE([proj.h found])
  310     else
  311         AC_MSG_ERROR([proj.h not found])
  312     fi
  313   fi
  314 fi
  315 
  316 AC_SUBST(PROJ_INCLUDE)
  317 
  318 
  319 AC_ARG_ENABLE(towgs84, [  --disable-towgs84       Disable WGS84 parameters for binary compatibility with pre-1.4.1], AC_DEFINE([GEO_NORMALIZE_DISABLE_TOWGS84], [], [Disable WGS84 parameters]))
  320 
  321 AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries])
  322 case "${host}" in
  323    *-*-cygwin* | *-*-mingw*|*-*-aix*)
  324     ## Add in the -no-undefined flag to LDFLAGS for libtool.
  325     AC_MSG_RESULT([yes])
  326     NOUNDEFINED=" -no-undefined"
  327     ;;
  328   *)
  329     ## Don't add in anything.
  330     AC_MSG_RESULT([no])
  331     ;;
  332 esac
  333 AC_SUBST([NOUNDEFINED])
  334 
  335 dnl #########################################################################
  336 dnl Doxygen settings
  337 dnl #########################################################################
  338 
  339 DX_HTML_FEATURE(ON)
  340 DX_CHM_FEATURE(OFF)
  341 DX_CHI_FEATURE(OFF)
  342 DX_MAN_FEATURE(ON)
  343 DX_RTF_FEATURE(OFF)
  344 DX_XML_FEATURE(OFF)
  345 DX_PDF_FEATURE(OFF)
  346 DX_PS_FEATURE(OFF)
  347 
  348 DX_INIT_DOXYGEN($PACKAGE_NAME, docs/Doxyfile, docs/output)
  349 
  350 
  351 
  352 dnl #########################################################################
  353 dnl Generate makefiles
  354 dnl #########################################################################
  355 
  356 AC_CONFIG_FILES([
  357     Makefile
  358     libxtiff/Makefile
  359     bin/Makefile
  360     man/Makefile
  361     man/man1/Makefile
  362     cmake/Makefile
  363     test/Makefile
  364 ])
  365 
  366 AC_OUTPUT
  367 
  368 dnl #########################################################################
  369 dnl Print configuration summary
  370 dnl #########################################################################
  371 
  372 LOC_MSG()
  373 LOC_MSG([libgeotiff configuration summary:])
  374 LOC_MSG()
  375 LOC_MSG([  Version..................: ${RELEASE_VERSION}])
  376 LOC_MSG([  Installation directory...: ${prefix}])
  377 LOC_MSG([  C compiler...............: ${CC} ${CFLAGS}])
  378 
  379 LOC_MSG([  Debugging support........: ${enable_debug}])
  380 LOC_MSG()
  381 
  382 LOC_MSG([  zlib support......: ${ZIP_CONFIG}])
  383 LOC_MSG([  jpeg support......: ${JPEG_CONFIG}])
  384 LOC_MSG([  TIFF support......: ${TIFF_CONFIG}])
  385 LOC_MSG([    -INCLUDE .......: ${TIFF_INC}])
  386 LOC_MSG([    -PREFIX ........: ${TIFF_PREFIX}])
  387 LOC_MSG([  PROJ support......: yes])
  388 LOC_MSG([    -INCLUDE .......: ${PROJ_INCLUDE}])
  389 
  390 LOC_MSG([  LIBS.....................: ${LIBS}])
  391 LOC_MSG()
  392 LOC_MSG([  libgeotiff - http://trac.osgeo.org/geotiff])
  393 LOC_MSG()
  394 
  395 dnl EOF