&makegen_include("../common-Makegen");

$D2CFLAGS = $D2CFLAGS . ' -L../common-dylan -L../file-system -L../file-system-base -L../date';

if ($features{'compiled_for_unix'}) {
    &emit_c_file_rule('posix-system') if ($enable_d2c);
    $system_lid_file = 'posix-system';
} else {
    &unknown_platform_error();
}

&emit_library_rule($system_lid_file, '$(BUILDROOT)/force.timestamp', '',
                   'compile', 'no-mindy', 'install');

# TODO: mindy support

# XXX - Get rid of the LGPL on this fragment.
open(CONSTANTS,">$srcdir/os-constants.dylan")
    || die "cannot create os-constants.dylan";
print CONSTANTS <<"EOF";
module:      operating-system
author:      Tom Emerson, tree\@tiac.net
             [based on unattributed previous work]
copyright:   Copyright 1999 Thomas R. Emerson
synopsis:    Constant definitions containing information about the software
             and hardware installed on the host machine.
note:        This file is generated by gen-makefile from Makegen.

/*
   Copyright (C) 1999 Thomas R. Emerson

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA  02111-1307, USA.

   Bug reports, questions, comments, and suggestions should be sent by
   E-mail to the Internet address "gd-bugs\@gwydiondylan.org".
*/

//
// The semantics of these constants are taken from the documentation for
// the operating-system library in Harlequin Dylan 1.2:
//
// http://www.harlequin.com/products/ads/dylan/doc12/io/io_222.htm
//
// The HQN documentation does not specify the types of \$machine-name and
// \$os-name, though HD 1.2 returns a <symbol> for each.
//
// Note that the value of \$architecture-little-endian? is computed during
// configuration. It is not taken from the platforms.descr for the target
// architecture. This should not be a problem, but it is worth documenting
// this possible cause of conflicting values.
//
define constant \$architecture-little-endian? = $architecture_little_endian;
define constant \$machine-name = #"$machine_name";
define constant \$os-name = #"$os_name";
define constant \$os-variant = #"$os_variant";
define constant \$os-version = "$os_version";
define constant \$platform-name = #"$platform_name";
EOF
close(CONSTANTS);
