games/angband fails to find ncursesw headers with the current ports Makefile because it instructs the compiler to look in /usr/local/include/ncurses/ for header files, but the angband code includes ncurses/ as a prefix in the header files for ncurses. This means that it fails to find ncurses, resulting in an empty array in main.c that breaks compilation. Here's the configure output: checking for ncursesw5-config... (cached) true checking for ncurses - wide char support... no *** Could not run ncurses test program, checking why... *** The test program failed to compile or link. See the file config.log for the *** exact error that occured. This usually means ncursesw was incorrectly *** installed or that you have moved ncursesw since it was installed. In the *** latter case, you may want to edit the ncursesw5-config script: *** true checking for mvwaddnwstr... yes checking for use_default_colors... yes checking for can_change_color... yes configure: creating ./config.status config.status: creating mk/buildsys.mk config.status: creating mk/extra.mk config.status: creating mk/sinclude.mk config.status: creating src/autoconf.h Configuration: Install path: /usr/local binary path: /usr/local/bin config path: /usr/local/etc/angband/ lib path: /usr/local/share/angband/ doc path: /usr/local/share/doc/angband/ var path: (not used) (with private save and score files in ~/.angband/Angband/) -- Frontends -- - Curses No; missing libraries [...] Here's the build output: gmake[3]: Entering directory `/usr/ports/games/angband/work/angband-v3.5.0/src' cc -nostdlib -Wl,-r -o angband.o attack.o birth.o cave.o cmd-cave.o cmd-context.o cmd-know.o cmd-misc.o cmd-obj.o cmd-pickup.o cmd-process.o death.o debug.o dungeon.o effects.o files.o game-cmd.o game-event.o generate.o grafmode.o guid.o history.o init.o keymap.o load.o monster/mon-init.o monster/melee1.o monster/melee2.o monster/mon-list.o monster/mon-lore.o monster/mon-make.o monster/mon-msg.o monster/mon-power.o monster/mon-spell.o monster/mon-timed.o monster/mon-util.o object/chest.o object/identify.o object/obj-desc.o object/obj-flag.o object/obj-info.o object/obj-list.o object/obj-make.o object/obj-power.o object/obj-ui.o object/obj-util.o object/pval.o object/randart.o object/slays.o option.o parser.o randname.o pathfind.o prefs.o player/calcs.o player/class.o player/player.o player/race.o player/spell.o player/timed.o player/p-util.o quest.o score.o signals.o save.o savefile.o spells1.o spells2.o squelch.o store.o tables.o target.o trap.o ui.o ui-birth.o ui-event.o ui-knowled ge.o ui-menu.o ui-options.o ui-spell.o util.o variable.o wiz-spoil.o wiz-stats.o wizard.o x-spell.o xtra2.o xtra3.o borg/borg1.o borg/borg2.o borg/borg3.o borg/borg4.o borg/borg5.o borg/borg6.o borg/borg7.o borg/borg8.o borg/borg9.o buildid.o z-bitflag.o z-file.o z-form.o z-msg.o z-quark.o z-queue.o z-rand.o z-set.o z-term.o z-type.o z-util.o z-virt.o z-textblock.o printf "Compiling main.c...\r" gmake[3]: Nothing to be done for `locales'. if cc -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -DHAVE_CONFIG_H -W -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-missing-field-initializers -DBUILD_ID=v3.5.0 -I. -std=c99 -Wdeclaration-after-statement -I/usr/local/include/ncurses -I. -c -o main.o main.c; then \ printf "Successfully compiled main.c.\n"; \ else \ err=$?; printf "Failed to compile main.c!\n"; exit $err; \ fi main.c:64: warning: ISO C forbids empty initializer braces main.c:43: error: zero or negative size array 'modules' LINK angband.o Failed to compile main.c! gmake[3]: *** [main.o] Error 1 Here's the offending section of main.c: /* * List of the available modules in the order they are tried. */ static const struct module modules[] = { #ifdef USE_X11 { "x11", help_x11, init_x11 }, #endif /* USE_X11 */ #ifdef USE_SDL { "sdl", help_sdl, init_sdl }, #endif /* USE_SDL */ #ifdef USE_GCU { "gcu", help_gcu, init_gcu }, #endif /* USE_GCU */ #ifdef USE_TEST { "test", help_test, init_test }, #endif /* !USE_TEST */ #ifdef USE_STATS { "stats", help_stats, init_stats }, #endif /* USE_STATS */ }; None of those macros is defined (USE_GCU is the one for ncurses) so the array is empty and the build fails. Fix: The patch below fixes things for me. How-To-Repeat: Disable SDL and X11 options in games/angband, try to build.
Now that I'm on FreeBSD 10, this failure doesn't seem to be happening any more. I don't readily have a system on 9.x still to test this, but can set up a VM easily enough, if that would help get this fixed more quickly. -- Chris Nehren
angband builds everywhere: http://portsmon.freebsd.org/portoverview.py?category=games&portname=angband&wildcard=