source: trunk/third/libgnomeprint/configure.in @ 18795

Revision 18795, 7.9 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18794, which included commits to RCS files with non-trunk default branches.
Line 
1-*- mode: m4 -*-
2AC_PREREQ(2.52)
3AC_INIT(libgnomeprint, 2.2.1.1,
4        http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-print)
5
6AM_CONFIG_HEADER(config.h)
7AM_INIT_AUTOMAKE(libgnomeprint, 2.2.1.1)
8
9AM_MAINTAINER_MODE
10
11AC_PROG_INTLTOOL
12
13AC_ISC_POSIX
14AC_PROG_CC
15AC_PROG_CPP
16AC_PROG_CXX
17AC_STDC_HEADERS
18AM_PROG_LIBTOOL
19
20AC_DEFINE(WE_ARE_LIBGNOMEPRINT_INTERNALS, 1, [Defined so that we can read our private headers])
21
22
23dnl ====================================================
24dnl FIXME: Does this really belong here?. See bug #80577
25dnl ====================================================
26AC_CHECK_FUNC(bind_textdomain_codeset,,[AC_CHECK_LIB(intl,bind_textdomain_codeset)])
27
28dnl =============
29dnl Warning flags
30dnl =============
31GNOME_COMPILE_WARNINGS(maximum)
32CFLAGS="$CFLAGS $warning_flags"
33
34dnl =======
35dnl gettext
36dnl =======
37GETTEXT_PACKAGE=libgnomeprint-2.2
38AC_SUBST(GETTEXT_PACKAGE)
39AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package])
40
41ALL_LINGUAS="am ar az be bg ca cs da de el es et fi fr he hi hu it ja ko lv mn ms nl nn no pl pt pt_BR ro ru sk sl sv ta tr uk vi wa zh_TW zh_CN"
42AM_GLIB_GNU_GETTEXT
43
44dnl ==========================================
45dnl Checks for gtk-doc and docbook-tools
46dnl ==========================================
47AC_ARG_WITH(html-dir, [  --with-html-dir=PATH    path to installed docs])
48if test "x$with_html_dir" = "x" ; then
49  HTML_DIR='${datadir}/gtk-doc/html'
50else
51  HTML_DIR=$with_html_dir
52fi
53AC_SUBST(HTML_DIR)
54
55AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
56gtk_doc_min_version=0.9
57if $GTKDOC ; then
58    gtk_doc_version=`gtkdoc-mkdb --version`
59    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
60
61    IFS="${IFS=         }"; gtk_save_IFS="$IFS"; IFS="."
62    set $gtk_doc_version
63    for min in $gtk_doc_min_version ; do
64        cur=$1; shift
65        if test -z $min ; then break; fi
66        if test -z $cur ; then GTKDOC=false; break; fi
67        if test $cur -gt $min ; then break ; fi
68        if test $cur -lt $min ; then GTKDOC=false; break ; fi
69    done
70    IFS="$gtk_save_IFS"
71
72    if $GTKDOC ; then
73      AC_MSG_RESULT(yes)
74    else
75      AC_MSG_RESULT(no)
76    fi
77fi
78
79AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
80AC_SUBST(HAVE_GTK_DOC)
81
82AC_CHECK_PROG(DB2HTML, db2html, true, false)
83AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
84
85dnl Let people disable the gtk-doc stuff.
86AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=no)
87
88if test x$enable_gtk_doc = xyes ; then
89  if test x$GTKDOC = xtrue ; then
90    enable_gtk_doc=yes
91  else
92    enable_gtk_doc=no
93  fi
94fi
95
96dnl NOTE: We need to use a separate automake conditional for this
97dnl       to make this work with the tarballs.
98AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
99dnl ==========================================
100dnl END: Checks for gtk-doc and docbook-tools
101dnl ==========================================
102dnl =================
103dnl pkg-config checks
104dnl =================
105glib_modules="glib-2.0 >= 1.3.10 gobject-2.0 >= 1.3.10 gmodule-2.0 >= 1.3.10"
106libart_modules="libart-2.0 >= 2.3.7"
107pango_modules="pango >= 0.21"
108libxml2_modules="libxml-2.0 >= 2.4.23"
109fontconfig_modules="fontconfig >= 1.0"
110PKG_CHECK_MODULES(GP, [ $glib_modules $libart_modules $pango_modules $libxml2_modules $libbonobo_modules $fontconfig_modules ])
111
112AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
113
114dnl =================================
115dnl Checking for freetype2
116dnl =================================
117FREETYPE_LIBS=
118FREETYPE_CFLAGS=
119AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
120if test "x$FREETYPE_CONFIG" = "xno" ; then
121        AC_MSG_ERROR(You need FreeType2 (freetype-devel v 2.x package) for this version of libgnomeprint)
122else
123        FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
124        FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
125fi
126
127libgnomeprint_save_ldflags=$LDFLAGS
128LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
129
130freetype_version=false
131AC_MSG_CHECKING([For sufficiently new FreeType (at least 2.0.5)])
132AC_CHECK_LIB(freetype, FT_Get_Postscript_Name, freetype_version=true, :)
133if $freetype_version ; then
134    AC_MSG_RESULT(yes)
135else
136    AC_MSG_ERROR(You need FreeType2 (freetype-devel 2.0.5 or greater package) for this version of libgnomeprint)
137fi
138
139LDFLAGS=$libgnomeprint_save_ldflags
140
141dnl =================================
142dnl END: Checking for freetype2
143dnl =================================
144
145dnl ==========================================
146dnl Checking for CUPS libraries
147dnl ==========================================
148try_cups=yes
149cups_msg=yes
150AC_ARG_WITH(cups,
151        [  --{with,without}-cups   Build the cups module],
152        if test "x$withval" = "xno"; then
153                try_cups=false
154                cups_msg="Disabled by request"
155        fi
156)
157if test "x$try_cups" = "xyes"; then
158        AC_MSG_CHECKING(for CUPS libraries version >= 1.1.0)
159        if cups-config --version --libs > /dev/null 2>&1; then
160            verstxt=`cups-config --version`
161            vers=`echo "$verstxt" | \
162                awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
163            if test "$vers" -lt 1001000; then
164                    AC_MSG_RESULT(Cups found but the version found is less than 1.1.0)
165              cups_msg="Version requirement not satisfied"
166            else
167                    CUPS_LIBS=`cups-config --libs`
168                    CUPS_CFLAGS=`cups-config --cflags`
169                    AC_MSG_RESULT(Found version $verstxt)
170            fi
171        else
172           AC_MSG_RESULT("cups not found, make sure cups-config is in the path")
173        cups_msg="cups-devel not installed (cups-config not found in the PATH)"
174        fi
175fi
176AC_SUBST(CUPS_LIBS)
177AC_SUBST(CUPS_CFLAGS)
178AM_CONDITIONAL(HAVE_CUPS, test x"$cups_msg" = "xyes")
179dnl ==========================================
180dnl END: Checking for CUPS libraries
181dnl ==========================================
182
183dnl =========================================================================
184dnl SET THE DIRECTORY PATHS, first: GNOME_PRINT_MODULES_DIR & GPA_MODULES_DIR
185dnl =========================================================================
186if test "x${prefix}" = "xNONE"; then
187        GNOME_PRINT_MODULES_DIR='${ac_default_prefix}/lib/libgnomeprint/${VERSION}/modules'
188else
189        GNOME_PRINT_MODULES_DIR='${libdir}/libgnomeprint/${VERSION}/modules'
190fi
191AC_SUBST(GNOME_PRINT_MODULES_DIR, $GNOME_PRINT_MODULES_DIR)
192
193dnl =========================
194dnl Now, GNOME_PRINT_DATA_DIR
195dnl =========================
196if test "x${prefix}" = "xNONE"; then
197        GNOME_PRINT_DATA_DIR='${ac_default_prefix}/${DATADIRNAME}/libgnomeprint/${VERSION}'
198else
199        GNOME_PRINT_DATA_DIR='${prefix}/${DATADIRNAME}/libgnomeprint/${VERSION}'
200fi
201AC_SUBST(GNOME_PRINT_DATA_DIR, $GNOME_PRINT_DATA_DIR)
202dnl ============================
203dnl END: SET THE DIRECTORY PATHS
204dnl ============================
205
206dnl ===============================
207dnl LIBGNOMEPRINT_LIBS & CFLAGS
208dnl ===============================
209LIBGNOMEPRINT_CFLAGS="$GP_CFLAGS $FREETYPE_CFLAGS"
210LIBGNOMEPRINT_LIBS="$GP_LIBS $FREETYPE_LIBS"
211AC_SUBST(LIBGNOMEPRINT_CFLAGS)
212AC_SUBST(LIBGNOMEPRINT_LIBS)
213
214dnl =================================================
215dnl Get the loadable module extension for this system
216dnl =================================================
217AC_LTDL_SHLIBEXT
218LTDL_SHLIBEXT=$libltdl_cv_shlibext
219AC_SUBST(LTDL_SHLIBEXT)
220
221dnl =============================
222dnl Used for tests/ & tests/tools
223dnl =============================
224PKG_CHECK_MODULES(TOOLS, "glib-2.0 gobject-2.0 libxml-2.0")
225TOOLS_LIBS="$TOOLS_LIBS -lpopt"
226AC_SUBST(TOOLS_CFLAGS)
227AC_SUBST(TOOLS_LIBS)
228
229AC_OUTPUT([
230Makefile
231po/Makefile.in
232libgnomeprint/Makefile
233libgnomeprint/gpa/Makefile
234libgnomeprint/transports/Makefile
235libgnomeprint/libgnomeprint-2.2.pc
236libgnomeprint/modules/Makefile
237libgnomeprint/modules/cups/Makefile
238data/Makefile
239data/models/Makefile
240data/printers/Makefile
241tests/Makefile
242tests/files/Makefile
243tests/output/Makefile
244tests/tools/Makefile
245doc/Makefile
246doc/reference/Makefile
247])
248
249echo "
250        Compiler:               ${CC}
251        Compiler flags:         ${CFLAGS}"
252if test "x$cups_msg" = "xyes"; then
253   echo "       Cups module:            $cups_msg    [LIBS: $CUPS_LIBS]"
254else
255   echo "       Cups module:            $cups_msg"
256fi
257echo "  Data dir:               `eval echo $GNOME_PRINT_DATA_DIR`"
258if test x$enable_gtk_doc = xyes ; then
259   echo "       Enable gtk-doc:         Yes"
260else
261   echo "       Enable gtk-doc:         No"
262fi
263echo
Note: See TracBrowser for help on using the repository browser.