From 80cdba4081ce9adc2ec64097ad2c4f7af2245120 Mon Sep 17 00:00:00 2001 From: Thomas Ries Date: Sat, 8 Jan 2005 10:25:52 +0000 Subject: [PATCH] Cygwin build support --- config.h.in | 6 ++++++ configure.in | 6 ++++++ src/rtpproxy_relay.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/config.h.in b/config.h.in index 5bc7ce6..404133a 100644 --- a/config.h.in +++ b/config.h.in @@ -220,6 +220,9 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* target platform */ +#undef UNAME + /* Version number of package */ #undef VERSION @@ -229,6 +232,9 @@ /* building on BSD/OS platform */ #undef _BSDOS +/* building on Cygwin (Windows) platform */ +#undef _CYGWIN + /* building on FreeBSD platform */ #undef _FREEBSD diff --git a/configure.in b/configure.in index ba61a0d..f1f8f5e 100644 --- a/configure.in +++ b/configure.in @@ -31,6 +31,7 @@ dnl 18-Aug-2004 tries fli4l-uclibc -> fli4l-21-uclibc, fli4l-22-uclibc dnl 2.1.x has no pthread support, link -static dnl 2.2.x has (maybe) pthread support dnl 08-Jan-2005 tries FreeBSD: check for libgnugetopt before using it +dnl Cygwin build support dnl dnl @@ -117,6 +118,7 @@ dnl --enable-dmalloc dnl dnl target platform specific stuff dnl +AC_DEFINE_UNQUOTED(UNAME,"$target",[target platform]) AC_MSG_CHECKING(target platform) case "$target" in *-*-linux*) @@ -161,6 +163,10 @@ case "$target" in AC_MSG_RESULT(Mac OS X) AC_DEFINE(_MACOSX,,[building on Mac OSX platform]) ;; + *-*-cygwin*) + AC_MSG_RESULT(Cygwin) + AC_DEFINE(_CYGWIN,,[building on Cygwin (Windows) platform]) + ;; *) AC_MSG_RESULT(Unknown Platform) AC_DEFINE(_UNKNOWN,,[building on unknown platform]) diff --git a/src/rtpproxy_relay.c b/src/rtpproxy_relay.c index 991b899..836b49b 100644 --- a/src/rtpproxy_relay.c +++ b/src/rtpproxy_relay.c @@ -111,12 +111,15 @@ int rtp_relay_init( void ) { int uid,euid; struct sched_param schedparam; +#ifndef _CYGWIN uid=getuid(); euid=geteuid(); DEBUGC(DBCLASS_RTP,"uid=%i, euid=%i", uid, euid); if (uid != euid) seteuid(0); if (geteuid()==0) { +#endif + #if defined(HAVE_SCHED_GET_PRIORITY_MAX) && defined(HAVE_SCHED_GET_PRIORITY_MIN) int pmin, pmax; /* place ourself at 1/3 of the available priority space */ @@ -134,11 +137,13 @@ int rtp_relay_init( void ) { if (sts != 0) { ERROR("pthread_setschedparam failed: %s", strerror(errno)); } +#ifndef _CYGWIN } else { INFO("Unable to use realtime scheduling for RTP proxy"); INFO("You may want to start siproxd as root and switch UID afterwards"); } if (uid != euid) seteuid(euid); +#endif } #endif