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
32
AC_INIT([nota-stubgen],[3.0-2010.01],[http://notaworld.org])
33
AC_CONFIG_HEADERS([config.h])
34
35
AC_CONFIG_SRCDIR(adapter/hin3_stubadapter.c)
36
AC_CONFIG_MACRO_DIR([platform/m4])
37
AM_INIT_AUTOMAKE([dist-bzip2])
38
39
if test x$prefix = xNONE; then
40
   prefix=/usr/local
41
fi
42
AC_SUBST(prefix)
43
44
AC_PROG_CC
45
AM_PROG_CC_STDC
46
AC_HEADER_STDC
47
AC_PROG_LIBTOOL
48
49
# require pkg-config
50
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) 
51
if test "x$PKG_CONFIG" = "xno"; then
52
   AC_MSG_ERROR([
53
   *** The pkg-config script could not be found. Make sure it is
54
   *** in your path, or set the PKG_CONFIG environment variable
55
   *** to the full path to pkg-config.]) 
56
fi
57
58
59
dnl check for perl and perl-xml
60
AC_PATH_PROG([NOTA_PERL_PATH],[perl],
61
	AC_MSG_ERROR([The stubgenerator requires 'perl' in your PATH]))
62
AC_SUBST(NOTA_PERL_PATH)
63
64
AC_MSG_CHECKING([XML::LibXML])
65
have_libxml="yes"
66
${NOTA_PERL_PATH} -e 'use XML::LibXML;' 2>/dev/null || have_libxml="no"
67
if test "x$have_libxml" = "xno"; then		  
68
   AC_MSG_WARN([not found]
69
     [Please install the required the XML::LibXML perl module]
70
     [On Debian/Ubuntu, the package name is 'libxml-libxml-perl'])
71
fi
72
echo $have_libxml
73
74
AM_CONDITIONAL(NOTA_HAVE_LIBXML_PERL, test "x$have_libxml" = "xyes")
75
76
#
77
# optionally, use an uninstalled l_in
78
AC_ARG_WITH([h_in_builddir],AC_HELP_STRING([--with-h-in-builddir[=PFX]],[Prefix for h_in]),
79
   [h_in_builddir="$withval"], [h_in_builddir="none"])
80
if test "x$h_in_builddir" != "xnone"; then
81
  
82
   test -e $withval/daemon/libh_in3.la || 
83
   	AC_MSG_ERROR($withval/daemon/libh_in3.la not found)
84
   test -d $withval/inc/h_in || 
85
   	AC_MSG_ERROR($withval/inc/h_in not found)
86
  
87
   NOTA_H_IN_LIBS=$withval/daemon/libh_in3.la
88
   NOTA_H_IN_CFLAGS=-I$withval/inc/
89
   NOTA_H_IN_SP_LIBS=$withval/sp/libh_in3_sp.la
90
   NOTA_H_IN_SP_CFLAGS=-I$withval/inc/
91
else
92
   PKG_CHECK_MODULES(NOTA_H_IN,nota-h_in-3.0)  		
93
   PKG_CHECK_MODULES(NOTA_H_IN_SP,nota-h_in-sp-3.0)
94
fi
95
96
AC_SUBST(NOTA_H_IN_LIBS)
97
AC_SUBST(NOTA_H_IN_CFLAGS)
98
AC_SUBST(NOTA_H_IN_SP_LIBS)
99
AC_SUBST(NOTA_H_IN_SP_CFLAGS)
100
101
dnl what kind of threadlib to use?
102
ACX_PTHREAD
103
LIBS="$PTHREAD_LIBS $LIBS"
104
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
105
CC="$PTHREAD_CC"
106
107
AC_ARG_WITH(platform, [AC_HELP_STRING([--with-platform],
108
	[platform to build for: posix, symbian32, t-kernel])],
109
[case "${with_platform}" in
110
      posix)      NOTA_PLATFORM=${with_platform};;
111
      symbian32)  NOTA_PLATFORM=${with_platform};;
112
      t-kernel)   NOTA_PLATFORM=${with_platform};;
113
      *)          AC_MSG_ERROR([unsupported platform]);;
114
 esac], [NOTA_PLATFORM=posix])
115
NOTA_PLATFORM_DIR=platform/${NOTA_PLATFORM}
116
AC_SUBST(NOTA_PLATFORM_DIR)
117
AC_SUBST(NOTA_PLATFORM)
118
119
120
AC_OUTPUT([
121
Makefile
122
stubgen/Makefile
123
platform/posix/Makefile
124
platform/symbian32/Makefile
125
platform/t-kernel/Makefile
126
platform/m4/Makefile
127
platform/Makefile
128
adapter/Makefile
129
adapter/stubgen/Makefile
130
test/Makefile
131
man/Makefile
132
nota-stubgen-sp-3.0.pc
133
nota-stubgen-3.0.pc])
134
135
echo
136
echo "Stubgen configure results"
137
echo "-----------------------------------"
138
echo "Prefix            : ${prefix}"
139
echo "CFLAGS            : $CFLAGS"
140
echo "Platform          : $NOTA_PLATFORM"
141
echo ""
142
echo "Working stubgen   : $have_libxml"