"Fossies" - the Fresh Open Source Software Archive

Member "pstoedit-3.78/configure.ac" (13 Nov 2021, 17341 Bytes) of package /linux/misc/pstoedit-3.78.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": 3.77_vs_3.78.

    1 dnl Configure a Makefile for pstoedit
    2 dnl initial version by Scott Pakin <scott+ps2ed_AT_pakin.org>
    3 
    4 dnl Adapting automake
    5 dnl By Masatake YAMATO<jet _AT_ gyve.org>
    6 
    7 dnl ------------------------------------------------------------------------
    8 dnl NOTE: I have tested this only on Linux/g++, Solaris/g++, and Solaris/CC,
    9 dnl       as those are all the systems I have access to.
   10 dnl ------------------------------------------------------------------------
   11 
   12 dnl Initialize Autoconf. 
   13 AC_INIT([pstoedit],[3.78],[wglunz35_AT_pstoedit.net],[],[http://www.pstoedit.com])
   14 AC_LANG(C++)
   15 dnl AC_CONFIG_AUX_DIR(config)
   16 AM_INIT_AUTOMAKE([foreign subdir-objects info-in-builddir -Wall])
   17 dnl AM_MAINTAINER_MODE
   18 AC_CONFIG_SRCDIR([src/pstoedit.h])
   19 AC_CONFIG_MACRO_DIR([m4])
   20 
   21 dnl We need only C++ and no other language
   22 dnl seems to be broken : AC_LIBTOOL_TAGS([CXX])
   23 
   24 dnl Check for various programs the Makefile needs.
   25 AC_PROG_CC
   26 AC_PROG_CXX
   27 
   28 AC_MSG_CHECKING(for g++ std)
   29 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ constexpr int ce = 10; int * p = nullptr; ]])],
   30                [AC_MSG_RESULT(you seem to have suitable version of g++)],
   31                [AC_MSG_ERROR([your version of g++ seems to be too old.])])
   32 
   33 AC_PROG_AWK
   34 AC_PROG_YACC
   35 AM_PROG_AR
   36 AC_PROG_INSTALL
   37 dnl there is no need to build the static libs if shared libs are available
   38 LT_INIT([disable-static win32-dll dlopen])
   39 
   40 AC_PROG_MAKE_SET
   41 
   42 AC_CONFIG_HEADER(src/pstoedit_config.h)
   43 
   44 dnl Check file command
   45 dnl FILECMD=""
   46 dnl AC_PATH_PROG(FILECMD,file)
   47 dnl if test -z "${FILECMD}"; then
   48 dnl    AC_MSG_ERROR([** Cannot find file command which is needed for libtool. Please install. ])
   49 dnl    exit 1
   50 dnl fi
   51 
   52 dnl Check Ghostscript
   53 AC_CHECK_PROGS([GS],[gs],[false])
   54 AS_IF([test x"${GS}" = xfalse],[AC_MSG_ERROR([** Cannot find ghostscript.  If it is already installed, Check PATH.])])
   55 
   56 PKG_PROG_PKG_CONFIG
   57 
   58 AC_C_BIGENDIAN([CPPFLAGS="$CPPFLAGS -D_BIG_ENDIAN"], [CPPFLAGS="$CPPFLAGS -D_LITTLE_ENDIAN"])
   59 
   60 dnl check for directory handling
   61 AC_HEADER_DIRENT
   62 
   63 dnl check for the more secure versions of some functions
   64 AC_CHECK_FUNCS([snprintf])
   65 
   66 
   67 dnl 
   68 dnl Look for various optional libraries.
   69 dnl
   70 dnl TODO: These should be replaced by ltdl.
   71 HAVE_LD=no
   72 LIBLD_LDFLAGS=
   73 AC_CHECK_LIB(dl,main,[LIBLD_LDFLAGS=-ldl])
   74 if test -n "${LIBLD_LDFLAGS}"; then
   75    HAVE_LD=yes
   76 fi
   77 AC_SUBST(LIBLD_LDFLAGS)
   78 
   79 AC_CHECK_LIB([gd],[gdImageCreateFromPng])
   80 
   81 dnl some optional packages - default is to check automatically
   82 dnl but the check can be disabled using --without-PACKAGE
   83 dnl legal PACKAGE names are:
   84 dnl emf, magick, libplot, swf
   85 
   86 # When doc regeneration is enabled, these are needed:
   87 AC_CHECK_PROGS([PDFLATEX],[pdflatex],[false])
   88 AC_CHECK_PROGS([LATEX2MAN],[latex2man],[false])
   89 # Note that this controls *generation* of documentation.  It is
   90 # installed in any case, and included in the "make dist" distribution
   91 # tarball.  As a consequence, at "make dist" time these files must
   92 # exist, usually because they have just been generated by "make".  To
   93 # generate them without compiling the pstoedit executable, you can use
   94 # an existing executable, e.g., "make dist P=/usr/bin/pstoedit"
   95 AC_MSG_CHECKING([enable_docs])
   96 # Check the option
   97 AC_ARG_ENABLE([docs],
   98        [AS_HELP_STRING([--enable-docs],[rebuild LaTeX-format documentation (default=yes iff pdflatex and latex2man are found)])],,
   99        [enable_docs=yes])
  100 # Disable the option if the necessary executables seem unavailable:
  101 AS_IF([test "x${PDFLATEX}" = xfalse],[enable_docs=no],
  102       [test "x${LATEX2MAN}" = xfalse],[enable_docs=no])
  103 AC_MSG_RESULT([$enable_docs])
  104 # Tell automake whether to try to regenerate docs
  105 AM_CONDITIONAL([DOCS], [test x${enable_docs} = xyes])
  106 
  107 # These are used in doc/Makefile.am, but not by default.
  108 AC_CHECK_PROGS([LATEX],[latex],[false])
  109 AC_CHECK_PROGS([DVIPS],[dvips],[false])
  110 AC_CHECK_PROGS([GROFF],[groff],[false])
  111 AC_CHECK_PROGS([RMAN],[rman],[false])
  112 
  113 
  114 AC_ARG_WITH([emf],
  115 [AS_HELP_STRING([--with-emf],[enable/disable emf interface (default: enabled - use --without-emf to disable)])],
  116 [with_emf=$withval],[with_emf=yes])
  117 AC_ARG_WITH([magick],
  118 [AS_HELP_STRING([--with-magick],[enable/disable magick++ interface (default: enabled - use --without-magick to disable)])],
  119 [with_magick=$withval],[with_magick=yes])
  120 AC_ARG_WITH([libplot],
  121 [AS_HELP_STRING([--with-libplot],[enable/disable libplot interface (default: enabled - use --without-libplot to disable)])],
  122 [with_libplot=$withval],[with_libplot=yes])
  123 AC_ARG_WITH([swf],
  124 [AS_HELP_STRING([--with-swf],[enable/disable swf interface (default: enabled - use --without-swf to disable)])],
  125 [with_swf=$withval],[with_swf=yes])
  126 AC_ARG_WITH([pptx],
  127 [AS_HELP_STRING([--with-pptx],[enable/disable pptx interface (default: enabled - use --without-pptX to disable)])],
  128 [with_pptx=$withval],[with_pptx=yes])
  129 
  130 
  131 OLD_CPPFLAGS=${CPPFLAGS}
  132 CPPFLAGS="$CPPFLAGS -DX_DISPLAY_MISSING"
  133 
  134 if test -f src/drvwwmf.cpp ; then
  135 	HAVE_PLUGINSRC=true;
  136 	AM_CONDITIONAL(HAVE_PLUGINSRC, true)
  137 else
  138 	HAVE_PLUGINSRC=false;
  139 	AM_CONDITIONAL(HAVE_PLUGINSRC, false)
  140 fi
  141 
  142 if test "${with_libplot}" = "yes" ; then
  143 dnl
  144 dnl Driver::libplotter
  145 dnl
  146 HAVE_LIBPLOTTER=no
  147 LIBPLOTTER_LDFLAGS=
  148 LIBPLOTTER_CFLAGS=
  149 dnl AC_CHECK_LIB(plotter,main,
  150 dnl	[LIBPLOTTER_LDFLAGS=-lplotter],,-lstdc++)
  151 AC_CHECK_LIB(plotter,main,
  152 	[LIBPLOTTER_LDFLAGS=-lplotter])
  153 AC_CHECK_HEADER(plotter.h,
  154         [LIBPLOTTER_CFLAGS="-DHAVE_LIBPLOTTER"])
  155 
  156 if test -n "${LIBPLOTTER_LDFLAGS}" && test -n "${LIBPLOTTER_CFLAGS}"; then
  157    HAVE_LIBPLOTTER=yes
  158    AC_MSG_CHECKING(for version of "lib plot" )   
  159    dnl See if we have a 2.3 or newer lib Plot version
  160    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  161 		#include <plotter.h>
  162 	     	typedef int Point; 
  163 		]], [[ ]])],[AC_MSG_RESULT(you seem to have a compatible version )],[LIBPLOTTER_CFLAGS="$LIBPLOTTER_CFLAGS -DOLD_LIBPLOTTER";   
  164 		    AC_MSG_RESULT(you seem to have an older version - need at least version 2.3)])
  165 else
  166    LIBPLOTTER_LDFLAGS=
  167    LIBPLOTTER_CFLAGS=
  168    AC_MSG_WARN([** libplotter driver is disabled.])
  169 fi
  170 AC_SUBST(LIBPLOTTER_LDFLAGS)
  171 AC_SUBST(LIBPLOTTER_CFLAGS)
  172 AM_CONDITIONAL(HAVE_LIBPLOTTER, test "$HAVE_LIBPLOTTER" = yes)
  173 else
  174    AC_MSG_WARN([libplot support disabled by configure argument .])
  175    AM_CONDITIONAL(HAVE_LIBPLOTTER, false )
  176 fi
  177 
  178 CPPFLAGS=${OLD_CPPFLAGS}
  179 
  180 
  181 
  182 
  183 
  184 AC_MSG_CHECKING(for mkstemp)
  185 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
  186 		 char buffer[] = "aaaXXXXXX";
  187 	 	 int i = mkstemp(buffer); ]], [[ ]])],[HAVE_MKSTEMP=yes;
  188                 MKSTEMP_CFLAGS="-DHAVE_MKSTEMP"; 
  189                 AC_MSG_RESULT(you seem to have mkstemp )],[AC_MSG_RESULT(you do not have mkstemp - so will try using tempnam instead)])
  190 
  191 AC_SUBST(MKSTEMP_CFLAGS)
  192 
  193 
  194 
  195 if test "${with_swf}" = "yes" ; then
  196 dnl
  197 dnl Driver::libming
  198 dnl
  199 HAVE_LIBMING=no
  200 LIBMING_LDFLAGS=
  201 LIBMING_CFLAGS=
  202 
  203 dnl If mingpp.h is found, use it.
  204 AC_CHECK_LIB(ming,main,
  205 	[LIBMING_LDFLAGS=-lming],,-lm)
  206 AC_CHECK_HEADER(mingpp.h,
  207 	[LIBMING_CFLAGS="-DHAVE_LIBMING"])
  208 if test -n "${LIBMING_LDFLAGS}" && test -n "${LIBMING_CFLAGS}"; then
  209    HAVE_LIBMING=yes
  210    dnl legacy for old versions of ming. AC_CHECK_HEADER(util/png2dbl.c,[LIBMING_CFLAGS="$LIBMING_CFLAGS -DHAVE_LIBMINGUTIL"])
  211    AC_MSG_RESULT([** libming driver is enabled.])
  212 else
  213    LIBMING_LDFLAGS=
  214    LIBMING_CFLAGS=
  215    AC_MSG_WARN([** libming driver is disabled.])
  216 fi
  217 AC_SUBST(LIBMING_LDFLAGS)
  218 AC_SUBST(LIBMING_CFLAGS)
  219 AM_CONDITIONAL(HAVE_LIBMING, test "$HAVE_LIBMING" = yes)
  220 else
  221    AC_MSG_WARN([swf support disabled by configure argument .])
  222    AM_CONDITIONAL(HAVE_LIBMING, false )
  223 fi
  224 
  225 if test "${with_pptx}" = "yes" ; then
  226 dnl
  227 dnl Driver::libpptx
  228 dnl
  229 HAVE_LIBZIP=no
  230 LIBZIP_LDFLAGS=
  231 LIBZIP_CFLAGS=
  232 
  233 dnl If zip.h is found, use it.
  234 AC_ARG_WITH([libzip-lib],
  235 [AS_HELP_STRING([--with-libzip-lib=DIR],[look for libzip library in dir (e.g. /usr/local/lib)])],
  236 [libzip_lib_dir=$withval],[libzip_lib_dir=])
  237 
  238 AC_ARG_WITH([libzip-include],
  239 [AS_HELP_STRING([--with-libzip-include=DIR],[look for libzip header in dir (e.g. /usr/local/include/libzip)])],
  240 [libzip_include_dir=$withval],[libzip_include_dir=])
  241 
  242 OLD_LIBS=${LIBS}
  243 if test -n "${libzip_lib_dir}"; then
  244    LIBS="-L${libzip_lib_dir} ${LIBS}"
  245 fi
  246 AC_CHECK_LIB(zip,zip_add,
  247 	[LIBZIP_LDFLAGS="-lzip -lz"],,-lz)
  248 LIBS=${OLD_LIBS}
  249 
  250 OLD_CPPFLAGS=${CPPFLAGS}
  251 if test -n "${libzip_include_dir}"; then
  252    CPPFLAGS="-I${libzip_include_dir} ${CPPFLAGS}"
  253 fi
  254 AC_CHECK_HEADER(zip.h,
  255 	[LIBZIP_CFLAGS="-DHAVE_LIBZIP"])
  256 CPPFLAGS=${OLD_CPPFLAGS}
  257 
  258 if test -n "${LIBZIP_LDFLAGS}" && test -n "${LIBZIP_CFLAGS}"; then
  259    HAVE_LIBZIP=yes
  260    if test -n "${libzip_include_dir}"; then
  261      LIBZIP_CFLAGS="-I${libzip_include_dir} ${LIBZIP_CFLAGS}"
  262    fi
  263    if test -n "${libzip_lib_dir}"; then
  264      LIBZIP_LDFLAGS="-L${libzip_lib_dir} ${LIBZIP_LDFLAGS}"
  265    fi   
  266    AC_MSG_RESULT([** libpptx driver is enabled.])
  267 else
  268    LIBZIP_LDFLAGS=
  269    LIBZIP_CFLAGS=
  270    AC_MSG_WARN([** libpptx driver is disabled.])
  271 fi
  272 AC_SUBST(LIBZIP_LDFLAGS)
  273 AC_SUBST(LIBZIP_CFLAGS)
  274 AM_CONDITIONAL(HAVE_LIBZIP, test "$HAVE_LIBZIP" = yes)
  275 else
  276    AC_MSG_WARN([pptx support disabled by configure argument .])
  277    AM_CONDITIONAL(HAVE_LIBZIP, false )
  278 fi
  279 
  280 
  281 
  282 
  283 
  284 
  285 if test "${with_magick}" = "yes" ; then
  286 dnl
  287 dnl Driver::libmagick++
  288 dnl If Magick++.h is found, use it.
  289 dnl
  290 HAVE_LIBMAGICK=no
  291 LIBMAGICK_CFLAGS=
  292 LIBMAGICK_LDFLAGS=
  293 PSTOEDIT_GCC_OK=yes
  294 if test "x${CC}" = xgcc; then 
  295    AC_MSG_CHECKING(for gcc version)
  296    GCC_VERSION=`${CC} --version`
  297    changequote(,)dnl
  298    GCC_MAJOR_VERSION=`echo $GCC_VERSION \
  299    | sed -e "s/^\([0-9]*\)\.[0-9]*/\1/"`
  300    GCC_MINOR_VERSION=`echo $GCC_VERSION \
  301    | sed -e "s/^[0-9]*\.\([0-9]*\)/\1/"`
  302    changequote([,])dnl
  303    AC_MSG_RESULT([${GCC_MAJOR_VERSION}.${GCC_MINOR_VERSION}])
  304    if test "x${GCC_MAJOR_VERSION}" = x2; then
  305       PSTOEDIT_GCC_OK=no
  306    fi
  307 fi
  308 
  309 if test "x${PSTOEDIT_GCC_OK}" = xno ; then
  310       AC_MSG_WARN([** gcc version is too old to use Magick++ in pstoedit]) 
  311       AC_MSG_WARN([** gcc version >= 3 is required.]) 
  312       AC_MSG_WARN([** libMagick++ driver is disabled.])
  313 else
  314       if test -n "$PKG_CONFIG"; then
  315         AC_MSG_CHECKING(ImageMagick flags through pkg-config)
  316 	PKG_CHECK_MODULES(LIBMAGICK, ImageMagick++, 
  317 		HAVE_LIBMAGICK=yes 
  318 		LIBMAGICK_CFLAGS="-DHAVE_MAGIC $LIBMAGICK_CFLAGS" 
  319 		LIBMAGICK_LDFLAGS="$LIBMAGICK_LIBS" , 
  320 		echo "trying other methods for finding ImageMagick")
  321       else
  322 	AC_PATH_PROG(MAGICK_CONFIG, Magick++-config)
  323 	if test -n "${MAGICK_CONFIG}"; then
  324 	   AC_MSG_CHECKING(for version of "GraphicsMagick++" )   
  325 	   dnl See if we have a 1.0.6 or newer version
  326 	   OLD_CPPFLAGS=${CPPFLAGS}
  327 	   CPPFLAGS="$CPPFLAGS `Magick++-config --cppflags`"
  328 	   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Magick++.h>
  329 	            #if MagickLibVersion >= 0x000008
  330 	 	    int correct;
  331 	  	    #else
  332 	  	    old version of GraphicsMagick;
  333 	  	    #endif ]], [[ ]])],[MAGICKCORRECTVERSION="YES";AC_MSG_RESULT(you seem to have a compatible version )],[AC_MSG_RESULT(you seem to have an older version - need at least version 1.0.6)])
  334 	   CPPFLAGS=$OLD_CPPFLAGS
  335 	   if test -n "${MAGICKCORRECTVERSION}"; then
  336 	      HAVE_LIBMAGICK=yes
  337 	      LIBMAGICK_CFLAGS="-DHAVE_MAGIC `Magick++-config --cppflags`"
  338 	      LIBMAGICK_LDFLAGS="`Magick++-config --libs` `Magick++-config --ldflags`"
  339 	   else
  340 	      AC_MSG_WARN([** libMagick++ driver is disabled because of too old version of GraphicsMagick (need at least 1.0.6).])
  341 	   fi
  342 	else
  343 	      AC_MSG_WARN([** libMagick++ driver is disabled.])
  344 	fi
  345       fi
  346 fi
  347 AC_SUBST(LIBMAGICK_CFLAGS)
  348 AC_SUBST(LIBMAGICK_LDFLAGS)
  349 AM_CONDITIONAL(HAVE_LIBMAGICK, test "$HAVE_LIBMAGICK" = yes)
  350 else
  351    AC_MSG_WARN([magick support disabled by configure argument .])
  352    AM_CONDITIONAL(HAVE_LIBMAGICK, false )
  353 fi
  354 
  355 
  356 
  357 
  358 
  359 if test "${with_emf}" = "yes" ; then
  360 dnl
  361 dnl Driver::libEMF
  362 dnl Check for EMF support library
  363 dnl
  364 HAVE_LIBEMF=no
  365 LIBEMF_CFLAGS=
  366 LIBEMF_LDFLAGS=
  367 
  368 OLD_CPPFLAGS=
  369 OLD_LIBS=
  370 
  371 
  372 AC_ARG_WITH([libemf-src],
  373 [AS_HELP_STRING([--with-libemf-src=DIR],[look for libEMF src in dir (e.g. /usr/local/lib)])],
  374 [libemf_lib_src=$withval],[libemf_lib_src=])
  375 
  376 if test -n "${libemf_lib_src}"; then
  377 dnl use libemf source directly
  378 HAVE_LIBEMF=yes
  379 AM_CONDITIONAL(USE_EMFBYSOURCE, true )
  380 AM_CONDITIONAL(HAVE_LIBEMF, true )
  381 LIBEMF_CFLAGS="-DHAVE_LIBEMF -I${libemf_lib_src}/include -I${libemf_lib_src}/libemf -I${libemf_lib_src}/config "
  382 AC_SUBST(LIBEMF_CFLAGS)
  383 
  384 else
  385 AM_CONDITIONAL(USE_EMFBYSOURCE, false )
  386 
  387 AC_ARG_WITH([libemf-lib],
  388 [AS_HELP_STRING([--with-libemf-lib=DIR],[look for libEMF library in dir (e.g. /usr/local/lib)])],
  389 [libemf_lib_dir=$withval],[libemf_lib_dir=])
  390 
  391 AC_ARG_WITH([libemf-include],
  392 [AS_HELP_STRING([--with-libemf-include=DIR],[look for libEMF header in dir (e.g. /usr/local/include/libEMF)])],
  393 [libemf_include_dir=$withval],[libemf_include_dir=])
  394 
  395 OLD_LIBS=${LIBS}
  396 if test -n "${libemf_lib_dir}"; then
  397    LIBS="-L${libemf_lib_dir} ${LIBS}"
  398 fi
  399 AC_CHECK_LIB(EMF,main, [LIBEMF_LDFLAGS="-lEMF -lm"],,-lm)
  400 if test -n "${LIBEMF_LDFLAGS}"; then
  401   if test -n "${libemf_lib_dir}"; then
  402      LIBEMF_LDFLAGS="-L${libemf_lib_dir} ${LIBEMF_LDFLAGS}"
  403   fi   
  404 else
  405       AC_MSG_WARN([** Cannot find libEMF. libEMF supports are disabled.])
  406 fi
  407 LIBS=${OLD_LIBS}
  408 
  409 OLD_CPPFLAGS=${CPPFLAGS}
  410 if test -n "${libemf_include_dir}"; then
  411    CPPFLAGS="-I${libemf_include_dir} ${CPPFLAGS}"
  412 fi
  413 AC_CHECK_HEADER(emf.h,
  414 		[LIBEMF_CFLAGS="-DHAVE_LIBEMF -DOLDLIBEMF"])
  415 AC_CHECK_HEADER(libemf/emf.h,
  416 		[LIBEMF_CFLAGS="-DHAVE_LIBEMF"])
  417 AC_CHECK_HEADER(libEMF/emf.h,
  418 		[LIBEMF_CFLAGS="-DHAVE_LIBEMF"])
  419 if test -n "${LIBEMF_CFLAGS}"; then
  420    if test -n "${libemf_include_dir}"; then
  421 	 LIBEMF_CFLAGS="-I${libemf_include_dir} ${LIBEMF_CFLAGS}"
  422    fi
  423 else
  424    AC_MSG_WARN([** Cannot find emf.h. libEMF supports are disabled.])
  425 fi
  426 CPPFLAGS=${OLD_CPPFLAGS}
  427 
  428 if test -n "${LIBEMF_LDFLAGS}" && test -n "${LIBEMF_CFLAGS}"; then
  429    HAVE_LIBEMF=yes
  430 else
  431    LIBEMF_CFLAGS=
  432    LIBEMF_LDFLAGS=
  433 fi
  434 
  435 AC_SUBST(LIBEMF_LDFLAGS)
  436 AC_SUBST(LIBEMF_CFLAGS)
  437 AM_CONDITIONAL(HAVE_LIBEMF, test "$HAVE_LIBEMF" = yes)
  438 fi
  439 else
  440    AC_MSG_WARN([EMF support disabled by configure argument .])
  441    AM_CONDITIONAL(USE_EMFBYSOURCE, false )
  442    AM_CONDITIONAL(HAVE_LIBEMF, false )
  443 fi
  444 
  445 
  446 
  447 
  448 
  449 dnl
  450 dnl PNG and Zlib
  451 dnl
  452 dnl OBS: HAVE_LIBPNG=no
  453 dnl OBS: LIBPNG_CFLAGS=
  454 dnl OBS: LIBPNG_LDFLAGS=
  455 dnl OBS: AC_MSG_CHECKING(See if we have libpng and zlib)
  456 dnl OBS: AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <png.h>
  457 dnl OBS: 	 	 int i = PNG_TRANSFORM_IDENTITY; ]], [[ ]])],[dnl OBS:                HAVE_LIBPNG=yes;
  458 dnl OBS:                 LIBPNG_CFLAGS="-DHAVE_LIBPNG"; 
  459 dnl OBS:                 LIBPNG_LDFLAGS="-lpng -lz ";
  460 dnl OBS:                 AC_MSG_RESULT(you seem to have compatible version of libpng)],[dnl OBS:                AC_MSG_RESULT(you either have no libpng or an old version - 1.0.8 should be ok.)])
  461 dnl OBS: AC_SUBST(LIBPNG_LDFLAGS)
  462 dnl OBS: AC_SUBST(LIBPNG_CFLAGS)
  463 dnl OBS: AM_CONDITIONAL(HAVE_LIBPNG, test "$HAVE_LIBPNG" = yes)
  464 
  465 dnl
  466 dnl C++ compiler related checking
  467 dnl
  468 
  469 dnl See if we need to define a "bool" type.
  470 AC_MSG_CHECKING(for built-in "bool" datatype)
  471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[bool testing_bool; testing_bool=true;]])],[CXXFLAGS="$CXXFLAGS -DINTERNALBOOL"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
  472 
  473 dnl Add extra, platform-specific, C++ compiler options.
  474 AC_MSG_CHECKING(C++ compiler model)
  475 if test "$GXX" = yes; then
  476   if test "$host_os" = riscos; then
  477     AC_MSG_RESULT([GNU on RiscOS])
  478     SPECIAL_CXXFLAGS="-Wall -Dunix -Ilibgpp: -Ilibstdc: -Ilibio:"
  479     LDLIBS="-rescan libgpp:o.libg++ libstdc:o.libstdc++ libio:o.libiostrea gcc:o.libgcc Unix:o.UnixLib"
  480     LINK=link
  481     AC_SUBST(LINK)
  482     AC_SUBST(LDLIBS)
  483   else
  484     AC_MSG_RESULT([GNU])
  485 #   need to disable long long warning here because of ImageMagick using it
  486     SPECIAL_CXXFLAGS="-Wall -Wextra -Wuninitialized -Wswitch-default -Wunused -Wshadow -Wwrite-strings -Wcast-qual -Wpointer-arith -Wno-long-long"
  487   fi
  488 elif test `echo "$CXX" | egrep -c 'xlC$'` -eq 1; then
  489   AC_MSG_RESULT([AIX xlC])
  490   SPECIAL_CXXFLAGS="-D__unix__ -g -+ -I/usr/lpp/xlC/src/nihC/aixinclude"
  491 elif test `echo "$CXX" | egrep -c 'cxx$'` -eq 1; then
  492   AC_MSG_RESULT([OSF/1 cxx])
  493   SPECIAL_CXXFLAGS="-w -define_templates"
  494 elif test `echo "$CXX" | egrep -c 'CC$'` -eq 1; then
  495   if test "$host_os" = irix5.3; then
  496     AC_MSG_RESULT([Irix 5.3])
  497     SPECIAL_CXXFLAGS="-O2 -mips2 -Olimit 2400"
  498   elif test "$host_os" = irix6.2; then
  499     AC_MSG_RESULT([Irix 6.2])
  500     SPECIAL_CXXFLAGS="-mips3 -n32 -O2 -OPT:fold_arith_limit=2500"
  501   elif test "$host_vendor" = sun; then
  502     AC_MSG_RESULT([Sun])
  503     SPECIAL_CXXFLAGS="-w"
  504   fi
  505 else
  506   AC_MSG_RESULT(unknown)
  507 fi
  508 
  509 AC_ARG_ENABLE([wrapper],
  510               [AS_HELP_STRING([--enable-wrapper=PROGRAM],
  511                           [Wrap (i.e. prefix) compiler invocations with PROGRAM (e.g. \"insure\" or \"purify\")])],
  512               [CXX="$enableval $CXX"])
  513 AC_SUBST(SPECIAL_CXXFLAGS)
  514 
  515 dnl
  516 dnl Standard C++ library and C++ Runtime
  517 dnl
  518 CXX_RUNTIME_LIB=
  519 CXX_STD_LIB=
  520 if test x"$GXX" = xyes; then
  521    AC_CHECK_LIB(g++,main,CXX_RUNTIME_LIB=-lg++)
  522    AC_CHECK_LIB(stdc++,main,CXX_STD_LIB=-lstdc++,,${CXX_RUNTIME_LIB})
  523 fi
  524 AC_SUBST(CXX_STD_LIB)
  525 AC_SUBST(CXX_RUNTIME_LIB)
  526 
  527 dnl Write the resulting Makefile.
  528 AC_CONFIG_FILES([Makefile 
  529 src/Makefile 
  530 config/Makefile config/pstoedit.pc
  531 doc/Makefile
  532 doc/version.tex
  533 examples/Makefile 
  534 contrib/Makefile contrib/cairo/Makefile
  535 contrib/java/Makefile contrib/java/java1/Makefile contrib/java/java2/Makefile 
  536 misc/Makefile misc/swffonts/Makefile 
  537 os2/Makefile 
  538 msdev/Makefile othersrc/Makefile othersrc/gsdllinc/Makefile])
  539 
  540 AC_OUTPUT
  541