Skip to content

Commit

Permalink
LibSpiro version 0.4
Browse files Browse the repository at this point in the history
Collective fixes from tagpoint v0.3 (20150131) up to now v0.4 (20150701).
  • Loading branch information
JoesCat committed Jul 1, 2015
1 parent 9845950 commit 044e109
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 54 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Authors:
Raph Levien <raph.levien@gmail.com>
George Williams <gww@silcom.com>
Joe Da Silva, www.joescat.com

Patent Grant and Copyright (C) 2007 Raph Levien

Extra edits, patches, updates... (2013...)
Extra edits, patches, updates... (2013,2014,2015...)
Dave Crossland
Shriramana Sharma
Joe Da Silva
Expand Down
30 changes: 18 additions & 12 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
- 31-Jan-2015
- 2015-Jul-1
* Libspiro Version 0.4.20150701
* Re-edit lib and tests to be more accommodating of older compilers.
* Many changes to call-test.c to run on bigger variety of platforms,
and some minor configure.ac tweaks done to resolve issues #9, #10.
as seen on https://github.com/fontforge/libspiro/issues (closed).
* Added developer/install test for cyclic spiros (without {} or z).
* Verify libspiro output data is correct for test curves {0,1,2,4}.
* User can overide default configure flags with LS_CFLAGS and LS_LIB

- 2015-Jan-31
* Libspiro Version 0.3.20150131
* Allow Libspiro to be included using PKG_CHECK_MODULES().
* Bug fixes in configure.ac m4 calls that caused problems seen in:
Expand All @@ -7,37 +17,33 @@
* Add TaggedSpiroCPsToBezier1() and SpiroCPsToBezier1() for programs
that cannot use TaggedSpiroCPsToBezier0() or SpiroCPsToBezier0().

- 30-Sep-2013
- 2013-Sep-30
* Libspiro Version 0.2.20130930

- 29-Aug-2013
* Optional 'make check' runs 'call-test' to check libspiro functions.
* Minor logic optimizations. Removed global 'n', passed 'n' instead.

- 22-Jul-2013
- 2013-Jul-22
* Use 'make check' to run spiro.c UNIT_TEST internal main() routine.

- 28-Jun-2013
- 2013-Jun-28
* Allow for setting VERBOSE during configure - helps with debugging.
* Allow for setting CHECK_INPUT_FINITENESS during configure - to test
input values for finiteness before doing calculations (optional).
* Pass nmat variable to reduce repeatedly recomputing with count_vec().

- 31-May-2013
- 2013-May-31
* Convert build system to autotools method (configure.ac, Makefile.am).

- 29-May-2013
* Backporting robustness patches from Inkscape.
* Increase Spiro max iterations to 30 after finding convergences of 15.
* If did not converge or encountered non-finite values, do not output
spline. Only good splines will be output.

- 20-Apr-2013
- 2013-Apr-20
* Initial commit to https://github.com/fontforge/libspiro.git
* Add bezctx.md based on http://libspiro.sourceforge.net/bezctx.html

- 08-May-2009
- 2009-May-08
* Add Java implementation.

- 28-Oct-2007
- 2007-Oct-28
* Initial release.
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ pkgconfig_DATA = libspiro.pc

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

AM_CFLAGS = $(WCFLAGS)
AM_LDFLAGS = $(WCFLAGS) -no-undefined --mode=link
AM_CFLAGS = $(WCFLAGS) $(LS_CFLAGS)
AM_LDFLAGS = $(WLSLIB) $(LS_LIB) -no-undefined --mode=link

LIBTOOL_DEPS = @LIBTOOL_DEPS@

Expand Down
29 changes: 23 additions & 6 deletions config.guess
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc.

timestamp='2015-01-01'
timestamp='2015-06-30'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || \
echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
Expand All @@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
# Determine ABI tags.
case "${UNAME_MACHINE_ARCH}" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
Expand All @@ -213,7 +227,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
echo "${machine}-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
Expand Down Expand Up @@ -933,6 +947,9 @@ EOF
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
e2k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
Expand Down Expand Up @@ -1021,7 +1038,7 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
Expand Down
13 changes: 8 additions & 5 deletions config.sub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc.

