1
#  Copyright (c) 2009 Nokia Corporation
2
#  All rights reserved.
3
# 
4
#  Redistribution and use in source and binary forms, with or without
5
#  modification, are permitted provided that the following conditions are
6
#  met:
7
# 
8
#  * Redistributions of source code must retain the above copyright
9
#    notice, this list of conditions and the following disclaimer.
10
#  * Redistributions in binary form must reproduce the above copyright
11
#    notice, this list of conditions and the following disclaimer in the
12
#    documentation and/or other materials provided with the distribution.
13
#  * Neither the name of the Nokia Corporation nor the names of its
14
#    contributors may be used to endorse or promote products derived from
15
#    this software without specific prior written permission.
16
# 
17
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18
#  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19
#  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20
#  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21
#  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24
#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26
#  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
#           
29
#
30
31
AC_INIT([OpenMAX IL Proxy], [0.0], [], [libilproxy])
32
33
# tar-ustar used in AM_INIT_AUTOMAKE for long filename support
34
AM_INIT_AUTOMAKE([1.9 tar-ustar])
35
36
# Prerequisite autoconf version
37
AC_PREREQ([2.59])
38
39
# Check if the omx_adapter.c file is present
40
AC_CONFIG_SRCDIR([src/proxyloader/omx_adapter.c])
41
42
# Set to 'm4' the directory where the extra autoconf macros are stored
43
AC_CONFIG_MACRO_DIR([m4])
44
45
AC_CONFIG_FILES([
46
    Makefile
47
    m4/Makefile
48
    include/Makefile
49
    src/Makefile
50
    src/core/Makefile
51
    src/proxyloader/Makefile
52
    src/proxyservice/Makefile
53
    test/Makefile
54
    test/standardstructs/Makefile
55
    test/standardstructs/core/Makefile
56
    test/standardstructs/app/Makefile
57
    test/simpletest/Makefile
58
    libilproxy.pc
59
    libilproxyloader.pc
60
])
61
62
# Check for a working C compiler
63
AC_PROG_CC
64
AM_PROG_CC_C_O
65
66
# Check for libtool
67
AM_PROG_LIBTOOL
68
69
# require pkg-config
70
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) 
71
if test "$PKG_CONFIG" = "no"; then
72
   AC_MSG_ERROR([
73
   *** The pkg-config script could not be found. Make sure it is
74
   *** in your path, or set the PKG_CONFIG environment variable
75
   *** to the full path to pkg-config.])
76
fi
77
78
# libtool versioning
79
# REVISION gets incremented for non-ABI/API-break changes
80
# CURRENT/AGE get incremented for API/ABI-breaks; REVISION goes back to 0 
81
LTVERSION_CURRENT=0
82
LTVERSION_REVISION=0
83
# count of old, supported interfaces
84
LTVERSION_AGE=0
85
LIBILPROXY_LTVERSION=${LTVERSION_CURRENT}:${LTVERSION_REVISION}:${LTVERSION_AGE}
86
AC_SUBST([LIBILPROXY_LTVERSION])
87
88
dnl sem_timedwait hack is an trick to prevent deadlocks when there are
89
dnl error on the network level; it's useful for NoTA connections
90
dnl see omxProxySemWait in src/proxyloader/omx_proxy_common_functions.c
91
AC_ARG_ENABLE(
92
    [sem-timedwait-hack],
93
    [AC_HELP_STRING(
94
        [--enable-sem-timedwait-hack],
95
        [whether to enable the sem_timedwait hack])],
96
    [sem_timedwait_hack="-DSEM_TIMEDWAIT_HACK=1"],
97
    [sem_timedwait_hack=""])
98
99
dnl
100
dnl note, you can set user flags with
101
dnl ./configure CFLAGS=....
102
AM_CFLAGS="-Wall -DOMX_SKIP64BIT -DIGNORE_CMIMETYPE -D_REENTRANT \
103
 -DNOTAOMXIL_SPECVERSIONMAJOR=1 -DNOTAOMXIL_SPECVERSIONMINOR=1 \
104
 -DNOTAOMXIL_SPECREVISION=2 -DNOTAOMXIL_SPECSTEP=0 ${sem_timedwait_hack}"      
