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

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
dnl
dnl	configure.in
dnl	Copyright (c) 2000, 2001, 2002, 2003, 2004 Kriang Lerdsuwanakij
dnl	email:		lerdsuwa@users.sourceforge.net
dnl
dnl	This program is free software; you can redistribute it and/or modify
dnl	it under the terms of the GNU General Public License as published by
dnl	the Free Software Foundation; either version 2 of the License, or
dnl	(at your option) any later version.
dnl
dnl	This program is distributed in the hope that it will be useful,
dnl	but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl	GNU General Public License for more details.
dnl
dnl	You should have received a copy of the GNU General Public License
dnl	along with this program; if not, write to the Free Software
dnl	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl

AC_REVISION($Revision: 1.36 $)
AC_PREREQ(2.53)
AC_INIT
AC_CONFIG_SRCDIR([board.cc])

dnl *****************************************************************
dnl  Initialization
dnl *****************************************************************

PACKAGE=grhino
. $srcdir/scripts/version
AH_TEMPLATE([PACKAGE],
	    [Define to the name of the distribution.])
AH_TEMPLATE([VERSION],
	    [Define to the version of the distribution.])
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

ALL_LINGUAS="en_GB"
LINGUAS="$ALL_LINGUAS"

top_builddir=`pwd`
AC_SUBST(top_builddir)

dnl *****************************************************************
dnl  Set header output file
dnl *****************************************************************
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(scripts)

dnl *****************************************************************
dnl  Read configure options
dnl *****************************************************************

dnl Default settings
GRHINO_gnome="yes"
GRHINO_gtp="yes"
DEFTARGETLIST=""

AC_ARG_ENABLE(gnome,
	[  --disable-gnome         do not build GNOME frontend (grhino)],
	[	if test "$enableval" = "yes"; then
			GRHINO_gnome="yes"
		elif test "$enableval" = "no"; then
			GRHINO_gnome="no"
		else
			{ _AS_ECHO([configure: error: invalid argument for --enable-gnome],[2]); exit 1; }
		fi
	])
AC_ARG_ENABLE(gtp,
	[  --disable-gtp           do not build GTP frontend (gtp-rhino)],
	[	if test "$enableval" = "yes"; then
			GRHINO_gtp="yes"
		elif test "$enableval" = "no"; then
			GRHINO_gtp="no"
		else
			{ _AS_ECHO([configure: error: invalid argument for --enable-gtp],[2]); exit 1; }
		fi
	])

if test "$GRHINO_gnome" = yes; then
	DEFTARGETLIST="$DEFTARGETLIST grhino"
fi

if test "$GRHINO_gtp" = yes; then
	DEFTARGETLIST="$DEFTARGETLIST gtp-rhino"
fi

AC_SUBST(DEFTARGETLIST)

dnl *****************************************************************
dnl  Checks for programs
dnl *****************************************************************
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP

dnl Add -W -Wall (produce all warnings) if gcc is used
if test "$GXX" = yes; then
	CFLAGS="$CFLAGS -W -Wall"
	CXXFLAGS="$CXXFLAGS -W -Wall"
fi

AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_LANG([C++])

dnl *****************************************************************
dnl  Add include/libraries
dnl *****************************************************************

dnl -----------------------------------------------------------------
dnl  pthread library
dnl -----------------------------------------------------------------
AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"],
	[ AC_MSG_ERROR(pthread library is required) ])

dnl -----------------------------------------------------------------
dnl  gnome libraries
dnl -----------------------------------------------------------------

if test "$GRHINO_gnome" = yes; then
	AC_CHECK_PROG(GRHINO_pkg_config, pkg-config, pkg-config, no)
	if test "$GRHINO_pkg_config" = no; then
		AC_MSG_ERROR(pkg_config is missing -- GNOME 2 is required)
	else
		if "$GRHINO_pkg_config" --exists libgnomeui-2.0; then
			GRHINO_gnome=2
		else
			AC_MSG_ERROR(libgnomeui-2.0 is missing -- GNOME 2 is required)
		fi
	fi

	echo "GNOME version $GRHINO_gnome found"
	if test "$GRHINO_gnome" = 2; then
		LIBS="$LIBS `$GRHINO_pkg_config --libs libgnomeui-2.0`"
		GNOME_CONFIG="`$GRHINO_pkg_config --cflags libgnomeui-2.0`"
	fi

dnl Remove some system include directories that cause GCC 3.x problem
dnl but avoid their subdirectories
changequote(<<, >>)dnl
	GNOME_CONFIG="`echo $GNOME_CONFIG | sed 'sx-I/usr/include x x'`"
	GNOME_CONFIG="`echo $GNOME_CONFIG | sed 'sx-I/usr/local/include x x'`"
changequote([, ])dnl

	CPPFLAGS="$CPPFLAGS $GNOME_CONFIG"

fi

dnl *****************************************************************
dnl  Checks for C++ features
dnl *****************************************************************

CXXAC_TYPE_BOOL
if test "$cxxac_cv_have_bool" = no; then
	AC_MSG_ERROR(C++ compiler that supports bool is required)
fi
CXXAC_BAD_ALLOC
CXXAC_HAVE_EXPLICIT
CXXAC_HAVE_MUTABLE
CXXAC_HAVE_ARRAY_NEW
CXXAC_BAD_DELETE
CXXAC_DEFAULT_EXCEPTION
CXXAC_HAVE_TYPENAME
CXXAC_NO_GUIDE_DECL
CXXAC_HEADER_ALL

dnl *****************************************************************
dnl  I18n, l10n
dnl *****************************************************************

AM_GNU_GETTEXT([external])

dnl *****************************************************************
dnl  Done
dnl *****************************************************************

AC_CONFIG_FILES([Makefile po/Makefile.in desktop/grhino.desktop])

AC_OUTPUT