libpcre-native: Fix linking issues when the build system doesn't have pcre installed
authorRichard Purdie <rpurdie@rpsys.net>
Wed, 19 Mar 2008 12:33:38 +0000 (12:33 +0000)
committerRichard Purdie <rpurdie@rpsys.net>
Wed, 19 Mar 2008 12:33:38 +0000 (12:33 +0000)
packages/libpcre/files/.mtn2git_empty [new file with mode: 0644]
packages/libpcre/files/native-rpath-link.patch [new file with mode: 0644]
packages/libpcre/libpcre-native_4.4.bb

diff --git a/packages/libpcre/files/.mtn2git_empty b/packages/libpcre/files/.mtn2git_empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/libpcre/files/native-rpath-link.patch b/packages/libpcre/files/native-rpath-link.patch
new file mode 100644 (file)
index 0000000..69de2be
--- /dev/null
@@ -0,0 +1,19 @@
+Index: pcre-4.4/Makefile.in
+===================================================================
+--- pcre-4.4.orig/Makefile.in  2003-08-21 11:43:07.000000000 +0100
++++ pcre-4.4/Makefile.in       2008-03-19 10:34:08.000000000 +0000
+@@ -107,12 +107,12 @@
+ libpcre.la:     $(OBJ)
+               -rm -f libpcre.la
+-              $(LINKLIB) -rpath $(LIBDIR) -version-info \
++              $(LINKLIB) -rpath $(LIBDIR) -L$(LIBDIR) -version-info \
+               '$(PCRELIBVERSION)' -o libpcre.la $(LOBJ)
+ libpcreposix.la: pcreposix.@OBJEXT@
+               -rm -f libpcreposix.la
+-              $(LINKLIB) -rpath $(LIBDIR) libpcre.la -version-info \
++              $(LINKLIB) -rpath $(LIBDIR) -L$(LIBDIR) libpcre.la -version-info \
+               '$(PCREPOSIXLIBVERSION)' -o libpcreposix.la pcreposix.lo
+ pcre.@OBJEXT@:  $(top_srcdir)/chartables.c $(top_srcdir)/pcre.c \
index 8a42113..1bbfde7 100644 (file)
@@ -6,3 +6,14 @@ FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/libpcre-${PV}"
 # NOTE: multiple providers are available (libpcre, libpcre-native);
 # NOTE: consider defining PREFERRED_PROVIDER_pcre
 PROVIDES = ""
+
+SRC_URI += "file://native-rpath-link.patch;patch=1"
+
+do_compile () {
+       # The generation of dftables can lead to timestamp problems with ccache
+       # because the generated config.h seems newer.  It is sufficient to ensure that the
+       # attempt to build dftables inside make will actually work (foo_FOR_BUILD is
+       # only used for this).
+       oe_runmake CC_FOR_BUILD="${BUILD_CC}" CFLAGS_FOR_BUILD="-DLINK_SIZE=2 -I${S}/include" LINK_FOR_BUILD="${BUILD_CC}"
+}
+