util.h \
list.h
-radsecproxy_CFLAGS = -g -Wall -pedantic -pthread @SSL_CFLAGS@
-radsecproxy_LDFLAGS = @SSL_LDFLAGS@
+radsecproxy_CFLAGS = -g -Wall -pedantic -pthread @SSL_CFLAGS@ @TARGET_CFLAGS@
+radsecproxy_LDFLAGS = @SSL_LDFLAGS@ @TARGET_LDFLAGS@
radsecproxy_LDADD = @SSL_LIBS@
dist_sysconf_DATA = $(srcdir)/radsecproxy.conf-example
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_CC_C_O
+dnl Check if we're on Solaris and set CFLAGS accordingly
+AC_CANONICAL_SYSTEM
+case "${target_os}" in
+ solaris*)
+ TARGET_CFLAGS="-DSYS_SOLARIS9 -D_POSIX_PTHREAD_SEMANTICS"
+ TARGET_LDFLAGS="-lsocket"
+ ;;
+ *)
+ TARGET_CFLAGS=""
+ TARGET_LDFLAGS=""
+ esac
+AC_SUBST(TARGET_CFLAGS)
+AC_SUBST(TARGET_LDFLAGS)
AX_CHECK_SSL
AC_OUTPUT(Makefile)
* copyright notice and this permission notice appear in all copies.
*/
+#ifndef SYS_SOLARIS9
#include <stdint.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
* copyright notice and this permission notice appear in all copies.
*/
+#ifndef SYS_SOLARIS9
#include <stdint.h>
+#endif
#define DBG_DBG 8
#define DBG_INFO 16
#include <netdb.h>
#include <string.h>
#include <unistd.h>
+#ifdef SYS_SOLARIS9
+#include <fcntl.h>
+#endif
#include <sys/time.h>
#include <sys/types.h>
#include <arpa/inet.h>
exit(1);
}
+#ifdef SYS_SOLARIS9
+int daemon(int a, int b) {
+ int i;
+
+ if (fork())
+ exit(0);
+
+ setsid();
+
+ for (i = 0; i < 3; i++) {
+ close(i);
+ open("/dev/null", O_RDWR);
+ }
+ return 1;
+}
+#endif
+
int main(int argc, char **argv) {
pthread_t udpserverth, udpaccserverth, udpclient4rdth, udpclient6rdth;
struct list_node *entry;
if (getnameinfo(addr, len, addr_buf[i], sizeof(addr_buf[i]),
NULL, 0, NI_NUMERICHOST)) {
debug(DBG_WARN, "getnameinfo failed");
- return NULL;
+ return return "getnameinfo_failed";
}
return addr_buf[i];
}