configure.ac 3.7 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 --------------------------------------------------------------
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
6
m4_define([dvdnav_major], [6])
7
m4_define([dvdnav_minor], [0])
8
m4_define([dvdnav_sub],   [1])
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 61
DVDNAV_LT_CURRENT=6
DVDNAV_LT_AGE=2
DVDNAV_LT_REVISION=0
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 78 79 80 81
dnl ---------------------------------------------
dnl threads
dnl ---------------------------------------------
case $host in
  *-*-freebsd*)
    THREAD_LIBS="-L/usr/local/lib -pthread"
    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
82
    CFLAGS="$THREAD_CFLAGS $CFLAGS"
83
    ;;
84 85
  *mingw32* | *cygwin*)
    ;;
86 87
  *android*)
    ;;
88 89
  *)
    AC_CHECK_LIB(pthread, pthread_create,
90 91
        [THREAD_LIBS="-lpthread"],
        AC_MSG_ERROR(pthread needed))
92 93 94 95 96
    ;;
esac
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)

97
PKG_CHECK_MODULES([DVDREAD], [dvdread >= 6.0.0])
98

99 100 101
dnl ---------------------------------------------
dnl Check for bitfield compiler flag
dnl ---------------------------------------------
102
CC_CHECK_CFLAG_APPEND([-mno-ms-bitfields])
103

104 105 106
dnl check for -Wall -Wextra support
CC_CHECK_CFLAG_APPEND([-Wall -Wsign-compare -Wextra])

107 108 109 110 111
dnl ---------------------------------------------
dnl Check for doxygen (dynamic documentation generator)
dnl ---------------------------------------------
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)

KO Myung-Hun's avatar
KO Myung-Hun committed
112 113 114 115 116 117 118 119
dnl ---------------------------------------------
dnl -no-undefined libtool flag
dnl
dnl This should be after all checks
dnl ---------------------------------------------
AS_CASE([$host_os],
  [os2*], [LDFLAGS="$LDFLAGS -no-undefined"])

120 121 122 123
dnl ---------------------------------------------
dnl Output configuration files
dnl ---------------------------------------------
AC_OUTPUT([
124
Makefile
125
misc/dvdnav.pc
126
misc/libdvdnav.spec
127
])