Commit 8b7ed3cc authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Check for Win32, set OS_WIN32 automake variable. Check for strtok_r.

2003-09-21  Tor Lillqvist  <tml@iki.fi>

	* configure.in: Check for Win32, set OS_WIN32 automake
	variable. Check for strtok_r.

	* Makefile.am: Use -lm only on Unix. Add LIBGSF_LIBS and
	LIBCROCO_LIBS to librsvg_2_la_LIBADD.

	* rsvg-css.c: Use G_PI instead of M_PI.
	(strtok_r): Implement strtok_r here if not available. (Very
	suboptimal implementation.)
parent 19c1587a
2003-09-21 Tor Lillqvist <tml@iki.fi>
* configure.in: Check for Win32, set OS_WIN32 automake
variable. Check for strtok_r.
* Makefile.am: Use -lm only on Unix. Add LIBGSF_LIBS and
LIBCROCO_LIBS to librsvg_2_la_LIBADD.
* rsvg-css.c: Use G_PI instead of M_PI.
(strtok_r): Implement strtok_r here if not available. (Very
suboptimal implementation.)
2003-09-19 Sven Neumann <sven@gimp.org>
* rsvg-file-util.c: implemented missing GError handling for file
......
......@@ -14,6 +14,11 @@ GSFHEADERS =
GSFSOURCES =
endif
if OS_WIN32
else
libm = -lm
endif
EXTRA_DIST =\
COPYING.LIB \
librsvg.spec.in \
......@@ -47,7 +52,7 @@ librsvg_2_la_SOURCES = $(GSFSOURCES) \
rsvg.c
librsvg_2_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined -export-dynamic
librsvg_2_la_LIBADD = $(LIBRSVG_LIBS)
librsvg_2_la_LIBADD = $(LIBRSVG_LIBS) $(LIBGSF_LIBS) $(LIBCROCO_LIBS)
librsvgincdir = $(includedir)/librsvg-2/librsvg
librsvginc_HEADERS = $(GSFHEADERS) \
......@@ -78,17 +83,17 @@ LDADDS =$(LIBGSF_LIBS)\
rsvg_SOURCES=test-rsvg.c
rsvg_LDFLAGS =
rsvg_DEPENDENCIES = $(DEPS)
rsvg_LDADD = $(LDADDS) -lm
rsvg_LDADD = $(LDADDS) $(libm)
test_performance_SOURCES=test-performance.c
test_performance_LDFLAGS =
test_performance_DEPENDENCIES = $(DEPS)
test_performance_LDADD = $(LDADDS) -lm
test_performance_LDADD = $(LDADDS) $(libm)
#test_display_SOURCES=test-display.c
#test_display_LDFLAGS =
#test_display_DEPENDENCIES = $(DEPS)
#test_display_LDADD = $(LDADDS) $(GTK_LIBS) -lm
#test_display_LDADD = $(LDADDS) $(GTK_LIBS) $(libm)
tests: rsvg
......
......@@ -65,6 +65,18 @@ esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
native_win32=yes
;;
*)
native_win32=no
;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
dnl ===========================================================================
PKG_CHECK_MODULES(LIBRSVG, \
......@@ -145,6 +157,10 @@ AC_SUBST(LIBCROCO_LIBS)
dnl ===========================================================================
AC_CHECK_FUNCS(strtok_r)
dnl ===========================================================================
dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
AC_ARG_ENABLE(more-warnings,
......
......@@ -34,15 +34,49 @@
#include <errno.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define POINTS_PER_INCH (72.0)
#define CM_PER_INCH (2.54)
#define MM_PER_INCH (25.4)
#define PICA_PER_INCH (6.0)
#ifndef HAVE_STRTOK_R
static char *
strtok_r(char *s, const char *delim, char **last)
{
char *p;
if (s == NULL)
s = *last;
if (s == NULL)
return NULL;
while (*s && strchr (delim, *s))
s++;
if (*s == '\0') {
*last = NULL;
return NULL;
}
p = s;
while (*p && !strchr (delim, *p))
p++;
if (*p == '\0')
*last = NULL;
else {
*p = '\0';
p++;
*last = p;
}
return s;
}
#endif /* !HAVE_STRTOK_R */
/**
* rsvg_css_parse_vbox
* @vbox: The CSS viewBox
......@@ -511,7 +545,7 @@ rsvg_css_parse_angle (const char * str)
if (end_ptr)
{
if (!strcmp(end_ptr, "rad"))
return degrees * 180. / M_PI;
return degrees * 180. / G_PI;
else if (!strcmp(end_ptr, "grad"))
return degrees * 360. / 400.;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment