summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-13 22:21:51 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-13 22:21:51 +0200
commit94d41042a9006375eecf5332e9a59657a0c8a492 (patch)
treefd3e8b09df67f4db21305f4f0ec9a31faebf804e
parent81070577a7bf81231ca79ce4efebc7235a9b605f (diff)
downloadlibass-94d41042a9006375eecf5332e9a59657a0c8a492.tar.bz2
libass-94d41042a9006375eecf5332e9a59657a0c8a492.tar.xz
Rework build system
* Remove checks for functions or headers that are part of ANSI C or C89. * Make enca optional. * Conditionally compile the test program depending on libpng availability.
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac45
2 files changed, 26 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am
index 08b3844..dd39648 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,4 +5,9 @@ EXTRA_DIST = libass.pc.in Changelog
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libass.pc
-SUBDIRS = libass test
+if HAVE_LIBPNG
+ test = test
+endif
+
+SUBDIRS = libass $(test)
+
diff --git a/configure.ac b/configure.ac
index 11f1765..db30674 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,3 @@
-AC_PREREQ(2.60a)
AC_INIT(libass, 0.9.7)
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([shave])
@@ -14,12 +13,24 @@ AC_PROG_CC
AC_PROG_CPP
AM_PROG_CC_C_O
-# Checks for libraries.
-AC_SEARCH_LIBS([iconv_open], [iconv], AC_DEFINE(CONFIG_ICONV, 1, [use iconv]))
-
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([inttypes.h stdint.h stdlib.h string.h sys/time.h unistd.h iconv.h enca.h])
+AC_HEADER_STDBOOL
+AC_CHECK_HEADERS([inttypes.h stdint.h stdlib.h string.h sys/time.h unistd.h iconv.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_INT64_T
+AC_TYPE_SIZE_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT8_T
+
+# Checks for library functions.
+AC_CHECK_FUNCS([mkdir strcasecmp strdup strtol])
+
+# Checks for libraries.
+AC_SEARCH_LIBS([iconv_open], [iconv], AC_DEFINE(CONFIG_ICONV, 1, [use iconv]))
# Check for libraries via pkg-config
PKG_CHECK_MODULES([FONTCONFIG], fontconfig >= 2.2.0, [
@@ -38,32 +49,16 @@ PKG_CHECK_MODULES([ENCA], enca, [
CFLAGS="$CFLAGS $ENCA_CFLAGS"
LIBS="$LIBS $ENCA_LIBS"
AC_DEFINE(CONFIG_ENCA, 1, [found enca via pkg-config])
- ])
+ ], [true])
PKG_CHECK_MODULES([LIBPNG], libpng >= 1.2.0, [
CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
LIBS="$LIBS $LIBPNG_LIBS"
AC_DEFINE(CONFIG_LIBPNG, 1, [found libpng via pkg-config])
- ])
+ libpng=true
+ ], [libpng=false])
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_INT64_T
-AC_TYPE_SIZE_T
-AC_STRUCT_TM
-AC_TYPE_UINT32_T
-AC_TYPE_UINT8_T
-
-# Checks for library functions.
-AC_FUNC_MALLOC
-AC_FUNC_MEMCMP
-AC_FUNC_REALLOC
-AC_FUNC_STAT
-AC_FUNC_STRTOD
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([memset mkdir strcasecmp strchr strdup strerror strstr strtol])
+AM_CONDITIONAL([HAVE_LIBPNG], [test x$libpng = xtrue])
# Setup output beautifier.
SHAVE_INIT([shave], [enable])