sim: Move getopt checking inside SIM_AC_PLATFORM
[binutils-gdb.git] / sim / README-HACKING
index 3715467337f724bbd219e1deabcfefff3d61a789..c47eef8ce73b7fa864c63b5de1b7e2e493521d9b 100644 (file)
@@ -20,10 +20,7 @@ The common directory contains:
 - common Makefile fragment and configury (e.g. Make-common.in, aclocal.m4).
 
 In addition "common" contains portions of the system call support
-(e.g. callback.c, nltvals.def).
-
-Even though no files are built in this directory, it is still configured
-so support for regenerating nltvals.def is present.
+(e.g. callback.c, target-newlib-*.c).
 \f
 Common Makefile Support
 =======================
@@ -34,24 +31,6 @@ in configure.ac and Makefile.in, and it also provides a foundation for
 enhancing the simulators uniformly (e.g. the more they share in common
 the easier a feature added to one is added to all).
 
-The configure.ac of a simulator using the common framework should look like:
-
---- snip ---
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../common ../.. ../../config])
-
-... target specific additions ...
-
-SIM_AC_OUTPUT
---- snip ---
-
-SIM_AC_OUTPUT:
-
-- creates the symbolic links defined in sim_link_{files,links}
-- creates config.h
-- creates the Makefile
-
 The Makefile.in of a simulator using the common framework should look like:
 
 --- snip ---
@@ -72,10 +51,6 @@ SIM_OBJS =
 SIM_EXTRA_DEPS =
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS =
-# List of extra libraries to link with.
-SIM_EXTRA_LIBS =
-# Dependency of `install' to install any extra files.
-SIM_EXTRA_INSTALL =
 # Dependency of `clean' to clean any extra files.
 SIM_EXTRA_CLEAN =
 
@@ -86,7 +61,7 @@ SIM_EXTRA_CLEAN =
 ... target specific rules ...
 --- snip ---
 
-COMMON_{PRE,POST}_CONFIG_FRAG are markers for SIM_AC_OUTPUT to tell it
+COMMON_{PRE,POST}_CONFIG_FRAG are markers for configure to tell it
 where to insert the two pieces of common/Make-common.in.
 The resulting Makefile is created by doing autoconf substitions on
 both the target's Makefile.in and Make-common.in, and inserting
@@ -112,35 +87,7 @@ are greppable and appear in the TAGS file.
 Generating "configure" files
 ============================
 
-For targets using the common framework, "configure" can be generated
-by running `autoconf'.
-
-To regenerate the configure files for all targets using the common framework:
-
-       $  cd devo/sim
-       $  make -f Makefile.in SHELL=/bin/sh autoconf-common
-
-To add a change-log entry to the ChangeLog file for each updated
-directory (WARNING - check the modified new-ChangeLog files before
-renaming):
-
-       $  make -f Makefile.in SHELL=/bin/sh autoconf-changelog
-       $  more */new-ChangeLog
-       $  make -f Makefile.in SHELL=/bin/sh autoconf-install
-
-In a similar vein, both the configure and config.in files can be
-updated using the sequence:
-
-       $  cd devo/sim
-       $  make -f Makefile.in SHELL=/bin/sh autoheader-common
-       $  make -f Makefile.in SHELL=/bin/sh autoheader-changelog
-       $  more */new-ChangeLog
-       $  make -f Makefile.in SHELL=/bin/sh autoheader-install
-
-To add the entries to an alternative ChangeLog file, use:
-
-       $  make ChangeLog=MyChangeLog ....
-
+"configure" can be generated by running `autoreconf'.
 \f
 C Language Assumptions
 ======================
@@ -161,8 +108,8 @@ internal state pretty printed from gdb.
 
 FIXME: This can obviously be made more elaborate.  As needed it will be.
 \f
-Rebuilding nltvals.def
-======================
+Rebuilding target-newlib-* files
+================================
 
 Checkout a copy of the SIM and LIBGLOSS modules (Unless you've already
 got one to hand):
@@ -191,17 +138,9 @@ all set!  If the target has a custom syscall table, you need to declare it:
                Add your new processor target (you'll need to grub
                around to find where your syscall.h lives).
 
-       devo/sim/<processor>/Makefile.in
-
-               Add the definition:
-
-                       ``NL_TARGET = -DNL_TARGET_d10v''
-
-               just before the line COMMON_POST_CONFIG_FRAG.
-
        devo/sim/<processor>/*.[ch]
 
-               Include targ-vals.h instead of syscall.h.
+               Include target-newlib-syscall.h instead of syscall.h.
 \f
 Tracing
 =======
@@ -335,8 +274,8 @@ only store the error code when the result is an error.
 
 Keep in mind that the CB_SYS_xxx defines are normalized values with no real
 meaning with respect to the target.  They provide a unique map on the host so
-that it can parse things sanely.  For libgloss, the common/nltvals.def file
-creates the target's system call numbers to the CB_SYS_xxx values.
+that it can parse things sanely.  For libgloss, the common/target-newlib-syscall
+file contains the target's system call numbers to the CB_SYS_xxx values.
 
 To simulate other userspace targets, you really only need to update the maps
 pointers that are part of the callback interface.  So create CB_TARGET_DEFS_MAP
@@ -387,8 +326,8 @@ Hardware Devices
 ================
 
 The simplest simulator doesn't include hardware device support.  Once you're
-ready to move on to the next level, call the common macro in your configure.ac:
-SIM_AC_OPTION_HARDWARE(devone devtwo devthree)
+ready to move on to the next level, declare in your Makefile.in:
+SIM_EXTRA_HW_DEVICES = devone devtwo devthree
 
 The basic hardware API is documented in common/hw-device.h.