On Wed, Jan 25, 2012 at 7:06 AM, Tareq Aljabban
<tareq.aljabban@gmail.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