From: Marc G. Fournier Date: Thu, 6 Feb 1997 08:40:16 +0000 (+0000) Subject: Various changes to improve/support Mklinux X-Git-Tag: REL9_0_0~29278 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2c9dbc57e597ccf7d1e6b3d0291bda9e9517f522;p=pg-rex%2Fsyncrep.git Various changes to improve/support Mklinux Submitted by: Tatsuo Ishii --- diff --git a/src/backend/port/linux/dynloader.c b/src/backend/port/linux/dynloader.c index ebf0625dd7..a3b551b6f9 100644 --- a/src/backend/port/linux/dynloader.c +++ b/src/backend/port/linux/dynloader.c @@ -10,12 +10,14 @@ * * * 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 +#ifdef HAVE_DLD_H #include +#endif #include "postgres.h" #include "port-protos.h" #include "utils/elog.h" @@ -26,6 +28,10 @@ extern char pg_pathname[]; void * pg_dlopen(char *filename) { +#ifndef HAVE_DLD_H + elog(WARN, "dynamic load not supported"); + return(NULL); +#else static int dl_initialized= 0; /* @@ -84,10 +90,15 @@ pg_dlopen(char *filename) } return (void *) strdup(filename); +#endif } char * pg_dlerror() { +#ifndef HAVE_DLD_H + return("dynaloader unspported"); +#else return dld_strerror(dld_errno); +#endif } diff --git a/src/backend/port/linux/port-protos.h b/src/backend/port/linux/port-protos.h index f80cd62d42..76f02b48fe 100644 --- a/src/backend/port/linux/port-protos.h +++ b/src/backend/port/linux/port-protos.h @@ -6,7 +6,7 @@ * * 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 $ * *------------------------------------------------------------------------- */ @@ -22,8 +22,13 @@ /* 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) diff --git a/src/configure b/src/configure index 6496662e41..2e65a09bde 100755 --- a/src/configure +++ b/src/configure @@ -2255,7 +2255,7 @@ else 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 diff --git a/src/configure.in b/src/configure.in index bc8184a5e5..782c6aa131 100644 --- a/src/configure.in +++ b/src/configure.in @@ -120,7 +120,7 @@ dnl Checks for header files. 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 diff --git a/src/include/config.h.in b/src/include/config.h.in index 8167e59775..add6142b97 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -32,6 +32,9 @@ /* Set to 1 if you have */ #undef HAVE_HISTORY +/* Set to 1 if you have */ +#undef HAVE_DLD_H + /* Set to 1 if you have isinf() */ #undef HAVE_ISINF @@ -162,9 +165,11 @@ */ # 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)