Build Under Linux
Home › Forums › Development › Build Under Linux
- This topic is empty.
-
AuthorPosts
-
November 4, 2010 at 1:04 am #23212JimShortsMember
I’ve just spent several hours today getting latest svn of WiiMC to build under linux. The main complexity is in the libs tree. The main codebase is relatively easy to get to build. Here are some notes I made.
1) All the “configure” files must be chmod’d 755 so they’re executable
2) All the “missing” files must be chmod’d 755 also
3) All the “version.sh” files must be chmod’d 755.
4) The file “source/mplayer/version.sh” has 0x0d characters in it (CR) on end of line, this messes up unix command interpreter names. I’d have thought svn would have taken care of the EOL conversion automatically, but evidently it doesn’t.
5) libs/fribidi/Makefile.am needs to have “bin doc test” taken out of the SUBDIRS definition. After this change, autoconf should be run inside libs/fribidi.
6) The .deps directories should never have been committed to svn, they are created as part of the build process. They should be removed from svn.
7) There is a bizarre problem that shows up when building the libs/pcre tree. The file “config.guess” tries to use the cross compiler to determine which LIBC is being used, and it makes a little code segment $dummy.c which has #include. Unfortunately this include fails because the devkitPPC only has include/sys/features.h. My linux distribution has include/features.h. I’m not sure what’s correct. I fixed it by creating a symlink /opt/devkitPro/devkitPPC/powerpc-eabi/include/features.h -> sys/features.h
8) It seems as though the libs/* trees expect the devkitPPC compiler to be in the $PATH, but that’s not how other code trees for Wiibrew seem to work. I made a makefile “libs/Makefile” which specifies the path to the cross compiler explicitly. I include it here for reference, perhaps it can be incorporated into the svn tree. The “make repair” is just a step I use since the svn tree is messed up.Hope this is of some use!
COMMAND1 = (make && sudo -E make install)
COMMAND2 = (CC=$(DEVKITPPC)/bin/powerpc-eabi-gcc CXX=$(DEVKITPPC)/bin/powerpc-eabi-g++ ./configure --host=powerpc-eabi --prefix="${DEVKITPRO}/portlibs/ppc" --libdir="${DEVKITPRO}/portlibs/ppc/lib" --disable-shared &&
make && sudo -E make install)
COMMAND3 = (CC=$(DEVKITPPC)/bin/powerpc-eabi-gcc ./configure --host=powerpc-eabi --prefix="${DEVKITPRO}/portlibs/ppc" --libdir="${DEVKITPRO}/portlibs/ppc/lib" --enable-shared=no --enable-static=yes --with-cpu=ppc_nofpu --with-optimization=3 &&
cd src/libmpg123 && make && sudo -E make install)
all: dir1 dir2 dir3 dir4 dir5 dir6
dir1:
cd libntfs && $(COMMAND1)
dir2:
cd fribidi && $(COMMAND2)
dir3:
cd libexif && $(COMMAND2)
dir4:
cd libiconv && $(COMMAND2)
dir5:
cd pcre && $(COMMAND2)
dir6:
cd libmpg123 && $(COMMAND3)
repair:
chmod 755 `find -name configure`
chmod 755 `find -name missing`
rm -rf `find -name .deps`
(cd fribidi ; sed "s/bin doc test//" < Makefile.am > k ; mv k Makefile.am )
ETA: The .deps directories that shouldn’t be in svn are these:
./libs/fribidi/gen.tab/.deps
./libs/fribidi/bin/.deps
./libs/fribidi/lib/.deps
./libs/fribidi/charset/.depsNovember 4, 2010 at 2:29 am #27473rodriesMemberThis is great! Thanks for posting all of your findings – I’m sure they will help others. I’ve updated SVN based on your comments. Let me know if there’s anything else that you think I can do. 🙂
November 4, 2010 at 4:06 am #27474JimShortsMember@Tantric wrote:
Let me know if there’s anything else that you think I can do. 🙂
Wow that was fast.
I updated my copy and tried the build, here are some notes:
libs/Makefile has (CR)’s on every end of line, and each line that starts in whitespace below the all: line needs to use a single TAB character instead of multiple spaces, “make” complains about missing separator. This sort of thing often happens when a cut-and-paste is used from a browser window. I attached Makefile.gz which should be correct.
The libs/ tree built without errors when I fixed the Makefile.
Following files ought to be chmod 755 (just for completeness)
libs/libiconv/libcharset/configure
source/mplayer/configure
source/mplayer/DOCS/xml/configure
source/mplayer/ffmpeg/configure
libs/liba52/autotools/missing
libs/libiconv/build-aux/missing
libs/libmpg123/build/missing
source/mplayer/ffmpeg/version.shI think the toplevel build will be ok now. It’s still building on my machine. If there are any errors I’ll edit this…
November 5, 2010 at 2:53 pm #27475stickmanMemberpuddles,
Thanks for sharing.
I am trying to build using Ubuntu 10.10 64bits (as a vmware client). It’s very straight forward to follow the instructions and also by using your makefile.
However, I ran into problem when building the pcre lib. All other libs build fine.
This is the error I got:
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... Invalid configuration `x86_64-unknown-linux-': machine `x86_64-unknown-linux' not recognized
configure: error: /bin/bash ./config.sub x86_64-unknown-linux- failed
make: *** [dir5] Error 1
Any idea what I am doing wrong?
November 5, 2010 at 3:12 pm #27476JimShortsMember@dynmosaic wrote:
Any idea what I am doing wrong?
Yep, that’s the bizarre problem regarding the location of features.h I mentioned. Do this:
sudo ln -s sys/features.h /opt/devkitPro/devkitPPC/powerpc-eabi/include/features.h
I’m not sure how else to fix it, lots of config.guess scripts expect to be able to include features.h, not sys/features.h…
November 5, 2010 at 4:38 pm #27477xzxeroMemberJust for the record, i have could compiled successfully under openSUSE 64bit and Ubuntu Maverick 32bit and the only things that I needed to change was the version.sh
Everything else worked fine.November 5, 2010 at 5:01 pm #27478stickmanMember@Ataraxis wrote:
Just for the record, i have could compiled successfully under openSUSE 64bit and Ubuntu Maverick 32bit and the only things that I needed to change was the version.sh
Everything else worked fine.Ataraxis, could you please share your change on version.sh with me?
puddles, I will try your fix for now to see what will bring. Will report back later if I have other problems. Thanks.
November 5, 2010 at 5:20 pm #27479xzxeroMemberall i did was changing the line ending and make it executable.
current svn does have this change.dos2unix ./source/mplayer/version.sh
chmod +x ./source/mplayer/version.shdos2unix can be found in the package tofrodos
November 5, 2010 at 5:42 pm #27480stickmanMember@Ataraxis wrote:
all i did was changing the line ending and make it executable.
current svn does have this change.dos2unix ./source/mplayer/version.sh
chmod +x ./source/mplayer/version.shdos2unix can be found in the package tofrodos
Thanks, Ataraxis, I am using the most recent svn. You did not have to do anything (like puddles did) to make the libs compile?
My problem was the same as what puddles had mentioned.
Puddles, after I applied your change wrt features.h, it compiles perfectly.
Now, for the same svn, I noticed that my windows build and ubuntu build is not the same size, is this normal? I will try them on my wii to see if there is any problem with the build. Will report back if there is anything unusual.
November 5, 2010 at 6:03 pm #27481xzxeroMemberi recompiled pcre completely and could not reproduce the problem, i could find the reference to features.h in config.guess though.
What might be different to puddle’s setup is that I do have the devkit compiler on my path, those are my settings for compiling:
export DEVKITPRO=/home/kwb/wii/devkitPro/
export DEVKITPPC=/home/kwb/wii/devkitPro/devkitPPC
export PATH=/home/kwb/wii/devkitPro/devkitPPC/bin:$PATH
export WIILOAD=tcp:192.168.2.11it seems to find the correct features.h though…
kwb@d820:/$ find -name features.h
./usr/lib/syslinux/com32/include/syslinux/features.h
./usr/src/linux-headers-2.6.35-22/include/xen/features.h
./usr/src/linux-headers-2.6.35-22/include/xen/interface/features.h
./usr/include/features.h
./usr/include/c++/4.4/parallel/features.h
./home/kwb/wii/devkitPro/devkitPPC/powerpc-eabi/include/sys/features.hNovember 5, 2010 at 8:02 pm #27482stickmanMemberAtaraxis,
Thanks for your help. However, if I get rid of the symbolic link that puddles provided, I could not get it to work. I have DEVKITPRO, DEVKITPPC exported correctly. I even update the path as you did. Although I don’t think WIILOAD is relevant here.
The following is my findings for features.h:
ubuntu:/$ sudo find -name features.h
./opt/devkitpro/devkitPPC/powerpc-eabi/include/sys/features.h
./usr/lib/syslinux/com32/include/syslinux/features.h
./usr/src/linux-headers-2.6.35-22/include/xen/features.h
./usr/src/linux-headers-2.6.35-22/include/xen/interface/features.h
./usr/include/features.h
./usr/include/wx-2.8/wx/features.h
./usr/include/c++/4.4/parallel/features.h
That’s strange.
November 5, 2010 at 11:33 pm #27483JimShortsMember@dynmosaic wrote:
That’s strange.
I have another way to get it to compile. Just add on the configure parameters
–build=powerpc-eabi-gnu
for the definition of COMMAND2. Attached is the modified Makefile. This way it doesn’t matter where features.h is, and I think the config.guess isn’t even used.
November 6, 2010 at 12:37 am #27484rodriesMemberSounds good! I’ve committed this change.
November 6, 2010 at 1:31 am #27486stickmanMember@Tantric wrote:
Sounds good! I’ve committed this change.
Thanks Tantric for the quick commit, and thanks puddles for the fix. It works very well. I have thus deleted the sym link for features.h.
I really like puddles Makefile, one small improvement, just for readability, instead of using dir1, dir2, …, dir6, could we use the following instead?
all: libntfs fribidi libexif libiconv pcre libmpg123
libntfs:
cd libntfs && $(COMMAND1)
fribidi:
cd fribidi && $(COMMAND2)
libexif:
cd libexif && $(COMMAND2)
libiconv:
cd libiconv && $(COMMAND2)
pcre:
cd pcre && $(COMMAND2)
libmpg123:
cd libmpg123 && $(COMMAND3)
In this way, if a particular lib, for example, libntfs, was changed, I can simply do a make libntfs (instead of make dir1)
No biggie. I have included the changed Makefile.gz if you choose to use it.
November 6, 2010 at 1:58 am #27487stickmanMemberNever mind, it won’t work by using the directory name. I guess by specifying the directory but not specifying the dependency, it simply check whether the directory exists or not.
For build under windows, the same Makefile won’t work, since there is no sudo -E command. I copied Makefile to Makefile.win, and removed all the occurances of ‘sudo -E’, everything works fine, I tested under MingW (ran as admin), except it choked on libmpg123. For that, I made the following change, I added the –build in COMMAND3, just as in COMMAND2, since the configure is complaining about “don’t use –host, but use –build” anyway, after the change, bingo, it worked.
So here is the Makefile.win.gz
-
AuthorPosts
- You must be logged in to reply to this topic.
