Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1363
Modified Files: Make.config Makefile configure.ac lpt.c regex.c zexy.h Added Files: zexyconf.h.in Log Message: moved configuration from compiler-arguments into zexyconf.h only build regex if there is a regex.h in the system
Index: lpt.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/lpt.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** lpt.c 28 Sep 2005 13:05:57 -0000 1.7 --- lpt.c 29 Nov 2005 17:29:04 -0000 1.8 *************** *** 47,56 **** # include <errno.h>
! # ifdef HAVE_PPDEV # include <sys/ioctl.h> # include <linux/ppdev.h> # include <linux/parport.h> # include <fcntl.h> ! # endif /* HAVE_PPDEV */
--- 47,56 ---- # include <errno.h>
! # ifdef HAVE_LINUX_PPDEV_H # include <sys/ioctl.h> # include <linux/ppdev.h> # include <linux/parport.h> # include <fcntl.h> ! # endif /* HAVE_LINUX_PPDEV_H */
*************** *** 113,117 **** unsigned char b = f; #ifdef Z_WANT_LPT ! # ifdef HAVE_PPDEV if (x->device>0){ ioctl (x->device, PPWDATA, &b); --- 113,117 ---- unsigned char b = f; #ifdef Z_WANT_LPT ! # ifdef HAVE_LINUX_PPDEV_H if (x->device>0){ ioctl (x->device, PPWDATA, &b); *************** *** 127,131 **** { unsigned char b = f; ! # ifdef HAVE_PPDEV if (x->device>0){ ioctl (x->device, PPWCONTROL, &b); --- 127,131 ---- { unsigned char b = f; ! # ifdef HAVE_LINUX_PPDEV_H if (x->device>0){ ioctl (x->device, PPWCONTROL, &b); *************** *** 141,145 **** static void lpt_bang(t_lpt *x) { ! # ifdef HAVE_PPDEV if (x->device>0){ unsigned char b=0; --- 141,145 ---- static void lpt_bang(t_lpt *x) { ! # ifdef HAVE_LINUX_PPDEV_H if (x->device>0){ unsigned char b=0; *************** *** 197,201 **** x->port=strtol(devname, 0, 16); if(0==x->port){ ! #ifdef HAVE_PPDEV x->device = open(devname, O_RDWR); if(x->device<=0){ --- 197,201 ---- x->port=strtol(devname, 0, 16); if(0==x->port){ ! #ifdef HAVE_LINUX_PPDEV_H x->device = open(devname, O_RDWR); if(x->device<=0){ *************** *** 209,213 **** } } ! #endif /* HAVE_PPDEV */ } } --- 209,213 ---- } } ! #endif /* HAVE_LINUX_PPDEV_H */ } } *************** *** 261,265 **** { #ifdef Z_WANT_LPT ! # ifdef HAVE_PPDEV if (x->device>0){ ioctl (x->device, PPRELEASE); --- 261,265 ---- { #ifdef Z_WANT_LPT ! # ifdef HAVE_LINUX_PPDEV_H if (x->device>0){ ioctl (x->device, PPRELEASE);
Index: zexy.h =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/zexy.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** zexy.h 14 Nov 2005 23:00:35 -0000 1.10 --- zexy.h 29 Nov 2005 17:29:04 -0000 1.11 *************** *** 40,43 **** --- 40,45 ---- #endif
+ #include "zexyconf.h" + #include "m_pd.h" #include <math.h>
Index: regex.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/regex.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** regex.c 2 Nov 2005 12:36:30 -0000 1.1 --- regex.c 29 Nov 2005 17:29:04 -0000 1.2 *************** *** 17,25 **** #include "zexy.h"
! #include <sys/types.h> ! #include <regex.h> ! #include <string.h>
! #define NUM_REGMATCHES 10
/* --- 17,27 ---- #include "zexy.h"
! #ifdef HAVE_REGEX_H ! # include <sys/types.h> ! # include <regex.h> ! # include <string.h> ! #endif
! # define NUM_REGMATCHES 10
/* *************** *** 36,44 **** { t_object x_obj; ! regex_t *x_regexp; int x_matchnum; } t_regex;
static char*regex_l2s(int *reslen, t_symbol*s, int argc, t_atom*argv) { --- 38,48 ---- { t_object x_obj; ! #ifdef HAVE_REGEX_H regex_t *x_regexp; int x_matchnum; + #endif } t_regex;
+ #ifdef HAVE_REGEX_H static char*regex_l2s(int *reslen, t_symbol*s, int argc, t_atom*argv) { *************** *** 106,112 **** --- 110,118 ---- return result; } + #endif
static void regex_regex(t_regex *x, t_symbol*s, int argc, t_atom*argv) { + #ifdef HAVE_REGEX_H char*result=0; int length=0; *************** *** 138,144 **** --- 144,152 ----
if(result)freebytes(result, length); + #endif } static void regex_symbol(t_regex *x, t_symbol *s, int argc, t_atom*argv) { + #ifdef HAVE_REGEX_H char*teststring=0; int length=0; *************** *** 193,196 **** --- 201,205 ---- freebytes(ap, sizeof(t_atom)*(1+2*num_matches)); } + #endif }
*************** *** 199,209 **** t_regex *x = (t_regex *)pd_new(regex_class);
- x->x_regexp=0; - x->x_matchnum=NUM_REGMATCHES; - outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("regex"));
if(argc)regex_regex(x, gensym(""), argc, argv);
return (x); --- 208,221 ---- t_regex *x = (t_regex *)pd_new(regex_class);
outlet_new(&x->x_obj, 0); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("regex"));
+ #ifdef HAVE_REGEX_H + x->x_regexp=0; + x->x_matchnum=NUM_REGMATCHES; if(argc)regex_regex(x, gensym(""), argc, argv); + #else + error("[regex] non-functional: compiled without regex-support!"); + #endif
return (x); *************** *** 212,215 **** --- 224,228 ---- static void regex_free(t_regex *x) { + #ifdef HAVE_REGEX_H if(x->x_regexp) { regfree(x->x_regexp); *************** *** 217,220 **** --- 230,234 ---- x->x_regexp=0; } + #endif }
Index: Makefile =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 29 Nov 2005 16:30:45 -0000 1.3 --- Makefile 29 Nov 2005 17:29:04 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- ./configure
+ zexyconf.h: zexyconf.h.in configure + ./configure
configure: configure.ac
Index: configure.ac =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/configure.ac,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** configure.ac 19 Nov 2005 16:18:18 -0000 1.10 --- configure.ac 29 Nov 2005 17:29:04 -0000 1.11 *************** *** 1,4 **** dnl Process this file with autoconf to produce a configure script. ! AC_INIT(zexy.c)
LIBNAME=zexy --- 1,5 ---- dnl Process this file with autoconf to produce a configure script. ! AC_INIT([zexy.h]) ! AC_CONFIG_HEADER([zexyconf.h])
LIBNAME=zexy *************** *** 23,28 **** AC_SUBST(LIBNAME)
- - AC_ARG_WITH(pdversion, [ --with-pdversion=<ver> enforce a certain pd-version (e.g. 0.37)]) AC_ARG_WITH(version, [ --with-version=<ver> enforce a certain zexy-version (e.g. 2.0)]) --- 24,27 ---- *************** *** 93,97 **** dnl Checks for header files. AC_HEADER_STDC ! AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h)
dnl Checks for typedefs, structures, and compiler characteristics. --- 92,96 ---- dnl Checks for header files. AC_HEADER_STDC ! AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h regex.h)
dnl Checks for typedefs, structures, and compiler characteristics. *************** *** 373,377 **** fi
! AC_CHECK_HEADER(linux/ppdev.h, [ have_ppdev="yes" ], [ have_ppdev="no" ])
dnl check for LPT --- 372,376 ---- fi
! AC_CHECK_HEADERS(linux/ppdev.h, [ have_ppdev="yes" ], [ have_ppdev="no" ])
dnl check for LPT *************** *** 381,385 **** if test "$enable_lpt" = "yes" then ! DFLAGS="$DFLAGS -DZ_WANT_LPT" echo "yes (forced)" else --- 380,384 ---- if test "$enable_lpt" = "yes" then ! AC_DEFINE([Z_WANT_LPT]) echo "yes (forced)" else *************** *** 397,404 **** if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1 then ! DFLAGS="$DFLAGS -DZ_WANT_LPT" if test "x$have_ppdev" = "xyes" then - DFLAGS="$DFLAGS -DHAVE_PPDEV" echo "yes (with device-support)" else --- 396,402 ---- if $CC $INCLUDES -o conftest.o conftest.c > /dev/null 2>&1 then ! AC_DEFINE([Z_WANT_LPT]) if test "x$have_ppdev" = "xyes" then echo "yes (with device-support)" else
--- NEW FILE: zexyconf.h.in ---
/* Define if you have the <regex.h> header file. */ #undef HAVE_REGEX_H
/* define if you want parallelport-support (direct access to the port address) */ #undef Z_WANT_LPT
/* define if you have the <linux/ppdev.h> header file. * (for parport _device_ support) * you need Z_WANT_LPT for this to have an effect ! */ #undef HAVE_LINUX_PPDEV_H
Index: Make.config =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/Make.config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Make.config 19 Nov 2005 16:18:18 -0000 1.2 --- Make.config 29 Nov 2005 17:29:04 -0000 1.3 *************** *** 7,11 ****
EXT = pd_linux ! DEFS = -DZEXY_LIBRARY -DZ_WANT_LPT -DHAVE_PPDEV IFLAGS = -I.
--- 7,11 ----
EXT = pd_linux ! DEFS = -DZEXY_LIBRARY IFLAGS = -I.