awtk/3rd/picasso/configure.in
2018-04-26 11:31:20 +08:00

191 lines
5.1 KiB
Plaintext

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(picasso, 2.3, onecoolx@gmail.com)
VERSION_MAJOR=2
VERSION_MINOR=3
VERSION_MICRO=0
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_MICRO)
AC_SUBST(VERSION)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, $VERSION)
AC_CONFIG_HEADER(pconfig.h)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PREFIX_DEFAULT(/usr/local)
# User define macro.
build_freetype2="yes"
build_fontconfig="yes"
build_fastcopy="yes"
build_sysmalloc="no"
build_lowmem="no"
format_rgba="yes"
format_argb="yes"
format_abgr="yes"
format_bgra="yes"
format_rgb="yes"
format_bgr="yes"
format_rgb565="yes"
format_rgb555="yes"
# Check user define macro.
AC_ARG_ENABLE(freetype2,
[ --enable-freetype2 Build FreeType2 support <default=yes>],
build_freetype2=$enableval)
AC_ARG_ENABLE(fontconfig,
[ --enable-fontconfig Build FontConfig support <default=yes>],
build_fontconfig=$enableval)
AC_ARG_ENABLE(lowmem,
[ --enable-lowmem Build Low Memory used support <default=no>],
build_lowmem=$enableval)
AC_ARG_ENABLE(fastcopy,
[ --enable-fastcopy Build Fast Memory Copy used support <default=yes>],
build_fastcopy=$enableval)
AC_ARG_ENABLE(sysmalloc,
[ --enable-sysmalloc Build System Memory Allocator
(new/delete/malloc/free/realloc/calloc) used support <default=no>],
build_sysmalloc=$enableval)
AC_ARG_ENABLE(rgba,
[ --enable-rgba Pixel format RGBA support <default=yes>],
format_rgba=$enableval)
AC_ARG_ENABLE(argb,
[ --enable-argb Pixel format ARGB support <default=yes>],
format_argb=$enableval)
AC_ARG_ENABLE(abgr,
[ --enable-abgr Pixel format ABGR support <default=yes>],
format_abgr=$enableval)
AC_ARG_ENABLE(bgra,
[ --enable-bgra Pixel format BGRA support <default=yes>],
format_bgra=$enableval)
AC_ARG_ENABLE(rgb,
[ --enable-rgb Pixel format RGB support <default=yes>],
format_rgb=$enableval)
AC_ARG_ENABLE(bgr,
[ --enable-bgr Pixel format BGR support <default=yes>],
format_bgr=$enableval)
AC_ARG_ENABLE(rgb565,
[ --enable-rgb565 Pixel format RGB565 support <default=yes>],
format_rgb565=$enableval)
AC_ARG_ENABLE(rgb555,
[ --enable-rgb555 Pixel format RGB555 support <default=yes>],
format_rgb555=$enableval)
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(memory.h stddef.h stdlib.h string.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS(floor memmove memset pow sqrt strncpy strncasecmp)
# Checks for User define macro.
if test "x$build_freetype2" = "xyes"; then
AC_DEFINE(ENABLE_FREE_TYPE2, 1, [Define if FreeType2 is supported.])
CFLAGS="$CFLAGS `freetype-config --cflags`"
CXXFLAGS="$CXXFLAGS `freetype-config --cflags`"
LIBS="$LIBS `freetype-config --libs`"
else
LIBS="$LIBS -lgdi32"
fi
if test "x$build_fontconfig" = "xyes"; then
AC_DEFINE(ENABLE_FONT_CONFIG, 1, [Define if FontConfig is supported.])
CFLAGS="$CFLAGS `pkg-config fontconfig --cflags`"
CXXFLAGS="$CXXFLAGS `pkg-config fontconfig --cflags`"
LIBS="$LIBS `pkg-config fontconfig --libs`"
fi
if test "x$build_lowmem" = "xyes"; then
AC_DEFINE(ENABLE_LOW_MEMORY, 1, [Define if Low memory is supported.])
fi
if test "x$build_fastcopy" = "xyes"; then
AC_DEFINE(ENABLE_FAST_COPY, 1, [Define if Fast memory copy is supported.])
fi
if test "x$build_sysmalloc" = "xyes"; then
AC_DEFINE(ENABLE_SYSTEM_MALLOC, 1, [Define if System memory allocator is supported.])
fi
if test "x$format_rgba" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_RGBA, 1, [Define if RGBA color format is supported.])
fi
if test "x$format_argb" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_ARGB, 1, [Define if ARGB color format is supported.])
fi
if test "x$format_abgr" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_ABGR, 1, [Define if ABGR color format is supported.])
fi
if test "x$format_bgra" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_BGRA, 1, [Define if BGRA color format is supported.])
fi
if test "x$format_rgb" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_RGB, 1, [Define if RGB color format is supported.])
fi
if test "x$format_bgr" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_BGR, 1, [Define if BGR color format is supported.])
fi
if test "x$format_rgb565" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_RGB565, 1, [Define if RGB565 color format is supported.])
fi
if test "x$format_rgb555" = "xyes"; then
AC_DEFINE(ENABLE_FORMAT_RGB555, 1, [Define if RGB555 color format is supported.])
fi
CFLAGS="$CFLAGS -Wall -DDLL_EXPORT=1 -DEXPORT=1 -fvisibility=hidden"
CXXFLAGS="$CXXFLAGS -Wall -fno-rtti -fno-exceptions -DDLL_EXPORT=1 -DEXPORT=1 -fvisibility=hidden -fvisibility-inlines-hidden"
AC_OUTPUT(
Makefile
include/Makefile
src/Makefile
ext/Makefile
ext/image_loader/Makefile
ext/image_loader/png/Makefile
ext/image_loader/jpeg/Makefile
ext/image_loader/gif/Makefile
ext/image_loader/webp/Makefile
test/Makefile
demos/Makefile
)