Skip to content
Permalink
Browse files

Fix SunOS 5 gcc and remove SunOS 4 workarounds

Found by: michaelortmann
Patch by: michaelortmann
Fixes: #778
  • Loading branch information...
michaelortmann authored and vanosg committed Jun 29, 2019
1 parent c0e6998 commit ccff3b39a3c42c7fb7c89cefdbf21eaee48f92b1
Showing with 27 additions and 48 deletions.
  1. +14 −27 aclocal.m4
  2. +13 −21 src/modules.c
@@ -555,13 +555,7 @@ AC_DEFUN([EGG_CHECK_MODULE_SUPPORT],
esac
;;
SunOS)
if test `echo "$egg_cv_var_system_release" | cut -d . -f 1` = 5; then
# We've had quite a bit of testing on Solaris.
WEIRD_OS="no"
else
# SunOS 4
AC_DEFINE(DLOPEN_1, 1, [Define if running on SunOS 4.0.])
fi
;;
FreeBSD|OpenBSD|NetBSD|DragonFly)
WEIRD_OS="no"
@@ -651,7 +645,7 @@ AC_DEFUN([EGG_CHECK_OS],
SHLIB_STRIP="$STRIP"
LINUX="no"
IRIX="no"
SUNOS="no"
SUNOS_GCC="no"
HPUX="no"
EGG_CYGWIN="no"

@@ -733,20 +727,13 @@ AC_DEFUN([EGG_CHECK_OS],
AC_DEFINE(STOP_UAC, 1, [Define if running on OSF/1 platform.])
;;
SunOS)
if test `echo "$egg_cv_var_system_release" | cut -d . -f 1` = 5; then
# Solaris
if test -n "$GCC"; then
SHLIB_CC="$CC -fPIC"
SHLIB_LD="$CC -shared"
else
SHLIB_CC="$CC -KPIC"
SHLIB_LD="$CC -G -z text"
fi
if test -n "$GCC"; then
SUNOS_GCC="yes"
SHLIB_CC="$CC -fPIC"
SHLIB_LD="$CC -shared"
else
# SunOS 4
SUNOS="yes"
SHLIB_LD="ld"
SHLIB_CC="$CC -PIC"
SHLIB_CC="$CC -KPIC"
SHLIB_LD="$CC -G -z text"
fi
;;
FreeBSD|OpenBSD|NetBSD)
@@ -825,13 +812,8 @@ AC_DEFUN([EGG_CHECK_LIBS],
)]
)])

if test "$SUNOS" = yes; then
# For suns without yp
AC_CHECK_LIB(dl, main)
else
if test "$HPUX" = yes; then
AC_CHECK_LIB(dld, shl_load)
fi
if test "$HPUX" = yes; then
AC_CHECK_LIB(dld, shl_load)
fi
fi
])
@@ -1056,6 +1038,11 @@ AC_DEFUN([EGG_TCL_TCLCONFIG],
TCL_LIB_SPEC=$(echo $TCL_LIB_SPEC | sed -- 's/-ldl//g')
fi

if test "$SUNOS_GCC" = yes; then
SHLIB_LD=$(echo $SHLIB_LD | sed -- 's/-z text//')
AC_MSG_NOTICE([SunOS found, SHLIB_LD = $SHLIB_LD])
fi

AC_MSG_CHECKING([for Tcl version])
AC_MSG_RESULT([$TCL_PATCHLEVEL])
AC_MSG_CHECKING([for Tcl library flags])
@@ -53,27 +53,19 @@
# endif

# ifdef MOD_USE_DL
# ifdef DLOPEN_1
char *dlerror();
void *dlopen(const char *, int);
int dlclose(void *);
void *dlsym(void *, char *);
# define DLFLAGS 1
# else /* DLOPEN_1 */
# include <dlfcn.h>

# ifndef RTLD_GLOBAL
# define RTLD_GLOBAL 0
# endif
# ifndef RTLD_NOW
# define RTLD_NOW 1
# endif
# ifdef RTLD_LAZY
# define DLFLAGS RTLD_LAZY|RTLD_GLOBAL
# else
# define DLFLAGS RTLD_NOW|RTLD_GLOBAL
# endif
# endif /* DLOPEN_1 */
# include <dlfcn.h>

# ifndef RTLD_GLOBAL
# define RTLD_GLOBAL 0
# endif
# ifndef RTLD_NOW
# define RTLD_NOW 1
# endif
# ifdef RTLD_LAZY
# define DLFLAGS RTLD_LAZY|RTLD_GLOBAL
# else
# define DLFLAGS RTLD_NOW|RTLD_GLOBAL
# endif
# endif /* MOD_USE_DL */
#endif /* !STATIC */

0 comments on commit ccff3b3

Please sign in to comment.
You can’t perform that action at this time.