diff options
author | Keith Packard <keithp@keithp.com> | 2011-12-07 12:27:23 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-12-07 12:27:23 -0800 |
commit | 22a666f9952feb7248e9bb2faf777edaaac8175f (patch) | |
tree | 694526af02f12db2bde42917c27deae9b657d803 | |
parent | 3824f558cc2ee051da8314c7bf08b8647b44e84a (diff) | |
parent | e89b0324da89ba5c0ba64af1ef46a12b7f55f879 (diff) |
Merge remote-tracking branch 'alanc/master'
-rw-r--r-- | configure.ac | 44 | ||||
-rw-r--r-- | hw/dmx/config/Makefile.am | 3 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.c | 5 | ||||
-rw-r--r-- | hw/vfb/InitOutput.c | 30 | ||||
-rw-r--r-- | hw/xfree86/loader/loadmod.c | 2 | ||||
-rw-r--r-- | hw/xfree86/xaa/xaaTables.c | 3 | ||||
-rw-r--r-- | hw/xnest/Display.c | 5 | ||||
-rw-r--r-- | hw/xwin/win.h | 4 | ||||
-rw-r--r-- | include/dix-config.h.in | 85 | ||||
-rw-r--r-- | include/dix.h | 2 | ||||
-rw-r--r-- | include/os.h | 8 | ||||
-rw-r--r-- | include/xkb-config.h.in | 3 | ||||
-rw-r--r-- | include/xorg-server.h.in | 21 | ||||
-rw-r--r-- | include/xwin-config.h.in | 3 | ||||
-rw-r--r-- | mi/mibitblt.c | 2 | ||||
-rw-r--r-- | os/Makefile.am | 16 | ||||
-rw-r--r-- | os/access.c | 28 | ||||
-rw-r--r-- | os/connection.c | 6 | ||||
-rw-r--r-- | os/osdep.h | 6 | ||||
-rw-r--r-- | os/strcasecmp.c | 4 | ||||
-rw-r--r-- | os/strcasestr.c | 2 | ||||
-rw-r--r-- | os/strlcpy.c | 2 | ||||
-rw-r--r-- | test/Makefile.am | 28 |
23 files changed, 142 insertions, 170 deletions
diff --git a/configure.ac b/configure.ac index 3d5414f4c..27bf7dbb2 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ dnl an unwitting cast of miscellaneous others dnl dnl Process this file with autoconf to create configure. -AC_PREREQ(2.57) +AC_PREREQ(2.60) AC_INIT([xorg-server], 1.11.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) RELEASE_DATE="2011-11-20" AC_CONFIG_SRCDIR([Makefile.am]) @@ -76,7 +76,6 @@ AC_PROG_LN_S AC_LIBTOOL_WIN32_DLL AC_DISABLE_STATIC AC_PROG_LIBTOOL -AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG AC_PROG_LEX AC_PROG_YACC @@ -213,34 +212,14 @@ AC_CHECK_FUNC([dlopen], [], AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ - strtol getopt getopt_long vsnprintf walkcontext backtrace \ - getisax getzoneid shmctl64 strcasestr ffs vasprintf]) -AC_FUNC_ALLOCA -AC_CHECK_FUNCS([strndup], [HAVE_STRNDUP=yes], [HAVE_STRNDUP=no]) -AM_CONDITIONAL(NEED_STRNDUP, [test x$HAVE_STRNDUP = xno]) -dnl Old HAS_* names used in os/*.c. -AC_CHECK_FUNC([getdtablesize], - AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.])) -AC_CHECK_FUNC([getifaddrs], - AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.])) -AC_CHECK_FUNC([getpeereid], - AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.])) -AC_CHECK_FUNC([getpeerucred], - AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) -AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) -AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) -AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) - -AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) - -dnl Check for mmap support for Xvfb -AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.])) - -dnl Find the math libary +AC_CHECK_FUNCS([backtrace ffs \ + getdtablesize getifaddrs getpeereid getpeerucred getzoneid \ + mmap shmctl64 strncasecmp vasprintf vsnprintf walkcontext]) +AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup]) + +dnl Find the math libary, then check for cbrt function in it. AC_CHECK_LIB(m, sqrt) -AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function])) +AC_CHECK_FUNCS([cbrt]) AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) @@ -1241,13 +1220,6 @@ XKB_LIB='$(top_builddir)/xkb/libxkb.la' XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" -AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, - [Do not have 'strcasecmp'.])) -AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1, - [Do not have 'strncasecmp'.])) -AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1, - [Do not have 'strcasestr'.])) - PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) if test "x$have_libxdmcp" = xyes; then AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am index 75181436e..06588e7a1 100644 --- a/hw/dmx/config/Makefile.am +++ b/hw/dmx/config/Makefile.am @@ -21,10 +21,7 @@ BUILT_SOURCES = parser.c parser.h scanner.c MAINTAINERCLEANFILES = $(BUILT_SOURCES) libdmxconfig_a_SOURCES = $(LIBSRCS) - -if NEED_STRLCAT libdmxconfig_a_SOURCES += $(top_srcdir)/os/strlcpy.c -endif if GLX GLX_DEFS = @GL_CFLAGS@ diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 47a6681c4..ebe4e52ed 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -332,6 +332,11 @@ hostx_set_title (char *title) ephyrTitle = title; } +#ifdef __SUNPRO_C +/* prevent "Function has no return statement" error for x_io_error_handler */ +#pragma does_not_return(exit) +#endif + static int _X_NORETURN x_io_error_handler (Display *dpy) { ErrorF("Lost connection to X server: %s\n", strerror(errno)); diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 3e5d05100..e1af5a471 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -48,12 +48,12 @@ from The Open Group. #include "mipointer.h" #include "micmap.h" #include <sys/types.h> -#ifdef HAS_MMAP +#ifdef HAVE_MMAP #include <sys/mman.h> #ifndef MAP_FILE #define MAP_FILE 0 #endif -#endif /* HAS_MMAP */ +#endif /* HAVE_MMAP */ #include <sys/stat.h> #include <errno.h> #ifndef WIN32 @@ -93,7 +93,7 @@ typedef struct unsigned int lineBias; CloseScreenProcPtr closeScreen; -#ifdef HAS_MMAP +#ifdef HAVE_MMAP int mmap_fd; char mmap_file[MAXPATHLEN]; #endif @@ -114,7 +114,7 @@ static vfbScreenInfo defaultScreenInfo = { .lineBias = VFB_DEFAULT_LINEBIAS, }; static Bool vfbPixmapDepths[33]; -#ifdef HAS_MMAP +#ifdef HAVE_MMAP static char *pfbdir = NULL; #endif typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType; @@ -158,7 +158,7 @@ ddxGiveUp(enum ExitCode error) switch (fbmemtype) { -#ifdef HAS_MMAP +#ifdef HAVE_MMAP case MMAPPED_FILE_FB: for (i = 0; i < vfbNumScreens; i++) { @@ -170,10 +170,10 @@ ddxGiveUp(enum ExitCode error) } } break; -#else /* HAS_MMAP */ +#else /* HAVE_MMAP */ case MMAPPED_FILE_FB: break; -#endif /* HAS_MMAP */ +#endif /* HAVE_MMAP */ #ifdef HAS_SHM case SHARED_MEMORY_FB: @@ -241,7 +241,7 @@ ddxUseMsg(void) ErrorF("-blackpixel n pixel value for black\n"); ErrorF("-whitepixel n pixel value for white\n"); -#ifdef HAS_MMAP +#ifdef HAVE_MMAP ErrorF("-fbdir directory put framebuffers in mmap'ed files in directory\n"); #endif @@ -280,7 +280,9 @@ ddxProcessArgument(int argc, char *argv[], int i) int screenNum; CHECK_FOR_REQUIRED_ARGUMENTS(2); screenNum = atoi(argv[i+1]); - if (screenNum < 0) + /* The protocol only has a CARD8 for number of screens in the + connection setup block, so don't allow more than that. */ + if ((screenNum < 0) || (screenNum >= 255)) { ErrorF("Invalid screen number %d\n", screenNum); UseMsg(); @@ -368,7 +370,7 @@ ddxProcessArgument(int argc, char *argv[], int i) return 2; } -#ifdef HAS_MMAP +#ifdef HAVE_MMAP if (strcmp (argv[i], "-fbdir") == 0) /* -fbdir directory */ { CHECK_FOR_REQUIRED_ARGUMENTS(1); @@ -376,7 +378,7 @@ ddxProcessArgument(int argc, char *argv[], int i) fbmemtype = MMAPPED_FILE_FB; return 2; } -#endif /* HAS_MMAP */ +#endif /* HAVE_MMAP */ #ifdef HAS_SHM if (strcmp (argv[i], "-shmem") == 0) /* -shmem */ @@ -521,7 +523,7 @@ vfbSaveScreen(ScreenPtr pScreen, int on) return TRUE; } -#ifdef HAS_MMAP +#ifdef HAVE_MMAP /* this flushes any changes to the screens out to the mmapped file */ static void @@ -606,7 +608,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb) pvfb->pXWDHeader = NULL; } } -#endif /* HAS_MMAP */ +#endif /* HAVE_MMAP */ #ifdef HAS_SHM @@ -670,7 +672,7 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) pvfb->pXWDHeader = NULL; switch (fbmemtype) { -#ifdef HAS_MMAP +#ifdef HAVE_MMAP case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break; #else case MMAPPED_FILE_FB: break; diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index c697d74ed..5b9f8d1c3 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -911,7 +911,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, goto LoadModule_fail; } ret->handle = LoaderOpen(found, errmaj, errmin); - if (ret->handle < 0) + if (ret->handle == NULL) goto LoadModule_fail; ret->path = strdup(found); diff --git a/hw/xfree86/xaa/xaaTables.c b/hw/xfree86/xaa/xaaTables.c index c7fa28af3..dbeb4a269 100644 --- a/hw/xfree86/xaa/xaaTables.c +++ b/hw/xfree86/xaa/xaaTables.c @@ -1,3 +1,6 @@ +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif #include "xaalocal.h" /* * This is a table of 24-bit values, indexed with an 8-bit byte value, then diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index 7acad755c..3176b60d7 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -55,6 +55,11 @@ Pixmap xnestScreenSaverPixmap; XlibGC xnestBitmapGC; unsigned long xnestEventMask; +#ifdef __SUNPRO_C +/* prevent "Function has no return statement" error for x_io_error_handler */ +#pragma does_not_return(exit) +#endif + static int _X_NORETURN x_io_error_handler (Display *dpy) { ErrorF("Lost connection to X server: %s\n", strerror(errno)); diff --git a/hw/xwin/win.h b/hw/xwin/win.h index e2e946fb5..ac26d0181 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -143,12 +143,12 @@ #undef HANDLE #endif -#ifdef HAS_MMAP +#ifdef HAVE_MMAP #include <sys/mman.h> #ifndef MAP_FILE #define MAP_FILE 0 #endif /* MAP_FILE */ -#endif /* HAS_MMAP */ +#endif /* HAVE_MMAP */ #include <X11/X.h> #include <X11/Xproto.h> diff --git a/include/dix-config.h.in b/include/dix-config.h.in index e1d3a9eaa..3fb641367 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -51,27 +51,9 @@ /* Support XDM-AUTH*-1 */ #undef HASXDMAUTH -/* Define to 1 if you have the `getdtablesize' function. */ -#undef HAS_GETDTABLESIZE - -/* Define to 1 if you have the `getifaddrs' function. */ -#undef HAS_GETIFADDRS - -/* Define to 1 if you have the `getpeereid' function. */ -#undef HAS_GETPEEREID - -/* Define to 1 if you have the `getpeerucred' function. */ -#undef HAS_GETPEERUCRED - -/* Define to 1 if you have the `mmap' function. */ -#undef HAS_MMAP - /* Support SHM */ #undef HAS_SHM -/* Have the 'strlcpy' function */ -#undef HAS_STRLCPY - /* Define to 1 if you have the <asm/mtrr.h> header file. */ #undef HAVE_ASM_MTRR_H @@ -81,7 +63,7 @@ /* Define to 1 if you have the <byteswap.h> header file. */ #undef HAVE_BYTESWAP_H -/* Define to 1 if you have cbrt */ +/* Define to 1 if you have the `cbrt' function. */ #undef HAVE_CBRT /* Define to 1 if you have the <dbm.h> header file. */ @@ -94,23 +76,26 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - /* Have execinfo.h */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `geteuid' function. */ -#undef HAVE_GETEUID +/* Define to 1 if you have the `ffs' function. */ +#undef HAVE_FFS -/* Define to 1 if you have the `getisax' function. */ -#undef HAVE_GETISAX +/* Define to 1 if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + +/* Define to 1 if you have the `getifaddrs' function. */ +#undef HAVE_GETIFADDRS -/* Define to 1 if you have the `getuid' function. */ -#undef HAVE_GETUID +/* Define to 1 if you have the `getpeereid' function. */ +#undef HAVE_GETPEEREID + +/* Define to 1 if you have the `getpeerucred' function. */ +#undef HAVE_GETPEERUCRED /* Define to 1 if you have the `getzoneid' function. */ #undef HAVE_GETZONEID @@ -136,9 +121,6 @@ /* Define to 1 if you have the libdispatch (GCD) available */ #undef HAVE_LIBDISPATCH -/* Define to 1 if you have the `link' function. */ -#undef HAVE_LINK - /* Define to 1 if you have the <linux/agpgart.h> header file. */ #undef HAVE_LINUX_AGPGART_H @@ -148,8 +130,8 @@ /* Define to 1 if you have the <linux/fb.h> header file. */ #undef HAVE_LINUX_FB_H -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP /* Define to 1 if you have the <ndbm.h> header file. */ #undef HAVE_NDBM_H @@ -181,8 +163,20 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strcasestr' function. */ +#undef HAVE_STRCASESTR + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strlcat' function. */ +#undef HAVE_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H @@ -193,12 +187,6 @@ /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - /* Define to 1 if SYSV IPC is available */ #undef HAVE_SYSV_IPC @@ -234,9 +222,6 @@ /* Have /dev/urandom */ #undef HAVE_URANDOM -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF @@ -432,18 +417,6 @@ /* Define to 64-bit byteswap macro */ #undef bswap_64 -/* Need the strcasecmp function. */ -#undef NEED_STRCASECMP - -/* Need the strncasecmp function. */ -#undef NEED_STRNCASECMP - -/* Need the strcasestr function. */ -#undef NEED_STRCASESTR - -/* Define to 1 if you have the `ffs' function. */ -#undef HAVE_FFS - /* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ #undef TLS diff --git a/include/dix.h b/include/dix.h index 34661f3b6..f98c87b04 100644 --- a/include/dix.h +++ b/include/dix.h @@ -529,7 +529,9 @@ extern _X_EXPORT void ScreenRestructured (ScreenPtr pScreen); #endif +#ifndef HAVE_FFS extern _X_EXPORT int ffs(int i); +#endif /* diff --git a/include/os.h b/include/os.h index 22983814b..1fd5367c4 100644 --- a/include/os.h +++ b/include/os.h @@ -472,22 +472,22 @@ extern _X_EXPORT void ddxGiveUp(enum ExitCode error); extern _X_EXPORT int TimeSinceLastInputEvent(void); /* strcasecmp.c */ -#if NEED_STRCASECMP +#ifndef HAVE_STRCASECMP #define strcasecmp xstrcasecmp extern _X_EXPORT int xstrcasecmp(const char *s1, const char *s2); #endif -#if NEED_STRNCASECMP +#ifndef HAVE_STRNCASECMP #define strncasecmp xstrncasecmp extern _X_EXPORT int xstrncasecmp(const char *s1, const char *s2, size_t n); #endif -#if NEED_STRCASESTR +#ifndef HAVE_STRCASESTR #define strcasestr xstrcasestr extern _X_EXPORT char *xstrcasestr(const char *s, const char *find); #endif -#ifndef HAS_STRLCPY +#ifndef HAVE_STRLCPY extern _X_EXPORT size_t strlcpy(char *dst, const char *src, size_t siz); extern _X_EXPORT size_t strlcat(char *dst, const char *src, size_t siz); #endif diff --git a/include/xkb-config.h.in b/include/xkb-config.h.in index d3cdd1916..7b6a671b8 100644 --- a/include/xkb-config.h.in +++ b/include/xkb-config.h.in @@ -29,7 +29,4 @@ /* XKB output dir for compiled keymaps. */ #undef XKM_OUTPUT_DIR -/* Do not have `strcasecmp'. */ -#undef NEED_STRCASECMP - #endif /* _XKB_CONFIG_H_ */ diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index b10b9949e..8086f32ae 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -37,6 +37,27 @@ /* Support SHM */ #undef HAS_SHM +/* Define to 1 if you have the `ffs' function. */ +#undef HAVE_FFS + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strcasestr' function. */ +#undef HAVE_STRCASESTR + +/* Define to 1 if you have the `strlcat' function. */ +#undef HAVE_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strndup' function. */ +#undef HAVE_STRNDUP + /* Support IPv6 for TCP connections */ #undef IPv6 diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in index 13b51ca7f..8122f5543 100644 --- a/include/xwin-config.h.in +++ b/include/xwin-config.h.in @@ -20,9 +20,6 @@ /* Define to 1 if unsigned long is 64 bits. */ #undef _XSERVER64 -/* Do we require our own snprintf? */ -#undef NEED_SNPRINTF - /* Short vendor name */ #undef XVENDORNAMESHORT diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 49e17bde6..2dfff1451 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -63,7 +63,7 @@ SOFTWARE. #include <X11/Xmd.h> #include "servermd.h" -#ifndef HAS_FFS +#ifndef HAVE_FFS extern int ffs(int); #endif diff --git a/os/Makefile.am b/os/Makefile.am index 8dd809531..88914852f 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -4,7 +4,6 @@ AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c -STRLCAT_SRCS = strlcat.c strlcpy.c XORG_SRCS = log.c libos_la_SOURCES = \ @@ -20,14 +19,12 @@ libos_la_SOURCES = \ osdep.h \ osinit.c \ utils.c \ - strcasecmp.c \ - strcasestr.c \ xdmauth.c \ xsha1.c \ xstrans.c \ xprintf.c \ $(XORG_SRCS) -libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) +libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) $(LTLIBOBJS) if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) @@ -37,16 +34,7 @@ if XDMCP libos_la_SOURCES += $(XDMCP_SRCS) endif -if NEED_STRLCAT -libos_la_SOURCES += $(STRLCAT_SRCS) -endif - -if NEED_STRNDUP -libos_la_SOURCES += $(STRNDUP_SRCS) -endif - -EXTRA_DIST = $(SECURERPC_SRCS) $(INTERNALMALLOC_SRCS) \ - $(XDMCP_SRCS) $(STRLCAT_SRCS) +EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS) if SPECIAL_DTRACE_OBJECTS # Generate dtrace object code for probes in libos & libdix diff --git a/os/access.c b/os/access.c index 159894007..0800c7f73 100644 --- a/os/access.c +++ b/os/access.c @@ -106,7 +106,7 @@ SOFTWARE. #include <netinet/in.h> #endif /* TCPCONN || STREAMSCONN */ -#ifdef HAS_GETPEERUCRED +#ifdef HAVE_GETPEERUCRED # include <ucred.h> # ifdef sun # include <zone.h> @@ -146,7 +146,7 @@ SOFTWARE. #endif #endif -#ifdef HAS_GETIFADDRS +#ifdef HAVE_GETIFADDRS #include <ifaddrs.h> #endif @@ -495,7 +495,7 @@ in6_fillscopeid(struct sockaddr_in6 *sin6) void DefineSelf (int fd) { -#ifndef HAS_GETIFADDRS +#ifndef HAVE_GETIFADDRS char *cp, *cplim; # ifdef USE_SIOCGLIFCONF struct sockaddr_storage buf[16]; @@ -510,7 +510,7 @@ DefineSelf (int fd) register struct ifreq *ifr; # endif void * bufptr = buf; -#else /* HAS_GETIFADDRS */ +#else /* HAVE_GETIFADDRS */ struct ifaddrs * ifap, *ifr; #endif int len; @@ -518,7 +518,7 @@ DefineSelf (int fd) int family; register HOST *host; -#ifndef HAS_GETIFADDRS +#ifndef HAVE_GETIFADDRS len = sizeof(buf); @@ -689,7 +689,7 @@ DefineSelf (int fd) } if (bufptr != buf) free(bufptr); -#else /* HAS_GETIFADDRS */ +#else /* HAVE_GETIFADDRS */ if (getifaddrs(&ifap) < 0) { ErrorF("Warning: getifaddrs returns %s\n", strerror(errno)); return; @@ -777,7 +777,7 @@ DefineSelf (int fd) } /* for */ freeifaddrs(ifap); -#endif /* HAS_GETIFADDRS */ +#endif /* HAVE_GETIFADDRS */ /* * add something of FamilyLocalHost @@ -798,7 +798,7 @@ DefineSelf (int fd) } } } -#endif /* hpux && !HAS_IFREQ */ +#endif /* hpux && !HAVE_IFREQ */ #ifdef XDMCP void @@ -1091,14 +1091,14 @@ LocalClientCred(ClientPtr client, int *pUid, int *pGid) int GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp) { -#if defined(HAS_GETPEEREID) || defined(HAS_GETPEERUCRED) || defined(SO_PEERCRED) +#if defined(HAVE_GETPEEREID) || defined(HAVE_GETPEERUCRED) || defined(SO_PEERCRED) int fd; XtransConnInfo ci; LocalClientCredRec *lcc; -#ifdef HAS_GETPEEREID +#ifdef HAVE_GETPEEREID uid_t uid; gid_t gid; -#elif defined(HAS_GETPEERUCRED) +#elif defined(HAVE_GETPEERUCRED) ucred_t *peercred = NULL; const gid_t *gids; #elif defined(SO_PEERCRED) @@ -1109,7 +1109,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp) if (client == NULL) return -1; ci = ((OsCommPtr)client->osPrivate)->trans_conn; -#if !(defined(sun) && defined(HAS_GETPEERUCRED)) +#if !(defined(sun) && defined(HAVE_GETPEERUCRED)) /* Most implementations can only determine peer credentials for Unix * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not @@ -1125,7 +1125,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp) lcc = *lccp; fd = _XSERVTransGetConnectionNumber(ci); -#ifdef HAS_GETPEEREID +#ifdef HAVE_GETPEEREID if (getpeereid(fd, &uid, &gid) == -1) { FreeLocalClientCreds(lcc); return -1; @@ -1134,7 +1134,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp) lcc->egid = gid; lcc->fieldsSet = LCC_UID_SET | LCC_GID_SET; return 0; -#elif defined(HAS_GETPEERUCRED) +#elif defined(HAVE_GETPEERUCRED) if (getpeerucred(fd, &peercred) < 0) { FreeLocalClientCreds(lcc); return -1; diff --git a/os/connection.c b/os/connection.c index c5fc5a07e..6f480deb6 100644 --- a/os/connection.c +++ b/os/connection.c @@ -114,7 +114,7 @@ SOFTWARE. #define Pid_t pid_t -#ifdef HAS_GETPEERUCRED +#ifdef HAVE_GETPEERUCRED # include <ucred.h> # include <zone.h> #endif @@ -122,7 +122,7 @@ SOFTWARE. #ifdef XSERVER_DTRACE # include <sys/types.h> typedef const char *string; -# ifndef HAS_GETPEERUCRED +# ifndef HAVE_GETPEERUCRED # define zoneid_t int # endif # include "../dix/Xserver-dtrace.h" @@ -282,7 +282,7 @@ InitConnectionLimits(void) lastfdesc = sysconf(_SC_OPEN_MAX) - 1; #endif -#ifdef HAS_GETDTABLESIZE +#ifdef HAVE_GETDTABLESIZE if (lastfdesc < 0) lastfdesc = getdtablesize() - 1; #endif diff --git a/os/osdep.h b/os/osdep.h index 087e36d06..72bd7d762 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -103,12 +103,6 @@ SOFTWARE. /* MAXSELECT is the number of fds that select() can handle */ #define MAXSELECT (sizeof(fd_set) * NBBY) -#ifndef HAS_GETDTABLESIZE -#if !defined(SVR4) && !defined(SYSV) -#define HAS_GETDTABLESIZE -#endif -#endif - #include <stddef.h> #if defined(XDMCP) || defined(HASXDMAUTH) diff --git a/os/strcasecmp.c b/os/strcasecmp.c index ad6da6a10..cf100baf4 100644 --- a/os/strcasecmp.c +++ b/os/strcasecmp.c @@ -34,7 +34,7 @@ #include <ctype.h> #include "dix.h" -#ifdef NEED_STRCASECMP +#ifndef HAVE_STRCASECMP int xstrcasecmp(const char *str1, const char *str2) { @@ -50,7 +50,7 @@ xstrcasecmp(const char *str1, const char *str2) } #endif -#ifdef NEED_STRNCASECMP +#ifndef HAVE_STRNCASECMP int xstrncasecmp(const char *s1, const char *s2, size_t n) { diff --git a/os/strcasestr.c b/os/strcasestr.c index f89b2f2dc..a20a6cc33 100644 --- a/os/strcasestr.c +++ b/os/strcasestr.c @@ -41,7 +41,7 @@ /* * Find the first occurrence of find in s, ignore case. */ -#ifdef NEED_STRCASESTR +#ifndef HAVE_STRCASESTR char * xstrcasestr(const char *s, const char *find) { diff --git a/os/strlcpy.c b/os/strlcpy.c index 2e55b2e63..7ffb64cd6 100644 --- a/os/strlcpy.c +++ b/os/strlcpy.c @@ -22,6 +22,7 @@ #include <string.h> #include "os.h" +#ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -52,3 +53,4 @@ strlcpy(char *dst, const char *src, size_t siz) return s - src - 1; /* count does not include NUL */ } +#endif diff --git a/test/Makefile.am b/test/Makefile.am index 62c398c18..48393d39a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,21 +1,32 @@ if ENABLE_UNIT_TESTS -SUBDIRS= . xi2 -noinst_PROGRAMS = xkb input xtest list misc fixes xfree86 string +SUBDIRS= . +noinst_PROGRAMS = list string +if XORG +# Tests that require at least some DDX functions in order to fully link +# For now, requires xf86 ddx, could be adjusted to use another +SUBDIRS += xi2 +noinst_PROGRAMS += xkb input xtest misc fixes xfree86 +endif check_LTLIBRARIES = libxservertest.la TESTS=$(noinst_PROGRAMS) TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ -INCLUDES = $(XORG_INCS) -I$(top_srcdir)/hw/xfree86/parser \ - -I$(top_srcdir)/miext/cw -I$(top_srcdir)/hw/xfree86/ddc \ +INCLUDES = $(XORG_INCS) -I$(top_srcdir)/miext/cw +if XORG +INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ + -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -I$(top_srcdir)/hw/xfree86/ramdac +endif TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +if XORG if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif +endif xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) @@ -25,9 +36,10 @@ misc_LDADD=$(TEST_LDADD) fixes_LDADD=$(TEST_LDADD) xfree86_LDADD=$(TEST_LDADD) +libxservertest_la_LIBADD = $(XSERVER_LIBS) +if XORG nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c -libxservertest_la_LIBADD = \ - $(XSERVER_LIBS) \ +libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ $(top_builddir)/hw/xfree86/common/libcommon.la \ @@ -37,7 +49,9 @@ libxservertest_la_LIBADD = \ $(top_builddir)/hw/xfree86/ramdac/libramdac.la \ $(top_builddir)/hw/xfree86/ddc/libddc.la \ $(top_builddir)/hw/xfree86/i2c/libi2c.la \ - $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ + $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la +endif +libxservertest_la_LIBADD += \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la \ @XORG_LIBS@ |