[PATCH] gcj-branch makefile 'stuff'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] gcj-branch makefile 'stuff'

Paul Querna
Attached is a little convince patch against the current GCJ-backend
Makefile.

- Uses the shell function to expand the cflags/cppflags/libraries from
apr-config. (instead of invoking apr-config multiple times for each
source file)

- Now uses an installed APR. (old makefile required to use the APR Build
Directory...)

- missing a directory creation inside src.

I haven't had much time to seriously play with it, but it does compile
and run on Debian/Testing with a custom gcc 4.0.0 install.

If I have some spare time later, I will look at fixing the Automake
based build, and after that, I will try to integrate mod_mbox...

-Paul
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] gcj-branch makefile 'stuff'

Paul Querna
And before I fall asleep, this time I will attach the patch.


Paul Querna wrote:

> Attached is a little convince patch against the current GCJ-backend
> Makefile.
>
> - Uses the shell function to expand the cflags/cppflags/libraries from
> apr-config. (instead of invoking apr-config multiple times for each
> source file)
>
> - Now uses an installed APR. (old makefile required to use the APR Build
> Directory...)
>
> - missing a directory creation inside src.
>
> I haven't had much time to seriously play with it, but it does compile
> and run on Debian/Testing with a custom gcc 4.0.0 install.
>
> If I have some spare time later, I will look at fixing the Automake
> based build, and after that, I will try to integrate mod_mbox...
>
> -Paul
>

Index: Makefile
===================================================================
--- Makefile (revision 179011)
+++ Makefile (working copy)
@@ -1,9 +1,11 @@
-APR_ROOT=../apr-trunk
-GCC_ROOT=/home/rooneg/work/gcj
+APR_ROOT=/usr/local/apr/trunk
+GCC_ROOT=/home/chip/gcc4/
+APR_CONFIG=$(APR_ROOT)/bin/apr-1-config
 
-CPPFLAGS=`$(APR_ROOT)/apr-1-config --cppflags`
-CFLAGS=`$(APR_ROOT)/apr-1-config --cflags`
-INCLUDES=-Iinclude -I$(APR_ROOT)/include
+CPPFLAGS =$(shell $(APR_CONFIG) --cppflags)
+CFLAGS   =$(shell $(APR_CONFIG) --cflags)
+INCLUDES =-Iinclude $(shell $(APR_CONFIG) --includes)
+APR_LIBS =-Wl,-rpath=$(APR_ROOT)/lib $(shell $(APR_CONFIG) --libs --link-ld)
 
 CC=$(GCC_ROOT)/bin/gcc -g -Wall
 CXX=$(GCC_ROOT)/bin/g++ -g -Wall
@@ -51,10 +53,10 @@
 src/query_parser/query_parser.o: include/org/apache/lucene4c/QueryParserHack.h
 
 test/test: lib/liblucene4c.so test/main.o
- $(CC) $(CFLAGS) test/main.o -o $@ -Llib -Wl,-rpath=lib -llucene4c -L$(APR_ROOT)/.libs -Wl,-rpath=$(APR_ROOT)/.libs -lapr-1
+ $(CC) $(CFLAGS) test/main.o -o $@ -Llib -Wl,-rpath=lib -llucene4c ${APR_LIBS}
 
 src/cmdline/lcn: lib/liblucene4c.so $(CMDLINE_OBJS)
- $(CC) $(CFLAGS) $(CMDLINE_OBJS) -o $@ -Llib -Wl,-rpath=lib -llucene4c -L$(APR_ROOT)/.libs -Wl,-rpath=$(APR_ROOT)/.libs -lapr-1
+ $(CC) $(CFLAGS) $(CMDLINE_OBJS) -o $@ -Llib -Wl,-rpath=lib -llucene4c ${APR_LIBS}
 
 clean:
  rm -f $(OBJS)
@@ -66,7 +68,7 @@
  $(JCC) -c -o $@ lib/lucene-1.4.3.jar
 
 lib/liblucene4c.so: $(OBJS) lib/lucene.o
- $(CC) -shared -o $@ $(OBJS) lib/lucene.o -lgcj -Wl,-rpath=$(APR_ROOT)/.libs -L$(APR_ROOT)/.libs -lapr-1
+ $(CC) -shared -o $@ $(OBJS) lib/lucene.o -L$(GCC_ROOT)/lib -lgcj -Wl,-rpath=$(GCC_ROOT)/lib $(APR_LIBS)
 
 # XXX gcjh barfs on some lucene classes, needs to be fixed.
 
@@ -74,6 +76,7 @@
  $(JAR) xvf lib/lucene-1.4.3.jar
  rm -rf META-INF
  mkdir -p src/org/apache/lucene4c
+ mkdir -p include/org/apache/lucene4c
  mkdir .tmp && mv org .tmp/org
  find .tmp -type d | \
         sed 's|\.tmp/|include/|' | \
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] gcj-branch makefile 'stuff'

Garrett Rooney
Paul Querna wrote:
> And before I fall asleep, this time I will attach the patch.

Thanks Paul, I'll take a look at testing and committing this stuff
tomorrow sometime.

If you're going to keep working on the build system, we're just going to
have to give you commit access so you can do it yourself ;-)

-garrett