configure.ac 3.52 KB
Newer Older
1
dnl --------------------------------------------------------------
2 3 4
dnl Making releases: dvdnav_sub += 1; change DVDNAV_LT_* accordingly
dnl
dnl These are defined in m4 so they can be passed to AC_INIT
5
dnl --------------------------------------------------------------
6 7
m4_define([dvdnav_major], [5])
m4_define([dvdnav_minor], [0])
8
m4_define([dvdnav_sub],   [0])
9 10 11 12
m4_define([dvdnav_pre],   [])

AC_INIT([libdvdnav], [dvdnav_major.dvdnav_minor.dvdnav_sub[]dvdnav_pre])
AC_CONFIG_SRCDIR([src/dvdnav.c])
13 14 15 16 17 18 19 20

AC_PREREQ([2.53])
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 no-dist-gzip subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

LT_INIT
21 22

AC_CONFIG_HEADERS([config.h])
23
AC_CONFIG_MACRO_DIR([m4])
24 25 26 27 28

DVDNAV_MAJOR="dvdnav_major"
DVDNAV_MINOR="dvdnav_minor"
DVDNAV_SUB="dvdnav_sub"
DVDNAV_PRE="dvdnav_pre"
29 30 31 32 33

AC_SUBST(DVDNAV_MAJOR)
AC_SUBST(DVDNAV_MINOR)
AC_SUBST(DVDNAV_SUB)

34
dnl The libtool version numbers (DVDNAV_LT_*); Don't even think about faking this!
35
dnl
36 37 38
dnl immediately before every release do:
dnl ===================================
dnl if (the interface is totally unchanged from previous release)
39
dnl    DVDNAV_LT_REVISION ++;
40
dnl else { /* interfaces have been added, removed or changed */
41 42
dnl    DVDNAV_LT_REVISION = 0;
dnl    DVDNAV_LT_CURRENT ++;
43 44
dnl    if (any interfaces have been _added_ since last release)
dnl       AGE ++;
45
dnl    if (any interfaces have been _removed_ or _incompatibly changed_)
46 47
dnl       AGE = 0;
dnl }
48
dnl
49
dnl If you want to know more about what you are doing, here are some details:
50 51
dnl  * DVDNAV_LT_CURRENT is the current API version
dnl  * DVDNAV_LT_REVISION is an internal revision number which is increased when the API
52
dnl    itself did not change
53
dnl  * DVDNAV_LT_AGE is the number of previous API versions still supported by this library
54 55 56
dnl  * libtool has its own numbering scheme, because local library numbering schemes
dnl    are platform dependent
dnl  * in Linux, the library will be named
57
dnl    libname.so.(DVDNAV_LT_CURRENT - DVDNAV_LT_AGE).DVDNAV_LT_AGE.DVDNAV_LT_REVISION
58

59 60
DVDNAV_LT_CURRENT=5
DVDNAV_LT_AGE=1
Nico Sabbi's avatar
Nico Sabbi committed
61
DVDNAV_LT_REVISION=2
62

63 64 65
AC_SUBST(DVDNAV_LT_CURRENT)
AC_SUBST(DVDNAV_LT_AGE)
AC_SUBST(DVDNAV_LT_REVISION)
66 67 68

AC_PROG_CC

69
AC_SYS_LARGEFILE
70
AC_C_BIGENDIAN
71

72 73
AS_CASE([$host],
  [*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)])
74

75 76 77
AS_CASE([$host],
  [*os2*], [LDFLAGS="$LDFLAGS -no-undefined"])

78 79 80 81 82 83 84
dnl ---------------------------------------------
dnl threads
dnl ---------------------------------------------
case $host in
  *-*-freebsd*)
    THREAD_LIBS="-L/usr/local/lib -pthread"
    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
85
    CFLAGS="$THREAD_CFLAGS $CFLAGS"
86
    ;;
87 88
  *mingw32* | *cygwin*)
    ;;
89 90
  *android*)
    ;;
91 92
  *)
    AC_CHECK_LIB(pthread, pthread_create,
93 94
        [THREAD_LIBS="-lpthread"],
        AC_MSG_ERROR(pthread needed))
95 96 97 98 99
    ;;
esac
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)

100
PKG_CHECK_MODULES([DVDREAD], [dvdread])
101

102 103 104
dnl ---------------------------------------------
dnl Check for bitfield compiler flag
dnl ---------------------------------------------
105
CC_CHECK_CFLAG_APPEND([-mno-ms-bitfields])
106

107 108 109
dnl check for -Wall -Wextra support
CC_CHECK_CFLAG_APPEND([-Wall -Wsign-compare -Wextra])

110 111 112 113 114 115 116 117 118
dnl ---------------------------------------------
dnl Check for doxygen (dynamic documentation generator)
dnl ---------------------------------------------
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)

dnl ---------------------------------------------
dnl Output configuration files
dnl ---------------------------------------------
AC_OUTPUT([
119
Makefile
120
misc/dvdnav.pc
121
misc/libdvdnav.spec
122
])