Problems building Frotz 2.54 for Mac OS

I’m trying to build Frotz 2.54 on my Mac, but I’m getting this error:

cc -Wall -std=c99 -O3 -g -I/usr/include/ncurses -D_XOPEN_SOURCE_EXTENDED -fPIC -fpic -o ux_text.o -c ux_text.c
ux_text.c:183:22: error: use of undeclared identifier ‘A_ITALIC’
if (termattrs() & A_ITALIC) temp |= A_ITALIC;
^
ux_text.c:183:40: error: use of undeclared identifier ‘A_ITALIC’
if (termattrs() & A_ITALIC) temp |= A_ITALIC;

I’m doing a make clean and then getting that error when I do make

I’m using the master file from: David Griffith / frotz · GitLab

Any ideas?

1 Like

The version of curses on macOS apparently doesn’t support italics via A_ITALIC; you can disable italic support by passing ITALIC= when building, e.g.:

make ITALIC=

This will cause Frotz to use underline instead of italic. Be sure to run make clean first.

Note that this is documented in the INSTALL guide.

For macOS users, Frotz with all three of its user interfaces should compile without any changes to the source code or Makefiles. If you install Xcode from the Mac App Store, you should be able to run “make nosound” to build Frotz. To enable sound support, you can use Homebrew https://brew.sh/ to install the sound support libraries: “brew install libao libmodplug libsamplerate libsndfile libvorbis ncurses” Once the sound libraries are installed, a simple “make” should build Frotz. The ncurses that comes with macOS should not be used as it is extremely old and does not support italic characters. If you insist on using it, make sure you comment out the line in the Makefile that reads “ITALIC ?= yes”.

… but this paragraph seems to contradict itself. You can’t even make nosound to build Frotz if you don’t upgrade ncurses. (ncurses is not a “sound library.”)

EDIT: And the documentation is not even true. I just ran brew install ncurses and make nosound on my machine running macOS Monterey 12.3, but it failed to compile with the same A_ITALIC error.

Apart from these issues, does SDL Frotz compile on macOS?

I didn’t need sound (I’m only testing my own code) and I’m using macOS Catalina, but I built this last week as follows.

Edit makefile and comment out the italic ?= yes line by prefixing it with a # character, then.

make clean
make nosound

Jeremy

There’s a thread about this ^^ here.

I note that on my M1 (ARM) Mac running macOS 12.3 Monterey, I can’t get a full sound-enabled build. Even when I brew install libao libmodplug libsamplerate libsndfile libvorbis ncurses && make clean && make ITALIC=. I get:

ux_audio.c:55:10: fatal error: 'ao/ao.h' file not found

But this doesn’t appear to be a regression from 2.53 (or 2.52, even, which I know I was able to build locally on my x86_64 Mac).

I am able to run make clean && make ITALIC= nosound. But when I make ITALIC= sfrotz, that fails with this error:

sf_ftype.c:31:10: fatal error: 'freetype2/freetype/freetype.h' file not found

… even though I already ran brew install freetype2

:thinking:

Thanks a lot.

I got this working, and installed on my Mac. Looking at the open bug report, I should probably get some new hardware.

This also worked:

make clean
make ITALIC = nosound

I moved and expanded the macOS build info to correct the mistake of listing ncurses as a sound library and be more verbose about using Brew. Could I get someone with a Mac to check things out?

I don’t have Brew installed on my system, only Xcode’s command line tools, so I thought I’d try this.

First off, when I entered this line of code:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It took 10 minutes to install. Not very quick according to the instructions.

Then I did:

brew install ncurses

Then I took a fresh copy of the master folder, and did:

make nosound

I made no changes to the Makefile and I got back this error:

/Library/Developer/CommandLineTools/usr/bin/make -C src/common
make[1]: `frotz_common.a’ is up to date.
/Library/Developer/CommandLineTools/usr/bin/make -C src/curses
cc -Wall -std=c99 -O3 -g -I/usr/include/ncurses -D_XOPEN_SOURCE_EXTENDED -DNO_SOUND -fPIC -fpic -o ux_text.o -c ux_text.c
ux_text.c:183:22: error: use of undeclared identifier ‘A_ITALIC’
if (termattrs() & A_ITALIC) temp |= A_ITALIC;
^
ux_text.c:183:40: error: use of undeclared identifier ‘A_ITALIC’
if (termattrs() & A_ITALIC) temp |= A_ITALIC;
^

That’s the full error, the second time. I am on Big Sur 11.6.5. I hope this helps.

+1, when I brew install ncurses and then make clean && make nosound it crashes with that same error, on macOS 12 Monterey on both ARM and x86_64.

I’ve filed a merge request that seems to fix the macOS build, by assuming that on macOS you either want to use the Homebrew version of ncurses or you want to manually set CURSES_CONFIG=ncurses5.4-config ITALIC=.

I also fixed the SDL build there by “fixing” an #include path.

I note that somebody filed a PR to upgrade Homebrew’s frotz formula a few weeks ago. frotz 2.53 by Bo98 · Pull Request #72530 · Homebrew/homebrew-core · GitHub In that PR, the formula is configured to use macOS’s own ncurses, with ITALIC=.

When 2.54 is released, somebody (maybe me? maybe not?) should remove ITALIC= from the Homebrew formula and configure the formula to depend on Homebrew’s own installation of ncurses.

I did some more checking on ncurses and determined that italic support first appeared in the commit dated 20130831. The first release with this capability was 6.0. So, I was wrong about Apple’s version misidentifying what it can and can’t do. Therefore I think I can add some ifdefs to automatically disable italics if < 6.0 is detected.

I added a simple compile-time check to see if version 6.0 or later of ncurses is being used. If so, the curses interface will use italics. If not, it’ll use underline just as it would if ITALIC_SUPPORT was not defined. Please check. Hopefully this will be the end of macOS ncurses troubles. Nonetheless, I would recommend using Homebrew’s ncurses just because.

I ran through this and had no problems, not even warnings. Very clean.

Works out of the box. Tag it and call it 2.54! (And then somebody gets to update the Homebrew formula…)

BTW, is SDL sfrotz supposed to support italics? (It doesn’t on the latest master commit 9c4f56071. Italicized text is just underlined. I think that’s not a regression, though…?)

sfrotz has never supported italic. I’m going through the source now to figure out how to implement it.

[UPDATE]

It looks like implementing italic for the SDL interface is more than a trivial effort. Therefore I’ll wrap things up for tagging 2.54 and slate italic for the next release.

1 Like