File: configure.in

package info (click to toggle)
vdk2 2.4.0-5.5
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 4,528 kB
  • sloc: cpp: 26,950; sh: 10,974; ansic: 9,220; makefile: 605; perl: 113
file content (376 lines) | stat: -rw-r--r-- 9,646 bytes parent folder | download | duplicates (7)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
dnl configure.in for VDK
AC_PREREQ(2.52)
AC_INIT(vdk/vdk.h)

cflags_set=${CFLAGS+set}

VDK_VERSION_MAJOR=2
VDK_VERSION_MINOR=4
VDK_VERSION_MICRO=0


dnl put the right date here as we release a new version
VDK_RELEASE_DATE="05-22-2004"

VDK_VERSION=$VDK_VERSION_MAJOR.$VDK_VERSION_MINOR.$VDK_VERSION_MICRO

AC_SUBST(VDK_VERSION_MAJOR)
AC_SUBST(VDK_VERSION_MINOR)
AC_SUBST(VDK_VERSION_MICRO)
AC_SUBST(VDK_VERSION)
AC_SUBST(VDK_RELEASE_DATE)

dnl Libtool
LT_VDK_RELEASE=$VDK_VERSION_MAJOR.$VDK_VERSION_MINOR
LT_VDK_CURRENT=`expr $VDK_VERSION_MAJOR + $VDK_VERSION_MINOR`
LT_VDK_REVISION=$VDK_VERSION_MICRO
LT_VDK_AGE=$VDK_VERSION_MINOR
AC_SUBST(LT_VDK_RELEASE)
AC_SUBST(LT_VDK_CURRENT)
AC_SUBST(LT_VDK_REVISION)
AC_SUBST(LT_VDK_AGE)

dnl For Automake
VERSION=$VDK_VERSION
PACKAGE=vdk

dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CANONICAL_HOST


dnl Initialize Libtool
AM_PROG_LIBTOOL
AM_MAINTAINER_MODE


AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_CPLUSPLUS
AC_SUBST(LIBS)
AC_SUBST(CFLAGS)


AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno ; then
  AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
fi

if ! pkg-config --atleast-pkgconfig-version 0.8 ; then
   AC_MSG_ERROR([*** pkg-config too old; version 0.8 or better required.])
fi
echo "checking if an updated version of gtk+ is installed"
if $PKG_CONFIG --atleast-version 2.4.0 gtk+-2.0 ; then
        GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
        GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
        GTK_DEPLIBS=$GTK_LIBS
	echo " gtk+ version:" `pkg-config gtk+-2.0 --modversion`
 else
        AC_MSG_ERROR([
*** GTK+ 2.4.0 or newer is required. The latest version of GTK
*** is available from http://gtk.org/
*** or get latest cvs at http://gnome.org:
  ])
  fi

AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)


dnl Now check C++ compiler

AC_MSG_CHECKING(if C++ compiler supports bool (required))
AC_TRY_COMPILE(
[
],[
   bool b=true;
   bool b1=false;
],[
  ac_bool=yes
],[
  config_error=yes
  AC_WARN(bool type is not supported by your compiler)
])
AC_MSG_RESULT([$ac_bool])

AC_MSG_CHECKING(if C++ compiler supports templates well enough (required))
AC_TRY_LINK(
[
class foo { public: int a(float,int,int,foo*,foo**) { return 0; } };
template<class rettype, class T, class P1, class P2, class P3, class P4, class P5>
class k { 	
public:
   rettype (T::*method)(P1,P2,P3,P4,P5);
};
],[
  k<int,foo,float,int,int,foo*,foo**> a;
],[
  ac_vdk_template_support_well=yes
],[
  ac_vdk_template_support_well=no
  config_error=yes
  AC_WARN(your C++ compiler does not support templates well enough)
])
AC_MSG_RESULT([$ac_vdk_template_support_well])

AC_MSG_CHECKING(if C++ environment has working auto_ptr<>)
AC_TRY_COMPILE(
[
#include <memory>
],[
  std::auto_ptr<int> a;
],[
  vdk_autoptr_ok=yes
  AC_DEFINE(HAVE_AUTO_PTR)
],[
  vdk_autoptr_ok=no
])
AC_MSG_RESULT([$vdk_autoptr_ok])

AC_MSG_CHECKING(if C++ environment has working string class (required))
AC_TRY_LINK(
[
#include <string>
  using namespace std;
  class foo {
  public:
    void f(const string &s);
  };
  void foo::f(const string &s) {
    f(s.c_str());
  }
],[
   foo f1;
   f1.f("test");
],[
  vdk_string_ok=yes
],[
  vdk_string_ok=no
  config_error=yes
  AC_WARN(C++ compilers string support does not work)
])
AC_MSG_RESULT([$vdk_string_ok])

