Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 May 2009 20:57:27 -0500 (CDT)
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/134198: build problem with math/octave-forge-engine
Message-ID:  <200905040157.n441vRBi021748@cauchy.math.missouri.edu>
Resent-Message-ID: <200905040200.n44207TA048190@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         134198
>Category:       ports
>Synopsis:       build problem with math/octave-forge-engine
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 04 02:00:07 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Montgomery-Smith
>Release:        FreeBSD 7.1-STABLE i386
>Organization:
>Environment:
FreeBSD laptop3.gateway.2wire.net 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat May  2 15:16:46 CDT 2009     stephen@laptop3.gateway.2wire.net:/usr/obj/usr/src/sys/LAPTOP3  amd64


	
>Description:
The port math/octave-forge-engine seems not to be building on recent versions of FreeBSD current with recent versions of gcc43.

The problem seems to be created in that the source code has a function called getline, which conflicts with the function getline that is now part of FreeBSD and/or gcc43.

>How-To-Repeat:
	
>Fix:

Add a file called something like files/patch-getline, with the following content:

--- src/engGetFull.c.bak	2008-08-24 16:13:55.000000000 +0000
+++ src/engGetFull.c	2009-05-04 01:44:43.000000000 +0000
@@ -30,7 +30,7 @@
     flushjunk();
     sprintf( buf, "exist(\"%s\")\n", name );
     putline( buf );
-    getline( buf );
+    local_getline( buf );
     flushprompt( 0 );
     sscanf( buf, " ans = %d", &i );
 
@@ -39,20 +39,20 @@
       sprintf( buf, "save -ascii \"-\" %s\n", name );
       putline( buf );
 
-      getline( buf );
+      local_getline( buf );
       sscanf( buf, "%c %s %s", &comm, str1, str2 );
       if( comm != '#' )
 	return retval;
       if( !strcmp( "Created", str1 ) )  /* New in Octave 2.0.14 */
       {
-	getline( buf );
+	local_getline( buf );
 	sscanf( buf, "%c %s %s", &comm, str1, str2 );
       }
       if( strcmp( "name:", str1 ) )
  	return retval;
       if( strcmp( name, str2 ) )
  	return retval;
-      getline( buf );
+      local_getline( buf );
       sscanf( buf, "%c %s %s %s", &comm, str1, str2, str3 );
       if( comm != '#' )
 	return retval;
@@ -66,18 +66,18 @@
 	  *n = 1;
 	  *pr = mxCalloc( 1, sizeof( **pr ) );
 	  *pi = mxCalloc( 1, sizeof( **pi ) );
-	  getline( buf );
+	  local_getline( buf );
 	  sscanf( buf, "(%lf,%lf)", &pr[0][0], &pi[0][0] );
 	}
 	else
 	{
 	  if( !strcmp( "matrix", str3 ) )
 	  {
-	    getline( buf );
+	    local_getline( buf );
 	    sscanf( buf, "%c %s %d", &comm, str1, m );
 	    if( strcmp( "rows:", str1 ) )
 	      return retval;
-	    getline( buf );
+	    local_getline( buf );
 	    sscanf( buf, "%c %s %d", &comm, str1, n );
 	    if( strcmp( "columns:", str1 ) )
 	      return retval;
@@ -85,7 +85,7 @@
 	    *pi = mxCalloc( (*m)*(*n), sizeof( **pi ) );
 	    for( i=0; i<*m; i++ )
 	    {
-	      getline( buf );
+	      local_getline( buf );
 	      ptr = strtok( buf, " " );
 	      for( j=0; j<*n; j++ )
 	      {
@@ -106,18 +106,18 @@
 	  *n = 1;
 	  *pr = mxCalloc( 1, sizeof( **pr ) );
 	  *atrix", str2 ) )
 	  {
-	    getline( buf );
+	    local_getline( buf );
 	    sscanf( buf, "%c %s %d", &comm, str1, m );
 	    if( strcmp( "rows:", str1 ) )
 	      return retval;
-	    getline( buf );
+	    local_getline( buf );
 	    sscanf( buf, "%c %s %d", &comm, str1, n );
 	    if( strcmp( "columns:", str1 ) )
 	      return retval;
@@ -125,7 +125,7 @@
 	    *pi = NULL;
 	    for( i=0; i<*m; i++ )
 	    {
-	      getline( buf );
+	      local_getline( buf );
 	      ptr = strtok( buf, " " );
 	      for( j=0; j<*n; j++ )
 	      {
--- src/engif.c.bak	2008-08-24 16:13:55.000000000 +0000
+++ src/engif.c	2009-05-04 01:44:43.000000000 +0000
@@ -78,7 +78,7 @@
 }
 
 
-int getline( char* buf )
+int local_getline( char* buf )
 {
   int i;
 
@@ -95,7 +95,7 @@
   buf[i] = '\0';
 
 #ifdef DEBUGAPI
-  printf( "getline: %s", buf );
+  printf( "local_getline: %s", buf );
 #endif
 
   return 0;
--- src/engif.h.bak	2008-08-24 16:13:55.000000000 +0000
+++ src/engif.h	2009-05-04 01:44:43.000000000 +0000
@@ -1,6 +1,6 @@
 int flushprompt( int outkey );
 int flushjunk( void );
-int getline( char* buf );
+int local_getline( char* buf );
 int putline( char* buf );
 int openpipes( void );
 int closepipes( void );



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905040157.n441vRBi021748>