105
AC_SUBST(AM_CFLAGS)
106
107
AC_CHECK_HEADERS(pthread.h)
108
109
# Check whether TCP proxy is requested
110
AC_ARG_ENABLE(
111
    [tcpproxy],
112
    [AC_HELP_STRING(
113
        [--enable-tcpproxy],
114
        [whether to use direct tcp transport in libilproxy])],
115
    [with_tcpproxy=yes],
116
    [with_tcpproxy=no])
117
    
118
AC_ARG_ENABLE(
119
    [hin3proxy],
120
    [AC_HELP_STRING(
121
        [--enable-hin3proxy],
122
        [whether to use hin3 library as transport in libilproxy])],
123
    [with_hin3proxy=yes],
124
    [with_hin3proxy=no])
125
126
AC_ARG_ENABLE(
127
    [hin3spproxy],
128
    [AC_HELP_STRING(
129
        [--enable-hin3spproxy],
130
        [whether to use hin3 single process library as transport in libilproxy])],
131
    [with_hin3spproxy=yes],
132
    [with_hin3spproxy=no])
133
    
134
AC_ARG_ENABLE(
135
    [ilservice],
136
    [AC_HELP_STRING(
137
        [--enable-ilservice],
138
        [whether to build the OpenMAX IL service])],
139
    [with_ilservice=yes],
140
    [with_ilservice=no])
141
142
# this makes tcpproxy the default
143
if test "x$with_hin3proxy" == "xno" -a "x$with_hin3spproxy" == "xno"; then
144
   with_tcpproxy=yes
145
else
146
   with_tcpproxy=no
147
fi
148
149
AM_CONDITIONAL([WITH_TCPPROXY], [test "x$with_tcpproxy" = "xyes"])
150
AM_CONDITIONAL([WITH_HIN3PROXY], [test "x$with_hin3proxy" = "xyes"])
151
AM_CONDITIONAL([WITH_HIN3SPPROXY], [test "x$with_hin3spproxy" = "xyes"])
152
AM_CONDITIONAL([WITH_ILSERVICE], [test "x$with_ilservice" = "xyes"])
153
154
PKG_CHECK_MODULES(NOTA_H_IN,nota-h_in-3.0,hin3found=yes,hin3found=no)
155
PKG_CHECK_MODULES(NOTA_H_IN_SP,nota-h_in-sp-3.0,hin3spfound=yes,hin3spfound=no)
156
PKG_CHECK_MODULES(BELLAGIO,libomxil-bellagio,bellagiofound=yes,bellagiofound=no)
157
158
if test "x$bellagiofound" == "xno" -a "x$with_ilservice" == "xyes"; then
159
   AC_MSG_ERROR([Couldn't find Bellagio, you requested building the il proxy service that uses it. This is fatal. Check your PKG_CONFIG_PATH.])
160
fi
161
162
AM_CONDITIONAL([FOUND_HIN3], [test "x$hin3found" = "xyes"])
163
164
if test "x$hin3found" == "xno" -a "x$with_hin3proxy" == "xyes"; then
165
   AC_MSG_ERROR([Couldn't find HIN3, you requested for it. This is fatal. Check your PKG_CONFIG_PATH.])
166
fi
167
168
if test "x$hin3spfound" == "xno" -a "x$with_hin3spproxy" == "xyes"; then
169
   AC_MSG_ERROR([Couldn't find HIN3 sigle process, you requested for it. This is fatal. Check your PKG_CONFIG_PATH.])
170
fi
171
172
AC_SUBST(NOTA_H_IN_LIBS)
173
AC_SUBST(NOTA_H_IN_CFLAGS)
174
AC_SUBST(NOTA_H_IN_SP_LIBS)
175
AC_SUBST(NOTA_H_IN_SP_CFLAGS)
176
AC_SUBST(BELLAGIO_LIBS)
177
AC_SUBST(BELLAGIO_CFLAGS)
178
179
AC_OUTPUT
180
181
echo
182
echo "OpenMAX Proxy configure results"
183
echo "-----------------------------------"
184
echo "Prefix            : ${prefix}"
185
echo "CFLAGS            : $AM_CFLAGS $CFLAGS"
186
if test "x$with_ilservice" == "xyes"; then
187
echo "ilservice         : will be built"
188
else
189
echo "ilservice         : no (try --enable-ilservice)"
190
fi
191
echo "Only one transport should be selected below:"
192
echo "TCP transport     : $with_tcpproxy"
193
echo "HIN3 transport    : $with_hin3proxy"
194
echo "HIN3 SP transport : $with_hin3spproxy"
195
echo ""