LIBS="$LIBS $LEXLIB"
fi
+# Test for Windows vs. Unix
+case "${host}" in
+ *mingw32*) WIN32="yes" ;;
+ *) WIN32="no" ;;
+esac
+if test "$WIN32" = yes; then
+ ac_default_prefix="/"
+fi
+AM_CONDITIONAL([WIN32], test "$WIN32" = "yes")
+
AC_MSG_RESULT(LIBS = $LIBS)
AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile])
AC_OUTPUT
#include "rsl.h"
#include <stdlib.h>
+#include <limits.h>
void print_link_list(Azimuth_hash *list)
{
if (list == NULL) {
float random_azim(void)
{
- double drand;
- drand = drand48()*1;
- return (float)drand;
+ return (float)rand() / INT_MAX;
}
Sweep *permute_sweep(Sweep *sweep)
$(include_HEADERS)
librsl_la_LDFLAGS = -version-info 1:42
-librsl_la_CPPFLAGS = -DDATADIR="\"$(datadir)/rsl\""
+librsl_la_CPPFLAGS = -DDATADIRRSL="\"$(dots)$(datadir)/rsl\""
librsl_la_SOURCES = \
rapic_parse.y rapic_scan.l rapic_to_radar.c rapic_routines.c \
radtec.c radtec_to_radar.c \
radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
+if WIN32
+librsl_la_LDFLAGS += -mwindows -no-undefined
+librsl_la_LIBADD = -lws2_32
+dots = ..
+endif
+
# This should be speciifc to rapic,
# but I'm not sure how to do that with autofoo
AM_LFLAGS = -P rapic
#include <stdio.h>
#include <stdlib.h>
-#include <netinet/in.h>
#include <string.h>
#include "dorade.h"
+#ifndef WIN32
+#include <netinet/in.h>
+#else
+#include "win32compat.h"
+#endif
int dorade_verbose = 0;
#include <string.h>
#define _USE_BSD
#include <sys/types.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
#include <signal.h>
+#include "win32compat.h"
/* Prototype definitions within this file. */
int no_command (char *cmd);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "lassen.h"
+#ifndef WIN32
#include <rpc/rpc.h>
#include <netinet/in.h>
-#include "lassen.h"
+#else
+#include "win32compat.h"
+#endif
/* xdr_destroy is broken on HPUX, SGI, and SUN; Linux, the only working one? */
/* This broken behavior could be from old xdr versions, too. */
#include "rsl.h"
#include "rainbow.h"
+#include "win32compat.h"
+
static int get_param_int(char *buf)
{
/* Returns an integer parameter from a header line. */
fprintf(stderr, ">\n");
return 1;
}
-
-int rapicwrap(char *s)
-{
- yywrap(s);
- return 1;
-}
#include <stdio.h>
#include "rapic_routines.h"
#include <string.h>
-
+#ifndef WIN32
#include <netinet/in.h>
+#else
+#include "win32compat.h"
+#endif
+
void rapic_decode(unsigned char *inbuf, int inbytes, unsigned char *outbuf, int *outbytes,
float *azim, float *elev, int *delta_time)
{
%option nounput
%option noinput
+%option noyywrap
%x ATMODE
%%
/* so you shouldn't have to modify anything here. */
/**********************************************************************/
#ifndef COLORDIR
-#define COLORDIR DATADIR "/colors"
+#define COLORDIR DATADIRRSL "/colors"
#endif
/* These are the color table indexes. See RSL_set/get_color_table. */
--- /dev/null
+#ifdef WIN32
+#include <windows.h>
+#include <winsock2.h>
+
+typedef int bool_t;
+typedef unsigned char uchar_t;
+typedef unsigned short ushort_t;
+typedef unsigned int uint_t;
+
+typedef struct {} XDR;
+
+enum xdr_op { XDR_ENCODE = 0, XDR_DECODE = 1, XDR_FREE = 2 };
+
+static inline bool_t unimp(char *what)
+{
+ printf("%s not supported in win32\n", what);
+ exit(-1);
+ return FALSE;
+}
+
+static inline void xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op) { unimp("xdr"); }
+static inline void xdr_destroy(XDR *xdrs) { unimp("xdr"); }
+static inline bool_t xdr_u_char (XDR *xdrs, uchar_t *ucp) { return unimp("xdr"); }
+static inline bool_t xdr_bytes (XDR *xdrs, char **sp, uint_t *s, uint_t m) { return unimp("xdr"); }
+static inline bool_t xdr_int (XDR *xdrs, int *ip) { return unimp("xdr"); }
+static inline bool_t xdr_string (XDR *xdrs, char **sp, uint_t maxsize) { return unimp("xdr"); }
+static inline bool_t xdr_u_short(XDR *xdrs, ushort_t *usp) { return unimp("xdr"); }
+static inline bool_t xdr_short (XDR *xdrs, short *sp) { return unimp("xdr"); }
+static inline bool_t xdr_u_int (XDR *xdrs, uint_t *up) { return unimp("xdr"); }
+
+static inline pid_t fork(void) { return unimp("fork"); }
+
+static inline char *index(const char *s, int c)
+{
+ while (*s != c && *s != '\0')
+ s++;
+ return *s == '\0' ? NULL : (char*)s;
+}
+#endif
* The directory should be the same as the LIBDIR in the makefile.
*/
#ifndef WSR88D_SITE_INFO_FILE
-#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
+#define WSR88D_SITE_INFO_FILE DATADIRRSL "/wsr88d_locations.dat"
#endif
/*===============================================================*/
typedef struct {