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