Commits

David McClosky committed c214b7a

SWIG Makefiles: Don't pass -package option when building Python extensions.

Comments (0)

Files changed (2)

first-stage/PARSE/Makefile

 SWIG_PARSER_MODULE_NAME ?= SWIGParser
 # SWIG_JAVA_PACKAGE ?= your.package.name.for.the.swig.wrapper
 
+SWIG_JAVA_FLAGS = ${SWIG_FLAGS}
 ifneq ($(strip $(SWIG_JAVA_PACKAGE)),)
-	SWIG_FLAGS += -package ${SWIG_JAVA_PACKAGE}
+	SWIG_JAVA_FLAGS += -package ${SWIG_JAVA_PACKAGE}
 endif
 
 # 
 swig/build/java_wrapper.cxx: swig/wrapper.i
 	mkdir -p swig/build
 	mkdir -p swig/java/lib
-	swig $(SWIG_FLAGS) -module $(SWIG_PARSER_MODULE_NAME) -Wall -c++ -java -outdir swig/java/lib \
+	swig $(SWIG_JAVA_FLAGS) -module $(SWIG_PARSER_MODULE_NAME) -Wall -c++ -java -outdir swig/java/lib \
 		-o swig/build/java_wrapper.cxx swig/wrapper.i
 
 swig/build/java_wrapper.o: swig/build/java_wrapper.cxx

second-stage/programs/features/Makefile

 # Edit these variables as needed
 SWIG_RERANKER_MODULE_NAME ?= SWIGReranker
 SWIG_JAVA_PACKAGE ?= ${SWIG_RERANKER_MODULE_NAME}
+SWIG_JAVA_FLAGS = ${SWIG_FLAGS}
 
 ifneq ($(strip $(SWIG_JAVA_PACKAGE)),)
-	SWIG_FLAGS += -package ${SWIG_JAVA_PACKAGE}
+	SWIG_JAVA_FLAGS += -package ${SWIG_JAVA_PACKAGE}
 endif
 
 SWIG_OBJS = simple-api.o heads.o read-tree.o sym.o
 swig/java/lib/lib$(SWIG_RERANKER_MODULE_NAME).so: $(SWIG_OBJS)
 	mkdir -p swig/build
 	mkdir -p swig/java/lib
-	swig $(SWIG_FLAGS) -module $(SWIG_RERANKER_MODULE_NAME) -Wall -c++ -java -outdir swig/java/lib \
+	swig $(SWIG_JAVA_FLAGS) -module $(SWIG_RERANKER_MODULE_NAME) -Wall -c++ -java -outdir swig/java/lib \
 		-o swig/build/java_wrapper.cxx swig/wrapper.i
 	gcc -O2 $(CXXFLAGS) -c $(SWIG_JAVA_GCCFLAGS) -iquote . \
 		swig/build/java_wrapper.cxx -o swig/build/java_wrapper.o