diff --git a/GNUmakefile b/GNUmakefile index 98eb1fa..40ebc38 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -170,12 +170,11 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o) JAVA_CLASSES = $(JAVA_SOURCES:.java=.class) JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class) -CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations -CPPFLAGS= +CFLAGS+=-fPIC -W -Wall -Wmissing-prototypes -Wmissing-declarations INCLUDES=-Iinclude -all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) +all: snowball$(EXEEXT) libstemmer.a libstemmer.so stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt @@ -212,6 +212,9 @@ libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS) libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS) $(AR) -cru $@ $^ +libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS) + $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,libstemmer.so.0,-version-script,libstemmer/symbol.map -o $@.0.0.0 $^ + examples/%.o: examples/%.c $(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $< diff --git a/libstemmer/symbol.map b/libstemmer/symbol.map new file mode 100644 index 0000000..7a3d423 --- /dev/null +++ i/libstemmer/symbol.map @@ -0,0 +1,6 @@ +SB_STEMMER_0 { + global: + sb_stemmer_*; + local: + *; +};