Gentoo Archives: gentoo-commits

From: "Nirbheek Chauhan (nirbheek)" <nirbheek@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/gjs/files: gjs-drop-js-config.patch
Date: Sun, 01 May 2011 15:40:52
Message-Id: 20110501154039.7F34F20057@flycatcher.gentoo.org
1 nirbheek 11/05/01 15:40:39
2
3 Added: gjs-drop-js-config.patch
4 Log:
5 Move gjs from gnome overlay to the tree
6
7 (Portage version: 2.1.9.46/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-libs/gjs/files/gjs-drop-js-config.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/gjs/files/gjs-drop-js-config.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/gjs/files/gjs-drop-js-config.patch?rev=1.1&content-type=text/plain
14
15 Index: gjs-drop-js-config.patch
16 ===================================================================
17 From 4de63456b411ae2b16cdb813cf021e3f2e19e5f3 Mon Sep 17 00:00:00 2001
18 From: Nirbheek Chauhan <nirbheek@g.o>
19 Date: Thu, 17 Mar 2011 05:07:06 +0530
20 Subject: [PATCH] build: drop js-config support and xulrunner-1.8/1.9 cruft
21
22 In addition, add JS_LIBS to gjs_console_LDADD so that the
23 mozjs library in libdir from pkg-config is picked up first instead of
24 the library in /usr/lib which may be from a system install of spidermonkey
25 ---
26 Makefile.am | 1 +
27 configure.ac | 114 +++++++---------------------------------------
28 gjs-internals-1.0.pc.in | 2 +-
29 3 files changed, 20 insertions(+), 97 deletions(-)
30
31 diff --git a/Makefile.am b/Makefile.am
32 index b4814d6..3363ff5 100644
33 --- a/Makefile.am
34 +++ b/Makefile.am
35 @@ -121,6 +121,7 @@ gjs_console_CFLAGS = \
36 $(AM_CFLAGS) \
37 $(GOBJECT_CFLAGS)
38 gjs_console_LDADD = \
39 + $(JS_LIBS) \
40 $(GOBJECT_LIBS) \
41 libgjs.la
42 gjs_console_LDFLAGS = -R $(FIREFOX_JS_LIBDIR) -rdynamic
43 diff --git a/configure.ac b/configure.ac
44 index 715f2c3..1903cc6 100644
45 --- a/configure.ac
46 +++ b/configure.ac
47 @@ -91,54 +91,26 @@ m4_define(gobject_required_version, 2.18.0)
48 AC_CHECK_HEADERS([malloc.h])
49 AC_CHECK_FUNCS(mallinfo)
50
51 -# Look for Spidermonkey. If js-config exists, use that;
52 -# otherwise we try some pkgconfig files from various distributions.
53 +## mozilla-js: Gecko 1.9 and 2.0, all distributions
54 +PKG_CHECK_EXISTS([mozilla-js], [JS_PACKAGE=mozilla-js],)
55 +PKG_CHECK_MODULES(JS, $JS_PACKAGE)
56
57 -AC_ARG_VAR([JS_CONFIG], [The js-config program to use])
58 -if test "$ac_cv_env_JS_CONFIG_set" != "set"; then
59 - AC_PATH_PROG([JS_CONFIG], [js-config], [])
60 -fi
61 -
62 -if test -n "$JS_CONFIG"; then
63 - JS_CFLAGS="$($JS_CONFIG --cflags)"
64 - JS_LIBS="$($JS_CONFIG --libs)"
65 - FIREFOX_JS_LIBDIR="$($JS_CONFIG --libdir)"
66 - JS_PACKAGE=
67 +## some flavors of Firefox .pc only set sdkdir, not libdir
68 +FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
69 +FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
70
71 - # js-config gives almost usable CFLAGS, we must define one of XP_BEOS,
72 - # XP_OS2, XP_WIN or XP_UNIX
73 - JS_CFLAGS="$JS_CFLAGS -DXP_UNIX"
74 -else
75 - ## spidermonkey .pc file name varies across distributions and Gecko version
76 - ##
77 - ## mozilla-js: Gecko 1.9, all distributions
78 - ## xulrunner-js: Gecko 1.8 (and earlier?) Debian/Ubuntu
79 - ## firefox-js: ???
80 - ##
81 - ## Checking for mozilla-js first will hopefully get us the newest version
82 - ## of spidermonkey.
83 - PKG_CHECK_EXISTS([mozilla-js], [JS_PACKAGE=mozilla-js],
84 - [PKG_CHECK_EXISTS([xulrunner-js], [JS_PACKAGE=xulrunner-js], [JS_PACKAGE=firefox-js])])
85 -
86 - PKG_CHECK_MODULES(JS, $JS_PACKAGE)
87 -
88 - ## some flavors of Firefox .pc only set sdkdir, not libdir
89 - FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
90 - FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
91 -
92 - ## Ubuntu does not set libdir in mozilla-js.pc
93 - if test x"$FIREFOX_JS_LIBDIR" = x ; then
94 - ## Ubuntu returns xulrunner-devel as the sdkdir, but for the
95 - ## libdir we want the runtime location on the target system,
96 - ## so can't use -devel.
97 - ## The library is in the non-devel directory also.
98 - ## Don't ask me why it's in two places.
99 - FIREFOX_JS_LIBDIR=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
100 -
101 - if ! test -d "$FIREFOX_JS_LIBDIR" ; then
102 - FIREFOX_JS_LIBDIR=
103 - fi
104 - fi
105 +## Ubuntu does not set libdir in mozilla-js.pc
106 +if test x"$FIREFOX_JS_LIBDIR" = x ; then
107 + ## Ubuntu returns xulrunner-devel as the sdkdir, but for the
108 + ## libdir we want the runtime location on the target system,
109 + ## so can't use -devel.
110 + ## The library is in the non-devel directory also.
111 + ## Don't ask me why it's in two places.
112 + FIREFOX_JS_LIBDIR=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
113 +
114 + if ! test -d "$FIREFOX_JS_LIBDIR" ; then
115 + FIREFOX_JS_LIBDIR=
116 + fi
117 fi
118
119 if test x"$FIREFOX_JS_LIBDIR" = x ; then
120 @@ -179,35 +151,6 @@ else
121 AC_MSG_RESULT([no])
122 fi
123
124 -## workaround for Ubuntu Hardy bug where mozilla-js.pc gives CFLAGS
125 -## -I.../stable while jsapi.h is in .../unstable
126 -AC_MSG_CHECKING([if SpiderMonkey needs extra compiler flags])
127 -save_CFLAGS="$CFLAGS"
128 -CFLAGS="$CFLAGS $JS_CFLAGS"
129 -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jsapi.h>]])],
130 - [js_extra_cflags_needed=no],
131 - [js_extra_cflags_needed=yes])
132 -CFLAGS="$save_CFLAGS"
133 -AC_MSG_RESULT([$js_extra_cflags_needed])
134 -
135 -JS_EXTRA_CFLAGS=
136 -if test "$js_extra_cflags_needed" = yes; then
137 - try_cflags="-I`$PKG_CONFIG --variable=includedir $JS_PACKAGE`/unstable"
138 - AC_MSG_CHECKING([if $try_cflags works])
139 - save_CFLAGS="$CFLAGS"
140 - CFLAGS="$CFLAGS $JS_CFLAGS $try_cflags"
141 - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jsapi.h>]])],
142 - [AC_MSG_RESULT([yes])
143 - JS_EXTRA_CFLAGS="$try_cflags"],
144 - [AC_MSG_RESULT([no])])
145 - CFLAGS="$save_CFLAGS"
146 -
147 - if test x"$JS_EXTRA_CFLAGS" = x; then
148 - AC_MSG_ERROR([Unable to determine extra compiler flags needed])
149 - fi
150 -fi
151 -AC_SUBST([JS_EXTRA_CFLAGS])
152 -
153 AC_MSG_CHECKING([whether JSLocaleToUnicode takes a const char*])
154 save_CFLAGS="$CFLAGS"
155 CFLAGS="$CFLAGS $JS_CFLAGS -Wno-unused -Werror"
156 @@ -258,27 +201,6 @@ PKG_CHECK_MODULES([GJSTESTS], [$gjstests_packages])
157 GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
158 AC_SUBST(GI_DATADIR)
159
160 -if test x"$JS_PACKAGE" = x; then
161 - # if JS_PACKAGE is undefined, pkg-config modules don't include
162 - # SpiderMonkey and we need to deal with it ourselves
163 - GJS_CFLAGS="$GJS_CFLAGS $JS_CFLAGS"
164 - GJS_LIBS="$GJS_LIBS $JS_LIBS"
165 - GJS_GI_CFLAGS="$GJS_GI_CFLAGS $JS_CFLAGS"
166 - GJS_GI_LIBS="$GJS_GI_LIBS $JS_LIBS"
167 - GJS_CAIRO_CFLAGS="$GJS_CAIRO_CFLAGS $JS_CFLAGS"
168 - GJS_CAIRO_LIBS="$GJS_CAIRO_LIBS $JS_LIBS"
169 - GJS_DBUS_CFLAGS="$GJS_DBUS_CFLAGS $JS_CFLAGS"
170 - GJS_DBUS_LIBS="$GJS_DBUS_LIBS $JS_LIBS"
171 - GJSTESTS_CFLAGS="$GJSTESTS_CFLAGS $JS_CFLAGS"
172 - GJSTESTS_LIBS="$GJSTEST_LIBS $JS_LIBS"
173 -fi
174 -
175 -GJS_CFLAGS="$GJS_CFLAGS $JS_EXTRA_CFLAGS"
176 -GJS_GI_CFLAGS="$GJS_GI_CFLAGS $JS_EXTRA_CFLAGS"
177 -GJS_CAIRO_CFLAGS="$GJS_CAIRO_CFLAGS $JS_EXTRA_CFLAGS"
178 -GJS_DBUS_CFLAGS="$GJS_DBUS_CFLAGS $JS_EXTRA_CFLAGS"
179 -GJSTESTS_CFLAGS="$GJSTESTS_CFLAGS $JS_EXTRA_CFLAGS"
180 -
181 # readline
182 LIBS_no_readline=$LIBS
183
184 diff --git a/gjs-internals-1.0.pc.in b/gjs-internals-1.0.pc.in
185 index 701dd42..e4517cb 100644
186 --- a/gjs-internals-1.0.pc.in
187 +++ b/gjs-internals-1.0.pc.in
188 @@ -10,7 +10,7 @@ jsdir=@gjsjsdir@
189 jsnativedir=@gjsnativedir@
190 mozjslibdir=@FIREFOX_JS_LIBDIR@
191
192 -Cflags: -I${includedir}/gjs-1.0 @JS_EXTRA_CFLAGS@
193 +Cflags: -I${includedir}/gjs-1.0
194 Libs: -Wl,--rpath=${mozjslibdir}
195 Requires: gjs-1.0 gobject-introspection-1.0 @JS_PACKAGE@
196
197 --
198 1.7.3.4