source: trunk/third/eel/configure.in @ 17274

Revision 17274, 11.0 KB checked in by amb, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17273, which included commits to RCS files with non-trunk default branches.
Line 
1AC_INIT(eel)
2
3dnl ==========================================================================
4dnl
5dnl If you add a version number here, you *must* add an AC_SUBST line for
6dnl it too, or it will never make it into the spec file!
7dnl
8dnl ==========================================================================
9
10GNOME_REQUIRED=1.2.8
11GNOME_LIBS_REQUIRED=1.2.11
12GTK_REQUIRED=1.2.9
13GLIB_REQUIRED=1.2.9
14GDK_PIXBUF_REQUIRED=0.10.0
15LIBXML_REQUIRED=1.8.10
16GNOME_VFS_REQUIRED=1.0
17FREETYPE_REQUIRED=2.0.1
18FREETYPE_LIBRARY_REQUIRED=6.1.0
19LIBRSVG_REQUIRED=1.0.0
20GCONF_REQUIRED=0.12
21OAF_REQUIRED=0.6.5
22
23AC_SUBST(LIBXML_REQUIRED)
24AC_SUBST(GNOME_VFS_REQUIRED)
25AC_SUBST(FREETYPE_REQUIRED)
26AC_SUBST(LIBRSVG_REQUIRED)
27
28dnl ===========================================================================
29
30if test -n "$GNOME2_PATH"; then
31        PATH="$GNOME2_PATH/bin:$PATH"
32        export PATH
33fi
34
35EEL_MAJOR_VERSION=1
36EEL_LIBTOOL_MAJOR_VERSION=`expr $EEL_MAJOR_VERSION - 1`
37EEL_MINOR_VERSION=0
38EEL_MICRO_VERSION=2
39EEL_VERSION=$EEL_MAJOR_VERSION.$EEL_MINOR_VERSION.$EEL_MICRO_VERSION
40EEL_VERSION_INFO=`expr $EEL_LIBTOOL_MAJOR_VERSION + $EEL_MINOR_VERSION`:$EEL_MICRO_VERSION:$EEL_MINOR_VERSION
41
42AC_SUBST(EEL_MAJOR_VERSION)
43AC_SUBST(EEL_MINOR_VERSION)
44AC_SUBST(EEL_MICRO_VERSION)
45AC_SUBST(EEL_VERSION)
46AC_SUBST(EEL_VERSION_INFO)
47
48VERSION=$EEL_VERSION
49
50AM_INIT_AUTOMAKE(eel, $VERSION)
51AM_CONFIG_HEADER(config.h)
52AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "eel")
53
54AM_MAINTAINER_MODE
55
56AM_DISABLE_STATIC
57AM_PROG_LIBTOOL
58
59AM_PROG_XML_I18N_TOOLS
60
61AM_SANITY_CHECK
62AC_PROG_CC
63AC_PROG_CPP
64AC_PROG_INSTALL
65AC_PROG_LN_S
66AC_PROG_MAKE_SET
67AC_ISC_POSIX
68
69AC_PROG_AWK
70AC_CHECK_PROGS(PERL, perl5 perl)
71
72_found_perl=0
73if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then
74  _found_perl=1
75else
76  # The version string for perl changed for 'version 5' to 'v5' in
77  # perl 5.6 or therabouts
78  if test -n "$PERL" && $PERL -v | grep 'v5.' > /dev/null ; then
79    _found_perl=1
80  fi
81
82fi
83
84REBUILD=\#
85if test $_found_perl -eq 1; then
86  if test -n "$AWK" ; then
87    REBUILD=
88  fi
89fi
90AC_SUBST(REBUILD)
91
92dnl ====================================
93dnl = Begin profiling support
94dnl ====================================
95ENABLE_PROFILER=
96AC_ARG_ENABLE(profiler,
97[  --enable-profiler            Enable profiler],
98ENABLE_PROFILER=1
99AC_DEFINE(ENABLE_PROFILER))
100
101if test "x$ENABLE_PROFILER" = "x1"
102then
103        CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES"
104        LDFLAGS="/gnome/PROFILE/lib/libprofiler.so -lpthread"
105fi
106
107AC_SUBST(ENABLE_PROFILER)
108AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
109dnl ====================================
110dnl = End profiling support
111dnl ====================================
112
113dnl ====================================
114dnl = Method for changing environment
115dnl ====================================
116AC_CHECK_FUNCS( setenv unsetenv putenv )
117
118dnl =======================
119dnl = begin tests for FreeType2
120dnl =======================
121NAUTILUS_PATH_FREETYPE2($FREETYPE_LIBRARY_REQUIRED,,
122AC_MSG_ERROR([
123*** FreeType2 $FREETYPE_REQUIRED or better is required. You can obtain a
124*** packaged version of FreeType2 over here:
125*** http://developer.eazel.com/eazel-hacking/updates/freetype2
126*** source versions are available from ftp://ftp.freetype.org]))
127
128AC_SUBST(FREETYPE2_CFLAGS)
129AC_SUBST(FREETYPE2_LIBS)
130dnl =======================
131dnl = End tests for FreeType2
132dnl =======================
133
134dnl Checks for libraries.
135AM_PATH_GLIB($GLIB_REQUIRED,,
136AC_MSG_ERROR([
137*** GLIB $GLIB_REQUIRED or better is required. The latest version of GLIB
138*** is always available from ftp://ftp.gtk.org/.]))
139
140AC_SUBST(GLIB_REQUIRED)
141
142AM_PATH_GTK($GTK_REQUIRED,,
143AC_MSG_ERROR([
144*** Gtk+ $GTK_REQUIRED or better is required. The latest version of GTK
145*** is always available from ftp://ftp.gtk.org/.]))
146
147AC_SUBST(GTK_REQUIRED)
148
149AM_PATH_GNOME($GNOME_REQUIRED,,AC_MSG_ERROR([*** GNOME $GNOME_REQUIRED or better is required.]), gnomeui gtk gdk_pixbuf xml vfs librsvg)
150
151AC_SUBST(GNOME_REQUIRED)
152
153AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
154if test x$GNOME_CONFIG = xno; then
155  AC_MSG_ERROR(Couldn't find gnome-config. Please install the GNOME package)
156fi
157
158NAUTILUS_VERSION_INSIST(gnome-libs, $GNOME_CONFIG --version | awk '{print $2}', >=, GNOME_LIBS_REQUIRED)
159
160dnl check for gnome_canvas_set_dither existence
161_libs="$LIBS"
162LIBS=$GNOMEUI_LIBS
163AC_CHECK_FUNCS(gnome_canvas_set_dither)
164LIBS="$_libs"
165
166AC_SUBST(GNOMECANVASPIXBUF_LIBS)
167AC_SUBST(GNOMECANVASPIXBUF_INCLUDEDIR)
168AC_SUBST(VFS_CFLAGS)
169AC_SUBST(VFS_LIBS)
170
171dnl   Bug 7315: Rediscover CFLAGS for GTK, because gnome-config won't know
172dnl   all the necessary flags if GTK has been upgraded more recently than
173dnl   it has.
174
175AC_PATH_PROG(GTK_CONFIG,gtk-config,false)
176AC_MSG_CHECKING(for gtk-config cflags)
177GTK_CFLAGS=`$GTK_CONFIG --cflags`
178AC_MSG_RESULT($GTK_CFLAGS)
179GNOMEUI_CFLAGS="$GNOMEUI_CFLAGS $GTK_CFLAGS"
180AC_SUBST(GNOMEUI_CFLAGS)
181
182AC_PATH_PROG(XML_CONFIG,xml-config,no)
183if test x$XML_CONFIG = xno; then
184  AC_MSG_ERROR(Couldn't find xml-config please install the gnome-xml package)
185fi
186
187XML_VERSION="`$XML_CONFIG --version`"
188case "$XML_VERSION" in
189        1.*)
190                :
191        ;;
192
193        *)
194                AC_ERROR(Eel needs gnome-xml version 1.x not $XML_VERSION)
195        ;;
196esac
197AC_SUBST(XML_LIBS)
198AC_SUBST(XML_CFLAGS)
199
200AM_PATH_OAF($OAF_REQUIRED)
201AC_SUBST(OAF_REQUIRED)
202
203AM_PATH_GCONF($GCONF_REQUIRED,,,gconf-gtk)
204AC_SUBST(GCONF_REQUIRED)
205
206dnl ====================================
207dnl = Begin tests for librsvg
208dnl ====================================
209AC_PATH_PROG(RSVG_CONFIG,librsvg-config,no)
210if test x$RSVG_CONFIG = xno; then
211  AC_MSG_ERROR(Couldn't find librsvg-config please install the librsvg package)
212fi
213
214RSVG_VERSION="`$RSVG_CONFIG --version`"
215case "$RSVG_VERSION" in
216        1.0.*)
217                :
218        ;;
219
220        *)
221                AC_ERROR(Eel needs librsvg version 1.0.x not $RSVG_VERSION)
222        ;;
223esac
224AC_SUBST(LIBRSVG_LIBS)
225AC_SUBST(LIBRSVG_CFLAGS)
226
227dnl ====================================
228dnl = End tests for librsvg
229dnl ====================================
230
231dnl ====================================
232dnl = begin gdk-pixbuf checks
233dnl ====================================
234AM_PATH_GDK_PIXBUF($GDK_PIXBUF_REQUIRED,,
235AC_MSG_ERROR([*** gdk_pixbuf $GDK_PIXBUF_REQUIRED or better is required.]))
236
237AC_SUBST(GDK_PIXBUF_REQUIRED)
238dnl ====================================
239dnl = end gdk-pixbuf checks
240dnl ====================================
241
242
243AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz
244AC_SUBST(Z_LIBS)], AC_MSG_ERROR([*** zlib is required]))
245
246dnl ====================================
247dnl = Begin tests for libpng
248dnl ====================================
249  if test -z "$LIBPNG"; then
250    AC_CHECK_LIB(png, png_read_info,
251      AC_CHECK_HEADER(png.h,
252        png_ok=yes,
253        png_ok=no),
254      AC_MSG_ERROR(*** (PNG library not found) ***), -lz -lm)
255    if test "$png_ok" = yes; then
256      AC_MSG_CHECKING([for png_structp in png.h])
257      AC_TRY_COMPILE([#include <png.h>],
258        [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
259        png_ok=yes,
260        png_ok=no)
261      AC_MSG_RESULT($png_ok)
262      if test "$png_ok" = yes; then
263        PNG='png'; LIBPNG='-lpng -lz'
264      else
265        AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
266      fi
267    else
268     AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
269    fi
270  fi
271
272AC_SUBST(LIBPNG)
273dnl =======================
274dnl = End tests for libpng
275dnl =======================
276
277dnl =======================
278dnl = Checks for possible font directories
279dnl = These are only used if the font server
280dnl = configuration is not detected.  This makes
281dnl = system like solaris have good font choices
282dnl = even if they dont user the font server.
283dnl =======================
284EEL_POSSIBLE_FONT_DIRECTORIES=""
285
286possible_font_dirs="
287/usr/X/lib/X11/fonts/TrueType
288/usr/X/lib/X11/fonts/Type1
289"
290
291for d in $possible_font_dirs
292do
293        if test -f $d/fonts.dir
294        then
295                if test -z "$EEL_POSSIBLE_FONT_DIRECTORIES"
296                then
297                        EEL_POSSIBLE_FONT_DIRECTORIES="$d"
298                else
299                        EEL_POSSIBLE_FONT_DIRECTORIES="$EEL_POSSIBLE_FONT_DIRECTORIES,$d"
300                fi
301        fi
302done
303
304AC_DEFINE_UNQUOTED(EEL_POSSIBLE_FONT_DIRECTORIES, "$EEL_POSSIBLE_FONT_DIRECTORIES")
305dnl =======================
306dnl = End checks for possible font directories
307dnl =======================
308
309dnl Checks for i18n
310ALL_LINGUAS="az ca cs da de el en_GB es fi fr ga gl hu it ja ko lt nl nn no pl pt_BR ru sk sl sv ta tr uk zh_TW"
311AM_GNOME_GETTEXT
312# AM_GNOME_GETTEXT above substs $DATADIRNAME
313# this is the directory where the *.{mo,gmo} files are installed
314gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
315AC_SUBST(gnomelocaledir)
316
317dnl Checks for typedefs, structures, and compiler characteristics.
318AC_C_CONST
319AC_C_BIGENDIAN
320
321dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
322
323AC_ARG_ENABLE(more-warnings,
324[  --enable-more-warnings  Maximum compiler warnings],
325set_more_warnings="$enableval",[
326if test -f $srcdir/CVSVERSION; then
327        is_cvs_version=true
328        set_more_warnings=yes
329else
330        set_more_warnings=no
331fi
332])
333AC_MSG_CHECKING(for more warnings, including -Werror)
334if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
335        AC_MSG_RESULT(yes)
336        CFLAGS="\
337        -Wall \
338        -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
339        -Wnested-externs -Wpointer-arith \
340        -Wcast-align -Wsign-compare \
341        -Werror \
342        $CFLAGS"
343
344        for option in -Wsign-promo -Wno-sign-compare; do
345                SAVE_CFLAGS="$CFLAGS"
346                CFLAGS="$option $CFLAGS"
347                AC_MSG_CHECKING([whether gcc understands $option])
348                AC_TRY_COMPILE([], [],
349                        has_option=yes,
350                        has_option=no,)
351                if test $has_option = no; then
352                        CFLAGS="$SAVE_CFLAGS"
353                fi
354                AC_MSG_RESULT($has_option)
355                unset has_option
356                unset SAVE_CFLAGS
357        done
358        unset option
359else
360        AC_MSG_RESULT(no)
361fi
362
363dnl
364dnl Define the build message (probably not used)
365dnl CVSVERSION overrides
366dnl
367
368EEL_BUILD_MESSAGE=""
369AC_ARG_WITH(build-message, [  --with-build-message=MESSAGE              Build (about box) message], EEL_BUILD_MESSAGE=$withval)
370
371if test -n "$is_cvs_version"
372then
373        EEL_BUILD_MESSAGE="Development Build"
374fi
375
376EEL_SOURCE_DIRECTORY=`(cd $srcdir && pwd)`
377AC_DEFINE_UNQUOTED(EEL_SOURCE_DIRECTORY, "$EEL_SOURCE_DIRECTORY")
378
379dnl Flags for libraries that Eel depends on
380EEL_DEPENDENCY_CFLAGS="${GCONF_CFLAGS} `$GNOME_CONFIG --cflags gnomeui gtk gdk_pixbuf xml vfs`"
381EEL_DEPENDENCY_LIBS="${GCONF_LIBS} `$GNOME_CONFIG --libs gnomeui gtk gdk_pixbuf xml vfs librsvg` ${LIBPNG}"
382AC_SUBST(EEL_DEPENDENCY_CFLAGS)
383AC_SUBST(EEL_DEPENDENCY_LIBS)
384
385dnl Flags for modules that depend on Eel
386EEL_LIBDIR='-L${libdir}'
387EEL_INCLUDEDIR="-I${includedir}/eel-1 ${EEL_DEPENDENCY_CFLAGS}"
388EEL_LIBS="-leel ${EEL_DEPENDENCY_LIBS}"
389AC_SUBST(EEL_LIBDIR)
390AC_SUBST(EEL_INCLUDEDIR)
391AC_SUBST(EEL_LIBS)
392
393AC_OUTPUT([
394eel.spec
395Makefile
396data/Makefile
397data/fonts/Makefile
398data/fonts/urw/Makefile
399eel/Makefile
400eel/eel-features.h
401po/Makefile.in
402intl/Makefile
403test/Makefile
404])
405
406dnl <= Configuration summary =>
407
408echo "Eel configuration summary:"
409echo ""
410
411dnl <= CFLAGS and LDFLAGS =>
412echo "CFLAGS : $CFLAGS"
413echo "LDFLAGS : $LDFLAGS"
414echo ""
415
416dnl <= Profile support? =>
417case "X$ENABLE_PROFILER" in
418  X1)
419        echo "Enable profiler                   : YES"
420        ;;
421  *)
422        echo "Enable profiler                   : NO"
423        ;;
424esac
425
426dnl <= Eel =>
427echo "EEL_LIBDIR     : $EEL_LIBDIR"
428echo "EEL_INCLUDEDIR : $EEL_INCLUDEDIR"
429echo "EEL_LIBS       : $EEL_LIBS"
430
431dnl <= End of configuration summary =>
Note: See TracBrowser for help on using the repository browser.