Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 90819 invoked from network); 13 Oct 2006 14:00:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2006 14:00:20 -0000 Received: (qmail 58221 invoked by uid 500); 13 Oct 2006 14:00:19 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 58164 invoked by uid 500); 13 Oct 2006 14:00:19 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 58069 invoked by uid 99); 13 Oct 2006 14:00:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 07:00:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of James.Kratzer@ngc.com designates 208.20.220.55 as permitted sender) Received: from [208.20.220.55] (HELO xmrt0101.northgrum.com) (208.20.220.55) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Oct 2006 07:00:14 -0700 Received: from XBHT0001.northgrum.com ([132.228.189.53]) by xmrt0101.northgrum.com with InterScan Message Security Suite; Fri, 13 Oct 2006 06:59:01 -0700 Received: from xcgoh901.northgrum.com ([167.225.22.33]) by XBHT0001.northgrum.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Fri, 13 Oct 2006 07:59:51 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Developing C++ modules with apache 1.3.34 Date: Fri, 13 Oct 2006 09:59:47 -0400 Message-ID: <85A664F2F3F2D1409EE003C7D3D52EE43C3D0F@xcgoh901.northgrum.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Developing C++ modules with apache 1.3.34 Thread-Index: AcburlkWdS/HPLXXQQ+VVSQO4EBJ/gAINr6Q From: "Kratzer, James \(Xetron\)" To: X-OriginalArrivalTime: 13 Oct 2006 13:59:51.0231 (UTC) FILETIME=[DA27A4F0:01C6EECF] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N See this threebit article on building an Apache modules using autoconf, automake, and libtool: http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html You create the files configure.in and Makefile.am. In the file Makefile.am is where you specify your cpp file like so: libmodfoo_la_SOURCES =3D mod_foo.c mod_bar.cpp Good luck James Kratzer =20 -----Original Message----- From: Manish Chakravarty [mailto:manishchaks@gmail.com]=20 Sent: Friday, October 13, 2006 5:59 AM To: modules-dev@httpd.apache.org Subject: Re: Developing C++ modules with apache 1.3.34 Could you please tell me how you do that? when i run my ./configure --activate-module=3Dsrc/modules/mod_foo/mod_foo.cpp \ enable-module=3Dmod_foo it gives me the error Configuring for Apache, Version 1.3.34 + using installation path layout: Apache (config.layout) + activated clickout module (modules/mod_foo/mod_foo.cpp configure:Error: No such module named 'mod_foo' could you please tell me how you use autoconf/libtool, or atleast provide me pointers as to how they are used? On 10/12/06, Kratzer, James (Xetron) wrote: > Hi, > > Here is what I'm doing with Apache 2.0. > > I use autoconf and libtool to create my makefiles and to build my=20 > apache modules. I then put all of your C++ functions is a separate=20 > source file having a cpp extension and I wrap the c++ functions with extern "C" > declarations. I then call the c++ functions from the C module code. > Works great. > > James Kratzer > > -----Original Message----- > From: Manish Chakravarty [mailto:manishchaks@gmail.com] > Sent: Thursday, October 12, 2006 2:49 AM > To: modules-dev@httpd.apache.org > Subject: Developing C++ modules with apache 1.3.34 > > Hi All, > > I am a newbie to Apache development. I am trying to develop a module=20 > for apache 1.3.34 in C++. I really need to link with some C++ libs and > use > C++ headers for this project. > > 1) How do i go about it ? Do i follow the standard Makefile approach=20 > as outlined in the book "Writing Apache Modules with Perl and C" ? > > 2) The sample skeleton code (mixed C/C++) is given below. Would=20 > someone be kind enough to go through and tell me if my approach is OK? > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3DExample code = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= #include=20 > "apache/httpd.h" > #include "http_config.h" > #include "http_core.h" > #include "http_log.h" > #include "http_protocol.h" > > #undef strtoul > //will the next line work as intended? > extern "C" module MODULE_VAR_EXPORT clickout_module; > > static void co_mod_init(server_rec *s, pool *p) { > //some module initialization stuff } static int=20 > co_handler(request_rec *r) { > const char* hostname; > r->content_type =3D "text/html"; > ap_send_http_header(r); > hostname =3D ap_get_remote_host(r->connection, r->per_dir_config,=20 > REMOTE_NAME); > ap_rputs ("Some text"); > return OK; > } > static handler_rec co_handlers[] =3D > { > {"some-hander", some_handler}, > {NULL} > }; > void co_proc_init(server_rec* s, pool* p) { // some c++ initialization > functions here. > } > > extern "C" { // is this extern useful here? > module MODULE_VAR_EXPORT clickout_module =3D { > STANDARD_MODULE_STUFF, > co_mod_init, /** module initializer */ > NULL, /** per-directory config creator */ > NULL, /** dir config merger */ > NULL, /** server config creator */ > NULL, /** server config merger */ > NULL, /** command table */ > co_handlers, /** [9] content handlers */ > NULL, /** [2] URI-to-filename translation */ > NULL, /** [5] check/validate user_id */ > NULL, /** [6] check user_id is valid *here* */ > NULL, /** [4] check access by host address */ > NULL, /** [7] MIME type checker/setter */ > NULL, /** [8] fixups */ > NULL, /** [10] logger */ > NULL, /** [3] header parser */ > co_proc_init, /** process initialization */ > NULL, /** process exit/cleanup */ > NULL /** [1] post read_request handling */ > }; > } > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3DEnd example code = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Thanks in advance.!! > > -- > Warm Regards, > Manish Chakravarty > ---- > Consultant Software Developer > PH: +919886702500 > http://manishchaks.net > --- > -- Warm Regards, Manish Chakravarty ---- Consultant Software Developer PH: +919886702500 http://manishchaks.net ---