Permalink
Browse files

Build System: Fix pgxn issues recently found.

Jira:MADLIB-589

It seems the wild card in Makefile rule doesn't work with fixed target
in some environment.  Also inlucde some pgxn package improvement (it will
be rewritten in cmake in the future.)
  • Loading branch information...
1 parent d74d950 commit c09fd3d627630ee9e836b5b95495e422fbbf6797 @haradh1 haradh1 committed with Florian Schoppmann Jul 24, 2012
Showing with 13 additions and 4 deletions.
  1. +3 −1 configure
  2. +3 −2 deploy/PGXN/package.sh
  3. +1 −1 src/ports/postgres/CMakeLists.txt
  4. +6 −0 src/ports/postgres/cmake/FindPostgreSQL.cmake
View
@@ -23,7 +23,9 @@ cd ..
cat <<MAKEFILE >Makefile
-all %:
+all:
+
+%:
\$(MAKE) -C build \$@
clean:
rm -f Makefile
View
@@ -1,17 +1,18 @@
#!/bin/sh
GIT_URL=$1
+BRANCH=$2
if [ -z $GIT_URL ]; then
- echo "$0 GIT_URL"
+ echo "$0 GIT_URL BRANCH"
exit;
fi
ORIG=`pwd`
TEMPDIR=`mktemp -d -t madlib`
cd $TEMPDIR
-git clone $GIT_URL madlib
+git clone $GIT_URL madlib && (cd madlib; git checkout $BRANCH)
# This is the version string for the distribution.
VERSION=`cat madlib/deploy/PGXN/dist.ver`
@@ -326,7 +326,7 @@ function(add_extension_support)
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_BINARY_DIR}/modules ${${DBMS_UC}_SHARE_DIR}/madlib/modules
COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_BINARY_DIR}/lib/libmadlib.so ${${DBMS_UC}_LIB_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib/libmadlib.so ${${DBMS_UC}_PKGLIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy
${EXTENSION_SQL} ${${DBMS_UC}_SHARE_DIR}/extension/
COMMAND ${CMAKE_COMMAND} -E copy
@@ -22,6 +22,7 @@
# ${PKG_NAME}_FOUND - set to true if headers and binary were found
# ${PKG_NAME}_LIB_DIR - PostgreSQL library directory
# ${PKG_NAME}_SHARE_DIR - PostgreSQL share directory
+# ${PKG_NAME}_PKGLIB_DIR - PostgreSQL package library directory
# ${PKG_NAME}_CLIENT_INCLUDE_DIR - client include directory
# ${PKG_NAME}_SERVER_INCLUDE_DIR - server include directory
# ${PKG_NAME}_EXECUTABLE - path to postgres binary
@@ -162,6 +163,11 @@ if(${PKG_NAME}_PG_CONFIG AND ${PKG_NAME}_CLIENT_INCLUDE_DIR)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+ execute_process(COMMAND ${${PKG_NAME}_PG_CONFIG} --pkglibdir
+ OUTPUT_VARIABLE ${PKG_NAME}_PKGLIB_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
architecture("${${PKG_NAME}_EXECUTABLE}" ${PKG_NAME}_ARCHITECTURE)
else()
message(STATUS "Found pg_config at \"${${PKG_NAME}_PG_CONFIG}\", "

0 comments on commit c09fd3d

Please sign in to comment.