#! /usr/bin/perl
###############################################################################
#                               makeconfig
###############################################################################
#  Generate config.h.
#
#  Our arguments tell what to put in it.
###############################################################################

use strict;
use warnings;
use English;

my $TRUE=1; my $FALSE = 0;

###############################################################################
#                             MAINLINE
###############################################################################

my $panels;
my $menus;
my $forms;

while (@ARGV) {
    my $arg = shift;

    $arg eq 'PANELS' and ++$panels and next;
    $arg eq 'MENUS'  and ++$menus  and next;
    $arg eq 'FORMS'  and ++$forms  and next;
    Usage("Unknown argument: '$arg'");
}

print <<'EOHDR';
/*============================================================================
                                config.h
==============================================================================

  This file defines C macros that tell how the user has configured the build.

  ==> This file was automatically generated by a make rule; changes will be
  ==> lost when 'make clean' runs.

  If you need to edit this file because 'testsyms' didn't do a good job, be
  sure to save a copy of your changes.

  The "define"s below are simply educated guesses.  If you are having problems
  compiling, check the appropriate symbol to see if it was set correctly: For
  each line, if the answer to the question is "no", that line should start
  with "#undef"; if the answer is yes, it should start with "#define".
=============================================================================*/

EOHDR



print($panels ? "#define " : "#undef  ",
      "C_PANELFUNCTION         ",
      "/* Include panel library function?            */",
      "\n\n");

print($menus ? "#define " : "#undef  ",
      "C_MENUFUNCTION          ",
      "/* Include menu library function?             */",
      "\n\n");

print($forms ? "#define " : "#undef  ",
      "C_FORMFUNCTION          ",
      "/* Include form library function?             */",
      "\n\n");

