• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

Installing tools to do DS development on OSX

Started by bagster, July 26, 2006, 08:57:05 AM

Previous topic - Next topic

bagster

##Installing tools to do DS development on OSX##


1- Getting and installing Xcode

   First, you will need to install Xcode on your mac to use the nds dev. tools.  
   You can install Xcode from the CDs you got when you purchased your mac, or from this url:  

   http://developer.apple.com/tools/download/

   This tutorial use the version 2.3 obtained from apple' site (require Tiger (10.4.x).
   You must be an Apple Developer Connection member to download this item, but membership is free.
 
 
2- Getting and installing devkitpro

   A nice setup explanation can be found at http://devkitpro.org/setup.shtml
   As this setup is mainly windows oriented, i'll resume the installation process for OSX

   First, go there:

   http://sourceforge.net/project/showfiles.php?group_id=114505&package_id=124207

   Get the file devkitARM_r18-osx.zip (it's for PPC, but run well in rosetta on new macs)
   Don't get the most recent release, or you'll have problems with palib.
   You can install r19a later, after palib installation.

   As stated in the first installation' screen:
   "Everything will be installed into /opt/local/devkitpro."    
   "After installation you will need to set the environment variables DEVKITPRO and DEVKITARM to /opt/local/devkitpro and /opt/local/devkitpro/devkitARM respectively."

   Follow the installation process to install the package.

3- Testing compiler

   Go there and get the examples package (nds-examples-20060621.tar.bz2)

   http://sourceforge.net/project/showfiles.php?group_id=114505&package_id=159894&release_id=426650

   Extract it somewhere, and get ready to compile your first DS application!

   Open a terminal (I hope you know how...if not, it's in applications/utilities/Terminal, but maybe the next steps will be a little bit complicated if

you don't know how to open the terminal...).

   Set the 2 variables stated earlier, this way (type this at the prompt)
   export DEVKITPRO=/opt/local/devkitpro
   export DEVKITARM=/opt/local/devkitpro/devkitARM

   You can set these variables in your .profile in your home folder, so they will get set when you launch Terminal.  
   I prefer to set them in a file called devkitpro.env, and put this file in my home folder.  
   When I want to use devkitpro, I simply type:
   
   source ~/devkitpro.env

   Next, change directory (cd) to the folder of the example you want to try (start with the one in Graphics/2D/hello_world).

   Type "make", cross your fingers and check your screen.  
   If you see something like "built ... hello_world.nds", congrats!  
   Your setup is correct, and this file is your binary.  Simply copy it to your card (I use a supercard CF) and run it!

4- Getting and installing paLib

   Go there and download the file PAlib040306.zip

   http://sourceforge.net/project/showfiles.php?group_id=142901&package_id=157025

   Extract the content.
   Put the PAlib folder somewhere in your devkitpro folder (I put it directly in /opt/local/devkitpro/PAlib)

   Next, set these 2 variables:
   export PATH=/opt/local/devkitpro/devkitARM/bin:$PATH
   export PAPATH=/opt/local/devkitpro/PAlib

   You can, like earlier, put them in your .profile ou in a file that you will source.

   Now, go in the PAlib folder and type:
   make clean ; make ; make archive

   If everything went well, you can now compile stuff using PAlib.  You can try one in the PAlibExemples folder.

5- Getting and installing wifiLibs

   Go to http://www.akkit.org/dswifi/index.html, and get these 2 files:
   dswifi_lib_v0.3_lib.zip
   dswifi_lib_v0.3_examples.zip

   Like stated in the zip file, installation of the librarys are very easy.  
   The interesting part in the readme.txt is:
   "To install the library, I would suggest you copy the libdswifi*.a files into your
   libnds/lib directory, and copy the include files (dswifi*.h, and the berkley
   emulation files) into your libnds/include directory.
   Then, to include the proper libraries in a project, you can add the -ldswifi* to
   your LIBS define in the makefile for the project you're building."

   So just copy files in these 2 folders, located in /opt/local/devkitpro/libnds

   Next, extract the files from dswifi_lib_v0.3_examples.zip, set up your environment variables (or source the file containing all of them) and try to

compile wifi_example.  

   Everything should work fine!  That's it for today!

6- TODOs, notes and others

   TODO:    Make and maintain a OSX package updated frequently, containing devkitpro, palib and wifilibs

   Note:     Recent devkitpro builds use arm-eabi rather than arm-elf.  
      Palib use arm-elf to compile, so just edit the makefile and change the elf for eabi.

   Come back often on scdev.org, my next paper will be a tutorial on making an application to use the DS to control OSX applications.

   You can contact me at: p e l l e t i y [ at ] g m a i l . c o m  (bagster)
Onyx DS with R4 and SC lite, 2x1g kingston
Ice blue DS with R4
Gray phat DS with SCSD and 512M

bagster

On july 31st, devkitpro have been updated.  We now have a intel release of devkitpro!  I'll install it and I'll let you know how it is.
Onyx DS with R4 and SC lite, 2x1g kingston
Ice blue DS with R4
Gray phat DS with SCSD and 512M

Patater


bagster

Yes, works nicely.  As stated in my tuto., arm-eabi are used, so to use palib, you must change few things in palib makefiles, but everything work well.  btw, congrats for your 1st place, i'm happy that a developper win the contest :)
Onyx DS with R4 and SC lite, 2x1g kingston
Ice blue DS with R4
Gray phat DS with SCSD and 512M

Patater

I'm glad that the intel package works well, since I was the guy who will be making those intel packages (and perhaps the PPC ones as well) from now on. The installer should have taken care of your environment variables as well, so you won't have to source devkitpro.env each time you open a terminal (just a little fyi).

bagster

oh, great! :)
very good news to count you as a member of this forum :)
Onyx DS with R4 and SC lite, 2x1g kingston
Ice blue DS with R4
Gray phat DS with SCSD and 512M