timestamp='2015-01-01'
timestamp='2015-03-08'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
Expand Down Expand Up @@ -259,7 +259,7 @@ case $basic_machine in
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| e2k | epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
Expand Down Expand Up @@ -381,7 +381,7 @@ case $basic_machine in
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
Expand Down Expand Up @@ -518,6 +518,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-aros
;;
asmjs)
basic_machine=asmjs-unknown
;;
aux)
basic_machine=m68k-apple
os=-aux
Expand Down Expand Up @@ -1373,7 +1376,7 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -aos* | -aros* | -cloudabi* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
Expand Down
47 changes: 42 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.

# Copyright (C) 2013, by Joe Da Silva
# Copyright (C) 2013,2014,2015 by Joe Da Silva

AC_PREREQ([2.61])
#-------------------------------------------
# PackageTimestamp version
m4_define([spiro_package_stamp], [20150131])
m4_define([spiro_package_stamp], [20150701])
#-------------------------------------------
# Making point releases:
# spiro_major_version += 0;
Expand All @@ -21,7 +21,7 @@ m4_define([spiro_package_stamp], [20150131])
# spiro_minor_version = 0;
#
m4_define([spiro_major_version], [0])
m4_define([spiro_minor_version], [3])
m4_define([spiro_minor_version], [4])
m4_define([spiro_version],
[spiro_major_version.spiro_minor_version.spiro_package_stamp])
m4_define([spiro_info],
Expand Down Expand Up @@ -144,8 +144,16 @@ AM_CONDITIONAL([WANTPTHREADS],[test x$havepthreads = xtrue])
# Platform specific stuff ($host)
AC_CANONICAL_HOST

#-------------------------------------------
# Compiler and Linker flags to override auto
# detection and insertion. Use CFLAGS if you
# want to add more in addition to autodetect
AC_ARG_VAR([LS_CFLAGS],[C compiler flags for libspiro, overriding automatic detection])
AC_ARG_VAR([LS_LIB],[Linker flags for libspiro, overriding automatic detection])

#-------------------------------------------
# Check for and add usable compiler warnings
# Skip if replacing with LS_CFLAGS instead.
WCFLAGS=""
AC_LANG_PUSH([C])
AX_CHECK_COMPILE_FLAG([-Wall],[WCFLAGS="$WCFLAGS -Wall"])
Expand All @@ -155,8 +163,30 @@ AX_CHECK_COMPILE_FLAG([-Wbad-function-cast],[WCFLAGS="$WCFLAGS -Wbad-function-ca
AX_CHECK_COMPILE_FLAG([-Wc++-compat],[WCFLAGS="$WCFLAGS -Wc++-compat"])
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes],[WCFLAGS="$WCFLAGS -Wmissing-prototypes"])
AX_CHECK_COMPILE_FLAG([-Wunused],[WCFLAGS="$WCFLAGS -Wunused"])

dnl AX_CHECK_COMPILE_FLAG([-Wconversion],[WCFLAGS="$WCFLAGS -Wconversion"])
dnl AX_CHECK_COMPILE_FLAG([-Wsign-conversion],[WCFLAGS="$WCFLAGS -Wsign-conversion"])
dnl AX_CHECK_COMPILE_FLAG([-Wformat=2],[WCFLAGS="$WCFLAGS -Wformat=2"])
dnl AX_CHECK_COMPILE_FLAG([-Wformat-security],[WCFLAGS="$WCFLAGS -Wformat-security"])
dnl AX_CHECK_COMPILE_FLAG([-fno-common],[WCFLAGS="$WCFLAGS -fno-common"])
dnl AX_CHECK_COMPILE_FLAG([-Wmissing-declarations],[WCFLAGS="$WCFLAGS -Wmissing-declarations"])
dnl AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],[WCFLAGS="$WCFLAGS -Wstrict-prototypes"])
dnl AX_CHECK_COMPILE_FLAG([-fPIC],[WCFLAGS="$WCFLAGS -fPIC"])
dnl AX_CHECK_COMPILE_FLAG([-Wstrict-overflow],[WCFLAGS="$WCFLAGS -Wstrict-overflow"])
dnl AX_CHECK_COMPILE_FLAG([-Wpointer-arith],[WCFLAGS="$WCFLAGS -Wpointer-arith"])
dnl AX_CHECK_COMPILE_FLAG([-Wcast-qual],[WCFLAGS="$WCFLAGS -Wcast-qual"])
dnl AX_CHECK_COMPILE_FLAG([-Wcast-align],[WCFLAGS="$WCFLAGS -Wcast-align"])
dnl AX_CHECK_COMPILE_FLAG([-Wpadded],[WCFLAGS="$WCFLAGS -Wpadded"])
dnl AX_CHECK_COMPILE_FLAG([-Woverlength-strings],[WCFLAGS="$WCFLAGS -Woverlength-strings"])
AC_LANG_POP
AC_SUBST([WCFLAGS])
# Skip if replacing with LS_LIB instead.
WLSLIB=""
if test -z $LS_LIB ; then
WLSLIB="${WCFLAGS}"
fi
if test "${LS_CFLAGS}"x != x; then
WCFLAGS=""
fi

