Re: Configuring Postgres to Add A New Source File

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tareq Aljabban <tareq(dot)aljabban(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Configuring Postgres to Add A New Source File
Date: 2012-01-26 17:54:08
Message-ID: CA+TgmoaW+dYAF8vhDsLNeBPrd_JnjaFqmSw5BDLNxBkLJEtZYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 25, 2012 at 7:06 AM, Tareq Aljabban
<tareq(dot)aljabban(at)gmail(dot)com> wrote:
> Hi,
> I'm doing some development on the storage manager module of Postgres.
>
> I have added few source files already to the smgr folder, and I was able to
> have the Make system includes them by adding their names to the OBJS list in
> the Makefile inside the smgr folder. (i.e. When I add A.c, I would add A.o
> to the OBJS list).
>
> That was working fine. Now I'm trying to add a new file hdfs_test.c to the
> project. The problem with this file is that it requires some extra
> directives in its compilation command (-I and -L directives).
>
> Using gcc the file is compiled with the command:
>
> gcc hdfs_test.c -I/HDFS_HOME/hdfs/src/c++/libhdfs
> -I/usr/lib/jvm/default-java/include -L/HDFS_HOME/hdfs/src/c++/libhdfs
> -L/HDFS_HOME/build/c++/Linux-i386-32/lib
> -L/usr/lib/jvm/default-java/jre/lib/i386/server -ljvm -lhdfs -o hdfs_test
>
> I was told that in order to add the extra directives, I need to modify
> $LDFLAGS in configure.in and $LIBS in MakeFile.
>
> I read about autoconf and checked configure.in of Postgres but still wasn't
> able to know exactly what I should be doing.

This is really a general question about make that has nothing to do
with PostgreSQL specifically; you might want to get a book on "make".

Makefiles in subdirectories of src/backend are only intended to be
able to build the backend itself, so there's probably no particularly
easy way to do what you want there. You likely want to put this code
someplace like src/test/hdfs_test and copy one of the other Makefiles
into the new directory, perhaps src/test/isolation/Makefile.

But even if you do that for starters, you're going to need to make
some modifications, which may be a bit tricky if you have no
experience at all using make.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-01-26 18:01:21 Re: hiding variable-length fields from Form_pg_* structs
Previous Message Robert Haas 2012-01-26 17:49:46 Re: pg_bulkload ON_DUPLICATE_MERGE