AC_MSG_CHECKING(if C++ environment provides all required features)
if test "x$config_error" = xyes ; then
  AC_MSG_RESULT([no])
  AC_MSG_ERROR([Your compiler is not powerful enough to compile VDK. If it should be, see config.log for more information of why it failed.])
fi
AC_MSG_RESULT([yes])

dnl check if doxygen is installed
AC_PATH_PROG(DOXYGEN, doxygen)
AC_PATH_PROG(PERL, perl)

dnl added by Raff
dnl you must tell your programs that DOXYGEN exists
AC_SUBST(DOXYGEN)
AC_SUBST(PERL)

dnl AM_CONFIG_HEADER(./include/vdk/vdkfeatures.h:./include/vdk/vdkfeatures.h.in)
AM_CONFIG_HEADER(config.h)

dnl ==========================
dnl user configurable options
dnl ==========================
AC_ARG_ENABLE(debug,   [  --enable-debug=[no/minimum/yes]  enable debug information [default=no]],,enable_debug=no)
AC_ARG_ENABLE(opt,     [  --enable-opt=[OPTIMIZATION/no]  Compile with -Ox optimization [default=2]],,enable_opt=2)
AC_ARG_ENABLE(testvdk, [  --enable-testvdk=[yes/no] Compile testvdk program example [default=yes]],,enable_testvdk=yes)
#AC_ARG_ENABLE(sigc, [  --enable-sigc=[yes/no] Enable libsigc++-extension [default=no]],,enable_sigc=no)
#AC_ARG_ENABLE(testsigc, [  --enable-testsigc=[yes/no] Compile testsigcvdk program [default=no]],,enable_testsigc=no)

dnl waiting for gnome support to gtk+2.0
dnl gnome support
dnl AC_ARG_ENABLE(gnome,
dnl [  --enable-gnome=[yes/no]      enable use of gnome[default=no]],
dnl	gnome=$enableval, gnome=no)


dnl doxygen options
AC_ARG_ENABLE(doc-html,  [ --enable-doc-html[=yes/no] enable generation of docs in html format [default=yes]],,enable_doc_html=yes)
AC_ARG_ENABLE(doc-latex, [ --enable-doc-latex[=yes/no] enable generation of docs in latex format [default=no]],,enable_doc_latex=no)
AC_ARG_ENABLE(doc-man,   [ --enable-doc-man[=yes/no] enable generation of docs in latex format [default=no]],,enable_doc_man=no)

if test "x$enable_debug" = "xminimum"; then
  AC_DEFINE(VDKDEBUG)
  CXXFLAGS="-s"
else
  if test "x$enable_debug" = "xyes"; then
    AC_DEFINE(VDKDEBUG)
    CXXFLAGS="-g"
  else
    CXXFLAGS="-s"
  fi
fi

if test "x$enable_opt" != "xno"; then
  CXXFLAGS="$CXXFLAGS -O$enable_opt"
fi

if test "x$enable_testvdk" = "xyes"; then
  TESTVDK="testvdk"
else
  TESTVDK=""
fi

AC_SUBST(TESTVDK)

#dnl anyhow we have to add -lpthread
#if test "x$enable_sigc" = "xyes" && test "$SIGC_LIBS"!=""; then
#dnl earlier versions of libsigc++ might also work (>= 0.85)
#	AM_PATH_SIGC(1.0.0,,
#	     AC_MSG_WARN(Couldn't find libgsigc++ VDK will be build without it))
#	LIBS="$LIBS $SIGC_LIBS"
#	CFLAGS="$CFLAGS $SIGC_CFLAGS"
#	CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS"
#	SIGCDEFINE="-DUSE_SIGCPLUSPLUS"
#	WITHSIGC="yes"
#else
#	SIGCDEFINE=""
#	SIGC_CFLAGS=""
#	SIGC_LIBS="-lpthread"
#	WITHSIGC="no"
#fi

#if test "x$enable_testsigc" = "xyes" && test "$SIGCDEFINE" != ""; then
#	TESTSIGCVDK="testsigcvdk"
#	WITHTESTSIGCVDK="yes"	
#else
#	TESTSIGCVDK=""
#	WITHTESTSIGCVDK="no"	
#fi
#AC_SUBST(TESTSIGCVDK)

