source: trunk/third/vte/configure.in @ 22012

Revision 22012, 15.1 KB checked in by rbasch, 20 years ago (diff)
Use the correct autoconf test for recvmsg(), which is in the socket library on Solaris, to fix descriptor passing between a vte client and gnome-pty-helper.
Line 
1AC_INIT(vte.pc.in)
2VERSION=`grep ^Version: $srcdir/vte.spec | awk '{print $NF}'`
3AM_INIT_AUTOMAKE(vte,$VERSION)
4
5AC_ISC_POSIX
6AC_PROG_CC
7AC_STDC_HEADERS
8AM_PROG_CC_STDC
9AM_MAINTAINER_MODE
10
11AM_PROG_LIBTOOL
12ALL_LINGUAS="am ar az be bg bn ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gu he hr hu id is it ja ko li lt lv mk ml mn ms ne nl nn no pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv tr uk vi wa zh_CN zh_TW"
13
14AM_GLIB_GNU_GETTEXT
15AC_CHECK_DECLS(bind_textdomain_codeset,,,[#include "libintl.h"])
16
17AC_PATH_XTRA
18CFLAGS="$X_CFLAGS $CFLAGS"
19LIBS="$X_LIBS $LIBS"
20
21if pkg-config --exists "gtk+-2.0 >= 2.2" ; then
22        MODULEGTK="gtk+-2.0 >= 2.2"
23        AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
24else
25        MODULEGTK="gtk+-2.0"
26fi
27PKG_CHECK_MODULES(GLIB,glib-2.0)
28PKG_CHECK_MODULES(GOBJECT,[glib-2.0 gobject-2.0])
29PKG_CHECK_MODULES(GTK,[glib-2.0 gobject-2.0 $MODULEGTK])
30
31wantedmodules="glib-2.0 gobject-2.0 $MODULEGTK fontconfig"
32
33# Let the user specify the default terminal emulation.
34AC_ARG_WITH(default-emulation,
35AS_HELP_STRING(--with-default-emulation=xterm,default terminal type to be emulated),
36emulation=$withval,emulation=xterm)
37AC_DEFINE_UNQUOTED(VTE_DEFAULT_EMULATION,"$emulation",[The default terminal type to be emulated.])
38VTE_DEFAULT_EMULATION=$emulation
39AC_SUBST(VTE_DEFAULT_EMULATION)
40
41# Use Xft2 if Pango has Xft2 support and it isn't disabled.
42if test "$have_x" = yes ; then
43        AC_ARG_WITH(xft2,[AS_HELP_STRING(--with-xft2,enable drawing using Xft2)],with_xft2=$withval,with_xft2=yes)
44        if test $with_xft2 = yes ; then
45                if pkg-config --exists pangoxft '>=' 1.1.0 ; then
46                        AC_DEFINE(HAVE_XFT2,1,[Whether we have Xft2])
47                        wantedmodules="$wantedmodules pangoxft >= 1.1.0"
48                        wantedmodules="xft >= 2.0 $wantedmodules"
49                else
50                        AC_MSG_WARN([Xft2 not detected])
51                fi
52        fi
53fi
54
55# Use PangoX if we have it and it isn't disabled.
56if test "$have_x" = yes ; then
57        AC_ARG_WITH(pangox,[AS_HELP_STRING(--with-pangox,enable drawing using PangoX)],with_pangox=$withval,with_pangox=yes)
58        if test $with_pangox = yes ; then
59                if pkg-config --exists pangox ; then
60                        AC_DEFINE(HAVE_PANGOX,1,[Whether we have PangoX])
61                        wantedmodules="$wantedmodules pangox"
62                else
63                        AC_MSG_WARN([PangoX not detected])
64                fi
65        fi
66fi
67
68# Use glX if we have it and it isn't disabled.
69if test "$have_x" = yes ; then
70        AC_ARG_WITH(glX,[AS_HELP_STRING(--with-glX,enable drawing using glX)],with_glx=$withval,with_glx=no)
71        if test $with_glx = yes ; then
72                have_gl=0
73                have_libgl=0
74                AC_CHECK_HEADERS(GL/glx.h)
75                if test $ac_cv_header_GL_glx_h = yes ; then
76                        AC_CHECK_FUNC(glXQueryExtension,[have_gl=1],AC_CHECK_LIB(GL,glXQueryExtension,[have_gl=1;have_libgl=1]))
77                fi
78                if test $have_gl = 1 ; then
79                        AC_DEFINE(HAVE_GL,1,[Whether we have GL and glX.])
80                fi
81                if test $have_libgl = 1 ; then
82                        LIBS="-lGLU -lGL $LIBS"
83                fi
84        fi
85fi
86
87# Search for the required modules.
88PKG_CHECK_MODULES(VTE,[$wantedmodules])
89NEEDEDPACKAGES="$wantedmodules"
90AC_SUBST(NEEDEDPACKAGES)
91
92# Require Freetype2.  We use our local copy of the macro because packages of
93# freetype's development files don't always include the proper macro.
94VTE_CHECK_FT2(6.1.0,,[AC_MSG_ERROR([You must have freetype 2.0.2 or later to build vte.])])
95
96# Temporarily pull in the Freetype cflags and libs for checking what's
97# available in this version.
98savecflags="$CFLAGS"
99CFLAGS="$CFLAGS $FT2_CFLAGS"
100savecppflags="$CPPFLAGS"
101CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
102if test -d "$ac_x_includes" ; then
103        CFLAGS="$CFLAGS -I$ac_x_includes"
104        CPPFLAGS="$CPPFLAGS -I$ac_x_includes"
105fi
106AC_CHECK_HEADERS(ft2build.h)
107if test x$ac_cv_header_ft2build_h != xyes ; then
108        AC_MSG_ERROR([You must have freetype 2.0.2 or later to build vte.])
109fi
110
111AC_CHECK_DECL(ft_render_mode_mono,[AC_DEFINE(HAVE_DECL_ft_render_mode_mono,1,Define if your freetype2 installation defines ft_render_mode_mono.)],,[
112#ifdef HAVE_FT2BUILD_H
113#include <ft2build.h>
114#include FT_FREETYPE_H
115#endif
116])
117
118AC_CHECK_DECL(FT_RENDER_MODE_MONO,[AC_DEFINE(HAVE_DECL_FT_RENDER_MODE_MONO,1,Define if your freetype2 installation defines FT_RENDER_MODE_MONO.)],,[
119#ifdef HAVE_FT2BUILD_H
120#include <ft2build.h>
121#include FT_FREETYPE_H
122#endif
123])
124
125AC_CHECK_DECLS(FT_LOAD_NO_HINTING,,,[
126#ifdef HAVE_FT2BUILD_H
127#include <ft2build.h>
128#include FT_FREETYPE_H
129#endif
130])
131
132AC_CHECK_DECLS(FT_RENDER_MODE_LIGHT,,,[
133#ifdef HAVE_FT2BUILD_H
134#include <ft2build.h>
135#include FT_FREETYPE_H
136#endif
137])
138
139AC_CHECK_DECLS(FT_RENDER_MODE_NORMAL,,,[
140#ifdef HAVE_FT2BUILD_H
141#include <ft2build.h>
142#include FT_FREETYPE_H
143#endif
144])
145
146AC_CHECK_DECL(FT_PIXEL_MODE_MONO,[AC_DEFINE(HAVE_DECL_FT_PIXEL_MODE_MONO,1,Define if your freetype2 build declares FT_PIXEL_MODE_MONO.)],,[
147#ifdef HAVE_FT2BUILD_H
148#include <ft2build.h>
149#include FT_FREETYPE_H
150#endif
151])
152AC_CHECK_DECL(ft_pixel_mode_mono,[AC_DEFINE(HAVE_DECL_ft_pixel_mode_mono,1,Define if your freetype2 build declares ft_pixel_mode_mono.)],,[
153#ifdef HAVE_FT2BUILD_H
154#include <ft2build.h>
155#include FT_FREETYPE_H
156#endif
157])
158
159AC_CHECK_DECLS(FT_PIXEL_MODE_GRAY2,,,[
160#ifdef HAVE_FT2BUILD_H
161#include <ft2build.h>
162#include FT_FREETYPE_H
163#endif
164])
165AC_CHECK_DECLS(FT_PIXEL_MODE_GRAY4,,,[
166#ifdef HAVE_FT2BUILD_H
167#include <ft2build.h>
168#include FT_FREETYPE_H
169#endif
170])
171
172AC_CHECK_DECL(FT_PIXEL_MODE_GRAY,[AC_DEFINE(HAVE_DECL_FT_PIXEL_MODE_GRAY,1,Define if your freetype2 build declares FT_PIXEL_MODE_GRAY.)],,[
173#ifdef HAVE_FT2BUILD_H
174#include <ft2build.h>
175#include FT_FREETYPE_H
176#endif
177])
178AC_CHECK_DECL(ft_pixel_mode_grays,[AC_DEFINE(HAVE_DECL_ft_pixel_mode_grays,1,Define if your freetype2 build declares ft_pixel_mode_grays.)],,[
179#ifdef HAVE_FT2BUILD_H
180#include <ft2build.h>
181#include FT_FREETYPE_H
182#endif
183])
184
185AC_CHECK_DECLS(FT_PIXEL_MODE_LCD,,,[
186#ifdef HAVE_FT2BUILD_H
187#include <ft2build.h>
188#include FT_FREETYPE_H
189#endif
190])
191
192CFLAGS="$savecflags"
193CPPFLAGS="$savecppflags"
194
195# Use all available features under glibc, and disable accidental use of
196# deprecated functionality.
197AC_EGREP_CPP(glibc,
198                [
199                 #include <stdio.h>
200                 #ifdef __GLIBC__
201                 glibc
202                 #endif
203                ],
204                AC_DEFINE(_GNU_SOURCE,1,[Use all glibc features.]))
205AC_DEFINE(_XOPEN_SOURCE_EXTENDED,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
206AC_DEFINE(_XOPEN_SOURCE,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
207AC_DEFINE(__EXTENSIONS__,1,[Needed to get declarations for msg_control and msg_controllen on Solaris])
208
209AC_ARG_ENABLE(deprecation,[AS_HELP_STRING(--enable-deprecation,prohibit VTE from using deprecated GLib/Pango/GDK/GTK+ features)],usedeprecation=$enableval,usedeprecation=no)
210if test "$usedeprecation" = yes ; then
211AC_DEFINE(G_DISABLE_DEPRECATED,1,[Disable deprecated GLib features.])
212AC_DEFINE(GDK_DISABLE_DEPRECATED,1,[Disable deprecated GDK features.])
213AC_DEFINE(GDK_PIXBUF_DISABLE_DEPRECATED,1,[Disable deprecated gdk-pixbuf features.])
214AC_DEFINE(GTK_DISABLE_DEPRECATED,1,[Disable deprecated GTK+ features.])
215AC_DEFINE(PANGO_DISABLE_DEPRECATED,1,[Disable deprecated Pango features.])
216fi
217
218# Miscellaneous definitions.
219AC_DEFINE(VTE_UTF8_BPC,6,[Maximum number of bytes used per UTF-8 character.])
220AC_DEFINE(VTE_INVALID_SOURCE,-1,[A number which can never be a valid source ID.])
221AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE",[Package name.])
222
223# Check for headers.
224AC_CHECK_HEADERS(sys/select.h sys/termios.h sys/un.h stropts.h termios.h wchar.h)
225AC_HEADER_TIOCGWINSZ
226
227# Check for PTY handling functions.
228AC_CHECK_FUNCS(cfmakeraw getpgid getpt grantpt unlockpt ptsname ptsname_r)
229
230# Pull in the right libraries for various functions which might not be
231# bundled into an exploded libc.
232AC_CHECK_FUNC(socket,[have_socket=1],AC_CHECK_LIB(socket,socket,[have_socket=1; LIBS="$LIBS -lsocket"]))
233AC_CHECK_FUNC(socketpair,[have_socketpair=1],AC_CHECK_LIB(socket,socketpair,[have_socketpair=1; LIBS="$LIBS -lsocket"]))
234AC_CHECK_FUNC(recvmsg,[have_recvmsg=1],AC_CHECK_LIB(socket,recvmsg,[have_recvmsg=1; LIBS="$LIBS -lsocket -lnsl"]))
235if test x$have_socket = x1 ; then
236        AC_DEFINE(HAVE_SOCKET,1,[Define if you have the socket function.])
237fi
238if test x$have_socketpair = x1 ; then
239        AC_DEFINE(HAVE_SOCKETPAIR,1,[Define if you have the socketpair function.])
240fi
241if test x$have_recvmsg = x1 ; then
242        AC_DEFINE(HAVE_RECVMSG,1,[Define if you have the recvmsg function.])
243fi
244AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
245
246# Look for ncurses or curses or termcap.
247AC_CHECK_HEADER(ncurses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(ncurses,tgetent,[LIBS="-lncurses $LIBS";AC_DEFINE(HAVE_NCURSES,1,[Define if you have ncurses.h and libncurses])])])])
248if test x$ac_cv_lib_ncurses_tgetent != xyes ; then
249        AC_CHECK_HEADER(curses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(curses,tgetent,[LIBS="-lcurses $LIBS";AC_DEFINE(HAVE_CURSES,1,[Define if you have curses.h and libcurses])])])])
250        if test x$ac_cv_lib_curses_tgetent != xyes ; then
251                AC_CHECK_HEADER(termcap.h,[AC_CHECK_LIB(termcap,tgetent,[LIBS="-ltermcap $LIBS";AC_DEFINE(HAVE_TERMCAP,1,[Define if you have termcap.h and libtermcap])])])
252                if test x$ac_cv_header_termcap_h != xyes ; then
253                        AC_MSG_ERROR([You must have at least one of ncurses, curses, or libtermcap installed to build vte.])
254                fi
255        fi
256fi
257
258# Save the names of these other libraries.
259OTHERCFLAGS="$X_CFLAGS"
260AC_SUBST(OTHERCFLAGS)
261OTHERLIBS="$LIBS"
262AC_SUBST(OTHERLIBS)
263
264# Enable debugging messages and additional run-time checks.
265AC_ARG_ENABLE(debugging,[AS_HELP_STRING(--enable-debugging,enable extra debugging checks and logging messages)],DEBUG=$enableval,DEBUG=no)
266if test x$DEBUG != x ; then
267        if test x$DEBUG != xno ; then
268                if test x$GCC = xyes ; then
269                        AC_CHECK_CC_OPT(-std=c99,vte_std_c99)
270                        CFLAGS="${CFLAGS} $vte_std_c99"
271                        CFLAGS="${CFLAGS} -Wall"
272                        CFLAGS="${CFLAGS} -Waggregate-return"
273                        CFLAGS="${CFLAGS} -Wcast-align"
274                        CFLAGS="${CFLAGS} -Wimplicit"
275                        CFLAGS="${CFLAGS} -Wmissing-declarations"
276                        CFLAGS="${CFLAGS} -Wmissing-prototypes"
277                        CFLAGS="${CFLAGS} -Wpointer-arith"
278                        CFLAGS="${CFLAGS} -Wstrict-prototypes"
279                        CFLAGS="${CFLAGS} -Wuninitialized"
280                        #CFLAGS="${CFLAGS} -Wsign-compare"
281                        #CFLAGS="${CFLAGS} -Wunused-value"
282                fi
283                VTE_DEBUG=1
284        fi
285fi
286if test x$VTE_DEBUG = x1 ; then
287        AC_MSG_RESULT([enabling debug checks and messages])
288        AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.])
289fi
290
291wcs_funcs_includes="
292#ifdef HAVE_STRING_H
293# if !STDC_HEADERS && HAVE_MEMORY_H
294#  include <memory.h>
295# endif
296# include <string.h>
297#else
298# ifdef HAVE_STRINGS_H
299#  include <strings.h>
300# endif
301#endif
302#ifdef HAVE_WCHAR_H
303# include <wchar.h>
304#endif
305"
306
307AC_CHECK_TYPES(wint_t, AC_DEFINE(HAVE_WINT_T, , [Defined when the wint_t type is supported]), ,$wcs_funcs_includes)
308
309# Search for Python.
310BUILD_PYTHON=true
311AC_ARG_ENABLE(python, [AS_HELP_STRING(--enable-python,Build python bindings [default=yes])],[
312if test x"$enableval" != xno ; then
313        BUILD_PYTHON=true
314else
315        BUILD_PYTHON=false
316fi],BUILD_PYTHON=true)
317
318if $BUILD_PYTHON ; then
319        AM_PATH_PYTHON
320        if test -z "$PYTHON" ; then
321                BUILD_PYTHON=false
322        fi
323fi
324
325if $BUILD_PYTHON ; then
326        AC_MSG_CHECKING(for python >= 2.2)
327        prog="
328import sys, string
329minver = (2,2,0,'final',0)
330if sys.version_info < minver:
331        sys.exit(1)
332sys.exit(0)
333"
334        if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
335        then
336                AC_MSG_RESULT([okay])
337        else
338                BUILD_PYTHON=false
339                AC_MSG_RESULT([too old])
340        fi
341fi
342
343if $BUILD_PYTHON ; then
344        AM_CHECK_PYTHON_HEADERS(,BUILD_PYTHON=false)
345fi
346
347if $BUILD_PYTHON ; then
348        AC_MSG_CHECKING([for pygtk-2.0])
349        if pkg-config --exists pygtk-2.0 ; then
350                AC_MSG_RESULT([found])
351                PKG_CHECK_MODULES(PYGTK,[pygtk-2.0])
352                PYGTK_DATADIR=`pkg-config --variable=datadir pygtk-2.0`
353                AC_SUBST(PYGTK_DATADIR)
354        else
355                AC_MSG_RESULT([not found])
356                BUILD_PYTHON=false
357        fi
358fi
359
360if ! $BUILD_PYTHON ; then
361        AC_MSG_RESULT([Python bindings disabled.])
362fi
363
364AC_SUBST(PYTHONREV)
365AC_SUBST(PYTHONMODULES)
366AM_CONDITIONAL(BUILD_PYTHON_MODULES, $BUILD_PYTHON)
367
368# If we can find libzvt on the system, set up to build a variant of "reflect"
369# which uses it.
370REFLECT_ZVT=false
371if pkg-config --exists libzvt-2.0 ; then
372        REFLECT_ZVT=true
373        ZVT_DEFS=-DHAVE_ZVT
374        PKG_CHECK_MODULES(ZVT,[gtk+-2.0 libzvt-2.0])
375fi
376AC_SUBST(ZVT_DEFS)
377AM_CONDITIONAL(REFLECT_USE_ZVT, $REFLECT_ZVT)
378
379mylibdir=`eval echo $libdir`
380mylibexecdir=`eval echo $libexecdir`
381mydatadir=`eval echo $datadir`
382if test x$exec_prefix = xNONE ; then
383        if test x$prefix = xNONE ; then
384                mylibdir=` echo $mylibdir  | sed s,NONE,$ac_default_prefix,g`
385                mylibexecdir=` echo $mylibexecdir  | sed s,NONE,$ac_default_prefix,g`
386        else
387                mylibdir=` echo $mylibdir  | sed s,NONE,$prefix,g`
388                mylibexecdir=` echo $mylibexecdir  | sed s,NONE,$prefix,g`
389        fi
390fi
391if test x$prefix = xNONE ; then
392        mydatadir=`echo $mydatadir | sed s,NONE,$ac_default_prefix,g`
393fi
394AC_DEFINE_UNQUOTED(PKGLIBDIR,"$mylibdir/$PACKAGE",
395                   [The location where package-specific helpers can be found.])
396AC_DEFINE_UNQUOTED(LIBEXECDIR,"$mylibexecdir",
397                   [The location where package-specific helpers can be found.])
398AC_DEFINE_UNQUOTED(DATADIR,"$mydatadir",
399                   [The location where arch-independent package-specific data can be found.])
400AC_DEFINE_UNQUOTED(LOCALEDIR,"$mydatadir/locale",
401                   [The location where locale data can be found.])
402
403GETTEXT_PACKAGE=vte
404AC_SUBST(GETTEXT_PACKAGE)
405
406AC_ARG_ENABLE(gnome-pty-helper, [AS_HELP_STRING(--enable-gnome-pty-helper,Build a setuid helper for opening ptys [default=yes])], enable_gnome_pty_helper="$enableval", enable_gnome_pty_helper=yes)
407if test "$enable_gnome_pty_helper" != no; then
408        AC_DEFINE(VTE_USE_GNOME_PTY_HELPER,1,[Define if you intend to use gnome-pty-helper.])
409        AC_CONFIG_SUBDIRS(gnome-pty-helper)
410fi
411AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no])
412
413################################################################################
414
415# This is a check for gtk-doc which you can insert into your configure.in.
416# You shouldn't need to change it at all.
417
418##################################################
419# Check for gtk-doc.
420##################################################
421
422AC_ARG_WITH(html-dir, [AS_HELP_STRING(--with-html-dir=PATH,path to installed docs)])
423
424if test "x$with_html_dir" = "x" ; then
425  HTML_DIR='${datadir}/gtk-doc/html'
426else
427  HTML_DIR=$with_html_dir
428fi
429
430AC_SUBST(HTML_DIR)
431
432AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
433
434gtk_doc_min_version=0.6
435if $GTKDOC ; then
436    gtk_doc_version=`gtkdoc-mkdb --version`
437    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
438
439    IFS="${IFS=         }"; vte_save_IFS="$IFS"; IFS="."
440    set $gtk_doc_version
441    for min in $gtk_doc_min_version ; do
442        cur=$1; shift
443        if test -z $min ; then break; fi
444        if test -z $cur ; then GTKDOC=false; break; fi
445        if test $cur -gt $min ; then break ; fi
446        if test $cur -lt $min ; then GTKDOC=false; break ; fi
447    done
448    IFS="$vte_save_IFS"
449
450    if $GTKDOC ; then
451      AC_MSG_RESULT(yes)
452    else
453      AC_MSG_RESULT(no)
454    fi
455fi
456
457dnl Let people disable the gtk-doc stuff.
458AC_ARG_ENABLE(gtk-doc, [AS_HELP_STRING(--enable-gtk-doc,Use gtk-doc to build documentation [default=auto])], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
459
460if test x$enable_gtk_doc = xauto ; then
461  if test x$GTKDOC = xtrue ; then
462    enable_gtk_doc=yes
463  else
464    enable_gtk_doc=no
465  fi
466fi
467
468AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
469
470################################################################################
471
472AM_CONFIG_HEADER(config.h)
473
474AC_OUTPUT([
475Makefile
476src/Makefile
477termcaps/Makefile
478python/Makefile
479po/Makefile.in
480doc/Makefile
481doc/openi18n/Makefile
482doc/reference/Makefile
483vte.pc
484vte-uninstalled.pc
485])
Note: See TracBrowser for help on using the repository browser.