mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-16 16:50:06 +02:00
postgresql_server: WIP recipe for version 9.3.4
* used the gentoo name, instead of postgresql. * build stops because shared memory support still missing in Haiku
This commit is contained in:
@@ -0,0 +1,290 @@
|
||||
From 69b627758b0c5e78cfa982861fab45b871b73b37 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Wed, 7 May 2014 15:52:41 +0000
|
||||
Subject: autoconf version
|
||||
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 61484df..66e501c 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -19,10 +19,10 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
|
||||
|
||||
AC_INIT([PostgreSQL], [9.3.4], [pgsql-bugs@postgresql.org])
|
||||
|
||||
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.63], [], [m4_fatal([Autoconf version 2.63 is required.
|
||||
-Untested combinations of 'autoconf' and PostgreSQL versions are not
|
||||
-recommended. You can remove the check from 'configure.in' but it is then
|
||||
-your responsibility whether the result works or not.])])
|
||||
+dnl m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.63], [], [m4_fatal([Autoconf version 2.63 is required.
|
||||
+dnl Untested combinations of 'autoconf' and PostgreSQL versions are not
|
||||
+dnl recommended. You can remove the check from 'configure.in' but it is then
|
||||
+dnl your responsibility whether the result works or not.])])
|
||||
AC_COPYRIGHT([Copyright (c) 1996-2013, PostgreSQL Global Development Group])
|
||||
AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From a2440b0d15d9da3359c0bfba6bdf9160a35a2ab7 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Wed, 7 May 2014 16:03:31 +0000
|
||||
Subject: haiku support
|
||||
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 66e501c..3072dbc 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -59,6 +59,7 @@ case $host_os in
|
||||
darwin*) template=darwin ;;
|
||||
dragonfly*) template=netbsd ;;
|
||||
freebsd*) template=freebsd ;;
|
||||
+ haiku*) template=haiku ;;
|
||||
hpux*) template=hpux ;;
|
||||
irix*) template=irix ;;
|
||||
linux*|gnu*|k*bsd*-gnu)
|
||||
@@ -873,7 +874,7 @@ fi
|
||||
AC_CHECK_LIB(m, main)
|
||||
AC_SEARCH_LIBS(setproctitle, util)
|
||||
AC_SEARCH_LIBS(dlopen, dl)
|
||||
-AC_SEARCH_LIBS(socket, [socket wsock32])
|
||||
+AC_SEARCH_LIBS(socket, [socket wsock32 network])
|
||||
AC_SEARCH_LIBS(shl_load, dld)
|
||||
# We only use libld in port/dynloader/aix.c
|
||||
case $host_os in
|
||||
@@ -887,7 +888,7 @@ AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_SEARCH_LIBS(fdatasync, [rt posix4])
|
||||
# Required for thread_test.c on Solaris 2.5:
|
||||
# Other ports use it too (HP-UX) so test unconditionally
|
||||
-AC_SEARCH_LIBS(gethostbyname_r, nsl)
|
||||
+AC_SEARCH_LIBS(gethostbyname_r, [nsl network])
|
||||
# Cygwin:
|
||||
AC_SEARCH_LIBS(shmget, cygipc)
|
||||
|
||||
diff --git a/src/backend/port/dynloader/haiku.c b/src/backend/port/dynloader/haiku.c
|
||||
new file mode 100644
|
||||
index 0000000..c99b717
|
||||
--- /dev/null
|
||||
+++ b/src/backend/port/dynloader/haiku.c
|
||||
@@ -0,0 +1,133 @@
|
||||
+/*-------------------------------------------------------------------------
|
||||
+ *
|
||||
+ * linux.c
|
||||
+ * Dynamic Loader for Postgres for Linux, generated from those for
|
||||
+ * Ultrix.
|
||||
+ *
|
||||
+ * You need to install the dld library on your Linux system!
|
||||
+ *
|
||||
+ * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
|
||||
+ * Portions Copyright (c) 1994, Regents of the University of California
|
||||
+ *
|
||||
+ *
|
||||
+ * IDENTIFICATION
|
||||
+ * src/backend/port/dynloader/haiku.c
|
||||
+ *
|
||||
+ *-------------------------------------------------------------------------
|
||||
+ */
|
||||
+
|
||||
+#include "postgres.h"
|
||||
+
|
||||
+#ifdef HAVE_DLD_H
|
||||
+#include <dld.h>
|
||||
+#endif
|
||||
+
|
||||
+#include "dynloader.h"
|
||||
+#include "miscadmin.h"
|
||||
+
|
||||
+
|
||||
+#ifndef HAVE_DLOPEN
|
||||
+
|
||||
+void *
|
||||
+pg_dlopen(char *filename)
|
||||
+{
|
||||
+#ifndef HAVE_DLD_H
|
||||
+ elog(ERROR, "dynamic load not supported");
|
||||
+ return NULL;
|
||||
+#else
|
||||
+ static int dl_initialized = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * initializes the dynamic loader with the executable's pathname. (only
|
||||
+ * needs to do this the first time pg_dlopen is called.)
|
||||
+ */
|
||||
+ if (!dl_initialized)
|
||||
+ {
|
||||
+ if (dld_init(dld_find_executable(my_exec_path)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ /*
|
||||
+ * if there are undefined symbols, we want dl to search from the
|
||||
+ * following libraries also.
|
||||
+ */
|
||||
+ dl_initialized = 1;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * link the file, then check for undefined symbols!
|
||||
+ */
|
||||
+ if (dld_link(filename))
|
||||
+ return NULL;
|
||||
+
|
||||
+ /*
|
||||
+ * If undefined symbols: try to link with the C and math libraries! This
|
||||
+ * could be smarter, if the dynamic linker was able to handle shared libs!
|
||||
+ */
|
||||
+ if (dld_undefined_sym_count > 0)
|
||||
+ {
|
||||
+ if (dld_link("/usr/lib/libc.a"))
|
||||
+ {
|
||||
+ elog(WARNING, "could not link C library");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if (dld_undefined_sym_count > 0)
|
||||
+ {
|
||||
+ if (dld_link("/usr/lib/libm.a"))
|
||||
+ {
|
||||
+ elog(WARNING, "could not link math library");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if (dld_undefined_sym_count > 0)
|
||||
+ {
|
||||
+ int count = dld_undefined_sym_count;
|
||||
+ char **list = dld_list_undefined_sym();
|
||||
+
|
||||
+ /* list the undefined symbols, if any */
|
||||
+ do
|
||||
+ {
|
||||
+ elog(WARNING, "\"%s\" is undefined", *list);
|
||||
+ list++;
|
||||
+ count--;
|
||||
+ } while (count > 0);
|
||||
+
|
||||
+ dld_unlink_by_file(filename, 1);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return (void *) strdup(filename);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+PGFunction
|
||||
+pg_dlsym(void *handle, char *funcname)
|
||||
+{
|
||||
+#ifndef HAVE_DLD_H
|
||||
+ return NULL;
|
||||
+#else
|
||||
+ return (PGFunction) dld_get_func((funcname));
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+pg_dlclose(void *handle)
|
||||
+{
|
||||
+#ifndef HAVE_DLD_H
|
||||
+#else
|
||||
+ dld_unlink_by_file(handle, 1);
|
||||
+ free(handle);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+char *
|
||||
+pg_dlerror(void)
|
||||
+{
|
||||
+#ifndef HAVE_DLD_H
|
||||
+ return "dynaloader unspported";
|
||||
+#else
|
||||
+ return dld_strerror(dld_errno);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+#endif /* !HAVE_DLOPEN */
|
||||
diff --git a/src/backend/port/dynloader/haiku.h b/src/backend/port/dynloader/haiku.h
|
||||
new file mode 100644
|
||||
index 0000000..974cf4a
|
||||
--- /dev/null
|
||||
+++ b/src/backend/port/dynloader/haiku.h
|
||||
@@ -0,0 +1,44 @@
|
||||
+/*-------------------------------------------------------------------------
|
||||
+ *
|
||||
+ * linux.h
|
||||
+ * Port-specific prototypes for Linux
|
||||
+ *
|
||||
+ *
|
||||
+ * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
|
||||
+ * Portions Copyright (c) 1994, Regents of the University of California
|
||||
+ *
|
||||
+ * src/backend/port/dynloader/haiku.h
|
||||
+ *
|
||||
+ *-------------------------------------------------------------------------
|
||||
+ */
|
||||
+#ifndef PORT_PROTOS_H
|
||||
+#define PORT_PROTOS_H
|
||||
+
|
||||
+#include "utils/dynamic_loader.h" /* pgrminclude ignore */
|
||||
+#ifdef HAVE_DLOPEN
|
||||
+#include <dlfcn.h>
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+#ifdef HAVE_DLOPEN
|
||||
+
|
||||
+/*
|
||||
+ * In some older systems, the RTLD_NOW flag isn't defined and the mode
|
||||
+ * argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
|
||||
+ * if available, but it doesn't exist everywhere.
|
||||
+ * If it doesn't exist, set it to 0 so it has no effect.
|
||||
+ */
|
||||
+#ifndef RTLD_NOW
|
||||
+#define RTLD_NOW 1
|
||||
+#endif
|
||||
+#ifndef RTLD_GLOBAL
|
||||
+#define RTLD_GLOBAL 0
|
||||
+#endif
|
||||
+
|
||||
+#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
|
||||
+#define pg_dlsym dlsym
|
||||
+#define pg_dlclose dlclose
|
||||
+#define pg_dlerror dlerror
|
||||
+#endif /* HAVE_DLOPEN */
|
||||
+
|
||||
+#endif /* PORT_PROTOS_H */
|
||||
diff --git a/src/include/port/haiku.h b/src/include/port/haiku.h
|
||||
new file mode 100644
|
||||
index 0000000..beabea1
|
||||
--- /dev/null
|
||||
+++ b/src/include/port/haiku.h
|
||||
@@ -0,0 +1 @@
|
||||
+/* src/include/port/haiku.h */
|
||||
diff --git a/src/makefiles/Makefile.haiku b/src/makefiles/Makefile.haiku
|
||||
new file mode 100644
|
||||
index 0000000..53780c1
|
||||
--- /dev/null
|
||||
+++ b/src/makefiles/Makefile.haiku
|
||||
@@ -0,0 +1,12 @@
|
||||
+AROPT = cr
|
||||
+export_dynamic = -Wl,-E
|
||||
+# Use --enable-new-dtags to generate DT_RUNPATH instead of DT_RPATH.
|
||||
+# This allows LD_LIBRARY_PATH to still work when needed.
|
||||
+rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags
|
||||
+DLSUFFIX = .so
|
||||
+
|
||||
+CFLAGS_SL = -fpic
|
||||
+
|
||||
+# Rule for building a shared library from a single .o file
|
||||
+%.so: %.o
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $<
|
||||
diff --git a/src/template/haiku b/src/template/haiku
|
||||
new file mode 100644
|
||||
index 0000000..fd1e3dc
|
||||
--- /dev/null
|
||||
+++ b/src/template/haiku
|
||||
@@ -0,0 +1,2 @@
|
||||
+# src/template/haiku
|
||||
+
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
Reference in New Issue
Block a user