*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/linux/Attic/dynloader.c,v 1.1.1.1 1996/07/09 06:21:44 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/linux/Attic/dynloader.c,v 1.2 1997/02/06 08:39:40 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
+#ifdef HAVE_DLD_H
#include <dld.h>
+#endif
#include "postgres.h"
#include "port-protos.h"
#include "utils/elog.h"
void *
pg_dlopen(char *filename)
{
+#ifndef HAVE_DLD_H
+ elog(WARN, "dynamic load not supported");
+ return(NULL);
+#else
static int dl_initialized= 0;
/*
}
return (void *) strdup(filename);
+#endif
}
char *
pg_dlerror()
{
+#ifndef HAVE_DLD_H
+ return("dynaloader unspported");
+#else
return dld_strerror(dld_errno);
+#endif
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: port-protos.h,v 1.1.1.1 1996/07/09 06:21:44 scrappy Exp $
+ * $Id: port-protos.h,v 1.2 1997/02/06 08:39:53 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
/* dynloader.c */
#ifndef LINUX_ELF
+# ifndef HAVE_DLD_H
+#define pg_dlsym(handle, funcname) (NULL)
+# define pg_dlclose(handle) ({})
+# else
#define pg_dlsym(handle, funcname) ((func_ptr) dld_get_func((funcname)))
-#define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
+# define pg_dlclose(handle) ({ dld_unlink_by_file(handle, 1); free(handle); })
+# endif
#else
/* #define pg_dlopen(f) dlopen(f, 1) */
#define pg_dlopen(f) dlopen(f, 2)
fi
done
-for ac_hdr in readline.h history.h
+for ac_hdr in readline.h history.h dld.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h)
-AC_CHECK_HEADERS(readline.h history.h)
+AC_CHECK_HEADERS(readline.h history.h dld.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
/* Set to 1 if you have <history.h> */
#undef HAVE_HISTORY
+/* Set to 1 if you have <dld.h> */
+#undef HAVE_DLD_H
+
/* Set to 1 if you have isinf() */
#undef HAVE_ISINF
*/
# define JMP_BUF
# define USE_POSIX_TIME
-# define NEED_I386_TAS_ASM
-# define HAS_TEST_AND_SET
- typedef unsigned char slock_t;
+# if !defined(PPC)
+# define NEED_I386_TAS_ASM
+# define HAS_TEST_AND_SET
+ typedef unsigned char slock_t;
+# endif
#endif
#if defined(nextstep)