~ubuntu-branches/ubuntu/trusty/grhino/trusty-proposed

1 by Bart Martens
Import upstream version 0.16.0
1
dnl
2
dnl	configure.in
3
dnl	Copyright (c) 2000, 2001, 2002, 2003, 2004 Kriang Lerdsuwanakij
4
dnl	email:		lerdsuwa@users.sourceforge.net
5
dnl
6
dnl	This program is free software; you can redistribute it and/or modify
7
dnl	it under the terms of the GNU General Public License as published by
8
dnl	the Free Software Foundation; either version 2 of the License, or
9
dnl	(at your option) any later version.
10
dnl
11
dnl	This program is distributed in the hope that it will be useful,
12
dnl	but WITHOUT ANY WARRANTY; without even the implied warranty of
13
dnl	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
dnl	GNU General Public License for more details.
15
dnl
16
dnl	You should have received a copy of the GNU General Public License
17
dnl	along with this program; if not, write to the Free Software
18
dnl	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
dnl
20
21
AC_REVISION($Revision: 1.36 $)
22
AC_PREREQ(2.53)
23
AC_INIT
24
AC_CONFIG_SRCDIR([board.cc])
25
26
dnl *****************************************************************
27
dnl  Initialization
28
dnl *****************************************************************
29
30
PACKAGE=grhino
31
. $srcdir/scripts/version
32
AH_TEMPLATE([PACKAGE],
33
	    [Define to the name of the distribution.])
34
AH_TEMPLATE([VERSION],
35
	    [Define to the version of the distribution.])
36
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
37
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
38
AC_SUBST(PACKAGE)
39
AC_SUBST(VERSION)
40
41
ALL_LINGUAS="en_GB"
42
LINGUAS="$ALL_LINGUAS"
43
44
top_builddir=`pwd`
45
AC_SUBST(top_builddir)
46
47
dnl *****************************************************************
48
dnl  Set header output file
49
dnl *****************************************************************
50
AC_CONFIG_HEADER(config.h)
51
AC_CONFIG_AUX_DIR(scripts)
52
53
dnl *****************************************************************
54
dnl  Read configure options
55
dnl *****************************************************************
56
57
dnl Default settings
58
GRHINO_gnome="yes"
59
GRHINO_gtp="yes"
60
DEFTARGETLIST=""
61
62
AC_ARG_ENABLE(gnome,
63
	[  --disable-gnome         do not build GNOME frontend (grhino)],
64
	[	if test "$enableval" = "yes"; then
65
			GRHINO_gnome="yes"
66
		elif test "$enableval" = "no"; then
67
			GRHINO_gnome="no"
68
		else
69
			{ _AS_ECHO([configure: error: invalid argument for --enable-gnome],[2]); exit 1; }
70
		fi
71
	])
72
AC_ARG_ENABLE(gtp,
73
	[  --disable-gtp           do not build GTP frontend (gtp-rhino)],
74
	[	if test "$enableval" = "yes"; then
75
			GRHINO_gtp="yes"
76
		elif test "$enableval" = "no"; then
77
			GRHINO_gtp="no"
78
		else
79
			{ _AS_ECHO([configure: error: invalid argument for --enable-gtp],[2]); exit 1; }
80
		fi
81
	])
82
83
if test "$GRHINO_gnome" = yes; then
84
	DEFTARGETLIST="$DEFTARGETLIST grhino"
85
fi
86
87
if test "$GRHINO_gtp" = yes; then
88
	DEFTARGETLIST="$DEFTARGETLIST gtp-rhino"
89
fi
90
91
AC_SUBST(DEFTARGETLIST)
92
93
dnl *****************************************************************
94
dnl  Checks for programs
95
dnl *****************************************************************
96
AC_PROG_CC
97
AC_ISC_POSIX
98
AC_PROG_CC_STDC
99
AC_PROG_CPP
100
AC_PROG_CXX
101
AC_PROG_CXXCPP
102
103
dnl Add -W -Wall (produce all warnings) if gcc is used
104
if test "$GXX" = yes; then
105
	CFLAGS="$CFLAGS -W -Wall"
106
	CXXFLAGS="$CXXFLAGS -W -Wall"
107
fi
108
109
AC_PROG_INSTALL
110
AC_PROG_MAKE_SET
111
112
AC_LANG([C++])
113
114
dnl *****************************************************************
115
dnl  Add include/libraries
116
dnl *****************************************************************
117
118
dnl -----------------------------------------------------------------
119
dnl  pthread library
120
dnl -----------------------------------------------------------------
121
AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"],
122
	[ AC_MSG_ERROR(pthread library is required) ])
123
124
dnl -----------------------------------------------------------------
125
dnl  gnome libraries
126
dnl -----------------------------------------------------------------
127
128
if test "$GRHINO_gnome" = yes; then
129
	AC_CHECK_PROG(GRHINO_pkg_config, pkg-config, pkg-config, no)
130
	if test "$GRHINO_pkg_config" = no; then
131
		AC_MSG_ERROR(pkg_config is missing -- GNOME 2 is required)
132
	else
133
		if "$GRHINO_pkg_config" --exists libgnomeui-2.0; then
134
			GRHINO_gnome=2
135
		else
136
			AC_MSG_ERROR(libgnomeui-2.0 is missing -- GNOME 2 is required)
137
		fi
138
	fi
139
140
	echo "GNOME version $GRHINO_gnome found"
141
	if test "$GRHINO_gnome" = 2; then
142
		LIBS="$LIBS `$GRHINO_pkg_config --libs libgnomeui-2.0`"
143
		GNOME_CONFIG="`$GRHINO_pkg_config --cflags libgnomeui-2.0`"
144
	fi
145
146
dnl Remove some system include directories that cause GCC 3.x problem
147
dnl but avoid their subdirectories
148
changequote(<<, >>)dnl
149
	GNOME_CONFIG="`echo $GNOME_CONFIG | sed 'sx-I/usr/include x x'`"
150
	GNOME_CONFIG="`echo $GNOME_CONFIG | sed 'sx-I/usr/local/include x x'`"
151
changequote([, ])dnl
152
153
	CPPFLAGS="$CPPFLAGS $GNOME_CONFIG"
154
155
fi
156
157
dnl *****************************************************************
158
dnl  Checks for C++ features
159
dnl *****************************************************************
160
161
CXXAC_TYPE_BOOL
162
if test "$cxxac_cv_have_bool" = no; then
163
	AC_MSG_ERROR(C++ compiler that supports bool is required)
164
fi
165
CXXAC_BAD_ALLOC
166
CXXAC_HAVE_EXPLICIT
167
CXXAC_HAVE_MUTABLE
168
CXXAC_HAVE_ARRAY_NEW
169
CXXAC_BAD_DELETE
170
CXXAC_DEFAULT_EXCEPTION
171
CXXAC_HAVE_TYPENAME
172
CXXAC_NO_GUIDE_DECL
173
CXXAC_HEADER_ALL
174
175
dnl *****************************************************************
176
dnl  I18n, l10n
177
dnl *****************************************************************
178
179
AM_GNU_GETTEXT([external])
180
181
dnl *****************************************************************
182
dnl  Done
183
dnl *****************************************************************
184
185
AC_CONFIG_FILES([Makefile po/Makefile.in desktop/grhino.desktop])
186
187
AC_OUTPUT