I'm trying to compile the latest OpenWrt from GIT under Mac OS X 10.6.2. (I
can compile it using Ubuntu in a VMware Fusion virtual machine, but I'd like to
speed up my process by directly compiling it at the host.)
Unfortunately I ended up with problems with symlinks pointing to the root
directory, e.g.
$ ls -l staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr/lib/libc_pic.a
lrwxr-xr-x 1 pnr admin 6 Dec 11 12:53
staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr/lib/libc_pic.a ->
/libc.a
(Note that the symlink points to /libc.a, not to libc.a as it should.)
I was able to track the problem to uClibc Makefile.in, and was able to patch
it; see below. However, being a newcomer to OpenWrt (coming with a FreeBSD
background), I don't know if the patch is according to the OpenWRT standards,
or if it breaks the build on some other system. The patch seems to work also
on Ubuntu, not breaking the build there, however.
--Pekka Nikander
$ cat toolchain/uClibc/patches-0.9.30.1/999-Makefile_in_MacOSX.patch
--- ./Makefile.orig 2009-12-11 15:30:14.240668363 +0200
+++ ./Makefile.in 2009-12-11 15:32:21.516573614 +0200
@@ -373,7 +373,7 @@
$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
ifeq ($(HAVE_SHARED),y)
- for i in `find lib/ -type l -name 'lib[a-zA-Z]*.so' | \
+ for i in `find lib -type l -name 'lib[a-zA-Z]*.so' | \
$(SED) -e 's/lib\///'` ; do \
$(LN) -sf
$(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \
$(PREFIX)$(DEVEL_PREFIX)lib/$$i; \
@@ -403,7 +403,7 @@
# # If we build shared libraries then the static libs are PIC...
# # Make _pic.a symlinks to make mklibs.py and similar tools happy.
if [ -d lib ] ; then \
- for i in `find lib/ -type f -name 'lib*.a' | $(SED) -e
's/lib\///'` ; do \
+ for i in `find lib -type f -name 'lib*.a' | $(SED) -e
's/lib\///'` ; do \
$(LN) -sf $$i $(PREFIX)$(DEVEL_PREFIX)lib/`echo $$i \
| $(SED) -e 's/\.a$$/_pic.a/'`; \
done ; \
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel