EnvironmentSetup/AmigaOS

'''Back to EnvironmentSetup

Work in progress. Please DO NOT translate this page

November 2010
15 November 


 * Removed duplicated entry in set_soenv.in r978
 * Added Mathias Parnaudeau in the list of contributors (AmigaOS port). r977
 * More fixes on the road of the solver creation :
 * Commited some missing information in solenv : Amiga case was missing in osarch.pm r975
 * Added unxamigap case in ssolar.cmn. r976

10 November


 * Using KinCON. Thanks to Mathias.
 * Mathias provided me a testing version of dmake + an Amiga dedicated patch. FIXME : commit it ?

October 2010
16th October


 * At the JDLL event, went more far into the configure process, thanks to Corto, Salass00.
 * Next big step is Dmake which is strongly needed to keep going in the configure.

July 2010
 26th July


 * Added abc-shell in the list of usable shell on AmigaOS
 * FIXME : configure broken, due to missing perl bazaar . Investigating.

25th July


 * Fixed the file system issue, causing the subversion freeze. Thanks to Philippe Ferrucci.
 * Compiled my first C file on Amiga OS (using -mcrt=clib2 flag)
 * Completed the first svn co with OOo4Kids / OOoLight source code
 * Started to fix configure issues
 * Commited the first fixes. To be improved

24th July

Subversion triggers a bug in JXFS, the filesystem used on the machine I received, this FS is not usable for development. I then installed my work partition with the standard Amiga filesystem called FFS2. In order to make it faster, it is necessary to add the following line to the user-startup script (user configuration should be made there): run >NIL: fs_plugin_cache DH1:

May 2010
1st May

I finally was able to copy the OOo4Kids source on the disk. Was a nightmare :
 * subversion is not able to checkout the sources without fail.
 * no way to uncompress a 550 MB .tar.gz, containing the 2.2 GB of source OOo4Kids does  : failed several times, due to file containing wrong information ???
 * only two USB ports : I had to re-use the hack with the Apple keyboard, and copy-paste every subdir manually, until the sources are complete.
 * found no vi nor emacs nor whatever else correct editor on the machine

Current status : improve configure (the notepad seems to be helpful, and at least allows to modify the scripts.

Done :


 * installed the SDK, and the web browser OWB
 * configured the ethernet interface FIXME : doesn't work in fact, even using DHCP .. why btw ?
 * tested OWB
 * I finally found the processor type I got in the machine, and what hardware I received exactly (see http://en.wikipedia.org/wiki/Sam440#Sam440ep-flex), revision 2. this means we'll probably study / reuse the PowerPC bridge + some little changes adapted to Amiga OS
 * Continued to work on the Porting Documentation (see Port sur nouvelle architecture type Linux)
 * Copied the sources on the disk

Issues :


 * where (which location) install the SDK ? In the system ?  Or outside ? The documentation is unclear, so I used the second partition ( named  Work ), and I tested a bit.


 * the FAQ seems to be poor, and is not fully "open spirit".
 * some vocabulary is still missing me, and I have to understand better how everything is organised on Amiga OS
 * testing the Workbench and other things, it appears that some similar features are available on Mac OS X. Is it Apple who copied, or the opposite ? ;-)
 * the shell is uggly : strange completion, environnement tcsh like ( eeek ...) and lot of missing things.
 * uname -a returns the version 3.5 ... should be 4.1. This was reported on the adtools (Amiga Development Tools) sourceforge project.

Facts:


 * For an editor with text highlighting, CodeBench can be used. Other editors are available like Memacs in the OS (Utilities drawer) or vim.
 * There's no "install here place" on AmigaOS. Just decide where you think is the best place and install there. The SDK can then be installed in a "put my work there" partition.
 * The shell of the current AmigaOS version (OS 4.1 Update 2) I have is not the final one. I'll see what the new one offers when it is ready.

April 2010
27th April


 * Got the network working .. woo-hoo :)
 * Starting installing Super Mario and all :)
 * Installed subversion, checking out OOo4Kids sources : rev. 581

Facts:

All settings of the OS can be changed through the appropriate "preferences" program. They can be found in the "Prefs" drawer. As an example, to set the network settings, one need to run Prefs/Internet

5th April

Back at home (uff). I tested more intensively the Amiga OS 4.1 :-)

Thoughts:

Hardware side : there are only two USB ports available. One for the keyboard, and one for the mouse. So how to add my USB key containing the softwares I downloaded? (please think 3 or 4 USB ports, 2 is not enough).

hack : use an Apple keyboard, so, since this is an USB hub, other USB ports are available.

Facts:

The Sam440ep Flex motherboard has 5 USB ports. The only thing to know is that because of Uboot (Sam BIOS), the keyboard must be connected on the rear upper USB port to work in Uboot. After that, when the OS is loaded, the keyboard will work in any USB port.

March 2010
29th March

Received my machine today !! Unfortunaly, will ony be able to test it wednesday afternoon, or even saturday.

Links for the beginning :


 * Download the SDK : http://www.hyperion-entertainment.biz/index.php?option=com_registration&view=files&parent=30&Itemid=63
 * The depot (for all sorts of applications) : http://www.os4depot.net/
 * Subversion (for downloading OOo4Kids sources): http://os4depot.net/index.php?function=showfile&file=development/utility/subversion.lha

Thoughts:

Native extension archives on Amiga OS 4.1 is .lha Fortunately, I was able to unarchive the SDK archive, and start reading the documentation.

Strange .info files included (sort of blobs).

Facts:


 * The lha archive format is the most popular but all other standard ones can be used (zip, tar, gzip...). Archives can be extracted by the UnArc utility which is present in the operating system.
 * These .info files are file/drawer icons. They contain the imagery (both unselected and selected images) as well as optional one time configuration (so-called tooltypes).

Porting OOo4Kids on Amiga OS
=> Tips and tools

Milestone in progress is : 0.1

Todo (basics/first step):


 * [done] reinstall the SDK at the right location (how to uninstall the previous one btw ?), and
 * install other missing pieces, like AmiCygnix and tools e.g.
 * understand how AmiCygnix is used.

'''Important: we really thought to a native port, and install AmiCygnix does not mean we'll use it for the port. At milestone 0.6, it is scheduled to use the native API for the controls, and the frames. Means a lot of work, something similar to the native Mac OS X port of OpenOffice.org'''


 * find the Amiga OS 4.1 ABI
 * Update: As good starting point, found that : (french, sorry) : http://amigadev.free.fr/files/ProgrammationAmigaOS.pdf
 * [done] Install subversion and test the sources download
 * [done] Can update the sources, using "Code:SVN/subversion-1.1.4/bin-os4/svn up configure configure.in (e.g.)"
 * [issue] Why oh why do I need 10 minutes to run "svn up configure configure.in" successfully ?
 * [done] Added abc-shell possibility on AmigaOS at configure time"


 * discover the SDK, e.g. create simple windowed application, and analyze how
 * frames
 * events
 * controls
 * fonts
 * files
 * (other parts, to be completed) ... are managed

Cross Compilation
Everything is explained there : http://www.zerohero.se/cross/os4.html

'''Will give it a try though ... :-)'''

Result of "gcc -dumpspecs" : specs dumped by gcc

My first compilation on Amiga
simple hello

Results from config.guess
config.guess takes over the machine detection, and put the results in environment variables :

UNAME_MACHINE contains the result of `uname -m`

9.Code:test> uname -m

ppc

UNAME_RELEASE contains the result of`uname -r`

9.Code:test> uname -r

53.3

UNAME_SYSTEM contains the result of `uname -s`

9.Code:test> uname -s

AmigaOS

UNAME_VERSION contains the result of `uname -v`

9.Code:test> uname -v

3.5

(plain wrong, because should be 4.x )

Current choice
So, on the Sam440, we obtain : "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}"=ppc:AmigaOS:53.3:3.5

A previous detection of AmigaOS is included in config.guess, so we have to add a new case. So until the 3.5 version will be fixed (for a 4.x value), we'll consider we're running Amiga OS 4.x when ppc and AmigaOS  are detected (no other case does match with this result.

Conclusion => In our case, we'll display : powerpc-unknown-amigaos

Draft uname -a returns :

OS=AMIGAOS // 4.x

CPU=P // PowerPC

amigagppc.mk // use unxlngppc4.mk  as default values ?

Contains : PICSWITCH:=-fPIC .INCLUDE : unxlng.mk CDEFS+=-DAMIGA CFLAGS+= CFLAGSCC+= CFLAGSCXX+= DLLPOSTFIX=lh  // ??? static or dynamic libs ?? /Draft
 * 1) fichier mk Unix Linux HPPA utilisant GCC, merci de faire les modifications génériques pour Linux dans unxlng.mk

Perl stuff
Currently stalled at Perl installation step: checking for perl... /SDK/Local/C/perl checking the Perl version... Can't open threads.library checked (perl 20) checking for required Perl modules... ./configure[6746]: Can't: not found configure: error: Failed to find some modules

=> Perl can't run correctly (probably a configuration issue):

/AmigaOS4.1> Code:SDK/local/C/perl -v

Can't open threads.library

Update : this url might help (thanks to Chris Young for the info) : Perl pthreads.lha


 * Solution part1 : add perl threads.library 

I copied the one sent by Elwood, in Sys/Libs, and this solved the issue

Note: this is a hack, and should not happen in a normal installation ...


 * Solution part2 : install Archive:Zip (missing)

This can be achieved installing the missing modules via CPAN =>  Install Perl modules using CPAN

The log: checking the Perl version... checked (perl 5) checking for required Perl modules... Can't locate Archive/Zip.pm in @INC (@INC contains: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos                                   /SDK/Local/clib2/lib/perl5/5.8.5 /SDK/Local/clib2/lib/perl5/site_perl/5.8.5/ppc-amigaos                                    /SDK/Local/clib2/lib/perl5/site_perl/5.8.5 /SDK/Local/clib2/lib/perl5/site_perl .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. configure: error: Failed to find some modules

Origin of the breakage (configure, line around 6746) :

{ $as_echo "$as_me:$LINENO: checking for required Perl modules" >&5 $as_echo_n "checking for required Perl modules... " >&6; } if `$PERL -e 'use Archive::Zip;'`; then { $as_echo "$as_me:$LINENO: result: all modules found" >&5 $as_echo "all modules found" >&6; } else

After some tries, and lot of warnings, Archive::Zip is installed using CPAN.


 * Solution part3 : install unzip (requested by CPAN
 * Download gunzip from the Depot
 * Copy gunzip in the PATH ( Code:/SDK/C on my machine )


 * Solution part4 : install Compress::Raw::Zlib (missing)

Currently broken ... :/

Perl installation seems not reliable ... :

/SDK/newlib/include/netinet/in.h:148:1: warning: this is the location of the previous definition In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/perl.h:1985, from Zlib.xs:31: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/amigaos.h:22:1: warning: "SIGQUIT" redefined In file included from /SDK/newlib/include/signal.h:5, from /SDK/newlib/include/sys/select.h:7, from /SDK/newlib/include/sys/time.h:16, from /SDK/newlib/include/sys/resource.h:4, from /SDK/newlib/include/sys/reent.h:19, from /SDK/newlib/include/stdlib.h:16, from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/perl.h:451, from Zlib.xs:31: /SDK/newlib/include/sys/signal.h:34:1: warning: this is the location of the previous definition In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/perl.h:1985, from Zlib.xs:31: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/amigaos.h:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'constructed' In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/perl.h:2082, from Zlib.xs:31: /SDK/local/newlib/include/pthread.h:46:23: error: sys/sched.h: No such file or directory In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/perl.h:2082, from Zlib.xs:31: /SDK/local/newlib/include/pthread.h:61: error: field 'SchedParam' has incomplete type In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/XSUB.h:322, from Zlib.xs:32: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/amigaosexport.h:1098: warning: 'struct timespec' declared inside parameter list In file included from Zlib.xs:68: ppport.h:4337:1: warning: "Perl_sv_catpvf_mg_nocontext" redefined In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/XSUB.h:323, from Zlib.xs:32: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/amigaosexportinlines.h:906:1: warning: this is the location of the previous definition In file included from Zlib.xs:68: ppport.h:4410:1: warning: "Perl_sv_setpvf_mg_nocontext" redefined In file included from /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/XSUB.h:323, from Zlib.xs:32: /SDK/Local/clib2/lib/perl5/5.8.5/ppc-amigaos/CORE/amigaosexportinlines.h:907:1: warning: this is the location of the previous definition gmake: *** [Zlib.o] Error 1 Can't exec "/SDK/C/gmake": Unknown error 0 at /SDK/Local/clib2/lib/perl5/5.8.5/CPAN.pm line 4566. /SDK/C/gmake -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible

Milestones for the port (rough estimation)
-> This port will NOT use Java

Milestone 0.1

 * [done] complete and document the Amiga OS 4.1 post installation
 * [done] *** download the sources, after installing subversion. Subversion hangs without reason. Sources have been copied from an USB key (ssh does not work either, and the file system sucks a bit ...)
 * [done] install the missing parts (means: what configure will need) :


 * install gperf
 * install freetype2
 * install bison (Thanks to Fredrik "Salass00" Wikstrom for his help providing a new port of Bison. You were fast Fredrik! ;-) )
 * install zip
 * install patch

-> the version is plain wrong. must be 4.1, and 3.5 is returned
 * uname -a returns : AmigaOS localhost 53.2 3.5 ppc AMCC PPC440EP Sam440EP AmigaOS

config.guess return the wrong OS.

The current new file system seems to be able to support the svn co without freeze. Crossing the fingers ...
 * Thanks to Elwood for his time, helping me to reformat the partition.

Result of ./configure :

,,*)  CC_FOR_BUILD=$CC ;; ,*,*)  CC_FOR_BUILD=$HOST_CC ;; esac ; + > /dev/null + 2>&1 + 2> /dev/null + UNAME_MACHINE=ppc + 2> /dev/null + UNAME_RELEASE=53.2 + 2> /dev/null + UNAME_SYSTEM=AmigaOS + 2> /dev/null + UNAME_VERSION=3.5 + echo ppc-unknown-amigaos + exit 0 configure: error: operating system is not suitable to build OpenOffice.org!

gcc -v returns :

Target ppc-amigaos Configured with :

../gcc/configure --prefix=gcc \ --host=ppc-amigaos \ --target=ppc-amigaos \ --build=i686-cygwin \ --enable-haifa \ --enable-sjlj-exceptions \ --enable-languages=c,c++

Thread model=single gcc-version 4.2.4 (adtools build 20090118)

Timeline : early May 2010

configure
configure successfull

fix set_soenv.in

Needed fix (svn server down, will be commited asap):

=> Current patch : First fixes for Amiga

IMPORTANT: don't forget to run autoconf (if working)

Current configure command line :

8.Code:r765>sh # to enter in the abc-shell /Amiga cd Code:r765 /Code/r765>

./configure \ --with-lang="fr" \ --with-OOoLight \ --with-use-shell=abc-shell \ --disable-cups \ --with-java=no \ --disable-binfilter \ --disable-vba \ --disable-odk \ --disable-mozilla \ --disable-gtk \ --disable-Xaw \ --with-package-format=installed \ --disable-gconf \ --disable-gnome-vfs \ --enable-opengl

In one line : ./configure --with-lang="fr" --with-OOoLight --with-use-shell=abc-shell --disable-cups --with-java=no --disable-binfilter --disable-vba --disable-odk --disable-mozilla --disable-gtk --disable-Xaw --with-package-format=installed --disable-gconf --disable-gnome-vfs --enable-opengl
 * Environment settings
 * FULL LOG (current state)

Add new constants

 * [ in_progress] following Caolan recommandations, add the new OS


 * [ in_progress ] complete a correct configure: deadlock at the end, needs investigation

What the final screen looks like:
 * OOo4Kids or OOoLight 1.00 configuration.
 * Configuration part of OOo4Kids or OOoLight 1.00 build is finished.
 * NB! Be aware that you might not be able to build OOo4Kids or OOoLight if you
 * ignore any warning message that were generated during this configuration
 * process.
 * - Your gcc is not -fvisibility=hidden safe. Disabling visibility
 * - building without java will mean some features will not be available
 * USAGE:
 * Source AmigaOSPPCEnv.Set.sh (in sh)
 * in order to set up the build-environment variables.
 * - Your gcc is not -fvisibility=hidden safe. Disabling visibility
 * - building without java will mean some features will not be available
 * USAGE:
 * Source AmigaOSPPCEnv.Set.sh (in sh)
 * in order to set up the build-environment variables.
 * USAGE:
 * Source AmigaOSPPCEnv.Set.sh (in sh)
 * in order to set up the build-environment variables.

Complete set_soenv

 * [done] provide a correct set_soenv FIXME : set_soenv completed, and configure completed, but improvments are needed, and some adjustments too.

Build dmake

 * [ in_progress ] complete the bootstrap (dmake builds as expected, in single mode)
 * compile dmake (nothing about Amiga OS yet. Needs more love ...)

Building dmake (as a Linux) gives some expected breakers :

unix/runargv.o: In function `runargv': /Code/r765/dmake/unix/runargv.c:632: undefined reference to `fork' /Code/r765/dmake/unix/runargv.c:653: undefined reference to `execvp' unix/runargv.o: In function `dmwaitnext': /Code/r765/dmake/unix/runargv.c:268: undefined reference to `wait' unix/runargv.o: In function `dmwaitpid': /Code/r765/dmake/unix/runargv.c:363: undefined reference to `waitpid' gmake[2]: *** [dmake] Error 1 gmake[2]: Leaving directory `/Code/r765/dmake' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/Code/r765/dmake' gmake: *** [all] Error 2

Note : runargv [unix/runargv] The runargv function manages up to MAXPROCESS process queues (_procs[i]) for parallel process execution and hands the actual commands down to the operating system. Each of the process queues handles the sequential execution of commands that belong to that process queue. Usually this means the sequential execution of the recipe lines that belong to one target. Even in non parallel builds (MAXPROCESS==1) child processes are created and handled.

Timeline : early June 2010

Milestone 0.3

 * start a build
 * continue the compilation until the bridges (not included ), means cppu, cppuhelper, soltools and so on are ok

Timeline : early August 2010

Milestone 0.4

 * complete the bridge (using the Linux PowerPC one)

Timeline : early October 2010

Milestone 0.5

 * compile other modules, until vcl (not included)

Timeline : early November 2010

Milestone 0.6
Note : this part can need a lot of time (probably several month, or even a year for a basical native port).

vcl is a critical part, where :
 * system events,
 * fonts,
 * keyboard,
 * graphical (low level) layout like
 * instances,
 * frames,
 * windows,
 * controls and basically all graphical objects will be implemented

Objective : complete vcl build

find some documentation, about event, frames, windows, mouse position, and so on, on the Amiga OS.

Timeline : early April 2011

Milestone 0.7

 * compile sfx2, svx, framework
 * compile sd, sw, sc

Timeline : early May 2011

Milestone 0.8

 * complete the full build (fully repeatable)
 * be able to launch OOo4Kids on Amiga OS 4.1

Timeline : early June 2011

Milestone 0.9

 * Add a script for the Packaging
 * Package, install and uninstall OOo4Kids on Amiga OS 4.1
 * Provide a testable version

Timeline : early July 2011

Eric Bachard 08:26, 5 April 2010 (UTC)