#-------------------------------------------
# Put ifdef wrapper around spiro-config.h so
Expand All @@ -169,6 +199,10 @@ AH_BOTTOM([#endif])
# Pass variables to MAKEFILE.AM
AC_SUBST([HOST],[host])
AC_SUBST([LIBSPIRO_VERSION],[spiro_info])
AC_SUBST([LS_CFLAGS])
AC_SUBST([LS_LIB])
AC_SUBST([WCFLAGS])
AC_SUBST([WLSLIB])

#-------------------------------------------
AC_PROG_LIBTOOL
Expand All @@ -188,8 +222,11 @@ Configuration:
Build code location ${builddir}
Destination prefix ${prefix}
Compiler ${CC}
Config auto options "${WCFLAGS}"
Config auto WCFLAGS "${WCFLAGS}"
Config auto WLSLIB "${WLSLIB}"
Config CFLAGS "${CFLAGS}"
Config LDFLAGS "${LDFLAGS}"
Config LS_CFLAGS "${LS_CFLAGS}"
Config LS_LIB "${LS_LIB}"
])
8 changes: 5 additions & 3 deletions spiro.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,8 @@ static int count_vec(const spiro_seg *s, int nseg)
}

static void
add_mat_line(bandmat *m, double *v,
double derivs[4], double x, double y, int j, int jj, int jinc,
int nmat)
add_mat_line(bandmat *m, double *v,double derivs[4],
double x, double y, int j, int jj, int jinc, int nmat)
{
int joff, k;

Expand Down Expand Up @@ -779,6 +778,9 @@ spiro_iter(spiro_seg *s, bandmat *m, int *perm, double *v, int n, int nmat)
memcpy(v + 2 * nmat, v, sizeof(double) * nmat);
n_invert = 3 * nmat;
j = nmat;
#ifdef VERBOSE
printf("cyclic\n");
#endif
} else {
n_invert = nmat;
j = 0;
Expand Down
5 changes: 4 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DEPS = $(top_builddir)/.libs/libspiro.la
LDADDS = $(top_builddir)/.libs/libspiro.la

# The tests
noinst_PROGRAMS = unit-test call-test0 call-test1 call-test2 call-test3 call-testm
noinst_PROGRAMS = unit-test call-test0 call-test1 call-test2 call-test3 call-test4 call-testm

unit_test_SOURCES = unit-test.c

Expand All @@ -24,6 +24,9 @@ call_test2_LDADD = $(LDADDS)
call_test3_SOURCES = call-test3.c
call_test3_LDADD = $(LDADDS)

call_test4_SOURCES = call-test4.c
call_test4_LDADD = $(LDADDS)

call_testm_SOURCES = call-testm.c
call_testm_LDADD = $(LDADDS)
if WANTPTHREADS
Expand Down

0 comments on commit 044e109

Please sign in to comment.