[ovs-discuss] Enabling user defined preprocessing definitions during compilation of OVS 1.2.2

Ramana Reddy gtvrreddy at gmail.com
Sat Nov 12 10:38:35 UTC 2011


After going through the OVS code, I have observed that the following
modifications
are needed in the respective files mentioned below. Please correct me in
case, if I
missed some thing or wrong.

1. Add the following line to configure
RAMANA=yes

2. Add the following line to configure.in
OVS_CHECK_RAMANA

3. Add the following lines to ovs/m4/openvswitch.m4

dnl Checks for Ramana support.
AC_DEFUN([OVS_CHECK_RAMANA],
   AM_CONDITIONAL([RAMANA], [test "$RAMANA" = yes])
   if test "$RAMANA" = yes; then
      AC_DEFINE([Ramana], [1], [Enable Ramana's extensions.])
   fi])

Thanks,
Ramana Reddy.


On Sat, Nov 12, 2011 at 12:01 PM, Ramana Reddy <gtvrreddy at gmail.com> wrote:

> Thank you very much Ben for your reply. I have one more doubt regarding
> how to add our own
> files( Assume that it is in the ovs/lib directory and the files are
> dpif-mine.c and dpif-mine.h) to
> automake.mk file in ovs/lib directory without adding immediately after
> the existing ovs/lib files.
>
> I mean, is it possible to write some thing like below in automake.mkfile, after adding AC_DEFINE([Ramana], [1], [Enable Ramana's extensions.])
> to configure.ac, so that it controls both modified code in the existing
> files, as well
> as the newly added files to OVS.
>
> if Ramana
> lib_libopenvswitch_a_SOURCES += \
>                    lib/dpif-mine.c \
>                    lib/dpif-mine.h
> endif
>
>
> Thanks,
> Ramana Reddy.
>
>
> On Fri, Nov 11, 2011 at 10:29 PM, Ben Pfaff <blp at nicira.com> wrote:
>
>> On Fri, Nov 11, 2011 at 03:35:00PM +0530, Ramana Reddy wrote:
>> > I modified some code in OVS-1.2.2 both in user space and kernel
>> > space with my own preprocessing directives some thing like:
>> > #ifdef Ramana
>> > /* my code is here */
>> > #endif.
>> >
>> > Now I want to enable my code during the compilation of OVS-1.2.2.
>> > This can be done by defining #define ramana in the header file and
>> > adding this header file in the respective places can solve the problem.
>> > But some how I do not like to add this header file in all the places.
>> > How can we enable this preprocessor directive with out adding a header
>> file.
>> > Can we pass this one as a parameter to gcc like gcc -Dramana during
>> > compilation.
>> > if yes, where I should modify in the configuration file or some other
>> file.
>>
>> Add AC_DEFINE([Ramana], [1], [Enable Ramana's extensions.])
>> to configure.ac.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20111112/c2ec1422/attachment.html>


More information about the discuss mailing list