[47546] trunk/dports/x11/openmotif/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Sat Feb 28 16:26:47 PST 2009


Revision: 47546
          http://trac.macports.org/changeset/47546
Author:   jeremyhu at macports.org
Date:     2009-02-28 16:26:47 -0800 (Sat, 28 Feb 2009)
Log Message:
-----------
openmotif: Move the AC_X_PATH workaround after configure.args is set to properly append to it

Modified Paths:
--------------
    trunk/dports/x11/openmotif/Portfile

Modified: trunk/dports/x11/openmotif/Portfile
===================================================================
--- trunk/dports/x11/openmotif/Portfile	2009-03-01 00:25:33 UTC (rev 47545)
+++ trunk/dports/x11/openmotif/Portfile	2009-03-01 00:26:47 UTC (rev 47546)
@@ -48,22 +48,32 @@
     reinplace -E "/^LDFLAGS/s|\$| @LDFLAGS@|" ${worksrcpath}/lib/Xm/Makefile.in
 }
 
-# This block helps us link correctly and setup our pc files correctly when we are
-# +system_x11 and x11prefix is somewhere non-standard
-if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
-    # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
-    # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
-    # and LDFLAGS without interference
-    configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
-    configure.cppflags-append -I${x11prefix}/include
-    configure.ldflags-append  -L${x11prefix}/lib
-}
-
 configure.args  --mandir=${prefix}/share/man	\
                 --enable-xft	\
                 --enable-jpeg	\
                 --enable-png
 
+# AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
+# This block helps us link correctly and setup our pc files correctly when we   
+# are +system_x11 and x11prefix is somewhere non-standard and should cause
+# AC_X_PATH to let us setup our CPPFLAGS and LDFLAGS without interference
+configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
+if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] } {
+    pre-configure {
+        configure.cppflags-append -I${x11prefix}/include
+        configure.ldflags-append  -L${x11prefix}/lib
+    }
+
+    # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
+    post-destroot {
+        if {![file exists ${x11prefix}/lib/pkgconfig/x11.pc]} {
+            foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
+                reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
+            }
+        }
+    }
+}
+
 build.env       LANG=C
 
 post-destroot {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090228/3a7ef0a0/attachment.html>


More information about the macports-changes mailing list