Warning, /graphics/glaxnimate/external/potrace/configure.ac is written in an unsupported language. File is not indexed.
0001 dnl Copyright (C) 2001-2019 Peter Selinger.
0002 dnl This file is part of Potrace. It is free software and it is covered
0003 dnl by the GNU General Public License. See the file COPYING for details.
0004
0005 dnl Process this file with autoconf to produce a configure script.
0006
0007 dnl ----------------------------------------------------------------------
0008 dnl Package info
0009 AC_INIT([potrace],[1.16],[selinger at users.sourceforge.net])
0010 AC_CONFIG_SRCDIR(src/trace.c)
0011 AM_INIT_AUTOMAKE
0012 AC_CONFIG_HEADER(config.h)
0013 AC_CONFIG_MACRO_DIR([m4])
0014
0015 DATE="September 2019"
0016
0017 dnl ----------------------------------------------------------------------
0018 dnl The names of the installed executables are defined here, but
0019 dnl should not normally be changed.
0020
0021 POTRACE=potrace
0022 AC_DEFINE_UNQUOTED(POTRACE,"$POTRACE",Name of the potrace binary)
0023
0024 MKBITMAP=mkbitmap
0025 AC_DEFINE_UNQUOTED(MKBITMAP,"$MKBITMAP",Name of the mkbitmap binary)
0026
0027 dnl ----------------------------------------------------------------------
0028 dnl figure out compiler options
0029
0030 dnl Check for compiler
0031 AC_PROG_CC([clang gcc cc c99 mgcc c89 pcc opencc sunc99 suncc])
0032 AC_USE_SYSTEM_EXTENSIONS
0033
0034 dnl Also add CADD to the CFLAGS at configure time or compile time
0035 AC_SUBST(CADD)
0036
0037 AC_MSG_CHECKING(what compiler options to use)
0038 AC_MSG_RESULT($CADD $CFLAGS)
0039
0040 dnl ----------------------------------------------------------------------
0041 dnl check if --with-libpotrace was given - this must be done
0042 dnl before LT_INIT so that we can avoid building shared libraries
0043 dnl when they are not going to be installed.
0044
0045 AC_ARG_WITH(libpotrace,
0046 AS_HELP_STRING([--with-libpotrace],[install Potrace library and headers [default=no]]))
0047
0048 if test "$with_libpotrace" != yes; then
0049 enable_shared=no
0050 fi
0051
0052 dnl ----------------------------------------------------------------------
0053 dnl Figure out how to build libraries
0054
0055 AC_LIBTOOL_WIN32_DLL
0056 LT_INIT
0057
0058 dnl ----------------------------------------------------------------------
0059 dnl Figure out whether to install libraries (default: no)
0060
0061 AC_MSG_CHECKING(whether to install the Potrace library)
0062 if test "$with_libpotrace" = yes; then
0063 AC_MSG_RESULT(yes)
0064 INSTLIBS="libpotrace.la"
0065 INSTHEADERS="potracelib.h"
0066 else
0067 AC_MSG_RESULT(no)
0068 fi
0069 AC_SUBST(INSTLIBS)
0070 AC_SUBST(INSTHEADERS)
0071
0072 dnl ----------------------------------------------------------------------
0073 dnl check for compiler bugs.
0074
0075 dnl The GCC compiler used to have a loop optimization bug that affected
0076 dnl potrace. This bug had been present since gcc-2.X and was still
0077 dnl pending (as of gcc version 3.3.1). Since the presence of this bug
0078 dnl cannot be reliably tested, and I am not sure in which version it was
0079 dnl fixed, we simply assume (conservatively) that all gcc compilers may
0080 dnl have this bug. In future: add a test that checks the compiler
0081 dnl version.
0082
0083 if test "$GCC" = "yes"; then
0084 AC_MSG_CHECKING([whether gcc has bug number 12243])
0085 AC_DEFINE(HAVE_GCC_LOOP_BUG,, [Does the C compiler have gcc bug 12243?])
0086 AC_MSG_RESULT(maybe)
0087 fi
0088
0089 dnl ----------------------------------------------------------------------
0090 dnl check for features
0091
0092 AC_MSG_CHECKING(whether to use zlib)
0093 AC_ARG_ENABLE(zlib,
0094 AS_HELP_STRING([--disable-zlib],[disable PostScript level 3 compression]))
0095 if test "$enable_zlib" != no; then
0096 AC_DEFINE(HAVE_ZLIB,, Do we have the zlib library?)
0097 AC_MSG_RESULT(yes)
0098 else
0099 AC_MSG_RESULT(no)
0100 fi
0101
0102 dnl Set optional defaults
0103 AC_MSG_CHECKING(whether to default to metric units)
0104 AC_ARG_ENABLE(metric,
0105 AS_HELP_STRING([--enable-metric],[use metric units (centimeters) as default]))
0106 if test "$enable_metric" = yes; then
0107 AC_DEFINE(USE_METRIC,, Use metric units by default?)
0108 AC_MSG_RESULT(yes)
0109 else
0110 AC_MSG_RESULT(no)
0111 fi
0112
0113 AC_MSG_CHECKING(whether to default to a4 paper size)
0114 AC_ARG_ENABLE(a4,
0115 AS_HELP_STRING([--enable-a4],[use a4 as the default papersize]))
0116 if test "$enable_a4" = yes; then
0117 AC_DEFINE(USE_A4,, Use a4 papersize by default?)
0118 AC_MSG_RESULT(yes)
0119 else
0120 AC_MSG_RESULT(no)
0121 fi
0122
0123 AC_MSG_CHECKING(whether to use the simplified progress bar)
0124 AC_ARG_ENABLE(dumb-tty,
0125 AS_HELP_STRING([--enable-dumb-tty], [use simplified ASCII-only progress bar]))
0126 dumb_tty="$enable_dumb_tty"
0127 if test -z "$dumb_tty"; then
0128 AC_CANONICAL_HOST
0129 if test "$host_os" = "mingw32"; then
0130 dumb_tty="yes"
0131 fi
0132 fi
0133 if test "$dumb_tty" = "yes"; then
0134 AC_DEFINE(DUMB_TTY,, Use the simplified progress bar?)
0135 AC_MSG_RESULT(yes)
0136 else
0137 AC_MSG_RESULT(no)
0138 fi
0139
0140 dnl ----------------------------------------------------------------------
0141 dnl Calculate value of "prefix", to aid guessing of include file and
0142 dnl library locations.
0143
0144 USERPREFIX="$prefix"
0145 if test "$USERPREFIX" = "NONE"; then
0146 USERPREFIX="$ac_default_prefix"
0147 fi
0148
0149 dnl ----------------------------------------------------------------------
0150 dnl Check for header files
0151
0152 if test "$enable_zlib" != no; then
0153 AC_CHECK_HEADER(zlib.h, true,
0154 [AC_MSG_WARN([zlib.h not found in standard location.
0155 Trying again with -I$USERPREFIX/include])
0156 CPPFLAGS="$CPPFLAGS -I$USERPREFIX/include"
0157 dnl need to unset cached value to repeat the test
0158 unset ac_cv_header_zlib_h
0159 AC_CHECK_HEADER(zlib.h, true,
0160 [AC_MSG_ERROR([cannot find zlib.h.
0161 Rerun ./configure with CPPFLAGS=-I<include dir> if you have the header
0162 file in a non-standard directory, or with --disable-zlib to disable
0163 support for PostScript level 3 compression.])
0164 ])
0165 ])
0166 fi
0167
0168 dnl ----------------------------------------------------------------------
0169 dnl Check for symbols
0170 AC_CHECK_DECL(M_PI, ,
0171 AC_DEFINE(M_PI, 3.14159265358979323846, [Define if missing from math.h]),
0172 [#include <math.h>])
0173
0174 dnl ----------------------------------------------------------------------
0175 dnl Check for libraries
0176
0177 if test "$enable_zlib" != no; then
0178 AC_CHECK_LIB(z, deflate, EXTRA_LIBS="$EXTRA_LIBS -lz",
0179 [AC_MSG_WARN([libz library not found in standard location.
0180 Trying again with -L$USERPREFIX/lib])
0181 LDFLAGS="$LDFLAGS -L$USERPREFIX/lib"
0182 dnl need to unset cached value to repeat the test
0183 unset ac_cv_lib_z_deflate
0184 AC_CHECK_LIB(z, deflate, EXTRA_LIBS="$EXTRA_LIBS -lz",
0185 [AC_MSG_ERROR([cannot find the libz library (-lz).
0186 Rerun ./configure with LDFLAGS=-L<lib dir> if you have the library in
0187 a non-standard directory, or with --disable-zlib to disable support
0188 for PostScript level 3 compression.])
0189 ])
0190 ])
0191 fi
0192
0193 AC_CHECK_LIB(m, floor, true, AC_MSG_ERROR([cannot find the m library (-lm)]))
0194
0195 dnl ----------------------------------------------------------------------
0196 dnl Check for types
0197
0198 AC_TYPE_UINT64_T
0199
0200 dnl ----------------------------------------------------------------------
0201 dnl Check for library functions.
0202
0203 dnl Check for getopt_long
0204 AC_CHECK_FUNC(getopt_long, have_getopt_long=yes, have_getopt_long=no)
0205 if test "$have_getopt_long" = "yes"; then
0206 dnl Check whether getopt_long reorders its arguments
0207 AC_MSG_CHECKING([whether getopt_long reorders its arguments])
0208 AC_RUN_IFELSE([AC_LANG_PROGRAM(
0209 [[ #include <getopt.h>
0210 static struct option longopts[] = {
0211 {"help", 0, 0, 'h'},
0212 {0, 0, 0, 0}
0213 };
0214 ]],
0215 [[ int ac = 3;
0216 char *av[] = { "main", "file", "-h" };
0217 return 'h' == getopt_long(ac, av, "h", longopts, (int *)0) ? 0 : 1;
0218 ]])],
0219 [AC_MSG_RESULT(yes)],
0220 [AC_MSG_RESULT(no)
0221 have_getopt_long=no],
0222 [AC_MSG_RESULT(maybe (cross-compiling))
0223 have_getopt_long=no])
0224 fi
0225
0226 AC_ARG_WITH(included-getopt,
0227 AS_HELP_STRING([--with-included-getopt],[avoid using the system-wide getopt library]))
0228
0229 AC_MSG_CHECKING(whether to use included getopt)
0230 if test "$have_getopt_long" != "yes" || test "$with_included_getopt" = yes; then
0231 EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o"
0232 EXTRA_INCLUDES="$EXTRA_INCLUDES -I\$(srcdir)/include/getopt"
0233 AC_MSG_RESULT(yes)
0234 else
0235 AC_MSG_RESULT(no)
0236 fi
0237
0238 AC_CHECK_FUNC(strcasecmp, ,
0239 [AC_CHECK_FUNC(stricmp,
0240 [AC_DEFINE_UNQUOTED(strcasecmp, stricmp, [Replacement function for strcasecmp])],
0241 [AC_MSG_ERROR([cannot find a replacement for strcasecmp])]
0242 )]
0243 )
0244 AC_CHECK_FUNC(strncasecmp, ,
0245 [AC_CHECK_FUNC(strnicmp,
0246 [AC_DEFINE_UNQUOTED(strncasecmp, strnicmp, [Replacement function for strncasecmp])],
0247 [AC_MSG_ERROR([cannot find a replacement for strncasecmp])]
0248 )]
0249 )
0250
0251 dnl ----------------------------------------------------------------------
0252 dnl Check whether we have i386 features
0253 AC_MSG_CHECKING([for Intel 386])
0254 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int x;
0255 asm("bsf %1,%0\njnz 0f\nmovl $32,%0\n0:":"=r"(x):"r"(x));
0256 return x; /* need this so that -O2 does not optimize the asm away */
0257 ]])],[AC_MSG_RESULT(yes)
0258 AC_DEFINE(HAVE_I386,, Can we use Intel 386 optimizations?)
0259 ],[AC_MSG_RESULT(no)])
0260
0261
0262 dnl ----------------------------------------------------------------------
0263 dnl Check whether compiler supports inlining
0264
0265 AC_C_INLINE
0266
0267 dnl ----------------------------------------------------------------------
0268 dnl Set up substitutions of non-standard configuration parameters
0269 AC_SUBST(DATE)
0270 AC_SUBST(POTRACE)
0271 AC_SUBST(MKBITMAP)
0272 AC_SUBST(EXTRA_OBJS)
0273 AC_SUBST(EXTRA_INCLUDES)
0274 AC_SUBST(EXTRA_LIBS)
0275 AC_SUBST(AM_CPPFLAGS)
0276 AC_SUBST(POTRACELIB_VERSION)
0277
0278 dnl ----------------------------------------------------------------------
0279 AC_CONFIG_FILES([Makefile
0280 src/Makefile
0281 doc/Makefile
0282 check/Makefile
0283 doc/potrace.1
0284 doc/mkbitmap.1
0285 ])
0286 AC_OUTPUT