Développer et télécharger des logiciels Open Source

Browse Subversion Repository

Annotation of /kazehakase/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2708 - (hide annotations) (download)
Wed Dec 20 04:00:09 2006 UTC (17 years, 5 months ago) by makeinu
Original Path: kazehakase/trunk/configure.in
File size: 23452 byte(s)
Remove $_SAVE_CXXFLAGS from CXXFLAGS on checking Mozilla's API because all checks are faild when the "-Wnon-virtual-dtor" is specified by users.

1 ikezoe 3 dnl Process this file with autoconf to produce a configure script.
2 ikezoe 927 AC_PREREQ(2.57)
3    
4 furyo 2628 AC_INIT(kazehakase, 0.4.3)
5 ikezoe 927 AM_INIT_AUTOMAKE(1.6)
6 ikezoe 3 AM_CONFIG_HEADER(config.h)
7    
8 makeinu 55 AC_ENABLE_SHARED(yes)
9     AC_ENABLE_STATIC(no)
10     AM_PROG_LIBTOOL
11    
12 ikezoe 2651 LT_VERSION_INFO="1:0:1"
13     LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
14     AC_SUBST(LT_VERSION_INFO)
15     AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
16    
17 ikezoe 1997 AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
18 ikezoe 2000
19     AC_PROG_CXX
20     AC_PROG_CC
21     AC_PROG_CPP
22     AC_PROG_INSTALL
23     AC_PROG_LN_S
24     AC_PROG_MAKE_SET
25     AC_PROG_AWK
26    
27     dnl disable RTTI by default
28     AC_ARG_ENABLE(cpp-rtti,
29     [ --enable-cpp-rtti Enable C++ RTTI (for cvs gcc)],,
30     enable_cpp_rtti=no)
31    
32     if test "x$enable_cpp_rtti" = "xno"; then
33 ikezoe 2134 AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
34 ikezoe 2000 fi
35 ikezoe 2134
36 makeinu 59 dnl **************************************************************
37     dnl Check for GtkMozEmbed.
38     dnl **************************************************************
39 ikezoe 1997 GECKO=
40 ikezoe 2062 AC_ARG_WITH([gecko_engine],
41 tyuyu 2572 AS_HELP_STRING([--with-gecko-engine@<:@=mozilla|firefox|thunderbird|seamonkey|xulrunner@:>@],
42 ikezoe 2380 [Whether to use mozilla, firefox or thunderbird or seamonkey xpcom (default: mozilla)]),
43 ikezoe 1997 [GECKO="$withval"])
44    
45     dnl try to autodetect: if mozilla exists, use it, else try firefox, then thunderbird
46     if test "x$GECKO" = "x"; then
47 ikezoe 2134 if $PKG_CONFIG --exists firefox-xpcom; then
48 ikezoe 1997 GECKO=firefox
49 ikezoe 2134 elif $PKG_CONFIG --exists mozilla-firefox-xpcom; then
50 ikezoe 2034 GECKO=mozilla-firefox
51 ikezoe 2134 elif $PKG_CONFIG --exists mozilla-xpcom; then
52 ikezoe 1997 GECKO=mozilla
53 ikezoe 2380 elif $PKG_CONFIG --exists seamonkey-xpcom; then
54     GECKO=seamonkey
55 ikezoe 2134 elif $PKG_CONFIG --exists thunderbird-xpcom; then
56 ikezoe 1997 GECKO=thunderbird
57 tyuyu 2572 elif $PKG_CONFIG --exists xulrunner-xpcom; then
58     GECKO=xulrunner
59 ikezoe 1997 else
60     AC_MSG_ERROR([no mozilla installation found])
61     fi
62 tyuyu 2572 elif test "x$with_gecko_engine" != "xmozilla" -a "x$with_gecko_engine" != "xfirefox" -a "x$with_gecko_engine" != "xthunderbird" -a "x$with_gecko_engine" != "xseamonkey" -a "x$with_gecko_engine" != "xmozilla-firefox" -a "x$with_gecko_engine" != "xxulrunner"; then
63 ikezoe 1997 AC_MSG_ERROR([unknown gecko engine name ($GECKO)])
64     fi
65     AC_SUBST(GECKO)
66    
67     AC_MSG_RESULT([$GECKO])
68    
69     case "$GECKO" in
70     mozilla) min_version=1.7 flavour=mozilla ;;
71 ikezoe 2381 seamonkey) min_version=1.0 flavour=mozilla ;;
72 ikezoe 1997 firefox) min_version=1.0 flavour=toolkit ;;
73 ikezoe 2034 mozilla-firefox) min_version=1.0 flavour=toolkit ;;
74 ikezoe 1997 thunderbird) min_version=0.8 flavour=toolkit ;;
75 tyuyu 2572 xulrunner) min_version=1.8 flavour=toolkit ;;
76 ikezoe 1997 esac
77    
78     GECKO_FLAVOUR=$flavour
79     AC_SUBST(GECKO_FLAVOUR)
80    
81 ikezoe 2134 dnl **************************************************************
82     dnl Check for including gtkmozembed.
83     dnl **************************************************************
84     AC_ARG_ENABLE(gtkmozembed, [ --enable-gtkmozembed
85 ikezoe 2150 Enable including GtkMozEmbed module],,
86     enable_gtkmozembed=yes)
87 ikezoe 2134 if test x"$enable_gtkmozembed" = "xyes"; then
88     AC_DEFINE(ENABLE_GTKMOZEMBED, 1, [Define including GtkMozEmbed])
89     GECKO_MODULE=$GECKO-xpcom
90     else
91     GECKO_MODULE=$GECKO-gtkmozembed
92     fi
93     AM_CONDITIONAL(ENABLE_GTKMOZEMBED, test x"$enable_gtkmozembed" = "xyes")
94 ikezoe 1997
95 ikezoe 2134 PKG_CHECK_MODULES(MOZILLA_COMPONENT, $GECKO_MODULE >= $min_version)
96    
97 ikezoe 3 AC_SUBST(MOZILLA_COMPONENT_CFLAGS)
98     AC_SUBST(MOZILLA_COMPONENT_LIBS)
99    
100 kous 2611 MOZILLA_COMPONENT_VERSION="`$PKG_CONFIG --modversion $GECKO_MODULE`"
101     AC_SUBST(MOZILLA_COMPONENT_VERSION)
102    
103 ikezoe 2134 MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $GECKO-xpcom`"
104 ikezoe 3 AC_SUBST(MOZILLA_INCLUDE_ROOT)
105    
106 ikezoe 2134 MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $GECKO-xpcom`"
107 ikezoe 3 AC_SUBST(MOZILLA_HOME)
108    
109 ikezoe 2134 MOZILLA_PREFIX="`$PKG_CONFIG --variable=prefix $GECKO-xpcom`"
110 ikezoe 1997 AC_SUBST(MOZILLA_PREFIX)
111 ikezoe 108
112 furyo 2468
113 ikezoe 1338 dnl *************************************************************************
114     dnl This is from Mozilla's configure.in. They set almost all the config stuff
115     dnl they need in mozilla-config.h Except for this compiler flag, which can't
116     dnl go in mozilla-config.h So we check the flag too and now we can include
117     dnl mozilla-config.h without breaking epiphany.
118     dnl This is really gcc-only
119     dnl Do this test using CXX only since some versions of gcc
120     dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
121     dnl only have short-wchar support for c++.
122     AC_LANG_PUSH(C++)
123 ikezoe 2000 _SAVE_CPPFLAGS=$CPPFLAGS
124 ikezoe 1338 _SAVE_CXXFLAGS=$CXXFLAGS
125     _SAVE_AM_CXXFLAGS=$AM_CXXFLAGS
126     AM_CXXFLAGS="$AM_CXXFLAGS -fshort-wchar"
127     CXXFLAGS="$CXXFLAGS $AM_CXXFLAGS"
128    
129     AC_CACHE_CHECK(for compiler -fshort-wchar option,
130     ac_cv_have_usable_wchar_option,
131     [AC_TRY_RUN([#include <stddef.h>
132     int main () {
133     return (sizeof(wchar_t) != 2) ||
134     (wchar_t)-1 < (wchar_t) 0 ; } ],
135     ac_cv_have_usable_wchar_option="yes",
136     ac_cv_have_usable_wchar_option="no",
137     ac_cv_have_usable_wchar_option="maybe")])
138    
139     if test "$ac_cv_have_usable_wchar_option" != "yes"; then
140     AM_CXXFLAGS=$_SAVE_AM_CXXFLAGS
141     fi
142    
143 makeinu 59
144 makeinu 2708 CFLAGS=""
145 ikezoe 2603 CPPFLAGS="-I$MOZILLA_INCLUDE_ROOT -I$MOZILLA_INCLUDE_ROOT/widget -I$MOZILLA_INCLUDE_ROOT/layout -I$MOZILLA_INCLUDE_ROOT/helperAppDlg -I$MOZILLA_INCLUDE_ROOT/dom -I$MOZILLA_INCLUDE_ROOT/exthandler -I$MOZILLA_INCLUDE_ROOT/pipnss -I$MOZILLA_INCLUDE_ROOT/necko -I$MOZILLA_INCLUDE_ROOT/gfx -I$MOZILLA_INCLUDE_ROOT/content -I$MOZILLA_INCLUDE_ROOT/locale -I$MOZILLA_INCLUDE_ROOT/docshell `$PKG_CONFIG --cflags-only-I $GECKO-xpcom` -Wconversion -Wsign-compare -Werror"
146 makeinu 2708 CXXFLAGS="$AM_CXXFLAGS `$PKG_CONFIG --cflags-only-other $GECKO-xpcom`"
147 makeinu 59
148 ikezoe 2000 AC_MSG_RESULT([$CXXFLAGS])
149 makeinu 59 dnl **************************************************************
150 ikezoe 1997 dnl Check Mozilla API .
151     dnl This code picked from Epiphany-1.7.0.
152     dnl **************************************************************
153    
154 ikezoe 2000 dnl Changed from PRUnichar* to nsAString& in 1.8a1 and on aviary branch
155    
156 ikezoe 2271 dnl Determine gecko version
157     dnl We don't use the version from the .pc file, since that's the app version
158     dnl and not the Gecko version
159    
160     AC_MSG_CHECKING([[for gecko version]])
161    
162 ikezoe 2338 gecko_version=`cat $MOZILLA_INCLUDE_ROOT/mozilla-config.h | grep MOZILLA_VERSION_U | awk '{ print $[3]; }' | tr ".ab+" " "`
163     if test -z "$gecko_version"; then
164     gecko_version="1 7"
165     fi
166 ikezoe 2271
167 ikezoe 2338 gecko_version_major=`echo $gecko_version | awk '{ print $[1]; }'`
168     gecko_version_minor=`echo $gecko_version | awk '{ print $[2]; }'`
169 ikezoe 2271
170 ikezoe 2338 AC_MSG_RESULT([$gecko_version_major.$gecko_version_minor])
171    
172     if test "$gecko_version_major" != "1" -o "$gecko_version_minor" -lt "7" -o "$gecko_version_minor" -gt "9"; then
173     AC_MSG_ERROR([Unsupported Gecko version $gecko_version_major.$gecko_version_minor])
174     fi
175    
176     if test "$gecko_version_major" = "1" -a "$gecko_version_minor" -ge "8"; then
177 ikezoe 2271 AC_DEFINE([HAVE_GECKO_1_8],[1],[Define if we have gecko 1.8])
178     fi
179 ikezoe 2338 if test "$gecko_version_major" = "1" -a "$gecko_version_minor" -ge "9"; then
180     AC_DEFINE([HAVE_GECKO_1_9],[1],[Define if we have gecko 1.9])
181     fi
182 ikezoe 2271
183 ikezoe 2338 AM_CONDITIONAL([HAVE_GECKO_1_8],[test "$gecko_version_major" = "1" -a "$gecko_version_minor" -ge "8"])
184     AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$gecko_version_major" = "1" -a "$gecko_version_minor" -ge "9"])
185    
186 ikezoe 2274 AC_MSG_CHECKING([whether nsPIDOMWindow methods return nsPIDOMWindow*])
187 ikezoe 2273
188     AC_COMPILE_IFELSE(
189     [AC_LANG_PROGRAM(
190 ikezoe 2274 [[#include <nsPIDOMWindow.h>]],
191 ikezoe 2273 [[nsPIDOMWindow *w;
192 ikezoe 2274 w->GetPrivateRoot ();]]
193 ikezoe 2273 )],
194 ikezoe 2274 [AC_DEFINE([MOZ_NSPIDOMWINDOW_RETURNNSPIDOMWINDOW_],[1],[Define if nsPIDOMWindow returns nsPIDOMWindow*]) result=yes],
195 ikezoe 2273 [result=no])
196    
197     AC_MSG_RESULT([$result])
198    
199 ikezoe 1997 AC_MSG_CHECKING([whether nsIFilePicker methods expect nsAString&])
200    
201     AC_COMPILE_IFELSE(
202     [AC_LANG_PROGRAM(
203     [[#include <nsEmbedString.h>
204     #include <widget/nsIFilePicker.h>]],
205     [[nsIFilePicker *p;
206     p->SetDefaultString (nsEmbedString());]]
207     )],
208     [AC_DEFINE([MOZ_NSIFILEPICKER_NSASTRING_],[1],[Define if nsIFilePicker uses nsAString&]) result=yes],
209     [result=no])
210    
211     AC_MSG_RESULT([$result])
212    
213     dnl Changed from char* to nsAString& in 1.8a1
214    
215     AC_MSG_CHECKING([whether nsIMIMEInfo methods expect nsAString&])
216    
217     AC_COMPILE_IFELSE(
218     [AC_LANG_PROGRAM(
219     [[#include <nsEmbedString.h>
220     #include <mimetype/nsIMIMEInfo.h>]],
221     [[nsIMIMEInfo *p;
222     p->SetDescription (nsEmbedString());]]
223     )],
224     [AC_DEFINE([MOZ_NSIMIMEINFO_NSACSTRING_],[1],[Define if nsIMIMEInfo uses nsAString&]) result=yes],
225     [result=no])
226    
227     AC_MSG_RESULT([$result])
228    
229 ikezoe 2000 AC_MSG_CHECKING([whether nsICacheSession methods expect nsAString&])
230    
231     AC_COMPILE_IFELSE(
232     [AC_LANG_PROGRAM(
233     [[#include <nsEmbedString.h>
234     #include <nkcache/nsICacheSession.h>]],
235     [[nsICacheSession *p;
236     p->OpenCacheEntry (nsEmbedCString(),0, PR_FALSE, nsnull);]]
237     )],
238     [AC_DEFINE([MOZ_NSICACHESESSION_NSACSTRING_],[1],[Define if nsICacheSession uses nsAString&]) result=yes],
239     [result=no])
240    
241     AC_MSG_RESULT([$result])
242    
243 ikezoe 2021 AC_MSG_CHECKING([whether nsIHelperAppLauncherDialog methods expect PRBool])
244 ikezoe 2014
245     AC_COMPILE_IFELSE(
246     [AC_LANG_PROGRAM(
247     [[#include <nsIHelperAppLauncherDialog.h>]],
248     [[nsIHelperAppLauncherDialog *p;
249 ikezoe 2603 p->Show (nsnull, nsnull, -1);]]
250 ikezoe 2014 )],
251 ikezoe 2021 [AC_DEFINE([MOZ_NSIHELPERAPPLAUNCHERDIALOG_NSPRBOOL_],[1],[Define if nsIHelperAppLauncharDialog uses PRBool]) result=yes],
252 ikezoe 2014 [result=no])
253    
254     AC_MSG_RESULT([$result])
255    
256 ikezoe 2603 AC_MSG_CHECKING([whether NS_InitXPCOM3 exists])
257    
258 ikezoe 2600 AC_COMPILE_IFELSE(
259     [AC_LANG_PROGRAM(
260 ikezoe 2603 [[#include <nsXPCOM.h>]],
261     [[NS_InitXPCOM3(nsnull, nsnull, nsnull, nsnull, 0);]]
262     )],
263     [AC_DEFINE([MOZ_HAVE_NSINITXPCOM3_],[1],[Define if Gecko has NS_InitXPCOM3]) result=yes],
264     [result=no])
265    
266     AC_MSG_RESULT([$result])
267    
268     AC_COMPILE_IFELSE(
269     [AC_LANG_PROGRAM(
270 ikezoe 2600 [[#define MOZILLA_INTERNAL_API
271     #include <nsICanvasRenderingContextInternal.h>
272     #include <nsEmbedString.h>
273     #undef MOZILLA_INTERNAL_API]],
274     [[nsICanvasRenderingContextInternal *p;
275     p->GetInputStream (nsEmbedCString(), nsEmbedString(), nsnull);]]
276     )],
277     [AC_DEFINE([MOZ_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_],[1],[Define if nsICanvasRenderingContextInternal has GetInputStream]) result=yes],
278     [result=no])
279    
280 ikezoe 2602 AM_CONDITIONAL([MOZ_NO_NSICANVASRENDERINGCONTEXTINTERNAL_HAVE_GETINPUTSTREAM_], [test "$result" = "no"])
281 ikezoe 2600 AC_MSG_RESULT([$result])
282    
283     AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/content/nsICanvasRenderingContextInternal.h],
284     [AC_DEFINE([HAVE_NSICANVASRENDERINGCONTEXTINTERNAL_H],[1],[Define if nsICanvasRenderingContextInternal.h exists])])
285    
286 ikezoe 2271 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsIWebProgressListener2.h],
287     [AC_DEFINE([HAVE_NSIWEBPROGRESSLISTENER2_H],[1],[Define if nsIWebProgressListener2.h exists])],
288     [AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/uriloader/nsIWebProgressListener2.h],
289     [AC_DEFINE([HAVE_NSIWEBPROGRESSLISTENER2_H],[1],[Define if nsIWebProgressListener2.h exists])])])
290    
291 ikezoe 1997 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsITransfer.h],
292     [AC_DEFINE([HAVE_NSITRANSFER_H],[1],[Define if nsITransfer.h exists])],
293     [AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/uriloader/nsITransfer.h],
294     [AC_DEFINE([HAVE_NSITRANSFER_H],[1],[Define if nsITransfer.h exists])])])
295    
296 ikezoe 2046 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsIPresContext.h],
297     [AC_DEFINE([HAVE_NSIPRESCONTEXT_H],[1],[Define if nsIPresContext.h exists])],
298     [AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/layout/nsIPresContext.h],
299     [AC_DEFINE([HAVE_NSIPRESCONTEXT_H],[1],[Define if nsIPresContext.h exists])])])
300    
301 ikezoe 1997 dnl Not a simple file check due to the header being in the SDK since 1.8a6
302     dnl https://bugzilla.mozilla.org/show_bug.cgi?id=271068
303    
304 kous 2608 AC_CHECK_FILES([$MOZILLA_INCLUDE_ROOT/nsIPassword.h
305     $MOZILLA_INCLUDE_ROOT/wallet/nsIPassword.h
306     $MOZILLA_INCLUDE_ROOT/passwordmgr/nsIPassword.h],
307     [AC_DEFINE([HAVE_NSIPASSWORD_H],[1],
308     [Define if mozilla nsIPassword header is available])])
309 ikezoe 1997
310 tyuyu 2340 dnl Check for nsIDocShell::GetSecurityUI
311     dnl This code is picked from galeon-1.3.21.
312     dnl nsIDocShell::GetSecurityUI was added in 1.8b2 as part of the fastback
313     dnl patch
314     dnl https://bugzilla.mozilla.org/show_bug.cgi?id=274784
315    
316     AC_MSG_CHECKING([whether nsIDocShell::GetSecureUI exists])
317     AC_COMPILE_IFELSE(
318     [AC_LANG_PROGRAM(
319     [[#include <nsIDocShell.h>]],
320     [[ nsIDocShell *p;
321     p->GetSecurityUI( nsnull ); ]]
322     )],
323     [AC_DEFINE([HAVE_NSIDOCSHELL_GETSECUREUI], [1],
324     [Define if nsIDocShell::GetSecureUI exists]) result=yes],
325     [result=no])
326     AC_MSG_RESULT([$result])
327    
328     dnl restore flags
329     CPPFLAGS=$_SAVE_CPPFLAGS
330     CXXFLAGS=$_SAVE_CXXFLAGS
331    
332     AC_LANG_POP([C++])
333    
334 ikezoe 1997 dnl **************************************************************
335 makeinu 59 dnl Check for Gtk+2.
336     dnl **************************************************************
337 ikezoe 3 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
338     dnl pass to pkg-config
339 ikezoe 2525 AM_PATH_GTK_2_0(2.6.0)
340 makeinu 55 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
341 ikezoe 1327 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
342 ikezoe 3
343 makeinu 59 dnl **************************************************************
344 ikezoe 1700 dnl Check for gtk-webcore.
345     dnl **************************************************************
346 ikezoe 1704 AC_ARG_ENABLE(gtk_webcore, [ --enable-gtk-webcore
347 ikezoe 1700 Enable GTK-Webcore module for HTML rendering])
348 ikezoe 1704 if test x"$enable_gtk_webcore" = "xyes"; then
349 ikezoe 1706 PKG_CHECK_MODULES(NRCIT, osb-nrcit)
350     AC_SUBST(NRCIT_CFLAGS)
351     AC_SUBST(NRCIT_LIBS)
352 ikezoe 1704 AC_DEFINE(ENABLE_GTK_WEBCORE, 1, [Define using GTK-Webcore support])
353 ikezoe 1700 fi
354 ikezoe 1704 AM_CONDITIONAL(ENABLE_GTK_WEBCORE, test x"$enable_gtk_webcore" = "xyes")
355 ikezoe 1700
356     dnl **************************************************************
357 tyuyu 2325 dnl Check for openssl
358 ikezoe 2195 dnl **************************************************************
359 tyuyu 2325 dnl AC_ARG_ENABLE(ssl, [ --disable-ssl
360     dnl Disable OpenSSL suport],,
361     dnl disable_ssl=no)
362     dnl if test x"$disable_ssl" = "xno"; then
363     dnl PKG_CHECK_MODULES(SSL, openssl)
364     dnl AC_SUBST(SSL_CFLAGS)
365     dnl AC_SUBST(SSL_LIBS)
366     dnl AC_DEFINE(USE_SSL, 1, [Define using openssl])
367     dnl fi
368     dnl AM_CONDITIONAL(ENABLE_SSL, test x"$disable_ssl" = "xno")
369    
370     dnl **************************************************************
371     dnl Check for GNU TLS
372     dnl **************************************************************
373 ikezoe 2197 AC_ARG_ENABLE(ssl, [ --disable-ssl
374 tyuyu 2325 Disable GNU TLS suport],,
375 ikezoe 2197 disable_ssl=no)
376     if test x"$disable_ssl" = "xno"; then
377 tyuyu 2337 AM_PATH_LIBGNUTLS(1.2.0,
378     AC_DEFINE(USE_SSL, 1, [Define using GNU TLS]),
379     AC_MSG_WARN([[libgnutls was not found.]]))
380 ikezoe 2197 fi
381     AM_CONDITIONAL(ENABLE_SSL, test x"$disable_ssl" = "xno")
382 ikezoe 2195
383     dnl **************************************************************
384 makeinu 59 dnl Check for gettext.
385     dnl **************************************************************
386 ikezoe 2309 ALL_LINGUAS="cs fr ja ru"
387 ikezoe 107 GETTEXT_PACKAGE=kazehakase
388     AC_SUBST(GETTEXT_PACKAGE)
389 makeinu 72 AM_GLIB_GNU_GETTEXT
390 makeinu 59 localedir="${datadir}/locale"
391     AC_SUBST(localedir)
392    
393 makeinu 72 dnl
394     dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
395     dnl
396 ikezoe 1587 dnl kz_save_LIBS=$LIBS
397     dnl LIBS="$LIBS $GTK_LIBS"
398     dnl AC_CHECK_FUNCS(bind_textdomain_codeset)
399     dnl LIBS=$kz_save_LIBS
400 makeinu 59
401 makeinu 72
402     dnl **************************************************************
403     dnl Checks for programs.
404     dnl **************************************************************
405 ikezoe 3
406 kous 2422 AC_ARG_ENABLE(Werror, [ --enable-Werror Enable -Werror option for GCC])
407    
408 ikezoe 457 if test "x$GCC" = "xyes"; then
409     case " $CFLAGS " in
410     *[\ \ ]-Wall[\ \ ]*) ;;
411     *) CFLAGS="$CFLAGS -Wall" ;;
412     esac
413    
414 makeinu 1635 case " $CFLAGS " in
415     *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
416     *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
417     esac
418    
419     case " $CFLAGS " in
420     *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
421     *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
422     esac
423    
424     case " $CFLAGS " in
425     *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
426     *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
427     esac
428    
429     case " $CFLAGS " in
430     *[\ \ ]-Wcast-align[\ \ ]*) ;;
431     *) CFLAGS="$CFLAGS -Wcast-align" ;;
432     esac
433    
434 kous 2422 if test "x$enable_Werror" = "xyes"; then
435     case " $CFLAGS " in
436     *[\ \ ]-Werror[\ \ ]*) ;;
437     *) CFLAGS="$CFLAGS -Werror" ;;
438     esac
439     fi
440    
441 ikezoe 457 if test "x$enable_ansi" = "xyes"; then
442     case " $CFLAGS " in
443     *[\ \ ]-ansi[\ \ ]*) ;;
444     *) CFLAGS="$CFLAGS -ansi" ;;
445     esac
446    
447     case " $CFLAGS " in
448     *[\ \ ]-pedantic[\ \ ]*) ;;
449     *) CFLAGS="$CFLAGS -pedantic" ;;
450     esac
451     fi
452     fi
453    
454 makeinu 72 dnl **************************************************************
455     dnl Checks for libraries.
456     dnl **************************************************************
457     # FIXME: Replace `main' with a function in `-le':
458     AC_CHECK_LIB([e], [main])
459     # FIXME: Replace `main' with a function in `-links':
460     AC_CHECK_LIB([inks], [main])
461    
462 tyuyu 2167 dnl chekc zlib
463     AC_CHECK_HEADER(zlib.h,
464     [
465     dnl zlib.h was found
466     HAVE_ZLIB_H="1"
467     dnl if the lib wasn't found already, try again with the new paths
468     if test "$HAVE_LIBZ" != "1"; then
469     AC_CHECK_LIB(z, gzread,
470     [
471     dnl the lib was found!
472     HAVE_LIBZ="1"
473     ],
474     [ CPPFLAGS=$_cppflags
475     LDFLAGS=$_ldflags])
476     fi
477     ],
478     [
479     dnl zlib.h was not found, restore the flags
480     CPPFLAGS=$_cppflags
481     LDFLAGS=$_ldflags]
482     )
483     if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
484     then
485     AC_MSG_WARN([configure found only the libz lib, not the header file!])
486     elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
487     then
488     AC_MSG_WARN([configure found only the libz header file, not the lib!])
489     elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
490     then
491     ZLIB_LIBS=-lz
492     AC_SUBST(ZLIB_LIBS)
493     fi
494 makeinu 72
495     dnl **************************************************************
496     dnl Checks for header files.
497     dnl **************************************************************
498     AC_HEADER_STDC
499     AC_CHECK_HEADERS([fcntl.h libintl.h stdlib.h string.h unistd.h])
500    
501    
502     dnl **************************************************************
503     dnl Checks for typedefs, structures, and compiler characteristics.
504     dnl **************************************************************
505     AC_C_CONST
506    
507    
508     dnl **************************************************************
509     dnl Checks for library functions.
510     dnl **************************************************************
511 ikezoe 1236 AC_CHECK_FUNCS([setlocale strchr strtol uname memmove strerror])
512 makeinu 72
513 ikezoe 848 dnl **************************************************************
514 ikezoe 985 dnl Migemo
515     dnl **************************************************************
516     AC_ARG_ENABLE(migemo, [ --enable-migemo
517     Enable Migemo (Japanese incremental search)])
518     if test x"$enable_migemo" = "xyes"; then
519     AC_DEFINE(USE_MIGEMO, 1, [Define using Migemo support])
520     fi
521    
522 kous 2401 dnl **************************************************************
523     dnl Configure for extentions.
524     dnl **************************************************************
525     extdir="${libdir}/\$(PACKAGE)/ext"
526     AC_SUBST(extdir)
527 tyuyu 2167
528 kous 2401 dnl **************************************************************
529     dnl Extention: Check for Ruby.
530     dnl **************************************************************
531     ruby_available="no"
532 kous 2452 AC_ARG_WITH([ruby],
533 kous 2401 AS_HELP_STRING([--with-ruby=PATH],
534 kous 2452 [Ruby interpreter path (default: auto-detect)]),
535     [RUBY="$withval"])
536 tyuyu 2167
537 kous 2450 if test "$RUBY" = "no"; then
538 kous 2401 : # ignore
539 kous 2450 elif test "$RUBY" = ""; then
540     AC_PATH_PROG(RUBY, ruby, none)
541     if test "$RUBY" != "none"; then
542 kous 2401 ruby_available="yes"
543     fi
544     else
545 kous 2450 AC_CHECK_FILE([$RUBY],
546 kous 2402 [ruby_available="yes"],
547 kous 2452 [AC_MSG_WARN([$RUBY is not found. Disable Ruby extension.])])
548 kous 2401 fi
549    
550     if test "$ruby_available" = "yes"; then
551 kous 2450 rbconfig="$RUBY -rrbconfig -e "
552 kous 2408
553     changequote(<<, >>)
554 kous 2588 for var_name in archdir sitearchdir CFLAGS LIBRUBYARG libdir; do
555 kous 2408 rbconfig_tmp=`$rbconfig "print Config::CONFIG['$var_name']"`
556     eval "rbconfig_$var_name=\"$rbconfig_tmp\""
557     done
558     changequote([, ])
559    
560     RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir "
561     RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_sitearchdir "
562     RUBY_CFLAGS="$RUBY_CFLAGS $rbconfig_CFLAGS "
563     RUBY_LIBS="$rbconfig_LIBRUBYARG"
564     RUBY_LDFLAGS="-L$rbconfig_libdir"
565    
566 kous 2401 AC_SUBST(RUBY_CFLAGS)
567     AC_SUBST(RUBY_LIBS)
568     AC_SUBST(RUBY_LDFLAGS)
569 kous 2403
570     _SAVE_CFLAGS=$CFLAGS
571 erisnu 2444 ruby_undef_package_macros="
572 kous 2403 #undef PACKAGE_NAME
573     #undef PACKAGE_TARNAME
574     #undef PACKAGE_STRING
575     #undef PACKAGE_VERSION
576 erisnu 2444 "
577     ruby_disable_message="Disable Ruby extension."
578     CFLAGS="$CFLAGS $RUBY_CFLAGS"
579     AC_CHECK_HEADERS(ruby.h, [],
580 kous 2588 [ruby_available="no"
581 erisnu 2444 AC_MSG_WARN([$ruby_disable_message])],
582     [$ruby_undef_package_macros])
583     if test "x$ruby_available" = "xyes"; then
584     CFLAGS="$CFLAGS $GTK_CFLAGS"
585     AC_CHECK_HEADERS(rbgtk.h, [],
586 kous 2588 [ruby_available="no"
587 kous 2625 AC_MSG_WARN([$ruby_disable_message])],
588 erisnu 2444 [$ruby_undef_package_macros])
589     fi
590 kous 2403 CFLAGS=$_SAVE_CFLAGS
591 kous 2401 fi
592    
593     AM_CONDITIONAL([WITH_RUBY], [test "$ruby_available" = "yes"])
594    
595    
596 kous 2449 dnl **************************************************************
597 kous 2450 dnl Configure for gettext from Ruby scripts
598     dnl **************************************************************
599 kous 2452 AC_ARG_WITH([rgettext],
600     AS_HELP_STRING([--with-rgettext=PATH],
601     [rgettext path (default: auto-detect)]),
602     [RGETTEXT="$withval"])
603 kous 2450
604 kous 2452 if test "$RGETTEXT" = "no"; then
605     RGETTEXT=""
606     elif test "$RGETTEXT" = ""; then
607     AC_PATH_PROG(RGETTEXT, rgettext, none)
608     if test "$RGETTEXT" = "none"; then
609 kous 2450 RGETTEXT=""
610     fi
611 kous 2452 else
612     rgettext_message="$RGETTEXT is not found. Disable gettext from Ruby scripts."
613     AC_CHECK_FILE([$RGETTEXT], [],
614     [RGETTEXT=""
615     AC_MSG_WARN([$rgettext_message])])
616     fi
617 kous 2450
618 kous 2452 RGETTEXT_TARGETS=""
619     if test "$RGETTEXT" != ""; then
620     changequote(<<, >>)
621     for dir in data/ext/ruby; do
622     tmp_targets="`find $dir -name '*.rb' -exec echo \$\(top_srcdir\)/\{\} \;`"
623     RGETTEXT_TARGETS="$RGETTEXT_TARGETS `echo $tmp_targets | xargs echo`"
624     done
625     changequote([, ])
626 kous 2450 fi
627 kous 2452 AC_SUBST(RGETTEXT_TARGETS)
628 kous 2450
629     dnl **************************************************************
630 kous 2449 dnl Configure for UI XML
631     dnl **************************************************************
632     if test "$ruby_available" = "yes" ; then
633     UI_XML_RUBY_START=""
634     UI_XML_RUBY_END=""
635     else
636     UI_XML_RUBY_START="<!--"
637     UI_XML_RUBY_END="-->"
638     fi
639    
640     AC_SUBST([UI_XML_RUBY_START])
641     AC_SUBST([UI_XML_RUBY_END])
642    
643 kous 2611 KZ_BACKENDS="\$(GECKO)-\$(MOZILLA_COMPONENT_VERSION)"
644     AC_SUBST([KZ_BACKENDS])
645 kous 2449
646 ikezoe 2651 dnl **************************************************************
647     dnl Configure for history search module.
648     dnl **************************************************************
649     searchdir="${libdir}/\$(PACKAGE)/search"
650     AC_SUBST(searchdir)
651    
652 ikezoe 2658 dnl **************************************************************
653     dnl Check for Hyper Estraier.
654     dnl **************************************************************
655    
656     est_exists=no
657     PKG_CHECK_MODULES(EST, hyperestraier,
658     [est_exists=yes], [est_exists=no])
659     AM_CONDITIONAL([WITH_EST], [test "$est_exists" = "yes"])
660    
661 ikezoe 2682 dnl **************************************************************
662     dnl Check for Anthy
663     dnl **************************************************************
664    
665     anthy_exists=no
666     PKG_CHECK_MODULES(ANTHY, anthy,
667     [anthy_exists=yes], [anthy_exists=no])
668     AM_CONDITIONAL([WITH_ANTHY], [test "$anthy_exists" = "yes"])
669     MECAB_LIBS=`mecab-config --libs`
670     MECAB_CFLAGS=`mecab-config --cflags`
671     AC_SUBST([MECAB_CFLAGS])
672     AC_SUBST([MECAB_LIBS])
673 ikezoe 2706 if test x"$anthy_exists" = "xyes"; then
674     AC_DEFINE(WITH_ANTHY, 1, [Define including Anthy hugahoge])
675     fi
676 ikezoe 2682
677 ikezoe 2134 AC_SUBST([AM_CPPFLAGS])
678     AC_SUBST([AM_CFLAGS])
679     AC_SUBST([AM_CXXFLAGS])
680     AC_SUBST([AM_LDFLAGS])
681    
682 makeinu 72 AC_CONFIG_FILES([
683 makeinu 21 Makefile
684 makeinu 59 po/Makefile.in
685 makeinu 21 src/Makefile
686 makeinu 453 src/utils/Makefile
687     src/net/Makefile
688 makeinu 136 src/mozilla/Makefile
689 ikezoe 1700 src/khtml/Makefile
690 makeinu 453 src/actions/Makefile
691 makeinu 253 src/bookmarks/Makefile
692 ikezoe 1532 src/dialogs/Makefile
693 makeinu 122 src/prefs_ui/Makefile
694 makeinu 151 src/sidebar/Makefile
695 ikezoe 706 src/widget/Makefile
696 ikezoe 1323 src/libegg/Makefile
697     src/libegg/md5/Makefile
698     src/libegg/pixbufthumbnail/Makefile
699 ikezoe 1338 src/libegg/regex/Makefile
700     src/libegg/regex/pcre/Makefile
701 ikezoe 2651 module/Makefile
702     module/search/Makefile
703 makeinu 136 etc/Makefile
704 kous 2449 etc/kz-ui-beginner.xml
705     etc/kz-ui-medium.xml
706     etc/kz-ui-expert.xml
707 makeinu 1625 etc/mozilla/Makefile
708 kous 2387 ext/Makefile
709 kous 2401 ext/ruby/Makefile
710 ikezoe 231 data/Makefile
711     data/icons/Makefile
712 kous 2387 data/ext/Makefile
713 kous 2401 data/ext/ruby/Makefile
714 kous 2406 data/ext/ruby/kz/Makefile
715     data/ext/ruby/kz/actions/Makefile
716 ikezoe 1958 doc/Makefile
717 ikezoe 521 kazehakase.spec
718 makeinu 21 ])
719 makeinu 72
720     AC_OUTPUT

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26