1dnl -------------------------------------------------------------- 2dnl Making releases: dvdnav_sub += 1; change DVDNAV_LT_* accordingly 3dnl 4dnl These are defined in m4 so they can be passed to AC_INIT 5dnl -------------------------------------------------------------- 6m4_define([dvdnav_major], [6]) 7m4_define([dvdnav_minor], [1]) 8m4_define([dvdnav_sub], [1]) 9m4_define([dvdnav_pre], []) 10 11AC_INIT([libdvdnav], [dvdnav_major.dvdnav_minor.dvdnav_sub[]dvdnav_pre]) 12AC_CONFIG_SRCDIR([src/dvdnav.c]) 13 14AC_PREREQ([2.53]) 15AC_CANONICAL_HOST 16 17AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 no-dist-gzip subdir-objects]) 18m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 19 20LT_INIT 21 22AC_CONFIG_HEADERS([config.h]) 23AC_CONFIG_MACRO_DIR([m4]) 24 25DVDNAV_MAJOR="dvdnav_major" 26DVDNAV_MINOR="dvdnav_minor" 27DVDNAV_SUB="dvdnav_sub" 28DVDNAV_PRE="dvdnav_pre" 29 30DVDREAD_MIN_VERSION="6.0.0" 31 32AC_SUBST(DVDNAV_MAJOR) 33AC_SUBST(DVDNAV_MINOR) 34AC_SUBST(DVDNAV_SUB) 35AC_SUBST(DVDREAD_MIN_VERSION) 36 37dnl The libtool version numbers (DVDNAV_LT_*); Don't even think about faking this! 38dnl 39dnl immediately before every release do: 40dnl =================================== 41dnl if (the interface is totally unchanged from previous release) 42dnl DVDNAV_LT_REVISION ++; 43dnl else { /* interfaces have been added, removed or changed */ 44dnl DVDNAV_LT_REVISION = 0; 45dnl DVDNAV_LT_CURRENT ++; 46dnl if (any interfaces have been _added_ since last release) 47dnl AGE ++; 48dnl if (any interfaces have been _removed_ or _incompatibly changed_) 49dnl AGE = 0; 50dnl } 51dnl 52dnl If you want to know more about what you are doing, here are some details: 53dnl * DVDNAV_LT_CURRENT is the current API version 54dnl * DVDNAV_LT_REVISION is an internal revision number which is increased when the API 55dnl itself did not change 56dnl * DVDNAV_LT_AGE is the number of previous API versions still supported by this library 57dnl * libtool has its own numbering scheme, because local library numbering schemes 58dnl are platform dependent 59dnl * in Linux, the library will be named 60dnl libname.so.(DVDNAV_LT_CURRENT - DVDNAV_LT_AGE).DVDNAV_LT_AGE.DVDNAV_LT_REVISION 61 62DVDNAV_LT_CURRENT=7 63DVDNAV_LT_AGE=3 64DVDNAV_LT_REVISION=0 65 66AC_SUBST(DVDNAV_LT_CURRENT) 67AC_SUBST(DVDNAV_LT_AGE) 68AC_SUBST(DVDNAV_LT_REVISION) 69 70AC_PROG_CC_C99 71 72AC_SYS_LARGEFILE 73AC_C_BIGENDIAN 74 75AS_CASE([$host], 76 [*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)]) 77 78dnl --------------------------------------------- 79dnl threads 80dnl --------------------------------------------- 81case $host in 82 *-*-freebsd*) 83 THREAD_LIBS="-L/usr/local/lib -pthread" 84 THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE" 85 CFLAGS="$THREAD_CFLAGS $CFLAGS" 86 ;; 87 *mingw32* | *cygwin*) 88 ;; 89 *android*) 90 ;; 91 *) 92 AC_CHECK_LIB(pthread, pthread_create, 93 [THREAD_LIBS="-lpthread"], 94 AC_MSG_ERROR(pthread needed)) 95 ;; 96esac 97AC_SUBST(THREAD_LIBS) 98AC_SUBST(THREAD_CFLAGS) 99 100PKG_CHECK_MODULES([DVDREAD], [dvdread >= ${DVDREAD_MIN_VERSION}]) 101 102dnl --------------------------------------------- 103dnl Check for bitfield compiler flag 104dnl --------------------------------------------- 105CC_CHECK_CFLAG_APPEND([-mno-ms-bitfields]) 106 107dnl check for -Wall -Wextra support 108CC_CHECK_CFLAG_APPEND([-Wall -Wsign-compare -Wextra]) 109 110dnl --------------------------------------------- 111dnl Check for doxygen (dynamic documentation generator) 112dnl --------------------------------------------- 113AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no) 114 115dnl --------------------------------------------- 116dnl -no-undefined libtool flag 117dnl 118dnl This should be after all checks 119dnl --------------------------------------------- 120AS_CASE([$host_os], 121 [os2*], [LDFLAGS="$LDFLAGS -no-undefined"]) 122 123dnl --------------------------------------------- 124dnl Output configuration files 125dnl --------------------------------------------- 126AC_OUTPUT([ 127Makefile 128misc/dvdnav.pc 129misc/libdvdnav.spec 130src/dvdnav/version.h 131]) 132