Commit 7acdf427 authored by Christian Persch's avatar Christian Persch Committed by Christian Persch

Use gecko.m4 from Epiphany to detect gecko and set the various compiler

2005-11-30  Christian Persch  <chpe@cvs.gnome.org>

	* Makefile.am:
	* autogen.sh:
	* configure.in:
	* data/Makefile.am:
	* m4/gecko.m4:
	* src/Makefile.am: Use gecko.m4 from Epiphany to detect
	gecko and set the various compiler flags etc. Bug #322171.

	* src/Yelper.cpp: Use nsIWebBrowserSetup to turn off the
	global history.	Bug #322170.
parent 0f59a2e9
2005-11-30 Christian Persch <chpe@cvs.gnome.org>
* Makefile.am:
* autogen.sh:
* configure.in:
* data/Makefile.am:
* m4/gecko.m4:
* src/Makefile.am: Use gecko.m4 from Epiphany to detect
gecko and set the various compiler flags etc. Bug #322171.
* src/Yelper.cpp: Use nsIWebBrowserSetup to turn off the
global history. Bug #322170.
==================== 2.13.1 ====================
2005-11-27 Shaun McCance <shaunm@gnome.org>
......
SUBDIRS = src stylesheets po data
@INTLTOOL_DESKTOP_RULE@
ACLOCAL_AMFLAGS = -I m4
DESKTOP_IN_FILES=yelp.desktop.in
DESKTOP_FILES=$(DESKTOP_IN_FILES:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
Applicationsdir = $(datadir)/applications
Applications_DATA = $(DESKTOP_FILES)
desktopdir = $(datadir)/applications
desktop_in_files=yelp.desktop.in.in
desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
yelpdatadir = $(datadir)/yelp
yelpdata_DATA = important_docs.xml
EXTRA_DIST = \
autogen.sh \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
idl/GNOME_Yelp.idl \
important_docs.xml \
$(DESKTOP_IN_FILES) \
$(DESKTOP_FILES)
$(desktop_in_files)
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update
CLEANFILES = yelp.desktop
CLEANFILES = $(desktop_DATA)
DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
......@@ -6,7 +6,7 @@ test -z "$srcdir" && srcdir=.
PKG_NAME=Yelp
REQUIRED_AUTOMAKE_VERSION=1.8
REQUIRED_AUTOMAKE_VERSION=1.9
export REQUIRED_AUTOMAKE_VERSION
if ! test -f $srcdir/src/yelp-main.c; then
......
AC_INIT([yelp], [2.13.1],
[http://bugzilla.gnome.org/enter_bug.cgi?product=yelp])
AC_INIT([Yelp],[2.13.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=yelp],[yelp])
GNOME_COMMON_INIT
AC_CONFIG_SRCDIR(src/yelp-main.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR([src/yelp-main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
AM_MAINTAINER_MODE
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
......@@ -16,6 +16,7 @@ AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
......@@ -29,6 +30,16 @@ GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_CXX_WARNINGS
MORE_WARN_FLAGS=
DEPRECATION_FLAGS=
MOZILLA_WARN_CXXFLAGS="-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
if test "x$enable_maintainer_mode" = "xyes"; then
AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
# DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED"
MOZILLA_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth $MOZILLA_WARN_CXXFLAGS"
fi
if test "x$enable_debug" = "xyes"; then
AC_DEFINE([YELP_DEBUG],[1],[Enable Yelp debugging])
AM_CFLAGS="$AM_CFLAGS -pedantic -ansi"
......@@ -134,73 +145,36 @@ fi
AC_SUBST([YELP_SEARCH_CFLAGS])
AC_SUBST([YELP_SEARCH_LIBS])
dnl *******
dnl Mozilla
dnl *******
AC_MSG_CHECKING([which gecko to use])
AC_ARG_WITH([mozilla],
AS_HELP_STRING([--with-mozilla@<:@=mozilla|firefox|xulrunner|thunderbird@:>@],
[Which gecko engine to use (default: autodetect)]))
GECKOS="firefox mozilla-firefox seamonkey mozilla xulrunner thunderbird mozilla-thunderbird"
gecko=$with_mozilla
# *****
# Gecko
# *****
if test "x$gecko" = "x"; then
dnl Autodetect gecko
for g in $GECKOS; do
if $PKG_CONFIG --exists $g-xpcom; then
gecko=$g
break;
fi
done
fi
if test "x$gecko" = "x"; then
AC_MSG_ERROR([No gecko found])
elif ! ( echo "$GECKOS" | egrep "(^| )$gecko(\$| )" > /dev/null); then
AC_MSG_ERROR([Unknown gecko "$gecko" specified])
fi
AC_MSG_RESULT([$gecko])
case "$gecko" in
mozilla) min_version=1.7 flavour=mozilla ;;
seamonkey) min_version=1.0 flavour=mozilla ;;
*firefox) min_version=1.0 flavour=toolkit ;;
*thunderbird) min_version=1.0 flavour=toolkit ;;
xulrunner) min_version=1.8 flavour=toolkit ;;
esac
GECKO_INIT([MOZILLA])
MOZILLA=$gecko
AC_SUBST([MOZILLA])
AC_SUBST([MOZILLA_INCLUDE_ROOT])
AC_SUBST([MOZILLA_HOME])
case "$MOZILLA" in
mozilla) gecko_min_version=1.7 ;;
seamonkey) gecko_min_version=1.0 ;;
*firefox) gecko_min_version=1.0 ;;
*thunderbird) gecko_min_version=1.0 ;;
xulrunner) gecko_min_version=1.8 ;;
esac
PKG_CHECK_MODULES(MOZILLA_COMPONENT, $MOZILLA-gtkmozembed)
MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-gtkmozembed`"
AC_SUBST(MOZILLA_INCLUDE_ROOT)
MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $MOZILLA-gtkmozembed`"
AC_SUBST(MOZILLA_HOME)
PKG_CHECK_MODULES([MOZILLA_COMPONENT],[$MOZILLA-gtkmozembed >= $gecko_min_version $MOZILLA-xpcom >= $gecko_min_version])
dnl Needed since gecko 1.8b2
AC_DEFINE([MOZILLA_INTERNAL_API],[1],[Define to have access to internal Mozilla APIs])
AC_ARG_ENABLE([cpp-rtti],
AC_HELP_STRING([--enable-cpp-rtti],[Enable C++ RTTI]),[],
[enable_cpp_rtti=no])
if test "x$enable_cpp_rtti" = "xno"; then
AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
fi
AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/fastfind/nsITypeAheadFind.h],
[AC_DEFINE([TYPEAHEADFIND],[1],[Define if we have toolkit's nsITypeAheadFind])])
AC_DEFINE([MOZILLA_INTERNAL_API],[1],[Define to have access to internal mozilla APIs])
dnl =================
dnl Check for whereis
dnl =================
case $host in
*-linux-gnu | *-irix6*) AC_DEFINE(HAVE_MAN_WHEREIS, 1, [man(1) understands -w option]);;
*-solaris*) AC_DEFINE(HAVE_MAN_DEBUG, 1, [man(1) has a -d debug option]);;
......@@ -246,14 +220,15 @@ dnl <= Check for bzip2 > 1.0.0
dnl =>
AC_SUBST(BZ_LIBS)
dnl Set flags
AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
# Set flags
AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS $MOZILLA_WARN_CXXFLAGS"
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([
Makefile
......@@ -265,8 +240,7 @@ data/Makefile
data/icons/Makefile
data/ui/Makefile
po/Makefile.in
])
AC_OUTPUT([
yelp.desktop.in
])
AC_OUTPUT
......@@ -22,13 +22,13 @@ EXTRA_DIST = \
scrollkeeper.xml default.css \
yelp.js
install-data-local: $(schemas_DATA)
if GCONF_SCHEMAS_INSTALL
install-data-local:
if test -z "$(DESTDIR)"; then \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/data/yelp.schemas ; \
for p in $^ ; do \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p >&1 > /dev/null; \
done \
fi
else
install-data-local:
endif
CLEANFILES = yelp.schemas toc.xml man.xml
CLEANFILES = $(schemas_DATA) toc.xml man.xml
# Copyright (C) 2000-2004 Marco Pesenti Gritti
# Copyright (C) 2003, 2004, 2005 Christian Persch
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# GECKO_INIT([VARIABLE])
#
# Checks for gecko, and aborts if it's not found
#
# Checks for -fshort-wchar compiler variable, and adds it to
# AM_CXXFLAGS if found
#
# Checks whether RTTI is enabled, and adds -fno-rtti to
# AM_CXXFLAGS otherwise
#
# Checks whether the gecko build is a debug build, and adds
# debug flags to AM_CXXFLAGS if it is.
#
# Expanded variables:
# VARIABLE: Which gecko was found (e.g. "xulrunnner", "seamonkey", ...)
# VARIABLE_FLAVOUR: The flavour of the gecko that was found
# VARIABLE_HOME:
# VARIABLE_PREFIX:
# VARIABLE_INCLUDE_ROOT:
# VARIABLE_VERSION: The version of the gecko that was found
# VARIABLE_VERSION_MAJOR:
# VARIABLE_VERSION_MINOR:
AC_DEFUN([GECKO_INIT],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_MSG_CHECKING([which gecko to use])
AC_ARG_WITH([gecko],
AS_HELP_STRING([--with-gecko@<:@=mozilla|firefox|seamonkey|xulrunner@:>@],
[Which gecko engine to use (default: autodetect)]))
# Backward compat
AC_ARG_WITH([mozilla],[],[with_gecko=$withval],[])
_GECKO=$with_gecko
# Autodetect gecko
_geckos="firefox mozilla-firefox seamonkey mozilla xulrunner"
if test -z "$_GECKO"; then
for lizard in $_geckos; do
if $PKG_CONFIG --exists $lizard-xpcom; then
_GECKO=$lizard
break;
fi
done
fi
if test "x$_GECKO" = "x"; then
AC_MSG_ERROR([No gecko found])
elif ! ( echo "$_geckos" | egrep "(^| )$_GECKO(\$| )" > /dev/null); then
AC_MSG_ERROR([Unknown gecko "$_GECKO" specified])
fi
AC_MSG_RESULT([$_GECKO])
case "$_GECKO" in
mozilla) _GECKO_FLAVOUR=mozilla ;;
seamonkey) _GECKO_FLAVOUR=mozilla ;;
*firefox) _GECKO_FLAVOUR=toolkit ;;
xulrunner) _GECKO_FLAVOUR=toolkit ;;
esac
_GECKO_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $_GECKO-gtkmozembed`"
_GECKO_HOME="`$PKG_CONFIG --variable=libdir $_GECKO-gtkmozembed`"
_GECKO_PREFIX="`$PKG_CONFIG --variable=prefix $_GECKO-gtkmozembed`"
$1[]=$_GECKO
$1[]_FLAVOUR=$_GECKO_FLAVOUR
$1[]_INCLUDE_ROOT=$_GECKO_INCLUDE_ROOT
$1[]_HOME=$_GECKO_HOME
$1[]_PREFIX=$_GECKO_PREFIX
# **************************************************************
# This is really gcc-only
# Do this test using CXX only since some versions of gcc
# 2.95-2.97 have a signed wchar_t in c++ only and some versions
# only have short-wchar support for c++.
# **************************************************************
_GECKO_EXTRA_CPPFLAGS=
_GECKO_EXTRA_CFLAGS=
_GECKO_EXTRA_CXXFLAGS=
_GECKO_EXTRA_LDFLAGS=
AC_LANG_PUSH([C++])
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $_GECKO_EXTRA_CXXFLAGS -fshort-wchar"
AC_CACHE_CHECK([for compiler -fshort-wchar option],
gecko_cv_have_usable_wchar_option,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[#include <stddef.h>
int main () {
return (sizeof(wchar_t) != 2) || (wchar_t)-1 < (wchar_t) 0 ;
} ]])],
[gecko_cv_have_usable_wchar_option="yes"],
[gecko_cv_have_usable_wchar_option="no"],
[gecko_cv_have_usable_wchar_option="maybe (cross-compiling)"])])
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_POP([C++])
if test "$gecko_cv_have_usable_wchar_option" = "yes"; then
_GECKO_EXTRA_CXXFLAGS="-fshort-wchar"
AM_CXXFLAGS="$AM_CXXFLAGS -fshort-wchar"
fi
# **************
# Check for RTTI
# **************
AC_MSG_CHECKING([whether to enable C++ RTTI])
AC_ARG_ENABLE([cpp-rtti],
AS_HELP_STRING([--enable-cpp-rtti],[Enable C++ RTTI]),
[],[enable_cpp_rtti=no])
AC_MSG_RESULT([$enable_cpp_rtti])
if test "$enable_cpp_rtti" = "no"; then
_GECKO_EXTRA_CXXFLAGS="-fno-rtti $_GECKO_EXTRA_CXXFLAGS"
AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
fi
# *************
# Various tests
# *************
AC_LANG_PUSH([C++])
_SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS -I$_GECKO_INCLUDE_ROOT"
AC_MSG_CHECKING([[whether we have a gtk 2 gecko build]])
AC_RUN_IFELSE(
[AC_LANG_SOURCE(
[[#include <mozilla-config.h>
#include <string.h>
int main(void) {
return strcmp (MOZ_DEFAULT_TOOLKIT, "gtk2") != 0;
} ]]
)],
[result=yes],
[AC_MSG_ERROR([[This program needs a gtk 2 gecko build]])],
[result=maybe])
AC_MSG_RESULT([$result])
AC_MSG_CHECKING([[whether we have a gecko debug build]])
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE(
[[#include <mozilla-config.h>
#if !defined(MOZ_REFLOW_PERF) || !defined(MOZ_REFLOW_PERF_DSP)
#error No
#endif]]
)],
[gecko_cv_have_debug=yes],
[gecko_cv_have_debug=no])
AC_MSG_RESULT([$gecko_cv_have_debug])
CPPFLAGS="$_SAVE_CPPFLAGS"
AC_LANG_POP([C++])
if test "$gecko_cv_have_debug" = "yes"; then
_GECKO_EXTRA_CXXFLAGS="$_GECKO_EXTRA_CXXFLAGS -DDEBUG -D_DEBUG"
AM_CXXFLAGS="-DDEBUG -D_DEBUG $AM_CXXFLAGS"
fi
# ***********************
# Check for gecko version
# ***********************
AC_MSG_CHECKING([[for gecko version]])
_GECKO_VERSION_SPLIT=`cat $_GECKO_INCLUDE_ROOT/mozilla-config.h | grep MOZILLA_VERSION_U | awk '{ print $[3]; }' | tr ".ab+" " "`
if test -z "$_GECKO_VERSION_SPLIT"; then
_GECKO_VERSION_SPLIT="1 7"
fi
_GECKO_VERSION_MAJOR=`echo $_GECKO_VERSION_SPLIT | awk '{ print $[1]; }'`
_GECKO_VERSION_MINOR=`echo $_GECKO_VERSION_SPLIT | awk '{ print $[2]; }'`
_GECKO_VERSION="$_GECKO_VERSION_MAJOR.$_GECKO_VERSION_MINOR"
AC_MSG_RESULT([$_GECKO_VERSION])
$1[]_VERSION=$_GECKO_VERSION
$1[]_VERSION_MAJOR=$_GECKO_VERSION_MAJOR
$1[]_VERSION_MINOR=$_GECKO_VERSION_MINOR
if test "$_GECKO_VERSION_MAJOR" != "1" -o "$_GECKO_VERSION_MINOR" -lt "7" -o "$_GECKO_VERSION_MINOR" -gt "9"; then
AC_MSG_ERROR([Gecko version $_GECKO_VERSION is not supported!])
fi
if test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "7"; then
AC_DEFINE([HAVE_GECKO_1_7],[1],[Define if we have gecko 1.7])
gecko_cv_have_gecko_1_7=yes
fi
if test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "8"; then
AC_DEFINE([HAVE_GECKO_1_8],[1],[Define if we have gecko 1.8])
gecko_cv_have_gecko_1_8=yes
fi
if test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "9"; then
AC_DEFINE([HAVE_GECKO_1_9],[1],[Define if we have gecko 1.9])
gecko_cv_have_gecko_1_9=yes
fi
AM_CONDITIONAL([HAVE_GECKO_1_7],[test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "7"])
AM_CONDITIONAL([HAVE_GECKO_1_8],[test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "8"])
AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$_GECKO_VERSION_MAJOR" = "1" -a "$_GECKO_VERSION_MINOR" -ge "9"])
])
# ***************************************************************************
# ***************************************************************************
# ***************************************************************************
# GECKO_DISPATCH([MACRO], [HEADERS], ...)
m4_define([GECKO_DISPATCH],
[
AC_LANG_PUSH([C++])
_SAVE_CPPFLAGS="$CPPFLAGS"
_SAVE_CXXFLAGS="$CXXFLAGS"
_SAVE_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS -I$_GECKO_INCLUDE_ROOT $($PKG_CONFIG --cflags-only-I $_GECKO-xpcom)"
CXXFLAGS="$CXXFLAGS $_GECKO_EXTRA_CXXFLAGS $($PKG_CONFIG --cflags-only-other $_GECKO-xpcom)"
LDFLAGS="$LDFLAGS $_GECKO_EXTRA_LDFLAGS $($PKG_CONFIG --libs $_GECKO-xpcom) -Wl,--rpath=$_GECKO_HOME"
_GECKO_DISPATCH_HEADERS="$2"
# Sigh Gentoo has a rubbish header layout
# http://bugs.gentoo.org/show_bug.cgi?id=100804
# Mind you, it's useful to be able to test against uninstalled mozilla builds...
_GECKO_DISPATCH_HEADERS="$_GECKO_DISPATCH_HEADERS necko dom"
# Now add them to CPPFLAGS
for i in $_GECKO_DISPATCH_HEADERS; do
CPPFLAGS="$CPPFLAGS -I$_GECKO_INCLUDE_ROOT/$i"
done
m4_indir([$1],m4_shiftn(2,$@))
CPPFLAGS="$_SAVE_CPPFLAGS"
CXXFLAGS="$_SAVE_CXXFLAGS"
LDFLAGS="$_SAVE_LDFLAGS"
AC_LANG_POP([C++])
])# _GECKO_DISPATCH
# ***************************************************************************
# ***************************************************************************
# ***************************************************************************
# GECKO_COMPILE_IFELSE(HEADERS, PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
AC_DEFUN([GECKO_COMPILE_IFELSE],[GECKO_DISPATCH([AC_COMPILE_IFELSE],$@)])
# GECKO_RUN_IFELSE(HEADERS, PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
AC_DEFUN([GECKO_RUN_IFELSE],[GECKO_DISPATCH([AC_RUN_IFELSE],$@)])
# ***************************************************************************
# ***************************************************************************
# ***************************************************************************
# GECKO_CHECK_CONTRACTID(IDENTIFIER, CONTRACTID, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Checks wheter CONTRACTID is a registered contract ID
AC_DEFUN([GECKO_CHECK_CONTRACTID],
[AC_REQUIRE([GECKO_INIT])dnl
AC_CACHE_CHECK([for the $2 XPCOM component],
[gecko_cv_xpcom_contractid_[]$1],
[
gecko_cv_xpcom_contractid_[]$1[]=no
GECKO_RUN_IFELSE([],
[AC_LANG_PROGRAM([[
#include <mozilla-config.h>
#include <stdlib.h>
#include <stdio.h>
#include <nsXPCOM.h>
#include <nsCOMPtr.h>
#include <nsILocalFile.h>
#include <nsIServiceManager.h>
#include <nsIComponentRegistrar.h>
#include <nsString.h>
]],[[
// redirect unwanted mozilla debug output
freopen ("/dev/null", "w", stdout);
freopen ("/dev/null", "w", stderr);
nsresult rv;
nsCOMPtr<nsILocalFile> directory;
rv = NS_NewNativeLocalFile (NS_LITERAL_CSTRING("$_GECKO_HOME"), PR_FALSE, getter_AddRefs (directory));
if (NS_FAILED (rv) || !directory) {
exit (EXIT_FAILURE);
}
nsCOMPtr<nsIServiceManager> sm;
rv = NS_InitXPCOM2 (getter_AddRefs (sm), directory, nsnull);
if (NS_FAILED (rv)) {
exit (EXIT_FAILURE);
}
nsCOMPtr<nsIComponentRegistrar> registar (do_QueryInterface (sm, &rv));
sm = nsnull; // release service manager
if (NS_FAILED (rv)) {
NS_ShutdownXPCOM (nsnull);
exit (EXIT_FAILURE);
}
PRBool isRegistered = PR_FALSE;
rv = registar->IsContractIDRegistered ("$2", &isRegistered);
registar = nsnull; // release registar before shutdown
NS_ShutdownXPCOM (nsnull);
exit (isRegistered ? EXIT_SUCCESS : EXIT_FAILURE);
]])
],
[gecko_cv_xpcom_contractid_[]$1[]=present],
[gecko_cv_xpcom_contractid_[]$1[]="not present"],
[gecko_cv_xpcom_contractid_[]$1[]="not present (cross-compiling)"])
])
if test "$gecko_cv_xpcom_contractid_[]$1" = "present"; then
ifelse([$3],,[:],[$3])
else
ifelse([$4],,[AC_MSG_FAILURE([dnl
Contract ID "$2" is not registered, but $PACKAGE_NAME depends on it.])],
[$4])
fi
])
......@@ -89,7 +89,7 @@ yelp_LDADD = \
$(BZ_LIBS) \
$(MOZILLA_COMPONENT_LIBS)
yelp_LDFLAGS = -R$(MOZILLA_HOME)
yelp_LDFLAGS = -R$(MOZILLA_HOME) $(AM_LDFLAGS)
check_PROGRAMS = test-man-parser test-pager test-uri
......@@ -110,6 +110,8 @@ test_man_parser_CFLAGS = \
test_man_parser_LDADD = $(YELP_LIBS) $(Z_LIBS) $(BZ_LIBS)
test_man_parser_LDFLAGS = $(AM_LDFLAGS)
test_pager_SOURCES = \
yelp-db-pager.c yelp-db-pager.h \
yelp-error.c yelp-error.h \
......@@ -132,6 +134,8 @@ test_pager_CFLAGS = \
test_pager_LDADD = $(YELP_LIBS) $(POPT_LIBS) $(Z_LIBS) $(BZ_LIBS)
test_pager_LDFLAGS = $(AM_LDFLAGS)
test_uri_SOURCES = \
yelp-utils.c yelp-utils.h \
test-uri.c
......@@ -146,6 +150,8 @@ test_uri_CFLAGS = \
test_uri_LDADD = $(YELP_LIBS)
test_uri_LDFLAGS = $(AM_LDFLAGS)
serverdir = $(libdir)/bonobo/servers
server_in_files = GNOME_Yelp.server.in
server_DATA = $(server_in_files:.server.in=.server)
......@@ -191,8 +197,8 @@ EXTRA_DIST = \
$(server_in_files)
install-exec-local:
rm -f $(DESTDIR)$(bindir)/gnome-help
ln -s yelp $(DESTDIR)$(bindir)/gnome-help
rm -f $(DESTDIR)$(bindir)/gnome-help && \
$(LN_S) yelp $(DESTDIR)$(bindir)/gnome-help
distclean-local:
if test $(srcdir) != .; then \
......
......@@ -31,11 +31,13 @@
#include "nsEmbedString.h"
#define MOZILLA_INTERNAL_API 1
#include <nsIWebBrowserSetup.h>
#include <nsIClipboardCommands.h>
#include <nsICommandManager.h>
#include <nsIInterfaceRequestorUtils.h>
#include <nsIPrefService.h>
#include <nsIServiceManager.h>
#include <nsIDOMDocument.h>