gcc and xlc
hi everyone!!i'm very happy to be one of the most great linux forums in the world and thanks for all great work that u do here!!
i'm new to linux i have some basic but still newer!!i have a project that i work on!!it's a product that has been installed and compiled in AIX system with xlc compiler!!my job here is to migrate this one to red hat linux entreprise 5 and compile all the makefile with GCC i'l traying to do the max to find a similarity between xlc and gcc but i'm stuck in one or two option that i can't figure out the solution specially -D option there is one example of makefile that i do compile but with using the line that contains -D option: gcc -c -DAIX41_OPSYS -I/home/oracle/Open2/COMMON/inc -I/home/oracle/Open2/dbg -DSYSV -D_NO_LONGLONG -I../inc -g -g -c afp_dump.c i’m gratful if someone help me resolve this !! |
Hello,
the -D option tells to GCC preprocessor to define the symbol next to it, so in the given line afp_dump.c is compiled with the AIX41_OPSYS symbol defined, as if you've add "define AIX41_OPSYS" in the file. There is strange things in the line I can see: -g and -c options appear twice, that certainly means that the Makefile isn't well wrotten. If you need more info "man gcc" is the way to go. |
thanks man for your answer !!as i understand i have to define AIX41_OPSYS in the file afp_dump.c and the compilation will go correctly if u can give me an exeample that explain how this -D option works!!anyway thanks man for your replies again!!!
|
Nooo!
-DAIX41_OPSYS define the AIX41_OPSYS symbol _AS_IF_ you add "#define AIX41_OPSYS" in every src files you're compiling. Try this: Code:
#include <stdio.h> As you want to port from AIX to LINUX I guess that you have to port every pieces of code surrounded by "#ifdef AIX41_OPSYS" |
waaaaaaaw!!thanks man ,u are the best!!! now i see what -D option means !!!just one question what do u mean that i have to port every pieces of code surrounded by "#ifdef AIX41_OPSYS"!!belive me your answer was great and after 2 weeks in saerching in the net and no result, u come with a simple and good explaination !!!thanks again !!!
|
i see what do u mean know!!thanks a lot for the help it was very helpful thanks again!!
|
thanks man i foud AIX41_OPSYS in one of my .c files and i found this code!!u think that i can to port to linux:
#if (defined(UNIX_OPSYS) && !defined(sun)) || defined(IRIX53_OPSYS) || defined(AIX41_OPSYS) || defined(AIX) /****************************************************************************/ /* Function: set_signal() - VERSIONE UNIX */ /* Date L.M.: 26-May-1998 */ /* Description: Assign sig_handler() for all signals */ /****************************************************************************/ void set_signal() { struct sigaction act = { 0, 0, 0 }; int sig; act.sa_handler = sig_handler; for (sig = 1; sig < SIGMAX; sig++) if (sig != SIGKILL && sig != 21 && sig != SIGCHLD) sigaction(sig, &act, 0); } #endif #ifdef sun /****************************************************************************/ /* Function: set_signal() */ /* Date L.M.: 23-Nov-1998 */ /* Description: Assign sig_handler() for all signals */ /****************************************************************************/ void set_signal() { struct sigaction act = { 0, 0, 0 }; int sig; act.sa_handler = sig_handler; for (sig = 1; sig < SIGRTMAX; sig++) if (sig != SIGKILL && sig != SIGTTIN && sig != SIGCHLD) sigaction(sig, &act, 0); } #endif /* ifdef sun */ |
there are some differences with signals between unix versions.
you must read the man signal pages for AIX and compare with linux to see if you can work out how to rewrite the signal functions. It looks at a cursory glance if it's simply disabling the signals. I think in older unix versions the sigaction needs to be reset after a catch. though, of course, i could be wrong. you could always try it! |
All times are GMT -5. The time now is 02:40 PM. |