problem compiling toolchain under Mac Os X

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
paraita
Posts: 12
Joined: Tue Sep 25, 2007 8:51 am
Location: Nice, France
Contact:

problem compiling toolchain under Mac Os X

Post by paraita »

Hello, i svned toolchain yesterday and tried to run the toolchain.sh script, at first i had trouble when it came to 001-binutils-2.16.1.sh but i figured out how to continue (thx to Usefullidiot) but then, at 009-psplinkusb.sh it just fail with a:

Code: Select all

make[1]:*** [main.o] Error 1
make: *** [all] Error 2
../scripts/009-pspusblink.sh:Failed.

did any mac user had the same problem ?
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

I have only recently built psptoolchain on Mac. See: http://forums.ps2dev.org/viewtopic.php? ... highlight=

BTW, if you have searched the forum, you would've found that...
User avatar
paraita
Posts: 12
Joined: Tue Sep 25, 2007 8:51 am
Location: Nice, France
Contact:

Post by paraita »

i've already tried that too, i'll try to remove and download psptoolchain again tomorrow, but thx for the link, i'll search more.

edit: i got this, following what you said in your post:

Code: Select all

make -C pspsh clean
rm -f pspsh *.o
make -C usbhostfs_pc clean
rm -f usbhostfs_pc *.o
make -C tools/remotejoy/pcsdl clean
rm -f remotejoy *.o
make -C pspsh all
make[1]: *** No rule to make target `pspsh.o', needed by `pspsh'.  Stop.
make: *** [all] Error 2
../scripts/009-psplinkusb.sh: Failed.
did you had the same error ?
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

I don't remember having to deal with such weird error messages.

Go to psptoolchain/build/psplinkusb/pspsh/ directory. Type:

make clean

Next, type:

make

See if it compiles, if not, send me the output of that 2nd make command. Also, type:

g++ --version

This is the output of my C++ compiler version:

i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Check StrmnNrmns blog for install tips for OSX :)
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

StrmnNrmn didn't have an issue with the 9th step of psptoolchain script, at least he didn't make a comment about it. :)
User avatar
paraita
Posts: 12
Joined: Tue Sep 25, 2007 8:51 am
Location: Nice, France
Contact:

Post by paraita »

ok, i did a

Code: Select all

make clean
in the /usr/local/pspdev/psptoolchain/build/psplinkusb/pspsh directory, then did a

Code: Select all

make
in that same directory, here's the output:

Code: Select all

g++ -Wall -g -D_PCTERM -I../psplink   -c -o pspsh.o pspsh.C
pspsh.C: In function 'int execute_line(const char*)':
pspsh.C:232: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:232: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C: In function 'int close_cmd(int, char**)':
pspsh.C:429: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:429: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C: In function 'int strlen_cmd(int, char**)':
pspsh.C:439: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
pspsh.C: In function 'int tty_cmd(int, char**)':
pspsh.C:463: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:463: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C: In function 'void cli_handler(char*)':
pspsh.C:574: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:574: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C:601: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:601: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C: In function 'void completion_display(char**, int, int)':
pspsh.C:913: error: 'rl_forced_update_display' was not declared in this scope
pspsh.C: In function 'char** shell_completion(const char*, int, int)':
pspsh.C:934: error: 'rl_filename_completion_function' was not declared in this scope
pspsh.C:934: error: 'rl_completion_matches' was not declared in this scope
pspsh.C:940: error: invalid conversion from 'void (*)(char**, int, int)' to 'void (*)()'
pspsh.C:941: error: 'rl_completion_matches' was not declared in this scope
pspsh.C:945: error: 'rl_completion_matches' was not declared in this scope
pspsh.C:950: error: invalid conversion from 'void (*)(char**, int, int)' to 'void (*)()'
pspsh.C:953: error: 'rl_completion_matches' was not declared in this scope
pspsh.C:957: error: 'rl_completion_matches' was not declared in this scope
pspsh.C: In function 'int init_readline()':
pspsh.C:972: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:972: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
pspsh.C: In function 'int process_cmd(const unsigned char*)':
pspsh.C:1450: error: invalid conversion from 'void (*)(char*)' to 'void (*)()'
pspsh.C:1450: error:   initializing argument 2 of 'void rl_callback_handler_install(const char*, void (*)())'
make: *** [pspsh.o] Error 1
here's my g++ version:

Code: Select all

i686-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
i used Darwinports instead of Fink, but i don't really think the problem is from DP, do you have any idea ?
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

paraita,

Ok, I had exactly the same problem - compiler is using BSD readline headers instead of the GNU ones.

I have used MacPorts to download/install required packages. It is essentially the same as DarwinPorts.

Here's the solution to your problem:

1. Check if you have GNU readline package installed. Type:
port installed | grep readline

2. If you don't have readline installed, type:
sudo port install readline

3. Check if you have readline installed in /opt/local (this is default directory for MacPorts and I am not 100% about DarwinPorts). Type:
ls -la /opt/local/include | grep readline

4. I will assume you have it installed in /opt/local directory. Type these lines:
export C_INCLUDE_PATH="/opt/local/include"
export CPLUS_INCLUDE_PATH="/opt/local/include"
export LIBRARY_PATH="/opt/local/lib"

5. Now make the psplinkusb.
User avatar
paraita
Posts: 12
Joined: Tue Sep 25, 2007 8:51 am
Location: Nice, France
Contact:

Post by paraita »

i uninstalled darwinport and put macport instead (wishing it would work lol), i followed ragnaru's help but at the end i had the same problem, anyway, i tried what you told me and i got this after the make command in build/psplinkusb/pspsh/ :

Code: Select all

g++ -Wall -g -D_PCTERM -I../psplink   -c -o pspsh.o pspsh.C
pspsh.C: In function 'int strlen_cmd(int, char**)':
pspsh.C:439: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
g++ -Wall -g -D_PCTERM -I../psplink   -c -o parse_args.o parse_args.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o pspkerror.o pspkerror.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o asm.o asm.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o disasm.o disasm.C
g++ -o pspsh pspsh.o parse_args.o pspkerror.o asm.o disasm.o -lreadline -lcurses
i don't have any error output, do you think it's ok like that ? do i have to run the toolchain script again ?
bulb
Posts: 50
Joined: Thu Jan 19, 2006 10:59 pm

Post by bulb »

You needn't install MacPorts. They are basically the same, I was just not sure which directory DP uses for installation packages.

Anyway, build of pspsh works 100% now, you'll just have to apply the changes for the remotejoy (by following instructions on http://forums.ps2dev.org/viewtopic.php? ... highlight=) and the toolchain will work.

Note, if you are going to use remotejoy, you'll have to do some changes as well, otherwise you will have to kill the process after every use. Minimal change is to comment out SDL_KillThread in remotejoy.c.
User avatar
paraita
Posts: 12
Joined: Tue Sep 25, 2007 8:51 am
Location: Nice, France
Contact:

Post by paraita »

hi, i tried to run toolchain.sh again, after i typed a successful make in build/psplinkusb/pspsh/ , but toolchain just fails with the same error, i'll wait for a newer revision, if i find a way to run toolchain without errors, i'll post here ^^. thx anyway for your help bulb !
Post Reply