Welcome,
Guest
|
CodeTyphon Linux OS Development, discussions and problems
TOPIC:
Lazarus 2.80 in Mandriva and ROSA x64 12 years 2 months ago #2464
|
Here is updated cross compile guide for Mandriva and ROSA x64 using CodeTyphon 2.80
I really do not want to make a tutorial that will say something like "use steps from this to that one from that post", so some things are pure copy/paste from original tutorial, just in order to keep all in one place. If you read the original tutorial, you will see that this is one is much simpler, thanks to the fact that CT team added cross build elements to CT for Linux in 2.80. Thank you for that! At the end, you should be able to compile apps for those targets: 1. x86_64-linux (both gtk2 and qt widget sets) 2. i386-linux (both gtk2 and qt widget sets) 3. x86_64-win64 (gtk2, qt and windows widget sets) 4. i386-win32 (gtk2, qt and windows widget sets) Let's start... Mandriva and ROSA are both dualarc (means that they can run 32 and 64bit apps in 64bit OS), but both of those distributions need a little push in order to became usable for 32bit Linux compiling. If you already did some of those things, you can simply skip them. 1. Log in as root and add yourself to the "wheel" group if you are not already part of that group. usermod -aG wheel your_user Log out and log in again to make this change active. This is clean and proper way to add yourself to sudo users. 2. If you do not want to enter password for sudo every time, open console, and type sudo visudo %wheel ALL=(ALL) ALL %wheel ALL=(ALL) NOPASSWD: ALL 3. Now it is time to add repositories in order to update your system. I also added 32bit repositories (since we want to compile for 32bit too). Only Main 32 release and update are active. MIB repositories are included too (not needed for CT, but very useful for yourself). FOR ROSA 2012 sudo urpmi.removemedia -a
sudo urpmi.addmedia Main_64_release http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/main/release/
sudo urpmi.addmedia --update Main_64_updates http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/main/updates/
sudo urpmi.addmedia Contrib_64_release http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/contrib/release/
sudo urpmi.addmedia --update Contrib_64_updates http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/contrib/updates/
sudo urpmi.addmedia NonFree_64_release http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/non-free/release/
sudo urpmi.addmedia --update NonFree_64_updates http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/non-free/updates/
sudo urpmi.addmedia Restricted_64_release http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/restricted/release/
sudo urpmi.addmedia --update Restricted_64_updates http://mirrors.coreix.net/rosa/rosa2012lts/x86_64/media/restricted/updates/
sudo urpmi.addmedia --update MIB-basic_64 http://mirrors.coreix.net/MIB/rosa2012lts/64/basic/
sudo urpmi.addmedia --raw --update MIB-experts_64 http://mirrors.coreix.net/MIB/rosa2012lts/64/experts/
#
sudo urpmi.addmedia Main_32_release http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/main/release/
sudo urpmi.addmedia --update Main_32_updates http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/main/updates/
sudo urpmi.addmedia --raw Contrib_32_release http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/contrib/release/
sudo urpmi.addmedia --raw --update Contrib_32_updates http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/contrib/updates/
sudo urpmi.addmedia --raw NonFree_32_release http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/non-free/release/
sudo urpmi.addmedia --raw --update NonFree_32_updates http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/non-free/updates/
sudo urpmi.addmedia --raw Restricted_32_release http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/restricted/release/
sudo urpmi.addmedia --raw --update Restricted_32_updates http://mirrors.coreix.net/rosa/rosa2012lts/i586/media/restricted/updates/
sudo urpmi.addmedia --raw --update MIB-basic_32 http://mirrors.coreix.net/MIB/rosa2012lts/32/basic/
# FOR MANDRIVA 2011 sudo urpmi.removemedia -a
sudo urpmi.addmedia Main_64_release ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/main/release
sudo urpmi.addmedia --update Main_64_updates ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/main/updates
sudo urpmi.addmedia --update Main_64_backports ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/main/backports
sudo urpmi.addmedia Contrib_64_release ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/contrib/release
sudo urpmi.addmedia --update Contrib_64_updates ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/contrib/updates
sudo urpmi.addmedia --update Contrib_64_backports ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/contrib/backports
sudo urpmi.addmedia NonFree_64_release ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/non-free/release
sudo urpmi.addmedia --update NonFree_64_updates ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/non-free/updates
sudo urpmi.addmedia --update NonFree_64_backports ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/x86_64/media/non-free/backports
sudo urpmi.addmedia --update MDV-restricted_64 http://mirror.yandex.ru/mandriva/official/restricted/2011.0/x86_64/
sudo urpmi.addmedia --update MIB-basic_64 http://mib.pianetalinux.org/MIB/2011.0/64/basic/
sudo urpmi.addmedia --update --raw MIB-experts_64 http://mib.pianetalinux.org/MIB/2011.0/64/experts/
#
sudo urpmi.addmedia Main_32_release ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/main/release
sudo urpmi.addmedia --update Main_32_updates ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/main/updates
sudo urpmi.addmedia --update Main_32_backports ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/main/backports
sudo urpmi.addmedia --raw Contrib_32_release ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/contrib/release
sudo urpmi.addmedia --update --raw Contrib_32_updates ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/contrib/updates
sudo urpmi.addmedia --update --raw Contrib_32_backports ftp://ftp.free.fr/mirrors/ftp.mandriva.com/MandrivaLinux/official/2011/i586/media/contrib/backports
sudo urpmi.addmedia --update --raw MDV-restricted_32 http://mirror.yandex.ru/mandriva/official/restricted/2011.0/i586/
sudo urpmi.addmedia --update --raw MIB-basic_32 http://mib.pianetalinux.org/MIB/2011.0/32/basic/
# 4. Now it is time to update all. sudo urpmi --auto-update That was standard and usual part. Real fun begins here! You can try something similar on other distributions too, but I can not guaranty that it will work. 5. Install 32bit OpenGL Extension to GTK+2 sudo urpmi libgtkglext1 6. Next step is to make 32bit apps looks same as 64bit apps. sudo urpmi libcanberra-gtk0
sudo urpmi libmurrine 7. I am sure that I had to add this library On Mandriva, but in ROSA it was installed in step 5, so use this only if needed. sudo urpmi libgtk-aurora-engine-1 8. If you interested in QT development, you need to add both 32bit and 64bit qt4pass. In order to make them both installed, you need to force installation of 32bit like this sudo urpmi libQt4Pas5 libQt4Pas5-5 --allow-nodeps --allow-force --force 9. This is the tricky part. You need to fix all missing 32bit symbolic links. You can lost days trying to do that checking file by file and making symbolic links one by one, or you can use a little magic for that. cd /lib
find *.so.? -exec sh -c '[ ! -f `echo {} | sed 's/\.so\.[0-9]/\.so/'` ] && [ ! -h `echo {} | sed 's/\.so\.[0-9]/\.so/'` ] && sudo ln -s {} `echo {} | sed 's/\.so\.[0-9]/\.so/'`' \;
cd /usr/lib
find *.so.? -exec sh -c '[ ! -f `echo {} | sed 's/\.so\.[0-9]/\.so/'` ] && [ ! -h `echo {} | sed 's/\.so\.[0-9]/\.so/'` ] && sudo ln -s {} `echo {} | sed 's/\.so\.[0-9]/\.so/'`' \; Those folders (/lib and /usr/lib) are used in Mandriva, Rosa and probably some other RH derivatives. 10. Start Lazarus. Go to Tools and click on Options. Find Environment and then Files. Change Compiler path line. Replace /usr/lib/codetyphon/fpc/bin/x86_64-linux/ppcx64 /usr/lib/codetyphon/fpc/bin/x86_64-linux/fpc 11. In CodeTyphon Center, go to Cross Build and add cross elements for i386-linux, x86_64-win64 and for i386-win32. And that's it!!! In Project options Build Modes add new Macro named LCLWidgetType1 and set it to widget type you want to use (gtk2, qt or win32). In Project options Code Generation you can set Target OS and Target CPU. Additional info about step 9 For Ubuntu folders with 32 libraries that need symlinks are /usr/lib/i386-linux-gnu and /lib/i386-linux-gnu Original "magic" command didn't work on Ubuntu, so I tried to change it a little. I hope it will work now. More Ubuntu info here .
The following user(s) said Thank You: Rain, FredyCC
|
Please Log in or Create an account to join the conversation. |
Lazarus 2.80 in Mandriva and ROSA x64 12 years 2 months ago #2465
|
Thanks Sir
more "magic" thinks will come... PilotLogic Architect and Core Programmer
|
Please Log in or Create an account to join the conversation. |