Commits

Anonymous committed c24cbb4

Made modules' install names on Mac OS X more portable.

Comments (0)

Files changed (2)

                 language='c++'
         )
 ]
-
+destDir="orange/add-ons/Text"
 
 # list all language files that need to be included
 #lngFiles = glob.glob('language_data/*.bin') + glob.glob('language_data/*.fsa') + glob.glob('language_data/*.txt')
 
         if includePaths <> "":
                 f.write("COMPILEOPTIONSMODULES = %s\n" % (includePaths))
+        f.write("DESTDIR = $(PYTHONSITEPKGS)/%s\n" % (destDir))
 
         f.write("modules:")
         for ext in modules:
                 objs = " ".join(objs)
                 f.write("%s.so: %s\n" % (ext.name, objs))
                 f.write("\t$(LINKER) $(LINKOPTIONS) %s -o %s.so" % (objs, os.path.join("..", ext.name)))
+                f.write("ifeq ($(OS), Darwin)\n")
+                f.write("\tinstall_name_tool -id $(DESTDIR)/%s.so %s.so" % (ext.name, os.path.join("..", ext.name)))
+                f.write("endif\n")
         f.close()
 
 if __name__ == "__main__":
                 package_data = {'doc': docFiles, 'widgets': ['icons/*.png']},
 
                 py_modules = [ 'orngText', 'orngTextWrapper', 'textConfiguration'],
-                extra_path = ("orange-text", "orange/add-ons/Text"),
+                extra_path = ("orange-text", destDir),
                 ext_modules = modules,
                 scripts=["post_install_script.py"]
         )
 PYTHONINCLUDE = $(shell python -c "import sys; print sys.prefix+'/include/python'+sys.version[:3]")
+PYTHONLIB = $(shell python -c "import sys; print sys.prefix+'/lib/python'+sys.version[:3]")
+PYTHONSITEPKGS = $(PYTHONLIB)/site-packages
 OS = $(shell uname)
 
 COMPILER = g++
 LINKER = g++
 
 ifeq ($(OS), Darwin)
-  COMPILEOPTIONS = -arch i386 -arch ppc -fPIC -fpermissive -fno-common -w -D_POSIX_C_SOURCE -O3 -I$(PYTHONINCLUDE)
+  COMPILEOPTIONS = -arch i386 -arch ppc -fPIC -fpermissive -fno-common -w -O3 -I$(PYTHONINCLUDE)
   LINKOPTIONS = -arch i386 -arch ppc -dynamiclib -headerpad_max_install_names -undefined dynamic_lookup -lstdc++
 else
   COMPILEOPTIONS = -fPIC -fpermissive -w -O3 -I$(PYTHONINCLUDE)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.