Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#11093 closed defect (fixed)

BUG: calc 2.12.1.5 doesn't build (malloc.h: No such file or directory)

Reported by: vinc17@… Owned by: macports-tickets@…
Priority: High Milestone:
Component: ports Version:
Keywords: Cc: vinc17@… tobypeterson, markd@…
Port:

Description

I get the following error:

gcc  -DCALC_SRC -Wall -W -Wno-comment -O3 -g3     -c -o addop.o addop.c
In file included from zmath.h:43,
                 from qmath.h:36,
                 from cmath.h:36,
                 from value.h:37,
                 from calc.h:37,
                 from addop.c:34:
alloc.h:48:21: error: malloc.h: No such file or directory
make: *** [addop.o] Error 1

Moreover, I assume that the maintainer address @opendarwin.org is out-of-date.

Attachments (2)

patch-Makefile (1.3 KB) - added by vinc17@… 17 years ago.
New files/patch-Makefile that fixes the bug
diff (3.0 KB) - added by vinc17@… 17 years ago.
Patch to upgrade to 2.12.1.8 and add readline support

Download all attachments as: .zip

Change History (15)

Changed 17 years ago by vinc17@…

Attachment: patch-Makefile added

New files/patch-Makefile that fixes the bug

comment:1 Changed 17 years ago by vinc17@…

Hmm... I see that my patch adds a dependency on the cgilib port (which doesn't do the right thing by providing /opt/local/include/malloc.h -- IMHO this file should be in the base or all references to <malloc.h> should be removed).

comment:2 Changed 17 years ago by cssdev

The file malloc.h is not supported in Mac OS X. Source code should use stdlib.h instead.

See TN2071 Porting Command Line Unix Tools to Mac OS X

comment:3 Changed 17 years ago by vinc17@…

I've looked at the source very quickly, and in fact, the Makefile detects if the system provides a malloc.h or not. I don't know why (perhaps an inconsistency in the include paths and the fact that the cgilib port provides a malloc.h), but the test was failing without my patch. Alternatively, one can force HAVE_MALLOC_H to NO in the Makefile.

comment:4 Changed 17 years ago by markd@…

Cc: markd@… added

Version 2.12.1.8 is out. Does that version ahve the same problem?

comment:5 Changed 17 years ago by vinc17@…

No, but it has another problem:

Error: Target com.apple.archive returned: error copying "/opt/local/var/db/dports/build/_Users_vinc17_wd_macosx_dports_math_calc/work/.darwinports.calc.state" to "/opt/local/var/db/dports/build/_Users_vinc17_wd_macosx_dports_math_calc/work/destroot/+STATE": no such file or directory

comment:6 Changed 17 years ago by vinc17@…

Oops, I took the wrong Portfile. 2.12.1.8 has the same problem.

comment:7 Changed 17 years ago by markd@…

Looks like it needs some more patching.

http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/math/calc/files/patch-alloc.h?rev=1.1&content-type=text/plain

Also, from the Makefile:

# For Apple: install fink from http://fink.sourceforge.net # and then do a 'fink install readline' and then use: # #READLINE_LIB= -L/sw/lib -lreadline -lhistory -lncurses

Changed 17 years ago by vinc17@…

Attachment: diff added

Patch to upgrade to 2.12.1.8 and add readline support

comment:8 Changed 17 years ago by pipping@…

Milestone: Available Ports

comment:9 Changed 17 years ago by markd@…

Ok, I committed a fix for cgilib that makes unnecessary the malloc.h dummy file. Does that fix this port or do you think the updates you attached are still necessary?

comment:10 Changed 17 years ago by pipping@…

Milestone: Available PortsPort Bugs

comment:11 Changed 17 years ago by vinc17@…

The part concerning malloc.h is probably no longer necessary (the fact that the configure script detects a malloc.h which then can't be included is an upstream bug -- who knows if a malloc.h is installed somewhere else?), but the part that includes readline is necessary.

comment:12 Changed 17 years ago by markd@…

Resolution: fixed
Status: newclosed

Committed minus the malloc part of the patch. Thanks!

comment:13 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.