forked from Rupan/comskip
-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
103 lines (86 loc) · 2.67 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([comskip], [0.8.1], [http://www.kaashoek.com/comskip/])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([])
AC_CONFIG_SRCDIR([mpeg2dec.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
# Checks for HostOS
case "$host" in
*-*-mingw*|*-*-cygwin*)
AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
;;
*-*-linux*)
AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
;;
*-*-darwin*)
AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
;;
*-*-*bsd*)
AC_DEFINE(PLATFORM_BSD, 1, [Platform is BSD])
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
;;
esac
# Checks for HostCPU
AS_CASE([$host_cpu],
[i?86], [ARCH=i386],
[x86_64|amd64], [ARCH=x86_64],
[AC_MSG_ERROR("No assembler code for CPU $host_cpu")]
)
AC_DEFINE([ARCH], [ARCH], [CPU is $host_cpu])
# Checks for filesize
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(unsigned char *)
AC_SYS_LARGEFILE
m4_define([file_offset_bits], [$ac_cv_sys_file_offset_bits])
if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
AC_MSG_RESULT([FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits])
FILE_OFFSET_BITS=file_offset_bits()
AC_SUBST(FILE_OFFSET_BITS)
fi
# Define variables
AC_DEFINE([DONATOR], [1], [Description of DONATOR])
AC_DEFINE([DONATORS], [1], [Description of DONATORS])
#
# Checks for libraries.
#
# Search PATH
CFLAGS="$CFLAGS -I/usr/local/include -I./usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib -L./usr/local/lib"
# Checks for libm
AC_CHECK_LIB(m,exp,LIBS="-lm $LIBS" has_m=1,has_m=0)
if test $has_m = 0; then
AC_MSG_ERROR("ERROR: cannot find libm.")
fi
# Checks for pthread
AC_CHECK_LIB(pthread,pthread_create,LIBS="-lpthread $LIBS" has_pthread=1,has_pthread=0)
if test $has_pthread = 0; then
AC_MSG_ERROR("ERROR: cannot find pthread.")
fi
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h inttypes.h locale.h memory.h stdlib.h string.h sys/timeb.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FSEEKO
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([gettimeofday memset sqrt strchr strerror strrchr strstr strtol malloc])
# Setting for generate Makefile location
AC_CONFIG_FILES([Makefile])
AC_OUTPUT