Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 picosat (953-1) unstable; urgency=low
 .
   * Bumped standards version to 3.9.4 (no changes)
   * New upstream version (closes: #694592)
   * Converted debian/copyright to DEP-5
Author: Michael Tautschnig <mt@debian.org>
Bug-Debian: http://bugs.debian.org/694592

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- picosat-953.orig/makefile.in
+++ picosat-953/makefile.in
@@ -8,6 +8,7 @@ clean:
 	rm -f *.exe *.s *.o *.a *.so *.plist
 	rm -f makefile config.h
 	rm -f gmon.out *~ 
+	rm -f *.so.1.0.0 picomus
 
 analyze:
 	clang --analyze $(CFLAGS) *.c *.h
@@ -52,8 +53,17 @@ libpicosat.a: picosat.o version.o
 	ar rc $@ picosat.o version.o
 	ranlib $@
 
-SONAME=-Xlinker -soname -Xlinker libpicosat.so
-libpicosat.so: picosat.o version.o
-	$(CC) $(CFLAGS) -shared -o $@ picosat.o version.o $(SONAME)
+%.pic.o: %.o
+	mv $< $*.nopic.o
+	$(MAKE) CFLAGS="$(CFLAGS) -fPIC" $<
+	mv $< $@
+	mv $*.nopic.o $<
+
+SONAME=-Xlinker -soname -Xlinker libpicosat.so.1
+libpicosat.so: picosat.pic.o version.pic.o
+	$(CC) $(CFLAGS) -shared -o libpicosat.so.1.0.0 $^ -lc $(SONAME)
+
+libpicosat-trace.so: picosat.pic.o version.pic.o
+	$(CC) $(CFLAGS) -shared -o libpicosat-trace.so.1.0.0 $^ -lc -Wl,-soname,libpicosat-trace.so.1
 
 .PHONY: all clean
--- picosat-953.orig/picosat.c
+++ picosat-953/picosat.c
@@ -6668,7 +6668,7 @@ check_trace_support_and_execute (PS * ps
   (void) file;
   (void) fmt;
   (void) f;
-  ABORT ("compiled without trace support");
+  ABORT ("compiled without trace support; please use picosat.trace instead");
 #endif
 }
 
@@ -7326,7 +7326,7 @@ picosat_corelit (PS * ps, int int_lit)
     return res;
   }
 #else
-  ABORT ("compiled without trace support");
+  ABORT ("compiled without trace support; please use picosat.trace instead");
   return 0;
 #endif
 }
@@ -7362,7 +7362,7 @@ picosat_coreclause (PS * ps, int ocls)
     return res;
   }
 #else
-  ABORT ("compiled without trace support");
+  ABORT ("compiled without trace support; please use picosat.trace instead");
   return 0;
 #endif
 }
