File: configure.in

package info (click to toggle)
sip 2.5-2.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,340 kB
  • ctags: 1,472
  • sloc: ansic: 11,902; sh: 6,482; yacc: 1,987; cpp: 540; lex: 423; makefile: 104
file content (337 lines) | stat: -rw-r--r-- 6,245 bytes parent folder | download
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
dnl Copyright (c) 1999, 2000, 2001 Phil Thompson <phil@river-bank.demon.co.uk>


dnl Initialise.

AC_INIT(sip/main.c)
AM_INIT_AUTOMAKE(sip,2.5)
AM_CONFIG_HEADER(config.h)


dnl The extra options.

AC_ARG_WITH(debug,           [  --with-debug            don't remove -g from CXXFLAGS])
AC_ARG_ENABLE(qt,            [  --enable-qt             enable Qt signal/slot support [default=yes]])
AC_ARG_WITH(qt-dir,          [  --with-qt-dir=DIR       Qt root directory is DIR])
AC_ARG_WITH(qt-includes,     [  --with-qt-includes=DIR  Qt include files are in DIR])
AC_ARG_WITH(qt-mocdir,       [  --with-qt-mocdir=DIR    Qt meta object compiler is in DIR])
AC_ARG_WITH(qt-includes,     [  --with-qt-includes=DIR  Qt include files are in DIR])
AC_ARG_WITH(qt-libraries,    [  --with-qt-libraries=DIR Qt library files are in DIR])
AC_ARG_WITH(python,          [  --with-python=FILE      Python executable is FILE])


dnl The programs needed.

AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CXX
AC_PROG_YACC
AM_PROG_LEX
AM_PROG_LIBTOOL


dnl The root directories we search for bits of Qt.

sip_qt_versions="1.44 2.00 2.0.1 2.0.2 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1"

sip_qt_base_dirs="/opt/qt /usr/lib/qt /usr/local/qt /usr/qt"
sip_qt_dirs="/usr/X11R6 /usr /usr/local"

sip_extra_qt_bin_dirs=
sip_extra_qt_lib_dirs=
sip_extra_qt_inc_dirs="/usr/include/qt"

for d in $sip_qt_base_dirs
do
	for v in $sip_qt_versions
	do
		sip_qt_dirs="$d-$v $sip_qt_dirs"
	done

	sip_qt_dirs="${d}2 $d $sip_qt_dirs"
done

if test ! "X$QTDIR" = "X"
then
	sip_qt_dirs="$QTDIR $sip_qt_dirs"
fi

dnl Forget it all if a Qt root directory was explicitly given.

if test ! "X$with_qt_dir" = "X"
then
	with_qt_mocdir="$with_qt_dir/bin"
	with_qt_includes="$with_qt_dir/include"
	with_qt_libraries="$with_qt_dir/lib"
fi


dnl Determine if Qt support is disabled.

if test "X$enable_qt" = "X" -o "$enable_qt" = "yes"
then
	sip_qt_support=yes
elif test "$enable_qt" = "no"
then
	sip_qt_support=no
else
	AC_MSG_ERROR([$enable_qt is not a valid value for --enable-qt])
fi


dnl Find the Qt meta object compiler.

sip_qt_moc=

if test $sip_qt_support = "yes"
then
	AC_MSG_CHECKING([for the Qt meta object compiler])

	if test ! "X$with_qt_mocdir" = "X"
	then
		qt_mocdirs=$with_qt_mocdir
	else
		qt_mocdirs=""

		for d in $sip_qt_dirs
		do
			qt_mocdirs="$qt_mocdirs $d/bin"
		done

		qt_mocdirs="$qt_mocdirs $sip_extra_qt_bin_dirs"
	fi

	for d in $qt_mocdirs
	do
		if test -x $d/moc
		then
			sip_qt_moc=$d/moc
			break
		fi
	done

	if test "X$sip_qt_moc" = "X"
	then
		AC_MSG_RESULT([not found - Qt support disabled])
		sip_qt_support=no
	else
		AC_MSG_RESULT($sip_qt_moc)
	fi

fi


dnl Find the Qt include files.

sip_qt_incdir=

if test $sip_qt_support = "yes"
then
	AC_MSG_CHECKING([for the Qt include files])

	if test ! "X$with_qt_includes" = "X"
	then
		qt_incdirs=$with_qt_includes
	else
		qt_incdirs=""

		for d in $sip_qt_dirs
		do
			qt_incdirs="$qt_incdirs $d/include"
		done

		qt_incdirs="$qt_incdirs $sip_extra_qt_inc_dirs"
	fi

	for d in $qt_incdirs
	do
		if test -r $d/qobject.h
		then
			sip_qt_incdir=$d
			break
		fi
	done

	if test "X$sip_qt_incdir" = "X"
	then
		AC_MSG_RESULT([not found - Qt support disabled])
		sip_qt_support=no
	else
		AC_MSG_RESULT($sip_qt_incdir)
	fi
fi


dnl Find the Qt library files.

sip_qt_libdir=

if test $sip_qt_support = "yes"
then
	AC_MSG_CHECKING([for the Qt library files])

	if test ! "X$with_qt_libraries" = "X"
	then
		qt_libdirs=$with_qt_libraries
	else
		qt_libdirs=""

		for d in $sip_qt_dirs
		do
			qt_libdirs="$qt_libdirs $d/lib"
		done

		qt_libdirs="$qt_libdirs $sip_extra_qt_lib_dirs"
	fi

	for d in $qt_libdirs
	do
		ls $d/libqt* 2>/dev/null >/dev/null

		if test $? = 0
		then
			sip_qt_libdir=$d
			break
		fi
	done

	if test "X$sip_qt_libdir" = "X"
	then
		AC_MSG_RESULT([not found - Qt support disabled])
		sip_qt_support=no
	else
		AC_MSG_RESULT($sip_qt_libdir)
	fi
fi


dnl Find X includes and libraries.

if test $sip_qt_support = "yes"
then
	AC_PATH_XTRA

	if test "$no_x" = "yes"
	then
		sip_qt_support=no
	fi
fi


dnl Strip -g from CFLAGS and CXXFLAGS.
 
if test "X$with_debug" = "X"
then
	save_CFLAGS="$CFLAGS"
	CFLAGS=
 
	for f in $save_CFLAGS
	do
		if test ! "$f" = "-g"
		then
			CFLAGS="$CFLAGS $f"
		fi
	done

	save_CXXFLAGS="$CXXFLAGS"
	CXXFLAGS=
 
	for f in $save_CXXFLAGS
	do
		if test ! "$f" = "-g"
		then
			CXXFLAGS="$CXXFLAGS $f"
		fi
	done
fi


dnl See if we can disable exceptions.

AC_MSG_CHECKING([for -fno-exceptions])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fno-exceptions"

AC_TRY_LINK([],[
	int i;
], sip_result=yes,
   sip_result=no)

CXXFLAGS="$save_CXXFLAGS"
AC_LANG_RESTORE
AC_MSG_RESULT($sip_result)

sip_noexcept=

if test $sip_result = "yes"
then
	sip_noexcept="-fno-exceptions"
fi


dnl Find Python.
 
if test "X$with_python" = "X"
then
        AC_PATH_PROG(sip_python_interp,python)
 
        if test "X$sip_python_interp" = "X"
        then
                AC_MSG_ERROR("Unable to find a Python interpreter")
        fi
else
        sip_python_interp=$with_python
fi
 
dnl Find the different bits of Python.
 
sip_pyprefix=`$sip_python_interp -c 'import sys; print sys.prefix'`
sip_pyversion=`$sip_python_interp -c 'import sys; print sys.version'`
sip_pyversion=`echo $sip_pyversion | cut -c -3`

dnl Make sure the user knows what version we have found.

AC_MSG_CHECKING([Python version])
AC_MSG_RESULT($sip_pyversion)


dnl Find the Python include files.

sip_python_incdir="$sip_pyprefix/include/python$sip_pyversion"

AC_MSG_CHECKING([for Python include files])

if test -r $sip_python_incdir/Python.h
then
	AC_MSG_RESULT($sip_python_incdir)
else
	AC_MSG_ERROR([Python.h not found])
fi


dnl Set the variables to be exported to the Makefile.

SIP_CPPFLAGS="-I$sip_python_incdir"
SIP_CXXFLAGS="$sip_noexcept"

if test $sip_qt_support = "yes"
then
	SIP_QT_MOC=$sip_qt_moc
	SIP_CPPFLAGS="-DSIP_QT_SUPPORT -I$sip_qt_incdir $X_CFLAGS $SIP_CPPFLAGS"
	SIP_LDFLAGS="-L$sip_qt_libdir -lqt $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
else
	SIP_QT_MOC=
	SIP_LDFLAGS=
fi

AC_SUBST(SIP_QT_MOC)
AC_SUBST(SIP_CPPFLAGS)
AC_SUBST(SIP_CXXFLAGS)
AC_SUBST(SIP_LDFLAGS)


dnl Generate the output.

AC_OUTPUT(Makefile sip/Makefile siplib/Makefile sip.spec)