use -fPIC -shared when compiling "libraries" demo
authorBryan Bishop <kanzure@gmail.com>
Tue, 10 Sep 2013 01:03:18 +0000 (20:03 -0500)
committerBryan Bishop <kanzure@gmail.com>
Tue, 10 Sep 2013 01:03:18 +0000 (20:03 -0500)
This fixes the "libraries" demo's setup.py for building the call_mymath
extension.

Demos/libraries/setup.py

index b4a3659..557f64f 100644 (file)
@@ -8,7 +8,7 @@ from Cython.Distutils import build_ext
 # For demo purposes, we build our own tiny library.
 try:
     print "building libmymath.a"
-    assert os.system("gcc -c mymath.c -o mymath.o") == 0
+    assert os.system("gcc -shared -fPIC -c mymath.c -o mymath.o") == 0
     assert os.system("ar rcs libmymath.a mymath.o") == 0
 except:
     if not os.path.exists("libmymath.a"):