summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 2076f96b926686a8cb14dcc5822e93e6c29e402d (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)

AC_INIT([gst-plugins-fsl-vpu], [trunk], [bugs@pengutronix.de])
AC_CONFIG_HEADERS([include/gst-plugins-fsl-vpu_config.h])
AC_CONFIG_SRCDIR([src/mfw_gst_vpu_encoder.c])
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_AUX_DIR([config/autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

AM_MAINTAINER_MODE

CFLAGS="${CFLAGS} -Wall"

#
# libtool library versioning stuff
#
# Library code modified:	    REVISION++
# Interfaces changed/added/removed: CURRENT++	REVISION=0
# Interfaces added:		    AGE++
# Interfaces removed:		    AGE=0
LT_CURRENT=0
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)


#
# Checks for programs.
#
AC_PROG_CC
#AM_MISSING_PROG(PERL, perl, $missing_dir)
# libtool, old:
AC_LIBTOOL_WIN32_DLL
#AC_LIBTOOL_TAGS([])
AC_PROG_LIBTOOL
# libtool, new:
# LT_INIT(win32-dll)

AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])


#
# Checks for libraries.
#

##
# librn
##
# REQUIRES_LIBRN="librn >= 0.4.2"
# AC_SUBST(REQUIRES_LIBRN)
# PKG_CHECK_MODULES([librn],
# 	[${REQUIRES_LIBRN}],
# 	[],
# 	[AC_MSG_ERROR([*** ${REQUIRES_LIBRN} not found by pkg-config on your system])]
# )
# AC_SUBST(librn_CFLAGS)
# AC_SUBST(librn_LIBS)

#
# Checks for header files.
#
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([	\
	arpa/inet.h	\
	limits.h	\
	netdb.h		\
	netinet/in.h	\
	stddef.h	\
	stdlib.h	\
	string.h	\
	sys/param.h	\
	sys/socket.h	\
	sys/time.h	\
	sys/un.h	\
	unistd.h	\
	utime.h		\
	])


#
# Checks for typedefs, structures, and compiler characteristics.
#
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME


#
# Checks for library functions.
#
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname gettimeofday memset mkdir socket utime])


#
# Debugging
#
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
    AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=yes@:>@]),
	[case "$enableval" in
	y | yes) CONFIG_DEBUG=yes ;;
        *) CONFIG_DEBUG=no ;;
    esac],
    [CONFIG_DEBUG=yes])
AC_MSG_RESULT([${CONFIG_DEBUG}])
if test "${CONFIG_DEBUG}" = "yes"; then
    CFLAGS="${CFLAGS} -Werror -Wsign-compare -Wfloat-equal -Wformat-security -g -O1"
    AC_DEFINE(DEBUG, 1, [debugging])
else
    CFLAGS="${CFLAGS} -O2"
fi

#
# VPU version
#
AC_ARG_WITH(vpu-version,
    AS_HELP_STRING([--with-vpu-version=@<:@mx27|mx37|mx51@:>@], [select vpu version @<:@default=mx27@:>@]),
    [case "$withval" in
	mx37)
	AC_DEFINE(VPU_MX37, 1, [VPU on a MX37])
	VPU_TYPE="vpu_mx37"
	;;
	mx51)
	AC_DEFINE(VPU_MX51, 1, [VPU on a MX51])
	VPU_TYPE="vpu_mx51"
	;;
        mx27 | *)
	AC_DEFINE(VPU_MX27, 1, [VPU on a MX27])
	VPU_TYPE="vpu_mx27"
	;;
    esac])

AC_MSG_CHECKING([vpu version])
if test -z ${VPU_TYPE}; then
	AC_DEFINE(VPU_MX27, 1, [VPU on a MX27])
	VPU_TYPE="vpu_mx27"
fi
AC_MSG_RESULT([${VPU_TYPE}])

dnl Check for pkgconfig first
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)

dnl Give error and exit if we don't have pkgconfig
if test "x$HAVE_PKGCONFIG" = "xno"; then
  AC_MSG_ERROR(you need to have pkgconfig installed !)
fi

dnl Now we're ready to ask for gstreamer libs and cflags
dnl And we can also ask for the right version of gstreamer

GST_REQUIRED=0.10

GST_MAJORMINOR=0.10
PKG_CHECK_MODULES(GST, \
  gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
  HAVE_GST=yes,HAVE_GST=no)

dnl Give error and exit if we don't have gstreamer
if test "x$HAVE_GST" = "xno"; then
  AC_MSG_ERROR(you need gstreamer development packages installed !)
fi

dnl make GST_CFLAGS and GST_LIBS available
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)

dnl make GST_MAJORMINOR available in Makefile.am
AC_SUBST(GST_MAJORMINOR)

dnl If we need them, we can also use the plugin libraries
PKG_CHECK_MODULES(GST_LIBS, gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED,
                  HAVE_GST_LIBS=yes, HAVE_GST_LIBS=no)

dnl Give a warning if we don't have gstreamer libs
if test "x$HAVE_GST_LIBS" = "xno"; then
  AC_MSG_NOTICE(no GStreamer plugin libs found)
fi

dnl make GST_LIBS_CFLAGS and GST_LIBS_LIBS available
AC_SUBST(GST_LIBS_CFLAGS)
AC_SUBST(GST_LIBS_LIBS)

dnl set the plugindir where plugins should be installed
plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
AC_SUBST(plugindir)

dnl set proper LDFLAGS for plugins
GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_PLUGIN_LDFLAGS)

dnl we need the vpu library, no need to link them though.
FSL_VPU_LIBS_REQUIRED_VERSION=0.2.0
PKG_CHECK_MODULES(FSL_VPU_LIBS, libfsl-vpu >= $FSL_VPU_LIBS_REQUIRED_VERSION,
                  HAVE_FSL_VPU_LIBS=yes, HAVE_FSL_VPU_LIBS=no)
if test "x$HAVE_FSL_VPU_LIBS" = "xno"; then
  AC_MSG_ERROR([Please install libfsl-vpu version $FSL_VPU_LIBS_REQUIRED_VERSION
	      or later])
fi

AC_CONFIG_FILES([
	GNUmakefile
	config/gst-plugins-fsl-vpu.pc
	config/GNUmakefile
	include/GNUmakefile
	src/GNUmakefile
	])
AC_OUTPUT