[78880] trunk/dports/databases/postgresql82

jmr at macports.org jmr at macports.org
Wed May 25 08:51:53 PDT 2011


Revision: 78880
          http://trac.macports.org/changeset/78880
Author:   jmr at macports.org
Date:     2011-05-25 08:51:50 -0700 (Wed, 25 May 2011)
Log Message:
-----------
postgresql82: fix universal build (#24738)

Modified Paths:
--------------
    trunk/dports/databases/postgresql82/Portfile

Added Paths:
-----------
    trunk/dports/databases/postgresql82/files/ecpg_config.h.ed
    trunk/dports/databases/postgresql82/files/ldfat.sh
    trunk/dports/databases/postgresql82/files/pg_config.h.ed

Modified: trunk/dports/databases/postgresql82/Portfile
===================================================================
--- trunk/dports/databases/postgresql82/Portfile	2011-05-25 15:22:16 UTC (rev 78879)
+++ trunk/dports/databases/postgresql82/Portfile	2011-05-25 15:51:50 UTC (rev 78880)
@@ -46,6 +46,22 @@
 				--enable-thread-safety \
 				--enable-integer-datetimes
 
+if {[variant_isset universal]} {
+    post-patch {
+        xinstall -m 755 ${filespath}/ldfat.sh ${workpath}
+        reinplace s|@UNIVERSAL_ARCHS@|${universal_archs}| ${workpath}/ldfat.sh
+    }
+    configure.env-append LD=${workpath}/ldfat.sh
+    post-configure {
+        system "cd ${worksrcpath}/src/include \
+                && ed - pg_config.h < ${filespath}/pg_config.h.ed \
+                && touch stamp-h"
+        system "cd ${worksrcpath}/src/interfaces/ecpg/include \
+                && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \
+                && touch stamp-h"
+    }
+}
+
 build.type		gnu
 build.target
 

Copied: trunk/dports/databases/postgresql82/files/ecpg_config.h.ed (from rev 78878, trunk/dports/databases/postgresql84/files/ecpg_config.h.ed)
===================================================================
--- trunk/dports/databases/postgresql82/files/ecpg_config.h.ed	                        (rev 0)
+++ trunk/dports/databases/postgresql82/files/ecpg_config.h.ed	2011-05-25 15:51:50 UTC (rev 78880)
@@ -0,0 +1,15 @@
+/HAVE_LONG_INT_64/c
+#ifdef __LP64__
+#define HAVE_LONG_INT_64 1
+#else
+/* #undef HAVE_LONG_INT_64 */
+#endif
+.
+/HAVE_LONG_LONG_INT_64/c
+#ifdef __LP64__
+/* #undef HAVE_LONG_LONG_INT_64 */
+#else
+#define HAVE_LONG_LONG_INT_64 1
+#endif
+.
+w

Added: trunk/dports/databases/postgresql82/files/ldfat.sh
===================================================================
--- trunk/dports/databases/postgresql82/files/ldfat.sh	                        (rev 0)
+++ trunk/dports/databases/postgresql82/files/ldfat.sh	2011-05-25 15:51:50 UTC (rev 78880)
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# http://archives.postgresql.org/pgsql-hackers/2006-04/msg00285.php
+
+OFILES=""
+RELOPT=""
+OUTPUT=""
+OTHERS=""
+ARCHS="@UNIVERSAL_ARCHS@"
+
+while [ "$#" != "0" ];
+do
+   case "$1" in
+     -r) RELOPT="-r";;
+     -o) OUTPUT=`basename -s .o "$2"`; shift;;
+     *.o) OFILES="$OFILES $1";;
+     *) OTHERS="$OTHERS $1";;
+   esac
+   shift
+done
+
+if [ "$RELOPT" == "-r" ];
+then
+   echo ldfat $RELOPT -o $OUTPUT $OFILES $OTHERS
+   THIN_OBJS=""
+   for ARCH in $ARCHS; do
+        /usr/bin/ld -r -arch $ARCH -o ${OUTPUT}_${ARCH}.o $OFILES $OTHERS
+        THIN_OBJS+=" ${OUTPUT}_${ARCH}.o"
+   done
+   lipo -create -output ${OUTPUT}.o $THIN_OBJS
+else
+   echo ld -o $OUTPUT $OFILES $OTHERS
+   /usr/bin/ld -o $OUTPUT $OFILES $OTHERS
+fi
+exit $?


Property changes on: trunk/dports/databases/postgresql82/files/ldfat.sh
___________________________________________________________________
Added: svn:executable
   + *

Copied: trunk/dports/databases/postgresql82/files/pg_config.h.ed (from rev 78878, trunk/dports/databases/postgresql84/files/pg_config.h.ed)
===================================================================
--- trunk/dports/databases/postgresql82/files/pg_config.h.ed	                        (rev 0)
+++ trunk/dports/databases/postgresql82/files/pg_config.h.ed	2011-05-25 15:51:50 UTC (rev 78880)
@@ -0,0 +1,78 @@
+/ALIGNOF_DOUBLE/c
+#ifdef __LP64__
+#define ALIGNOF_DOUBLE 8
+#else
+#define ALIGNOF_DOUBLE 4
+#endif
+.
+/ALIGNOF_LONG/c
+#ifdef __LP64__
+#define ALIGNOF_LONG 8
+#else
+#define ALIGNOF_LONG 4
+#endif
+.
+/ALIGNOF_LONG_LONG_INT/c
+#ifdef __LP64__
+/* #undef ALIGNOF_LONG_LONG_INT */
+#else
+#define ALIGNOF_LONG_LONG_INT 4
+#endif
+.
+/HAVE_LL_CONSTANTS/c
+#ifdef __LP64__
+/* #undef HAVE_LL_CONSTANTS */
+#else
+#define HAVE_LL_CONSTANTS 1
+#endif
+.
+/HAVE_LONG_INT_64/c
+#ifdef __LP64__
+#define HAVE_LONG_INT_64 1
+#else
+/* #undef HAVE_LONG_INT_64 */
+#endif
+.
+/HAVE_LONG_LONG_INT_64/c
+#ifdef __LP64__
+/* #undef HAVE_LONG_LONG_INT_64 */
+#else
+#define HAVE_LONG_LONG_INT_64 1
+#endif
+.
+/INT64_FORMAT/c
+#ifdef __LP64__
+#define INT64_FORMAT "%ld"
+#else
+#define INT64_FORMAT "%lld"
+#endif
+.
+/MAXIMUM_ALIGNOF/c
+#ifdef __LP64__
+#define MAXIMUM_ALIGNOF 8
+#else
+#define MAXIMUM_ALIGNOF 4
+#endif
+.
+/SIZEOF_SIZE_T/c
+#ifdef __LP64__
+#define SIZEOF_SIZE_T 8
+#else
+#define SIZEOF_SIZE_T 4
+#endif
+.
+/SIZEOF_UNSIGNED_LONG/c
+#ifdef __LP64__
+#define SIZEOF_UNSIGNED_LONG 8
+#else
+#define SIZEOF_UNSIGNED_LONG 4
+#endif
+.
+/UINT64_FORMAT/c
+#ifdef __LP64__
+#define UINT64_FORMAT "%lu"
+#else
+#define UINT64_FORMAT "%llu"
+#endif
+.
+w
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110525/1dad9917/attachment.html>


More information about the macports-changes mailing list