dino-lang / dino

The programming language DINO
GNU General Public License v2.0
71 stars 5 forks source link

Build hints for Mac OS X with MacPorts + candidate fix to DINO/Makefile.am #3

Closed teshields closed 8 years ago

teshields commented 8 years ago

Environment: Mac OS X El Capitan version 10.11.5 (current) Xcode version 7.3.1 (current) MacPorts version 2.3.4 (current) - provides libgmp

Build hints for this environment

MacPorts installs by default into '/opt/local/include' & '/opt/local/lib', so these paths need to be specified as part of the invocation of './configure'. In my particular environment, the MacPorts version of 'libiconv' is installed as a dependency for some other MacPorts package, and the MacPorts version of 'iconv.h' contains some unexplained weirdness that redefines 'iconv_close' as 'libiconv_close' causing unresolved symbol at dynamic load time. Fortunately, there is a compile-time symbol 'LIBICONV_PLUG' that will remove this particular bit of weirdness if defined at compile-time.

Hence, the following options to './configure' are needed In order to successfully configure the DINO distribution in my environment: ./configure CPPFLAGS="-DLIBICONV_PLUG -I/opt/local/include" LDFLAGS="-L/opt/local/lib"

A MacPorts environment without the MacPorts version of 'libiconv' wouldn't need '-DLIBICONV_PLUG'.

Candidate fix for DINO/Makefile.am

Because 'gmp.h' is installed in '/opt/local/include', the Makefile rule to build 'd_genheader.i' in 'DINO/Makefile.am' in the dino-20160402 distribution doesn't find 'gmp.h' because the 'CPPFLAGS' variable isn't included in the compile command argument list.

This may not be the perfect fix, but adding '$(CPPFLAGS)' on line 86 (below) in 'DINO/Makefile.am' works for me: $(CC) @DEFS@ -I$(srcdir) -I. $(CPPFLAGS) $(libdino_la_CFLAGS) $(CFLAGS) -E > d_gen.tmp $(srcdir)/d_gen.c && mv d_gen.tmp $@

vnmakarov commented 8 years ago

Honestly, I did not think about MacPorts. Thank you for pointing the problem out. I'll incorporate your solution and document it.

vnmakarov commented 8 years ago

I've added CPPFLAGS to the Makefile rule and described what configure options to use to build Dino on Macports.