Hi, since trying to build dependencies for my planned coccinella update, I found that jack is not building on sparc with the system gcc.
appended patch just shuffles the initialization of variables a bit to allow to build with old gcc on sparc. Afterwards tested to build on mips64 too. Note, I don't have a soundcard in both boxes, and no 4.7 or -current box running with a soundcard to actually test whether I broke sth. see attached diff, please test and OK? cheers, Sebastian
? jack-for-sparc.patch Index: Makefile =================================================================== RCS file: /cvs/ports/audio/jack/Makefile,v retrieving revision 1.10 diff -u -r1.10 Makefile --- Makefile 9 Dec 2009 10:15:08 -0000 1.10 +++ Makefile 20 May 2010 10:23:24 -0000 @@ -6,7 +6,7 @@ V = 0.116.1 DISTNAME = jack-audio-connection-kit-${V} -PKGNAME = jack-${V}p3 +PKGNAME = jack-${V}p4 SHARED_LIBS += jack 0.0 # 0.28 SHARED_LIBS += jackserver 0.0 # 0.28 Index: patches/patch-drivers_netjack_net_driver_c =================================================================== RCS file: /cvs/ports/audio/jack/patches/patch-drivers_netjack_net_driver_c,v retrieving revision 1.1 diff -u -r1.1 patch-drivers_netjack_net_driver_c --- patches/patch-drivers_netjack_net_driver_c 11 Jan 2009 10:51:46 -0000 1.1 +++ patches/patch-drivers_netjack_net_driver_c 20 May 2010 10:23:27 -0000 @@ -1,7 +1,53 @@ $OpenBSD: patch-drivers_netjack_net_driver_c,v 1.1 2009/01/11 10:51:46 jakemsr Exp $ ---- drivers/netjack/net_driver.c.orig Sat Dec 6 02:43:36 2008 -+++ drivers/netjack/net_driver.c Fri Dec 19 05:27:28 2008 -@@ -493,7 +493,7 @@ net_driver_write (net_driver_t* driver, jack_nframes_t +--- drivers/netjack/net_driver.c.orig Sat Dec 6 11:43:36 2008 ++++ drivers/netjack/net_driver.c Wed May 19 21:19:00 2010 +@@ -334,14 +334,17 @@ net_driver_null_cycle (net_driver_t* driver, jack_nfra + // TODO: talk to paul about this. + // do i wait here ? + // just sending out a packet marked with junk ? ++ jacknet_packet_header *tx_pkthdr; ++ jacknet_packet_header *rx_pkthdr; ++ int payload_size; + + //int rx_size = get_sample_size(driver->bitdepth) * driver->capture_channels * driver->net_period_down + sizeof(jacknet_packet_header); + int tx_size = get_sample_size(driver->bitdepth) * driver->playback_channels * driver->net_period_up + sizeof(jacknet_packet_header); + unsigned int *packet_buf, *packet_bufX; + + packet_buf = alloca( tx_size); +- jacknet_packet_header *tx_pkthdr = (jacknet_packet_header *)packet_buf; +- jacknet_packet_header *rx_pkthdr = (jacknet_packet_header *)driver->rx_buf; ++ tx_pkthdr = (jacknet_packet_header *)packet_buf; ++ rx_pkthdr = (jacknet_packet_header *)driver->rx_buf; + + //framecnt = rx_pkthdr->framecnt; + +@@ -355,7 +358,7 @@ net_driver_null_cycle (net_driver_t* driver, jack_nfra + tx_pkthdr->framecnt = driver->expected_framecnt; + + // memset 0 the payload. +- int payload_size = get_sample_size(driver->bitdepth) * driver->playback_channels * driver->net_period_up; ++ payload_size = get_sample_size(driver->bitdepth) * driver->playback_channels * driver->net_period_up; + memset(packet_bufX, 0, payload_size); + + packet_header_hton(tx_pkthdr); +@@ -387,6 +390,7 @@ net_driver_read (net_driver_t* driver, jack_nframes_t + { + jack_position_t local_trans_pos; + jack_transport_state_t local_trans_state; ++ jacknet_packet_header *pkthdr; + + unsigned int *packet_buf, *packet_bufX; + +@@ -396,7 +400,7 @@ net_driver_read (net_driver_t* driver, jack_nframes_t + } + packet_buf = driver->rx_buf; + +- jacknet_packet_header *pkthdr = (jacknet_packet_header *)packet_buf; ++ pkthdr = (jacknet_packet_header *)packet_buf; + + packet_bufX = packet_buf + sizeof(jacknet_packet_header) / sizeof(jack_default_audio_sample_t); + +@@ -493,7 +497,7 @@ net_driver_write (net_driver_t* driver, jack_nframes_t { int r; Index: patches/patch-drivers_netjack_netjack_packet_c =================================================================== RCS file: patches/patch-drivers_netjack_netjack_packet_c diff -N patches/patch-drivers_netjack_netjack_packet_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-drivers_netjack_netjack_packet_c 20 May 2010 10:23:27 -0000 @@ -0,0 +1,129 @@ +$OpenBSD$ +--- drivers/netjack/netjack_packet.c.orig Wed May 19 21:19:11 2010 ++++ drivers/netjack/netjack_packet.c Wed May 19 21:32:41 2010 +@@ -672,13 +672,15 @@ packet_cache_find_latency( packet_cache *pcache, jack_ + int + netjack_recvfrom (int sockfd, char *packet_buf, int pkt_size, int flags, struct sockaddr *addr, socklen_t *addr_size, int mtu) + { +- if (pkt_size <= mtu) +- return recvfrom (sockfd, packet_buf, pkt_size, flags, addr, addr_size); +- char *rx_packet = alloca (mtu); +- jacknet_packet_header *pkthdr = (jacknet_packet_header *) rx_packet; ++ char *rx_packet; ++ jacknet_packet_header *pkthdr; + int rcv_len; + jack_nframes_t framecnt; + cache_packet *cpack; ++ if (pkt_size <= mtu) ++ return recvfrom (sockfd, packet_buf, pkt_size, flags, addr, addr_size); ++ rx_packet = alloca (mtu); ++ pkthdr = (jacknet_packet_header *) rx_packet; + do + { + rcv_len = recvfrom (sockfd, rx_packet, mtu, 0, addr, addr_size); +@@ -696,13 +698,16 @@ netjack_recvfrom (int sockfd, char *packet_buf, int pk + int + netjack_recv (int sockfd, char *packet_buf, int pkt_size, int flags, int mtu) + { +- if (pkt_size <= mtu) +- return recv (sockfd, packet_buf, pkt_size, flags); +- char *rx_packet = alloca (mtu); +- jacknet_packet_header *pkthdr = (jacknet_packet_header *) rx_packet; ++ char *rx_packet; ++ jacknet_packet_header *pkthdr; + int rcv_len; + jack_nframes_t framecnt; + cache_packet *cpack; ++ ++ if (pkt_size <= mtu) ++ return recv (sockfd, packet_buf, pkt_size, flags); ++ rx_packet = alloca (mtu); ++ pkthdr = (jacknet_packet_header *) rx_packet; + do + { + rcv_len = recv (sockfd, rx_packet, mtu, flags); +@@ -723,15 +728,18 @@ netjack_sendto (int sockfd, char *packet_buf, int pkt_ + int frag_cnt = 0; + char *tx_packet, *dataX; + jacknet_packet_header *pkthdr; ++ int fragment_payload_size; ++ int err; ++ char *packet_bufX; ++ int last_payload_size; + + tx_packet = alloca (mtu + 10); + dataX = tx_packet + sizeof (jacknet_packet_header); + pkthdr = (jacknet_packet_header *) tx_packet; + +- int fragment_payload_size = mtu - sizeof (jacknet_packet_header); ++ fragment_payload_size = mtu - sizeof (jacknet_packet_header); + + if (pkt_size <= mtu) { +- int err; + pkthdr = (jacknet_packet_header *) packet_buf; + pkthdr->fragment_nr = htonl (0); + err = sendto(sockfd, packet_buf, pkt_size, flags, addr, addr_size); +@@ -742,12 +750,11 @@ netjack_sendto (int sockfd, char *packet_buf, int pkt_ + } + else + { +- int err; + // Copy the packet header to the tx pack first. + memcpy(tx_packet, packet_buf, sizeof (jacknet_packet_header)); + + // Now loop and send all +- char *packet_bufX = packet_buf + sizeof (jacknet_packet_header); ++ packet_bufX = packet_buf + sizeof (jacknet_packet_header); + + while (packet_bufX < (packet_buf + pkt_size - fragment_payload_size)) + { +@@ -757,7 +764,7 @@ netjack_sendto (int sockfd, char *packet_buf, int pkt_ + packet_bufX += fragment_payload_size; + } + +- int last_payload_size = packet_buf + pkt_size - packet_bufX; ++ last_payload_size = packet_buf + pkt_size - packet_bufX; + memcpy (dataX, packet_bufX, last_payload_size); + pkthdr->fragment_nr = htonl (frag_cnt); + //jack_error("last fragment_count = %d, payload_size = %d\n", fragment_count, last_payload_size); +@@ -779,6 +786,7 @@ decode_midi_buffer (uint32_t *buffer_uint32, unsigned + for (i = 0; i < buffer_size_uint32 - 3;) + { + uint32_t payload_size; ++ unsigned int nb_data_quads; + payload_size = buffer_uint32[i]; + payload_size = ntohl (payload_size); + if (payload_size) +@@ -790,7 +798,7 @@ decode_midi_buffer (uint32_t *buffer_uint32, unsigned + jack_midi_event_write (buf, event.time, event.buffer, event.size); + + // skip to the next event +- unsigned int nb_data_quads = (((event.size-1) & ~0x3) >> 2)+1; ++ nb_data_quads = (((event.size-1) & ~0x3) >> 2)+1; + i += 3+nb_data_quads; + } + else +@@ -808,9 +816,12 @@ encode_midi_buffer (uint32_t *buffer_uint32, unsigned + for (i = 0; i < nevents; ++i) + { + jack_midi_event_t event; ++ unsigned int nb_data_quads; ++ unsigned int payload_size; ++ jack_midi_data_t* tmpbuff; + jack_midi_event_get (&event, buf, i); +- unsigned int nb_data_quads = (((event.size - 1) & ~0x3) >> 2) + 1; +- unsigned int payload_size = 3 + nb_data_quads; ++ nb_data_quads = (((event.size - 1) & ~0x3) >> 2) + 1; ++ payload_size = 3 + nb_data_quads; + // only write if we have sufficient space for the event + // otherwise drop it + if (written + payload_size < buffer_size_uint32 - 1) +@@ -824,7 +835,7 @@ encode_midi_buffer (uint32_t *buffer_uint32, unsigned + written++; + + // write data +- jack_midi_data_t* tmpbuff = (jack_midi_data_t*)(&(buffer_uint32[written])); ++ tmpbuff = (jack_midi_data_t*)(&(buffer_uint32[written])); + memcpy (tmpbuff, event.buffer, event.size); + written += nb_data_quads; + } Index: patches/patch-jackd_engine_c =================================================================== RCS file: /cvs/ports/audio/jack/patches/patch-jackd_engine_c,v retrieving revision 1.7 diff -u -r1.7 patch-jackd_engine_c --- patches/patch-jackd_engine_c 9 Dec 2009 10:15:08 -0000 1.7 +++ patches/patch-jackd_engine_c 20 May 2010 10:23:28 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-jackd_engine_c,v 1.7 2009/12/09 10:15:08 jakemsr Exp $ ---- jackd/engine.c.orig Tue Dec 2 08:29:23 2008 -+++ jackd/engine.c Mon Dec 7 22:18:52 2009 +--- jackd/engine.c.orig Tue Dec 2 17:29:23 2008 ++++ jackd/engine.c Wed May 19 21:09:21 2010 @@ -1383,7 +1383,7 @@ handle_external_client_request (jack_engine_t *engine, if ((r = read (client->request_fd, &req, sizeof (req))) < (ssize_t) sizeof (req)) { @@ -24,3 +24,52 @@ } } } +@@ -2422,6 +2426,9 @@ jack_notify_all_port_interested_clients (jack_engine_t + { + JSList *node; + jack_event_t event; ++ jack_client_internal_t* src_client; ++ jack_client_internal_t* dst_client; ++ jack_client_internal_t* client; + + event.type = (connected ? PortConnected : PortDisconnected); + event.x.self_id = a; +@@ -2430,11 +2437,11 @@ jack_notify_all_port_interested_clients (jack_engine_t + /* GRAPH MUST BE LOCKED : see callers of jack_send_connection_notification() + */ + +- jack_client_internal_t* src_client = jack_client_internal_by_id (engine, src); +- jack_client_internal_t* dst_client = jack_client_internal_by_id (engine, dst); ++ src_client = jack_client_internal_by_id (engine, src); ++ dst_client = jack_client_internal_by_id (engine, dst); + + for (node = engine->clients; node; node = jack_slist_next (node)) { +- jack_client_internal_t* client = (jack_client_internal_t*) node->data; ++ client = (jack_client_internal_t*) node->data; + if (src_client != client && dst_client != client && client->control->port_connect_cbset != FALSE) { + + /* one of the ports belong to this client or it has a port connect callback */ +@@ -2448,6 +2455,10 @@ jack_deliver_event (jack_engine_t *engine, jack_client + jack_event_t *event) + { + char status; ++ jack_time_t poll_timeout; ++ int poll_ret; ++ jack_time_t then; ++ jack_time_t now; + + /* caller must hold the graph lock */ + +@@ -2539,10 +2550,8 @@ jack_deliver_event (jack_engine_t *engine, jack_client + struct pollfd pfd[1]; + pfd[0].fd = client->event_fd; + pfd[0].events = POLLERR|POLLIN|POLLHUP|POLLNVAL; +- jack_time_t poll_timeout = JACKD_CLIENT_EVENT_TIMEOUT; +- int poll_ret; +- jack_time_t then = jack_get_microseconds (); +- jack_time_t now; ++ poll_timeout = JACKD_CLIENT_EVENT_TIMEOUT; ++ then = jack_get_microseconds (); + + #ifdef __linux + again: Index: patches/patch-libjack_client_c =================================================================== RCS file: /cvs/ports/audio/jack/patches/patch-libjack_client_c,v retrieving revision 1.4 diff -u -r1.4 patch-libjack_client_c --- patches/patch-libjack_client_c 4 Feb 2009 00:02:16 -0000 1.4 +++ patches/patch-libjack_client_c 20 May 2010 10:23:28 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-libjack_client_c,v 1.4 2009/02/04 00:02:16 merdely Exp $ ---- libjack/client.c.orig Thu Dec 4 03:30:27 2008 -+++ libjack/client.c Tue Feb 3 16:49:16 2009 +--- libjack/client.c.orig Thu Dec 4 11:30:27 2008 ++++ libjack/client.c Wed May 19 20:27:23 2010 @@ -974,10 +974,7 @@ jack_client_open_aux (const char *client_name, } @@ -12,7 +12,18 @@ /* External clients need to know where the tmpdir used for communication with the server lives -@@ -1119,10 +1116,11 @@ jack_client_t* jack_client_open(const char* ext_client +@@ -1110,8 +1107,9 @@ jack_client_open_aux (const char *client_name, + jack_client_t* jack_client_open(const char* ext_client_name, jack_options_t options, jack_status_t* status, ...) + { + va_list ap; ++ jack_client_t* res; + va_start(ap, status); +- jack_client_t* res = jack_client_open_aux(ext_client_name, options, status, ap); ++ res = jack_client_open_aux(ext_client_name, options, status, ap); + va_end(ap); + return res; + } +@@ -1119,10 +1117,11 @@ jack_client_t* jack_client_open(const char* ext_client jack_client_t * jack_client_new (const char *client_name) { @@ -25,3 +36,20 @@ } char * +@@ -1694,6 +1693,7 @@ jack_client_thread_aux (void *arg) + { + jack_client_t *client = (jack_client_t *) arg; + jack_client_control_t *control = client->control; ++ int status; + + pthread_mutex_lock (&client_lock); + client->thread_ok = TRUE; +@@ -1723,7 +1723,7 @@ jack_client_thread_aux (void *arg) + + while (1) { + DEBUG("client calls process()"); +- int status = (client->process (control->nframes, ++ status = (client->process (control->nframes, + client->process_arg) == + control->nframes); + control->state = Finished; Index: patches/patch-libjack_intclient_c =================================================================== RCS file: patches/patch-libjack_intclient_c diff -N patches/patch-libjack_intclient_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-libjack_intclient_c 20 May 2010 10:23:28 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ +--- libjack/intclient.c.orig Wed May 19 20:43:00 2010 ++++ libjack/intclient.c Wed May 19 20:45:49 2010 +@@ -166,8 +166,9 @@ jack_internal_client_load (jack_client_t *client, + jack_status_t *status, ...) + { + va_list ap; ++ jack_intclient_t res; + va_start(ap, status); +- jack_intclient_t res = jack_internal_client_load_aux(client, client_name, options, status, ap); ++ res = jack_internal_client_load_aux(client, client_name, options, status, ap); + va_end(ap); + return res; + } Index: patches/patch-tools_lsp_c =================================================================== RCS file: patches/patch-tools_lsp_c diff -N patches/patch-tools_lsp_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-tools_lsp_c 20 May 2010 10:23:28 -0000 @@ -0,0 +1,20 @@ +$OpenBSD$ +--- tools/lsp.c.orig Wed May 19 21:32:57 2010 ++++ tools/lsp.c Wed May 19 21:35:37 2010 +@@ -139,6 +139,7 @@ main (int argc, char *argv[]) + + for (i = 0; ports[i]; ++i) { + // skip over any that don't match ALL of the strings presented at command line ++ jack_port_t *port; + skip_port = 0; + for(k=optind; k < argc; k++){ + if(strstr(ports[i], argv[k]) == NULL ){ +@@ -149,7 +150,7 @@ main (int argc, char *argv[]) + + printf ("%s\n", ports[i]); + +- jack_port_t *port = jack_port_by_name (client, ports[i]); ++ port = jack_port_by_name (client, ports[i]); + + if (show_aliases) { + int cnt; Index: patches/patch-tools_netsource_c =================================================================== RCS file: patches/patch-tools_netsource_c diff -N patches/patch-tools_netsource_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-tools_netsource_c 20 May 2010 10:23:28 -0000 @@ -0,0 +1,37 @@ +$OpenBSD$ +--- tools/netsource.c.orig Wed May 19 21:35:48 2010 ++++ tools/netsource.c Wed May 19 21:38:07 2010 +@@ -230,6 +230,7 @@ process (jack_nframes_t nframes, void *arg) + + uint32_t *packet_buf, *packet_bufX; + jack_time_t packet_recv_timestamp; ++ jacknet_packet_header *pkthdr; + + if( bitdepth == 1000 ) + net_period = factor; +@@ -243,7 +244,7 @@ process (jack_nframes_t nframes, void *arg) + /* Allocate a buffer where both In and Out Buffer will fit */ + packet_buf = alloca ((rx_bufsize > tx_bufsize) ? rx_bufsize : tx_bufsize); + +- jacknet_packet_header *pkthdr = (jacknet_packet_header *) packet_buf; ++ pkthdr = (jacknet_packet_header *) packet_buf; + + /* + * ok... SEND code first. +@@ -453,6 +454,7 @@ main (int argc, char *argv[]) + extern char *optarg; + extern int optind, optopt; + int errflg=0, c; ++ int rx_bufsize; + + if (argc < 3) + { +@@ -574,7 +576,7 @@ main (int argc, char *argv[]) + else + net_period = ceilf((float) jack_get_buffer_size (client) / (float) factor); + +- int rx_bufsize = get_sample_size (bitdepth) * capture_channels * net_period + sizeof (jacknet_packet_header); ++ rx_bufsize = get_sample_size (bitdepth) * capture_channels * net_period + sizeof (jacknet_packet_header); + global_packcache = packet_cache_new (latency + 50, rx_bufsize, mtu); + + /* tell the JACK server that we are ready to roll */