Browse Source

Not sure if it matters, but try putting the sys(lib)root flags before the lib flags.

rdb 16 years ago
parent
commit
9ce886e6ef
1 changed files with 9 additions and 7 deletions
  1. 9 7
      makepanda/makepanda.py

+ 9 - 7
makepanda/makepanda.py

@@ -867,13 +867,7 @@ def CompileLink(dll, obj, opts):
                     cmd += ' -l' + base[3:-2]
                     cmd += ' -l' + base[3:-2]
                 else:
                 else:
                     cmd += ' ' + x
                     cmd += ' ' + x
-        for (opt, dir) in LIBDIRECTORIES:
-            if (opt=="ALWAYS") or (opt in opts): cmd += ' -L' + BracketNameWithQuotes(dir)
-        for (opt, name) in LIBNAMES:
-            if (opt=="ALWAYS") or (opt in opts): cmd += ' ' + BracketNameWithQuotes(name)
-        cmd += " -lpthread"
-        if (not sys.platform.startswith("freebsd")):
-            cmd += " -ldl"
+        
         if (sys.platform == "darwin"):
         if (sys.platform == "darwin"):
             if (OSXTARGET != None):
             if (OSXTARGET != None):
                 cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
                 cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
@@ -885,6 +879,14 @@ def CompileLink(dll, obj, opts):
                 if ("NOPPC" not in opts): cmd += " -arch ppc"
                 if ("NOPPC" not in opts): cmd += " -arch ppc"
         if (LDFLAGS !=""): cmd += " " + LDFLAGS
         if (LDFLAGS !=""): cmd += " " + LDFLAGS
         
         
+        for (opt, dir) in LIBDIRECTORIES:
+            if (opt=="ALWAYS") or (opt in opts): cmd += ' -L' + BracketNameWithQuotes(dir)
+        for (opt, name) in LIBNAMES:
+            if (opt=="ALWAYS") or (opt in opts): cmd += ' ' + BracketNameWithQuotes(name)
+        cmd += " -lpthread"
+        if (not sys.platform.startswith("freebsd")):
+            cmd += " -ldl"
+        
         oscmd(cmd)
         oscmd(cmd)
         if (GetOrigExt(dll)==".exe" and GetOptimizeOption(opts)==4 and "NOSTRIP" not in opts):
         if (GetOrigExt(dll)==".exe" and GetOptimizeOption(opts)==4 and "NOSTRIP" not in opts):
             oscmd("strip " + BracketNameWithQuotes(dll))
             oscmd("strip " + BracketNameWithQuotes(dll))