Hi Gerald and everybody, As you know I had a lot of problems building Embperl on Aix. I've managed to build everything correctly but DIDN'T TEST IT YET with Apache2/mod_perl2.
I have a LOT OF QUESTIONS and hope to get some answers. :-) I first tried to build Embperl from CPAN: 'install HTML::Embperl' It fetches the files and extracts them in cpan builds directory. Fine. Then I assume it runs 'perl Makefile.PL' and execute it soon after (AM I RIGHT ABOUT THIS?) When compiling from CPAN, i get to many typemap errors : /usr/local/bin/perl /usr/local/lib/perl5/5.8.2/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.2/ExtUtils/typemap -typemap typemap xs/Embperl/App/App.xs > xs/Embperl/App/App.xsc && mv xs/Embperl/App/App.xsc xs/Embperl/App/App.c Can't find typemap in /root/.cpan/build/Embperl-2.0b10/xs/Embperl/App *** Error code 2 Every subdirectory under /xs/ has the same problem, so I had to go under : /App /Component /Req /Syntax /Thread And do 'perl Makefile.PL && make' (NOTE that I ran 'clean HTML::Embperl' in CPAN shell to be able to 'make HTML::Embperl' again, and I ran these makes AFTER the clean) First, why I have to manually compile everything under the xs directories by hand? I noticed that running the Makefile only creates a .c file? Could anyone explain me what is the use of directories under /xs? Ok. After compiling in these subdirectories by hand, I ran 'make HTML::Embperl' again. Now I have another problem. All the .c files under /xs subdirectories reference to some header files in the top-level source directory: snippet from a .c file under /xs/App/ directory : #include "ep.h" #include "epmacro.h" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "eptypes.h" #include "eppublic.h" #include "epdat2.h" #include "ep_xs_sv_convert.h" #include "ep_xs_typedefs.h" When running 'make HTML::Embperl' in CPAN shell, these .h files aren't found and it returns errors. However, when running make on the top-level Makefile to install Embperl by hand, I have NO SUCH ERRORS. Could anyone tell me what makes the difference here? To solve my problem (I wanted to build Embperl with CPAN at all cost) : I copied the top-level header files (ep.h, epmacro.h, etc.) to EACH /xs subdirectory and their respective /Config subdirectory. Could I have done that more intelligently? (ex. make it look in the top-level directory to find the header files?) Running 'make HTML::Embperl' was then compiling these .c correctly. GOOD! The last error I got was missing symbols : Writing Embperl.bs chmod 644 Embperl.bs rm -f blib/arch/auto/Embperl/Embperl.so LD_RUN_PATH="" ld -bhalt:4 -bM:SRE -bI:/usr/local/lib/perl5/5.8.3/aix/CORE/perl.exp -bE:Embperl.exp -bnoentry -lc -L/usr/local/lib Embperl.o epmain.o epio.o epchar.o eputil.o epeval.o epmem.o epinit.o epcgiinit.o epcmd2.o epparse.o epdom.o epcomp.o epcache.o epprovider.o mod_embperl.o epapfilter.o xs/Embperl/App/App.o xs/Embperl/App/Config/Config.o xs/Embperl/Component/Component.o xs/Embperl/Component/Config/Config.o xs/Embperl/Component/Param/Param.o xs/Embperl/Component/Output/Output.o xs/Embperl/Req/Req.o xs/Embperl/Req/Config/Config.o xs/Embperl/Req/Param/Param.o xs/Embperl/Thread/Thread.o xs/Embperl/Syntax/Syntax.o -brtl -L/usr/local/lib -b32 -o blib/arch/auto/Embperl/Embperl.so ld: 0711-317 ERROR: Undefined symbol: .apr_palloc ld: 0711-317 ERROR: Undefined symbol: .ap_rputc ld: 0711-317 ERROR: Undefined symbol: .ap_rflush ld: 0711-317 ERROR: Undefined symbol: .ap_rwrite ld: 0711-317 ERROR: Undefined symbol: .ap_setup_client_block ld: 0711-317 ERROR: Undefined symbol: .ap_should_client_block ld: 0711-317 ERROR: Undefined symbol: .ap_get_client_block ld: 0711-317 ERROR: Undefined symbol: .apr_pstrdup ld: 0711-317 ERROR: Undefined symbol: .apr_table_add ld: 0711-317 ERROR: Undefined symbol: .apr_table_set ld: 0711-317 ERROR: Undefined symbol: .apr_table_elts ld: 0711-317 ERROR: Undefined symbol: .ap_log_error ld: 0711-317 ERROR: Undefined symbol: .ap_hook_open_logs ld: 0711-317 ERROR: Undefined symbol: .ap_exists_config_define ld: 0711-317 ERROR: Undefined symbol: .apr_pool_create_ex ld: 0711-317 ERROR: Undefined symbol: .ap_add_version_component ld: 0711-317 ERROR: Undefined symbol: .apr_table_get ld: 0711-317 ERROR: Undefined symbol: .apr_table_do ld: 0711-317 ERROR: Undefined symbol: .ap_sub_req_lookup_uri ld: 0711-317 ERROR: Undefined symbol: .apr_pstrcat ld: 0711-317 ERROR: Undefined symbol: .ap_sub_req_lookup_file ld: 0711-317 ERROR: Undefined symbol: .ap_run_sub_req ld: 0711-317 ERROR: Undefined symbol: .ap_destroy_sub_req ld: 0711-317 ERROR: Undefined symbol: .apr_brigade_destroy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. make: The error code from the last command is 8. As Gerald told me, it is probably a linker issue, maybe because the Aix ld doesn't work the same way? (why anyway?) That were I was really stucked building Embperl from CPAN. So I resigned to build Embperl directly from the sources, and modify the top-level Makefile to add the missing symbols : Snippet from the top-level Makefile that I had modified : LD = ld LDDLFLAGS = -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp /usr/local/apache2/lib/apr.exp /usr/local/apache2/lib/aprutil.exp /usr/local/apache2/modules/httpd.exp -bE:$(BASEEXT).exp -bnoentry -lc -L/usr/local/lib I added every .exp file found under my apache2 directory (apr.exp, aprutil.exp and httpd.exp) Could you explain what .exp file are and why the few found under /apache2/ are related to Embperl. I know that they are 'symbol files' but what is the big deal with symbol files? (I have a little experience with C) I ran make again and it compiled and linked everything smoothly. I soon after ran 'make install' and I will test Embperl later today. Here is the summary of questions I would like to have answers : 1. What's the advantage of Makefile.PL files? Could you have written only a simple Makefile? 2. What is the use of all the .c files (generated by Makefile) under /xs subdirectories (/App, /Component, /Syntax, etc) 3. Why I have to manually build the .c files in these subdirectories before building from CPAN and I am not required to do so if I compile Embperl myself? 4. Why did I have to copy the top-level header files (ep.h, epmacro.h, etc) in these subdirectories for CPAN to compile correctly and I were not required to do so when compiling Embperl myself? 5. Could I had fixed the missing header files by making CPAN look in the top-level directory? How? 6. What are .exp files. Why does Embperl need to be linked with .exp files found under /Apache2/, what is the big deal behind .exp files? You might want to answer "Look, it works if you build Embperl yourself, why bother with CPAN?" I just want to UNDERSTAND in what CPAN builds the software differently. As far as I know, It would use the SAME top-level Makefile to build Embperl; I don't understand why building from CPAN forces me to compile /xs subdirectories by and and gives me missing headers errors, and running the Makefile manually don't return me these errors. Well, if I have answer to these 6 main questions, I will feel better and maybe sleep better tonight :-) I will test Embperl against Apache2/mod_perl2 on this Aix box later today. Will keep you posted. Thank you VERY MUCH for your great support and for taking time to answer my questions. It is very appreciated. Best regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Forestières La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]