1AC_PREREQ(2.54) 2 3AC_INIT(swfmill, m4_esyscmd([ git describe | tr -d '\n' ])) 4AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests]) 5 6AC_CONFIG_MACRO_DIR([autoconfig/m4]) 7 8LT_INIT 9 10 11# Checks for programs. 12AC_PROG_CXX 13AC_PROG_SED 14AC_PROG_AWK 15AC_PROG_CC 16AC_PROG_CPP 17AC_PROG_INSTALL 18AC_PROG_LN_S 19AC_PROG_MAKE_SET 20AC_PROG_MKDIR_P 21PKG_PROG_PKG_CONFIG 22AM_PROG_CC_C_O 23AC_PATH_PROG([XSLTPROC], [xsltproc]) 24AC_PATH_PROG([MTASC], [mtasc]) 25 26if test "x${XSLTPROC}" == "x"; then 27 AC_MSG_ERROR([Please install xsltproc before trying to build swfmill]) 28fi 29 30 31# Checks for C++11 support. 32AX_CXX_COMPILE_STDCXX(11, noext) 33 34 35# Enable most reasonable warnings. 36AX_CFLAGS_WARN_ALL 37AX_CXXFLAGS_WARN_ALL 38 39 40# Checks for header files. 41AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) 42 43 44# Checks for typedefs, structures, and compiler characteristics. 45AC_HEADER_STDBOOL 46AC_TYPE_INT32_T 47AC_TYPE_INT64_T 48AC_TYPE_SIZE_T 49AC_TYPE_UINT16_T 50AC_TYPE_UINT32_T 51AC_TYPE_UINT64_T 52AC_TYPE_UINT8_T 53 54 55# Set flags if we're on Windows or Mac OS X, since we have some specific 56# hard-coded behaviour for those platforms. 57echo $host_os | $GREP mingw > /dev/null && IS_WINDOWS=yes 58echo $host_os | $GREP darwin > /dev/null && IS_OSX=yes 59AM_CONDITIONAL(IS_WINDOWS, [ test $IS_WINDOWS ]) 60AM_CONDITIONAL(IS_OSX, [ test $IS_OSX ]) 61 62 63# Checks for libraries 64 65AM_ICONV 66AC_SUBST(ICONV_CONST) 67 68if test $IS_OSX; then 69 test $XML_CFLAGS || XML_CFLAGS=-I/usr/include/libxml2 70 test $XML_LIBS || XML_LIBS=-lxml2 71else 72 PKG_CHECK_MODULES(XML, libxml-2.0) 73fi 74AC_SUBST(XML_CFLAGS) 75AC_SUBST(XML_LIBS) 76 77if test $IS_OSX; then 78 test $XSLT_CFLAGS || XSLT_CFLAGS=-I/usr/include/libxml2 79 test $XSLT_LIBS || XSLT_LIBS="-lxslt -lxml2" 80else 81 PKG_CHECK_MODULES(XSLT, libxslt) 82fi 83AC_SUBST(XSLT_CFLAGS) 84AC_SUBST(XSLT_LIBS) 85 86if test $IS_OSX; then 87 test $EXSLT_CFLAGS || EXSLT_CFLAGS=-I/usr/include/libxml2 88 test $EXSLT_LIBS || EXSLT_LIBS="-lexslt -lxslt -lxml2" 89else 90 PKG_CHECK_MODULES(EXSLT, libexslt) 91fi 92AC_SUBST(EXSLT_CFLAGS) 93AC_SUBST(EXSLT_LIBS) 94 95PKG_CHECK_MODULES(FREETYPE, freetype2) 96AC_SUBST(FREETYPE_CFLAGS) 97AC_SUBST(FREETYPE_LIBS) 98 99PKG_CHECK_MODULES(PNG, libpng) 100AC_SUBST(PNG_CFLAGS) 101AC_SUBST(PNG_LIBS) 102 103PKG_CHECK_MODULES(ZLIB, zlib) 104AC_SUBST(ZLIB_CFLAGS) 105AC_SUBST(ZLIB_LIBS) 106 107 108# Checks for library functions. 109AC_FUNC_STRTOD 110AC_CHECK_FUNCS([floor memset pow sqrt strcasecmp strdup strrchr]) 111 112 113AC_OUTPUT([ 114 Makefile 115 src/Makefile 116 test/Makefile 117 test/compile-and-verify/Makefile 118 test/transform-and-verify/Makefile 119 test/xml-swf-round-trip/Makefile 120 test/old/Makefile 121 ]) 122