#-------------------------
# to hide sigc implementation
# subst all above with this
LIBS="$LIBS -lpthread"
SIGCDEFINE=""
SIGC_CFLAGS=""
SIGC_LIBS="-lpthread"
WITHSIGC="no"
AC_SUBST(SIGC_CFLAGS)
AC_SUBST(SIGC_LIBS)
AC_SUBST(SIGCDEFINE)
TESTSIGCVDK=""
WITHTESTSIGCVDK="no"
AC_SUBST(TESTSIGCVDK)
#--------------------------




# doxygen support
if test "x$enable_doc_html" = "xyes"; then
	GENERATE_HTML=YES
#	TAG_SIGC=USE_SIGCPLUSPLUS
	TAG_SIGC=""
else
	GENERATE_HTML=NO
	TAG_SIGC=""
fi

if test "x$enable_devel" = "xyes"; then
  cflag="-g"
fi

if test "x$enable_doc_latex" = "xyes"; then
	GENERATE_LATEX=YES
#	TAG_SIGC=USE_SIGCPLUSPLUS
else
	GENERATE_LATEX=NO
fi

if test "x$enable_doc_man" = "xyes"; then
	GENERATE_MAN=YES
#	TAG_SIGC=USE_SIGCPLUSPLUS
else
	GENERATE_MAN=NO

fi

AC_SUBST(GENERATE_HTML)
AC_SUBST(GENERATE_LATEX)
AC_SUBST(GENERATE_MAN)
AC_SUBST(TAG_SIGC)


GNOMEDEFINE=""
GNOME_CFLAGS=""
GNOME_LIBS=""
GNOME_VDK=""

AC_SUBST(GNOMEDEFINE)
AC_SUBST(GNOME_LIBS)
AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_VDK)

# just to be fully gtk2.x compliant...
dnlCXXFLAGS="$CXXFLAGS -DGTK_DISABLE_DEPRECATED -Wall -Wcast-qual -Woverloaded-virtual -Wconversion -Wstrict-prototypes -Winline"

CXXFLAGS="$CXXFLAGS -Wall -Wcast-qual -Woverloaded-virtual -Wconversion -Wstrict-prototypes -Winline"

AC_SUBST(CXXFLAGS)

INCLUDES="$GTK_CFLAGS $SIGC_CFLAGS $SIGCDEFINE"



AC_SUBST(INCLUDES)



dnl	  contrib/Makefile 
dnl	  testvdk/pixmap/Makefile 
dnl	  sigcvdktest/Makefile 
dnl       vdk.spec \

AC_OUTPUT([Makefile \
	vdk/Makefile \
	vdk/vdkfeatures.h \
	testvdk/Makefile \
	sigcvdktest/Makefile \
	example/Makefile \
	doc/Makefile \
	doc/doxy/Makefile \
	doc/doxy/Doxyfile \
	vdk-2.m4 \
	vdk-config-2], \
	[chmod +x vdk-config-2])	

if test -z $DOXYGEN; then
	echo "*****************************************************"; 
	echo "* doxygen was not found, i will not be able to      *"; 
	echo "* generate the docs by myself.                      *"; 
	echo "* Doxygen is recommended, please check:             *"; 
	echo "* http://www.doxygen.org/download.html              *"; 
	echo "* for the latest version of doxygen.                *";  
	echo "*****************************************************";
	WITHDOCHTML="no"
else
	WITHDOCHTML="yes"
fi

echo ""
echo "VDK configure finished"
echo "VDK configuration:"
echo " 	- Version      			    : $VERSION"
echo " 	- Make static lib		    : $enable_static"
echo " 	- Make vdk test program		    : $enable_testvdk"
echo " 	- Libsigc++ signal extension support: $WITHSIGC"
echo " 	- Make signal extension test program: $WITHTESTSIGCVDK"
if test "x$WITHSIGC" = "xyes"; then
echo	"**************************************************************"
echo	"You have choosed to use Libsigc++ with VDK which is"
echo	"deprecated and will be unsupported in the near future"
echo	"**************************************************************"
fi
echo " 	- Gnome support			    : $WITHGNOME"
echo " 	- Debug        			    : $enable_debug"
echo " 	- Optimization 			    : $enable_opt"
echo " 	- Make docs on html format	    : $WITHDOCHTML"
echo " 	* Host                              : $host"
echo " 	* Installation Prefix               : $prefix"
echo " 	* Compiler version                  :" `g++ --version`
echo " 	* Target machine                    :" `c++ -dumpmachine`
#echo " 	* CPU                               :" `cat /proc/cpuinfo`