source: trunk/third/bonobo/configure.in @ 17180

Revision 17180, 10.3 KB checked in by ghudson, 23 years ago (diff)
Merge with bonobo 1.0.19.
Line 
1AC_INIT(bonobo/bonobo-object.h)
2
3dnl
4dnl Due to sed scripts being split on 90 line blocks,
5dnl this macro needs to be right at the beginning until
6dnl xml-i18n-tools is fixed to use some other approach.
7dnl
8AM_PROG_XML_I18N_TOOLS
9
10BONOBO_CURRENT=2
11BONOBO_REVISION=0
12BONOBO_AGE=0
13
14AC_SUBST(BONOBO_CURRENT)
15AC_SUBST(BONOBO_REVISION)
16AC_SUBST(BONOBO_AGE)
17
18AM_CONFIG_HEADER(config.h)
19AM_INIT_AUTOMAKE(bonobo,1.0.19)
20AM_MAINTAINER_MODE
21AM_ACLOCAL_INCLUDE(macros)
22
23GNOME_INIT
24AC_ISC_POSIX
25AC_PROG_CC
26AC_STDC_HEADERS
27AC_PROG_YACC
28AC_ARG_PROGRAM
29AM_PROG_LIBTOOL
30
31GNOME_COMPILE_WARNINGS
32GNOME_X_CHECKS
33
34AC_SUBST(CFLAGS)
35AC_SUBST(CPPFLAGS)
36AC_SUBST(LDFLAGS)
37
38dnl ====================================
39dnl =
40dnl = Profiling support
41dnl =
42dnl ====================================
43ENABLE_PROFILER=
44AC_ARG_ENABLE(profiler,
45[  --enable-profiler            Enable profiler],
46ENABLE_PROFILER=1)
47#AC_DEFINE(ENABLE_PROFILER))
48
49if test "x$ENABLE_PROFILER" = "x1"
50then
51        PROF_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES"
52        PROF_LDFLAGS="-L/gnome/PROFILE/lib -lprofiler -lpthread"
53fi
54
55# AC_SUBST(ENABLE_PROFILER)
56AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
57AC_SUBST(PROF_CFLAGS)
58AC_SUBST(PROF_LDFLAGS)
59dnl ====================================
60dnl = Profiling support
61dnl ====================================
62
63ALL_LINGUAS="az ca da de el en_GB es eu fi fr ga gl hu it ja ko lt nl no pl pt pt_BR ro ru sk sl sv uk wa tr zh_CN zh_TW"
64AM_GNOME_GETTEXT
65# AM_GNOME_GETTEXT above substs $DATADIRNAME
66# this is the directory where the *.{mo,gmo} files are installed
67bonobolocaledir='${prefix}/${DATADIRNAME}/locale'
68AC_SUBST(bonobolocaledir)
69
70dnl ORBit
71AC_MSG_CHECKING(ORBit version)
72orbit_version=`orbit-config --version | awk '{print $2;}'`
73AC_MSG_RESULT($orbit_version)
74orbit_version=`echo $orbit_version | awk -F. '{print $1 * 10000 + $2 * 100 + $3;}'`
75if test 0$orbit_version -lt 000512; then
76        AC_MSG_ERROR(ORBit 0.5.12 or later required)
77fi
78
79dnl libIDL
80AC_MSG_CHECKING(for libIDL >= 0.6.8)
81if gnome-config --libs libIDL > /dev/null 2>&1; then
82        verstxt=`gnome-config --modversion libIDL`
83        vers=`echo "$verstxt" | sed -e "s/^libIDL-//" | \
84                awk -F. '{ printf "%d", $1 * 10000 + $2 * 100 + $3; }'`
85else
86        vers=0
87fi
88
89if test "$vers" -ge 0608; then
90        AC_MSG_RESULT(found $verstxt)
91else
92        AC_MSG_ERROR(not found)
93fi
94
95dnl Test for dladdr
96AC_MSG_CHECKING(for dladdr)
97have_dladdr=false
98AC_TRY_COMPILE([
99#define _GNU_SOURCE
100#include <dlfcn.h>], [
101{
102        Dl_info info;
103        int     a;
104        a = dladdr ("SHLIB_ID", &info);
105}], have_dladdr=true)
106
107if $have_dladdr; then
108        AC_MSG_RESULT(found)
109        AC_DEFINE(HAVE_DLADDR)
110else
111        AC_MSG_RESULT(not found - no auto shlib factory unloads)
112fi
113
114BONOBO_IDL_CFLAGS=`gnome-config --cflags gnome libIDL`
115BONOBO_IDL_LIBS=`gnome-config --libs gnome libIDL`
116AC_SUBST(BONOBO_IDL_CFLAGS)
117AC_SUBST(BONOBO_IDL_LIBS)
118
119
120#######################
121# type alignment test #
122#######################
123
124AC_DEFUN(AC_CHECK_ALIGNOF,
125[changequote(<<, >>)dnl
126dnl The name to #define.
127define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl
128dnl The cache variable name.
129define(<<AC_CV_NAME>>, translit(ac_cv_alignof_$1, [ *], [_p]))dnl
130changequote([, ])dnl
131AC_MSG_CHECKING(alignment of $1)
132align_save_libs="$LIBS"
133LIBS="$GLIB_LIBS $LIBS"
134align_save_flags="$CFLAGS"
135CFLAGS="`orbit-config --cflags client` $CFLAGS"
136AC_CACHE_VAL(AC_CV_NAME,
137[AC_TRY_RUN([
138#include <stdio.h>
139#include <orb/orbit.h>
140typedef struct {char s1;} CORBA_struct;
141typedef void *CORBA_pointer;
142struct test {char s1; $1 s2;};
143main()
144{
145  FILE *f=fopen("conftestval", "w");
146  if (!f) exit(1);
147  fprintf(f, "%d\n", &(((struct test*)0)->s2));
148  exit(0);
149}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, AC_CV_NAME=0)])dnl
150AC_MSG_RESULT($AC_CV_NAME)
151LIBS="$align_save_libs"
152CFLAGS="$align_save_flags"
153AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
154undefine([AC_TYPE_NAME])dnl
155undefine([AC_CV_NAME])dnl
156])
157
158orig_CPPFLAGS=$CPPFLAGS
159CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
160AC_CHECK_ALIGNOF(CORBA_short)
161AC_CHECK_ALIGNOF(CORBA_long)
162AC_CHECK_ALIGNOF(CORBA_unsigned_short)
163AC_CHECK_ALIGNOF(CORBA_unsigned_long)
164AC_CHECK_ALIGNOF(CORBA_float)
165AC_CHECK_ALIGNOF(CORBA_double)
166AC_CHECK_ALIGNOF(CORBA_char)
167AC_CHECK_ALIGNOF(CORBA_boolean)
168AC_CHECK_ALIGNOF(CORBA_octet)
169AC_CHECK_ALIGNOF(CORBA_long_double)
170AC_CHECK_ALIGNOF(CORBA_wchar)
171AC_CHECK_ALIGNOF(CORBA_long_long)
172AC_CHECK_ALIGNOF(CORBA_unsigned_long_long)
173AC_CHECK_ALIGNOF(CORBA_struct)
174AC_CHECK_ALIGNOF(CORBA_pointer)
175CPPFLAGS=$orig_CPPFLAGS
176
177dnl bonobrowser needs libuuid and at least version 0.6.4 of libIDL
178dnl we might also want to check for mmap
179
180dnl build_bonobrowser=false
181
182dnl check for libuuid
183dnl lib_uuid=false
184dnl AC_CHECK_LIB(uuid, uuid_generate, lib_uuid=true, [AC_MSG_WARN([
185       
186dnl You need Theodore Ts'o's uuid library to compile bonobrowser.
187dnl If you're running Redhat, this may be as simple as typing...
188dnl ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so
189dnl ...as root.
190dnl
191dnl not building bonobrowser
192dnl     ])
193dnl ])
194dnl
195dnl
196dnl check for libidl
197dnl lib_idl=false
198dnl AM_PATH_LIBIDL(0.6.4, lib_idl=true,[
199dnl     AC_MSG_WARN([
200dnl
201dnl You need libIDL 0.6.4 or higher to compile bonobrowser
202dnl
203dnl not building bonobrowser
204dnl     ])
205dnl ])
206dnl
207dnl if test "x$lib_uuid" = "xtrue" ; then
208dnl     if test "x$lib_idl" = "xtrue" ; then
209dnl             build_bonobrowser=true
210dnl     fi
211dnl fi
212dnl
213dnl BonoboBrowser needs porting to oaf.
214AM_CONDITIONAL(BUILD_BONOBROWSER, false)
215
216
217dnl
218dnl  We need the right version of gnome-libs for the new
219dnl dock sizing logic.
220dnl
221AC_MSG_CHECKING(for gnome-libs >= 1.2.7)
222vers=`gnome-config --modversion gnome | sed -e "s/gnome-libs-//" | \
223                awk 'BEGIN { FS = "."; } { printf "%d", $1 * 10000 + $2 * 100 + $3;}'`
224if test "$vers" -ge 10207; then
225        AC_MSG_RESULT(found)
226else
227        AC_MSG_ERROR(not found)
228fi
229
230dnl Check for oaf
231have_oaf=true
232AC_MSG_CHECKING(for Oaf >= 0.6.7)
233vers=`gnome-config --modversion oaf | sed -e "s/oaf-//" | \
234                awk 'BEGIN { FS = "."; } { printf "%d", $1 * 10000 + $2 * 100 + $3;}'`
235if test "$vers" -ge 607; then
236        AC_DEFINE(USING_OAF)
237        AC_MSG_RESULT(found)
238else
239        AC_MSG_ERROR(not found)
240fi
241
242dnl
243dnl  We need the right version of libxml for the UI handler
244dnl prior versions have a nasty fatal bug
245dnl
246AC_MSG_CHECKING(for libXml >= 1.8.15)
247vers=`gnome-config --modversion xml | sed -e "s/xml-//" | \
248                awk 'BEGIN { FS = "."; } { printf "%d", $1 * 10000 + $2 * 100 + $3;}'`
249if test "$vers" -ge 10815; then
250        AC_MSG_RESULT(found)
251else
252        AC_MSG_ERROR(not found)
253fi
254
255dnl AM_CONDITIONAL(USE_UI_HANDLER, true)
256dnl AC_SUBST(USE_UI_HANDLER)
257dnl AC_DEFINE(USE_UI_HANDLER)
258
259dnl gtk-doc stuff
260
261AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
262AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
263AC_SUBST(HAVE_GTK_DOC)
264
265dnl Let people disable the gtk-doc stuff.
266AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
267
268if test x$enable_gtk_doc = xauto ; then
269  if test x$GTKDOC = xtrue ; then
270    enable_gtk_doc=yes
271  else
272    enable_gtk_doc=no
273  fi
274fi
275dnl NOTE: We need to use a separate automake conditional for this
276dnl       to make this work with the tarballs.
277AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
278
279AM_PATH_GDK_PIXBUF(0.6.0, ,AC_MSG_ERROR([Need gdk-pixbuf!]))
280
281dnl ******************************
282dnl GnomePrint checking
283dnl ******************************
284AC_MSG_CHECKING(for GnomePrint libraries >= 0.16)
285if gnome-config --libs print > /dev/null 2>&1; then
286    vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" | \
287        awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
288    if test "$vers" -ge 16; then
289        AC_MSG_RESULT(found)
290    else
291        AC_MSG_ERROR(You need at least gnome-print 0.16 for this version of bonobo)
292    fi
293else
294    AC_MSG_ERROR(Did not find gnome-print installed)
295fi
296
297GNOME_PRINT_LIBS="`$GNOME_CONFIG --libs print`"
298AC_SUBST(GNOME_PRINT_LIBS)
299
300have_vfs=false
301dnl AC_MSG_CHECKING(for Gnome Vfs >= 0.4.2.0)
302dnl if gnome-config --libs vfs > /dev/null 2>&1; then
303dnl     vers=`gnome-config --modversion vfs | sed -e "s/gnome-vfs-//" -e 's/cvs$//' | \
304dnl         awk 'BEGIN { FS = "."; } { print $1 * 100000 + $2 * 10000 + $3 * 100 + $4;}'`
305dnl     if test "$vers" -ge 040200; then
306dnl        AC_MSG_RESULT(found)
307dnl     VFS_LIBS=`gnome-config --libs vfs`
308dnl     VFS_CFLAGS=`gnome-config --cflags vfs`
309dnl     have_vfs=true
310dnl     else
311dnl      AC_MSG_ERROR(not found)
312dnl     fi
313dnl else
314dnl    AC_MSG_ERROR(not found)
315dnl fi
316
317AC_SUBST(VFS_LIBS)
318AC_SUBST(VFS_CFLAGS)
319AM_CONDITIONAL(HAVE_VFS,$have_vfs)
320
321dnl
322dnl For the various bonoboConf.sh scripts generation.
323dnl
324BONOBO_LIBDIR='-L${libdir}'
325BONOBO_INCLUDEDIR="-I${includedir}/gnome-1.0 `$GNOME_CONFIG --cflags gnomeui gdk_pixbuf print oaf xml`"
326BONOBO_LIBS="-lbonobo `$GNOME_CONFIG --libs oaf gtk gnome`"
327BONOBOX_LIBS="$BONOBO_LIBS -lbonobox `$GNOME_CONFIG --libs gnomeui gdk_pixbuf xml`"
328BONOBOX_PRINT_LIBS="$BONOBOX_LIBS -lbonobo-print `$GNOME_CONFIG --libs print`"
329XML_LIBS="`$GNOME_CONFIG --libs xml`"
330
331AC_SUBST(BONOBO_LIBDIR)
332AC_SUBST(BONOBO_INCLUDEDIR)
333AC_SUBST(BONOBO_LIBS)
334AC_SUBST(BONOBOX_LIBS)
335AC_SUBST(BONOBOX_PRINT_LIBS)
336AC_SUBST(XML_LIBS)
337
338dnl
339dnl For building tests within bonobo
340dnl
341BONOBO_TEST_CFLAGS=`$GNOME_CONFIG --cflags oaf glib gtk gnome`
342BONOBO_TEST_LIBS=`$GNOME_CONFIG --libs oaf glib gtk gnome`
343BONOBOX_TEST_CFLAGS=`$GNOME_CONFIG --cflags oaf gnomeui gdk_pixbuf print`
344BONOBOX_TEST_LIBS=`$GNOME_CONFIG --libs oaf gnomeui gdk_pixbuf print`
345
346AC_SUBST(BONOBO_TEST_LIBS)
347AC_SUBST(BONOBO_TEST_CFLAGS)
348AC_SUBST(BONOBOX_TEST_LIBS)
349AC_SUBST(BONOBOX_TEST_CFLAGS)
350
351dnl
352dnl For includes whilst building bonobo
353dnl
354OAF_CFLAGS=`$GNOME_CONFIG --cflags oaf`
355AC_SUBST(OAF_CFLAGS)
356
357if test "x$with_html_dir" = "x" ; then
358  HTML_DIR='${datadir}/bonobo/html'
359else
360  HTML_DIR=$with_html_dir
361fi
362
363AC_SUBST(HTML_DIR)
364
365AC_CONFIG_SUBDIRS(libefs)
366
367AC_OUTPUT([
368bonobo.spec
369Makefile
370bonobo/Makefile
371storage-modules/Makefile
372monikers/Makefile
373components/Makefile
374components/application-x-gnomine/Makefile
375components/text-plain/Makefile
376components/audio-ulaw/Makefile
377components/audio-ulaw/doc/Makefile
378components/audio-ulaw/doc/C/Makefile
379components/selector/Makefile
380tests/Makefile
381samples/Makefile
382samples/controls/Makefile
383samples/compound-doc/Makefile
384samples/compound-doc/container/Makefile
385samples/compound-doc/bonobo-hello/Makefile
386samples/bonobo-class/Makefile
387gshell/Makefile
388doc/Makefile
389doc/api/Makefile
390doc/dia/Makefile
391idl/Makefile
392macros/Makefile
393po/Makefile.in
394intl/Makefile])
395
396echo "
397
398Configuration:
399
400        Source code location:   ${srcdir}
401        Compiler:               ${CC}
402"
Note: See TracBrowser for help on using the repository browser.