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
AC_INIT([nota-rm],[3.0-2010.01],[http://notaworld.org])
31
AC_CONFIG_HEADERS([config.h])
32
33
AC_CONFIG_SRCDIR(service/resourcemng_main.c)
34
AC_CONFIG_MACRO_DIR([platform/m4])
35
AM_INIT_AUTOMAKE([dist-bzip2])
36
37
if test x$prefix = xNONE; then
38
   prefix=/usr/local
39
fi
40
AC_SUBST(prefix)
41
42
AC_PROG_CC
43
AM_PROG_CC_STDC
44
AC_HEADER_STDC
45
AC_PROG_LIBTOOL
46
47
# require pkg-config
48
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) 
49
if test "x$PKG_CONFIG" = "xno"; then
50
   AC_MSG_ERROR([
51
   *** The pkg-config script could not be found. Make sure it is
52
   *** in your path, or set the PKG_CONFIG environment variable
53
   *** to the full path to pkg-config.]) 
54
fi
55
56
dnl what kind of threadlib to use?
57
ACX_PTHREAD
58
LIBS="$PTHREAD_LIBS $LIBS"
59
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
60
CC="$PTHREAD_CC"
61
62
PKG_CHECK_MODULES(NOTA_H_IN,nota-h_in-3.0)  		
63
64
AC_SUBST(NOTA_H_IN_LIBS)
65
AC_SUBST(NOTA_H_IN_CFLAGS)
66
67
PKG_CHECK_MODULES(NOTA_H_IN_SP,nota-h_in-sp-3.0)
68
AC_SUBST(NOTA_H_IN_SP_LIBS)
69
AC_SUBST(NOTA_H_IN_SP_CFLAGS)
70
71
PKG_CHECK_MODULES(NOTA_STUBGEN,nota-stubgen-3.0)
72
AC_SUBST(NOTA_STUBGEN_LIBS)
73
AC_SUBST(NOTA_STUBGEN_CFLAGS)
74
75
76
# security? 
77
AC_ARG_ENABLE(secure_registration,
78
	[AC_HELP_STRING([--enable-secure-registration],
79
	[enable extra security for service registration/unregistration (yes,no)])],
80
[case "${enableval}" in
81
      yes) sec_reg=true;;
82
      *)   sec_reg=false ;;
83
esac],[sec_reg=false])   
84
			
85
if test "x$sec_reg" == "xtrue"; then
86
   echo "laal"
87
   AC_DEFINE_UNQUOTED(NOTA_HAVE_SECURE_REGISTRATION,1, 
88
   [whether we have secure registration/deregistration])
89
fi
90
91
# platform -- currently, only posix is supported
92
AC_ARG_WITH(platform,	[AC_HELP_STRING([--with-platform],
93
	[platform to build for: posix])],
94
[case "${with_platform}" in
95
      posix)  NOTA_PLATFORM=${with_platform};;
96
      *)              AC_MSG_ERROR([unsupported platform]);;
97
 esac], [NOTA_PLATFORM=posix])
98
AC_SUBST(NOTA_PLATFORM)
99
100
NOTA_PLATFORM_STUBS="stub/${NOTA_PLATFORM}"
101
AC_SUBST(NOTA_PLATFORM_STUBS)
102
103
AC_PATH_PROG([NOTA_STUBGENERATOR],[nota-stubgen3.pl],[no])
104
AS_IF(test "x$NOTA_STUBGENERATOR" = "xno",AC_MSG_WARN([stubgenerator not found]))
105
106
AM_CONDITIONAL(NOTA_HAVE_LIBXML_PERL, test "x$have_libxml" = "xyes")
107
108
AC_OUTPUT([
109
Makefile
110
service/Makefile
111
man/Makefile
112
platform/posix/Makefile
113
platform/symbian32/Makefile
114
platform/t-kernel/Makefile
115
platform/m4/Makefile
116
platform/Makefile
117
stub/Makefile
118
stub/posix/Makefile
119
stub/posix/common/Makefile
120
stub/posix/service/Makefile
121
stub/posix/user/Makefile
122
common/Makefile
123
sample_an_sn/Makefile
124
])
125
126
echo
127
echo "RM configure results"
128
echo "-----------------------------------"
129
echo "Platform             : ${NOTA_PLATFORM}"
130
echo "Secure registration  : ${sec_reg}"
131
echo "Stubgen              : ${NOTA_STUBGENERATOR}"
132
echo ""
133
echo "Prefix               : ${prefix}"
134
echo "CFLAGS               : $CFLAGS"
135
echo ""