Patch level : 12.0 no-patch

Files correlati     :
Commento            :

Aggiunto il preprocessore c++ mcpp per sostituire il compilatore nella compilazione delle maschere.
This commit is contained in:
Alessandro Bonazzi 2020-11-28 16:24:08 +01:00
parent 58116c3c18
commit e075990ed3
853 changed files with 140033 additions and 0 deletions

325
libraries/mcpp/ChangeLog Normal file
View File

@ -0,0 +1,325 @@
ChangeLog of MCPP and its accompanying Validation Suite
2008/11/30 kmatsui
* V.2.7.2
* Enabled some CPU-specific predefined macros in compiler-
independent-build as well as compiler-specific-build, because
there are some occasions which require those macros when we use
some compiler system's header files. Created init_cpu_macro().
(configure.ac, noconfig.H, configed.H, main.c, system.c)
* Enabled -m32 and -m64 options even on 32-bits systems and on
compiler-independent-build, when the OS is UNIX-like one. These
options change some predefined macros. (system.c)
* Made -z option to output #include lines themselves. (system.c)
* Fixed a bug of source line numbering in library-build. (by
Dwayne Boone) (main.c)
* Fixed a few minor bugs.
* Dropped support for Borland C 4.0.
* Updated the shell-scripts, makefiles and difference files, and
revised some mistakes.
* Updated the documents.
2008/05/19 kmatsui
* V.2.7.1
* Fixed a bug of newline synchronization on -K option. Created
sync_linenum(). (Thanks to Benjamin Smedberg) (directive.c)
* Made GCC-specific-build on x86_64 and ppc64 have two sets of
predefines for 32bit mode and 64bit mode, and implemented -m32
and -m64 options. (Thanks to Benjamin Smedberg) (configure.ac,
set_mcpp.sh, system.c)
* Stopped to use freopen() so that a main program which links
libmcpp can use stdin, stdout and stderr. (by Benoit Foucher)
(main.c)
* Fixed a bug of file-handle leak on -MD and -MF options.
(Thanks to Masashi Fujita) (system.c)
* Added ports to Vicual C++ 6.0 and Borland C++ 5.9 (aka C++
Builder 2007). (by Dwayne Boone) (vc6.dif, bc59.dif, eval.c)
* Revised declaration of stpcpy(). (internal.H)
* Split mcpp_out.h from mcpp_lib.h.
* Made library-build install also an mcpp executable and minimal
documents as well as libmcpp for a convenience of library
package. Created main_mcpplib.c. Made all the binary packages
library-build. (by Yutaka Niibe and kmatsui) (Makefile.am, src/
Makefile.am)
* Split config/cygwin_root and config/mingw_root from
configure.ac to avoid a trouble of backslash character handling
on some version of bash. (Thanks to Aleksandar Samardzic)
* Changed autoconf 2.59 to 2.61 and automake 1.9.6 to 1.10.
* Updated the documents accordingly.
2008/03/23 kmatsui
* V.2.7
* Created macro notification mode, implemented -K option and '#
pragma MCPP debug macro_call' sub-directive to enable this mode
on STD mode. Created get_src_location(), print_macro_inf(),
print_macro_arg(), close_macro_inf(), chk_magic_balance(),
remove_magics(), some MAC_* macros to define magic characters,
struct LINE_COL, MACRO_INF. Revised many functions.
(Specifications mostly by Taras Glek, partly by Samuel,
implemented mostly by kmatsui and partly by Taras Glek and
Samuel). (internal.H, main.c, directive.c, eval.c, expand.c,
support.c, system.c)
* Created -k option to keep horizontal white spaces as they are
and convert comment to spaces of the same length on STD mode.
(Specs by Taras Glek, implemented by kmatsui). (internal,H,
main.c, directive.c, mbchar.c, support.c)
* Implemented GCC2-spec variadic macro on STD mode in GCC-
specific-build. (by Taras Glek and kmatsui). (directive.c)
* Enabled GCC-like buggy handling of macro containing 'defined'
token in #if directive on GCC-specific-build. (by Taras Glek).
(expand.c)
* Reordered initialization steps and enabled undefining of not-
Standard-required predefined macros. Created undef_macros().
Removed undef_a_predef(). (main.c, system.c)
* Enabled non-conforming predefined macros such as 'linux' by
default on GCC-specific-build for compatibility with GCC.
Removed undef_gcc_macros(). Created DEF_NOARGS_* macros for
diagnostics sake. (internal.H, system.c)
* Fixed a bug of file searching failure when a file is specified
by relative path in -include option. Split is_full_path() from
open_include(). (thanks to Benjamin Smedberg) (system.c)
* Fixed a bug of mcpplib initialization which caused problem on
CygWIN. (main.c, system.c, lib.c)
* Fixed a bug of unterminated source file handling. (thanks to
Phil Knight) (support.c)
* Made norm_path() check existence of directory/file before
normalization. As its results, non-existent directory specified
by -I option was disabled, "non-existent/../existent" was judged
as non-existent before wrongly normalizing to "existent", and #
include "directory" was made not to open. Created norm_dir().
(thanks to Taras Glek and Dave Mandelin) (system.c)
* Stopped to convert path-list on Windows to lowercase-letters.
Changed path-list comparing function on Windows from strcmp() to
strcasecmp() or stricmp(). (system.c)
* Changed allocation of buffer for -M* options and incdir[],
fnamelist[], once_list[] from fixed size to dynamically
enlarging ones. (system.c)
* Made #line output for GCC-specific-build closer to GCC.
Changed FILEINFO and DEFBUF struct, moved sharp() from main.c to
system.c, revised many functions. (system.c, support.c, main.c,
directive.c)
* Absorbed lib.c into system.c. Renamed getopt() to mcpp_getopt
(), also variables opt* to mcpp_opt*, and made static in order
to prevent linking of glibc getopt(). (thanks to Dwayne Boone)
* Fixed a bug of UTF-8 multibyte character handling, enabled 4-
bytes long sequences, and enabled checking of overlong sequences
and UTF-16 surrogate pairs. (by Matt Wozniski) (mbchar.c,
support.c)
* Fixed a bug of tokenization in KR and OLD modes. (support.c)
* Changed FILENAME_MAX to PATH_MAX and FILENAMEMAX to PATHMAX,
because FILENAME_MAX of some systems are too short. (thanks to
Dwayne Boone)
* Bundled some variables into structs (std_limits, option_flags,
etc.). Tidied up the sources removing unused codes, rewriting
old comments. (most of the sources)
* Ported to Mac OS X / Apple-GCC. Enabled searching of
"framework" directories for #include. Enabled to search "header
map" file. Enabled #import, which is #include with
unconditional "once only" feature. Implemented -F, -arch,
-isysroot options. Created init_framework(), search_framework(),
search_subdir(), search_header_map(), hmap_hash(). (system.c,
directive.c, set_mcpp.sh, unset_mcpp.sh, configure.ac, src/
Makefile.am)
* Ported to Visual C++ 2008. Enabled '$' in identifier by
default in Visual-C-specific-build and GCC-specific-build.
(system.H, internal.H, support.c, system.c)
* Added documentation on source checking of firefox 3.0pre.
Added comments on system headers in Mac OS X. (mcpp-manual.html)
* Updated all the documents. (mainly by kmatsui, partly by
Taras Glek)
2007/05/19 kmatsui
* V.2.6.4
* Fixed memory leaks in subroutine-build related to file->
filename, sharp_filename and others. (by Juergen Mueller and
kmatsui). (main.c, directive.c, support.c, system.c)
* Revised expanding() and expanding_macro[] to fix memory leaks.
Created clear_exp_mac(). (internal.H, expand.c, support.c)
* Fixed a bug of accessing non-allocated memory. (by isr).
(support.c)
* Revised output of // comment by -C option. Output // comment
as it is, not converting to /* */. (thanks to Taras Glek).
(support.c)
* Changed output of line top white spaces in other than
POST_STANDARD mode to preserve them as they are, rather than
squeezing to one space, in order to make output more human-
readable. (main.c, support.c)
* Removed the settings to be compiled with C++. (configed.H,
noconfig.H, noconfig/*.mak)
* Updated version-info for shared-library-build from 0:0:0 to 0:
1:0.
* Changed installation directory of some documents in stand-
alone-and-compiler-independent-build by configure or by binary
packages.
* Updated the documents. Note that cpp-test.html were not
updated.
2007/04/07 kmatsui
* V.2.6.3
* Fixed a bug of some #line directive handling which wrongly
affected #include path. Added a new member for real file name
to struct FILEINFO, and made #line directive does not affect
real file name. (internal.H, main.c, support.c, system.c)
* Enabled dereferencing of symbolic linked directory (as well as
file) of #include path-list and include directory. Split
deref_syml() from norm_path(). (system.c)
* Revised again diagnostic messages for some macro expansions.
(internal.H, expand.c, support.c)
* Relaxed token checking and syntax checking in lang_asm mode.
(expand,c, support.c)
* Implemented GCC3-spec variadic macro for GCC-specific-build.
(internal.H, directive.c, expand.c)
* Added some predefined macro for GCC-specific-build. (system.c)
* Revised output routines abstracting output device, and
implementing optional memory buffer output when built with
MCPP_LIB macro. Created mcpp_lib.h, mcpp_lib_fputs(),
mcpp_lib_fputc(), mcpp_lib_fprintf(), mcpp_use_mem_buffers(),
mcpp_get_mem_buffer(), mcpp_set_out_func(),
mcpp_reset_def_out_func(), mem_putc(), mem_puts(),
append_to_buffer(), function pointers mcpp_fputs, mcpp_fputc,
mcpp_fprintf and some macros. This update disabled compilation
by C++. (All were contributed by Greg Kress and slightly
modified by kmatsui) (internal.H, main.c, directive.c, eval.c,
expand.c, mbchar.c, support.c, system.c, lib.c, mcpp_lib.h)
* Renamed some global names in order to lessen the possibility
of name collisions in subroutine-build. Renamed the variables
mode, cplus, line, debug, type[] and work[] to mcpp_mode,
cplus_val, src_line, mcpp_debug, char_type[] and work_buf[]
respectively. Renamed the functions install(), eval(), expand(),
get() and unget() to install_macro(), eval_if(), expand_macro(),
get_ch() and unget_ch() respectively. (internal.H, main.c,
directive.c, eval.c, expand.c, mbchar.c, support.c, system.c)
* Added 'mcpplib' target to make subroutine (library) build in
configure.ac and noconfig/*.mak.
* Revised some other minor points. (all sources)
* Changed default setting of noconfig.H to that of FreeBSD 6.* /
stand-alone / GCC 3.4. (noconfig.H)
* Added documentation on source checking of glibc 2.4. (mcpp-
manual.html)
* Abolished 'install-data' and 'uninstall-data' targets of
configured makefile. On the other hand, made 'install' target
install also mcpp-manual.html.
* Provided stand-alone-and-compiler-independent-build binary
packages port, rpm, deb, zip and their corresponding source
packages.
2006/11/12 kmatsui
* V.2.6.2
* Renamed control.c as directive.c and renamed control() as
directive().
* Fixed a bug of #else handling in pre-Standard modes.
(directive.c)
* Fixed a bug of mcpp specific directives such as #debug or #
put_defines in pre-Standard modes. (system.c)
* Fixed a bug of warning options for GCC-specific-builds.
(system.c)
* Fixed a bug of macro expansion timing in #include directive
line. (system.c)
* Revised some other minor points, moved cur_file() from main.c
to system.c. (main.c, eval.c, system.c)
* Revised diagnostic messages for some macro expansions.
(internal.H, expand.c, support.c)
* Fixed a bug of nested includes with relative paths. (thanks
to Leo Savernik). (system.c)
* Fixed memory leaks in routines related to normalizing path-
list. (by Juergen Mueller). (system.c)
* Added MCPP_LIB setting to use mcpp as a subroutine from other
main program. Created init_main(), init_directive(), init_eval(),
init_support(), init_system(), init_lib(), clear_filelist() and
clear_symtable(). Created testmain.c as a sample source. (all
were contributed by Juergen Mueller and slightly modified by
kmatsui). (internal.H, main.c, directive.c, eval.c, expand.c,
support.c, system.c, lib.c)
* Changed the macro STAND_ALONE to INDEPENDENT.
* Changed the terminology of building methods in the documents.
(INSTALL, mcpp-porting.html, mcpp-manual.html)
* Rewrote and converted the text files in 'doc' and 'doc-jp'
directories into html files.
* Updated and corrected many points of the documents.
2006/08/12 kmatsui
* V.2.6.1
* Enabled automatic conversion from [CR+LF] to [LF]. (support.c)
* Set the limit of #include nesting to INCLUDE_NEST (default:
256) in order to prevent infinitely recursive #includes.
(system.H, system.c)
* Revised white space handling in <header with spaces.h> style
header-name which is defined by macro. (system.c)
* Enabled -fworking-directory option for GCC-specific-build.
created put_info(). (system.c)
* Fixed a bug of macro definition. (lib.c)
* Fixed a bug of '#pragma once' failure. (by Greg Kress).
(system.c)
* Fixed some other minor bugs in sources.
* Revised path-list handling on CygWIN. Enabled -mno-cygwin
option for CygWIN GCC-specific-build. (configure.ac, noconfig.H,
system.c)
* Ported to MinGW. Created cc1.c to be invoked from GCC and to
invoke mcpp or GCC's cc1/cc1plus from it, because MinGW GCC
rejects to invoke a shell-script even if it is named cc1 and
because MinGW does not support symbolic link. (configure.ac,
src/Makefile.am, configed.H, noconfig.H, system.c)
* Fixed bugs in some noconfig/*.mak.
* Moved changelogs from the source files to ChangeLog and
ChangeLog.old.
2006/07/15 kmatsui
* V.2.6
* Integrated STANDARD mode and PRE_STANDARD mode into one
executable, differentiating the modes by the execution time
options. (all the sources)
* Absorbed DEBUG, DEBUG_EVAL, OK_MAKE into default, OK_DIGRAPHS,
OK_PRAGMA_OP into default of STD and POST_STD mode, OK_TRIGRAPHS
into default of STD mode, OK_SIZE into default of KR and
OLD_PREP modes. (all the sources)
* Changed --enable-maintainer-mode option of configure to
--enable-replace-cpp option which generates compiler-specific-
build of mcpp. Made compiler-specific-build to be installed
only into a compiler-specific-directory. (configure.ac, src/
Makefile.am)
* Made stand-alone-build independent from any compiler-systems.
It no longer requires GCC-specific header files. (configure.ac,
configed.H, noconfig.H, system.c)
* Revised '#pragma once' and handling of include directories
list, judging a identity of directory and file by converting it
to absolute path, and dereferencing symbolic linked file.
(system.c)
* Revised #line output and its related problem at the end of an
included file. (thanks to Jay Prakash). (internal.H, support.c)
* Ported to GCC V.4.0, CygWIN 1.5.18, Visual C++ 2005 and LCC-
Win32 2006-03. (noconfig.H, system.c)
* Added some options for Visual C++. (system.c)
* Removed settings for pre-C90 compiler (string concatenation by
preprocessor, '\a' and '\v' handling, no unsigned long #if, no
Standard library functions, non-prototype declarations, no #
pragma). (all the sources)
* Removed settings for MS-DOS compiler, DJGPP and Plan9. (*.H,
system.c, mbchar.c)
* Removed the implementation of post_preproc() for pre-Standard
compiler. Removed conv_esc(), is_last_esc(), conv2oct().
Removed HAVE_C_BACKSLASH_A and CONCAT_STRINGS macros. (main.c)
* Degraded the diagnostic of #if expression from error to
warning, which only overflows the range of 'long / unsigned
long' and does not overflow the range of 'long long / unsigned
long long' in modes other than C99. (eval.c)
* Enabled 'i64' ('ui64', 'i32', 'i16', etc.) suffixes for
integer, which are recognized when COMPILER is MSC or BORLANDC.
(eval.c)
* Renamed functions and some variables, created expand_init(),
according to integration of STANDARD and PRE_STANDARD modes.
(expand.c)
* Removed '#pragma MCPP include_next'. (system.c)
* Created init_msc_macro(), parse_warn_level(), chk_opts(),
init_predefines(), init_std_defines(), do_prestd_directive().
Removed set_cplus(), mem_model(). (system.c)
* Removed Standard functions (memmove(), memcpy(), memcmp(),
strstr(), strcspn()). (lib.c)
* Changed default setting of noconfig.H to FreeBSD 5.* / stand-
alone / GCC 3.4. (noconfig.H)
* Renamed 'doc' directory as 'doc-jp' and renamed 'doc_eng' as
'doc'.
* Removed some manuscript files of mcpp-summary.pdf from the
distribution.
* Validation Suite: Revised a few testcases.
* Updated all the documents accordingly.

View File

@ -0,0 +1,351 @@
ChangeLog.old of MCPP and its accompanying Validation Suite
2005/03/19 kmatsui
* V.2.5
* Absorbed POST_STANDARD mode into STANDARD as an execution time
option, absorbed OLD_PREPROCESSOR mode as an execution time
option of PRE_STANDARD. (all the sources)
* Changed the evaluation of #if expression in PRE_STANDARD mode
to use only (signed) long, not to use unsigned long. (eval.c)
* Revised the Standard mode macro expansion routine using GCC 3.
2 testsuite and Wave 1.0 testcases. Revised "blue painting" of
the same name macro. Revised debugging information. Revised
handling of token separator in STANDARD mode. Split
is_macro_call() from is_macro(). (expand.c)
* Revised the old-preprocessor mode to follow "Reiser cpp model".
(expand.c)
* Removed FOLD_CASE settings. (system.c)
* Renamed most of #pragma __* directives as #pragma MCPP *.
(system.c)
* Added porting to GCC V.3.3 and 3.4. Changed some options
accordingly (changed -c to -@compat, changed -m to -e, removed
-E, added -finput-charset=). Created init_gcc_macro(),
undef_gcc_macro(). (system.c)
* Sorted usage() message lines alphabetically.
* Removed documents on older preprocessors (DJGPP, compiler
systems on MS-DOS except Borland C).
* Revised judgment of GCC version and include directories.
(configure.ac).
* Provided man page.
* Renamed the documents.
* Validation Suite: Moved tests of multi-byte character encoding
to quality matters.
* Validation Suite: Changed points allocation of the test items.
* Validation Suite: Added a few testcases for macro expansion.
* Updated Japanese and English documents.
2004/03/20 kmatsui
* V.2.4.1
* Revised recursive macro expansion. (expand.c)
* Added -c option (compatible mode to GCC expansion of recursive
macro). (expand.c, system.c)
* Revised some testcases in cpp-test/test-t directory.
2004/02/25 kmatsui
* V.2.4 release.
* Implemented handling of multi-byte character encodings other
than 2-byte encodings. Made various encodings available
simultaneously. Added #pragma __setlocale. Added -m <encoding>
option. Enabled environment variable LC_ALL, LC_CTYPE and LANG
to specify the encoding. (all the sources)
* Created mbchar.c. Moved type[] from system.c. Created type_*
[] tables for various encodings of multi-byte character.
Created encoding_name[][] table. Created mb_init(),
mb_read_2byte(), mb_read_iso2022_jp(), mb_read_utf8(), mb_eval(),
set_encoding(), search_encoding() and strip_bar(). (mbchar.c)
* Added porting to Plan 9 / pcc. (noconfig.H, system.c)
* Validation Suite: Added tests of various multi-byte character
encodings.
* Updated Japanese documents.
* Updated English documents which were translated by Highwell,
inc. ltd. from the Japanese documents.
* Renamed the documents.
2003/11/28 kmatsui
* V.2.4 prerelease.
* Named this proprocessor as MCPP (This is not necessarily the
name of its executable).
* Changed predefined macro __decus_cpp as __MCPP.
* Created configure script to make mcpp executable automatically.
Accordingly, reorganized system.H, created configed.H and
noconfig.H, and changed some macro names.
* Diagnostics on macro expansion or macro redefinition were made
to show the original macro definition and its location.
* Changed DEFBUF and FILEINFO structure, reorganized some
functions and variables. Created set_fname() in system.c.
(other than system.H, eval.c lib.c)
* Created look_and_install(). (control.c)
* Removed CON_NOEXPAND and CON_EXPAND modes. Renamed CON_FALSE
mode as PRE_STANDARD. (all the sources)
* Removed append_string(), catenate() and conv_st_quote().
(expand.c)
* Added #pragma __push_macro, #pragma __pop_macro, #pragma
__preprocess, #pragma __preprocessed. Created push_or_pop() and
do_preprocess(), revised do_pragma() accordingly. (system.c)
* Implemented -MF, -MT, -MP, -MQ options for GCC-3-compatibility.
Created md_init() and md_quote(). (system.c)
* Added porting to Visual C++ .net. (system.H, system.c)
* Removed the oldest settings on VMS, DEC C and OS-9/09. And
removed accordingly vmsparse(), reopen_stdout(), set_stdin(),
get_redirection(), put_start_file(), put_fname() and put_source().
(system.H, system.c)
* Added strstr() and strcspn(). (lib.c)
* Moved open_file() and add_file() from main.c to system.c.
Moved sharp() from system.c to main.c.
* Updated test-reports on LCC-Win32 and ucpp.
* Updated the Japanese documents. (The English documents are not
yet updated.)
2003/03/29 kmatsui
* V.2.3 patch 1.
* Debugged the modes other than STANDARD. (system.c)
2003/02/28 kmatsui
* V.2.3 release.
* Implemented identifier-like operators in C++98. Created
chk_ops() in eval.c and id_operator() in support.c. (eval.c,
control.c, support.c)
* Reinforced checking of __VA_ARGS__. (control.c)
* Enabled interspersed options between filename arguments.
(system.c)
* Renamed #pragma __debug and #pragma __warning to #pragma
__debug_cpp and #pragma __warning_cpp. (system.c)
* Created the edition of Validation Suite for GCC / testsuite.
* -j option (GCC-compatible diagnostic format) added for testsuite.
* Created the document named mcpp-summary.pdf.
* Updated documents.
* Released English version of documents which were translated by
Highwell, inc. ltd. from the Japanese documents and revised by
kmatsui.
2002/12/16 kmatsui
* V.2.3 prerelease 2.
* Port to GCC 3.2. (system.H, system.c)
* Fixed the bug of #include_next. (system.c)
* GCC-compatible options (-I-, -std=*) added. (system.c)
* Created norm_path() to normalize include directories. (system.
c)
* Fixed the bug of rescan() which warns an innocent macro call.
(expand.c)
* Updated documents. Renamed the documents.
2002/08/26 kmatsui
* V.2.3 prerelease 1.
* Updated according to C99 (ISO/IEC 9899:1999).
* Added compatibility mode of C++ to C99. (eval.c, expand.c,
system.c)
* Increased the class of warnings from four (OR of 1, 2, 4, 8)
to five (OR of 1, 2, 4, 8, 16). Changed some errors to warnings.
* Fixed the bug of 0-parameter function-like macro. Modified re-
examination of macro of the same name. (expand.c)
* Fixed the bug of handling digraphs. Implemented UCN in pp-
number and string-literal. (support.c)
* Fixed the bugs of parse_env() and bsl2sl(). (system.c)
* Implemented many GCC-compatible options. Added -dM, -dD,
-include and -isystem option for GCC. Added -a (-lang-asm, -x
assembler-with-cpp) option. Extended -D option to enable
function-like macro definition. Changed specification of -S
option and added -V, -h option. (system.c)
* Implemented #include_next and #warning for GCC. Implemented
also #pragma __include_next and #pragma __warning_cpp. (system.
c)
* Created conv_case(), chk_env() and at_end(). Split set_limit(),
set_pragma_op(), def_a_macro() from dooptions(). Split
search_dir() from openinclude(). Removed is_id(). (system.c)
* Port to Linux / GCC 2.95.3, LCC-Win32, Borland C 5.5. (system.
H, control.c, system.c)
* Renamed functions and some variables using underscore to
separate the two words. (internal.H, all the *.c files)
* Updated the Validation Suite.
* Updated the documents.
* Renamed the directories and the documents by NIIBE Yutaka.
* Registered to CVS repository at m17n.org by NIIBE Yutaka
<gniibe@fsij.org>.
1998/11 kmatsui
* V.2.2
* Updated according to C++98 (ISO/IEC 14882:1998)
* Changed to evaluate "true" as 1 and "false" as 0 on C++,
according to C++ Standard. (eval.c)
* Updated UCN constraint on C++ according to C++ Standard.
(support.c)
* Fixed the bug of interaction of predefined non-standard macro
with -D option. (main.c, control.c, expand.c, system.c)
* Created undef_a_predef(). (main.c)
* Removed alloc_mem(). (system.c)
1998/09 kmatsui
* V.2.1
* Updated C99 features according to 1998/08 draft (including UCN,
optional multi-byte-character in identifier, type of #if
expression in integer of maximum size and concatenation of wide-
character-string-literal and character-string-literal). (main.c,
eval.c, support.c)
1998/08 kmatsui (Kiyoshi Matsui <kmatsui@t3.rim.or.jp>)
* V.2.0
* First release of MCPP (DECUS cpp V.2) at nifty-serve and
vector/software-pack.
* Re-written according to ISO 9899:1990 and it's Amendment 1,
Corrigendum 1, 2.
* Implemented translation phases precisely. (support.c)
* Revised tokenization according to the Standard and Amendment1.
(support.c & others)
* Implemented the pre-defined macros __STDC__, __STDC_VERSION__,
__TIME__, and revised __DATE__. Made these standard macros
cannot be undefined nor redefined. (main.c)
* Implemented _Pragma() operator. (main.c & others)
* Revised some non-standard pre-defined macros. (main.c)
* Implemented #error directive. The error message is output to
the stderr. (control.c)
* Implemented #pragma __once directive, -i option and -M* option,
imported from GCC. (control.c & others)
* Implemented #pragma __put_defines, #pragma __debug directives
and the old style directives corresponding to them. (system.c &
others)
* Made #pragma lines to be output with warning to the stderr for
the compiler which can't recognize the directive. (system.c)
* Made #line argument to be subject to macro expansion.
(control.c, support.c)
* Reinforced the test of #define syntax. (control.c)
* Created Standard conforming mode of macro-expansion (including
the processing of #, ## operators). (expand.c)
* Created "post-Standard" mode of preprocessing, which is a
simplified version of Standard mode. (all the sources)
* Simplified CON_FALSE mode corresponding to K&R 1st.
specifications. CON_NOEXPAND, CON_EXPAND modes of the original
version are retained (after revising). (main.c, control.c eval.
c, expand.c)
* Revised # operator so as to inserts \ before \ or " in
stringized arguments (except in MBCHAR) in Standard mode.
(expand.c)
* Changed the type of #if expression from int to long / unsigned
long. Reinforced expression evaluation. (eval.c)
* Implemented wide character constant, multi-character character
constant, and revised multi-byte character constant in #if
expression. (eval.c)
* Revised the handling of MBCHAR in string literal and character
constant. (support.c, expand.c, eval.c, main.c)
* Supplemented the optional phase for the pre-Standard compiler-
proper to concatenate adjacent string literals, convert '\a' and
'\v' to octals, convert digraphs. (main.c)
* Implemented the features of C99-1997/11 draft except Unicode-
related features (_Pragma operator, variable arguments of macro,
// comments, long long of #if expression, p+ of pp-number) (all
the sources)
* Supplemented the C++ preprocessor option. (support.c, system.
c)
* Refined error checks and diagnostic messages. (all the
sources)
* Implemented -M* option. (main.c, system.c)
* Updated MS-DOS memory model option. (system.c)
* Revised command line options. (system.c)
* Made the source files compilable by C++ as well as C. (all
the sources)
* Re-organized and re-written the source files to be portable to
many systems. (all the sources)
*
* main.c:
* Renamed cpp1.c main.c.
* Created do_pragma_op(), de_stringize(), devide_line(), putout(),
putline(), post_preproc(), conv_esc(), conv2oct(), is_last_esc(),
esc_mbchar(), conv_a_digraph().
* Removed output().
* Moved sharp() from cpp1.c to system.c, addfile(), openfile(),
initdefines(), unpredefine() from cpp3.c to main.c,
* Revised most of the functions and variables.
*
* control.c:
* Renamed cpp2.c control.c.
* Moved dodefine(), is_formal(), mtokensave(), stparmscan(),
doundef() from cpp4.c to control.c.
* Moved lookid(), defendel(), dump_a_def() from cpp6.c to
control.c.
* Moved doinclude(), openinclude(), vmsparse() from cpp2.c to
system.c.
* Split doline() from control().
* Split getparm(), getrepl(), def_stringization() from dodefine().
* Split dumprepl() from dump_a_def().
* Devided defendel() to install(), undefine(), lookprev().
* Removed textput(), charput(), checkparm() from cpp4.c.
* Expanded specification of stparmscan().
* Revised most of the functions.
*
* eval.c:
* Renamed cpp5.c eval.c.
* Created overflow(), dumpval().
* Split evalsval(), evaluval() from evaleval().
* Made #if error returns 0 (rather than 1).
* Changed the type of #if evaluation from int to long / unsigned
long (unsigned long is only for the compiler which has that type)
or long long / unsigned long long for C99.
* Reinforced expression evaluation (eval(), opdope[]).
* Implemented evaluation of multi-character character constant,
wide character constant and revised evaluation of multi-byte
character constant.
* Revised most of the functions.
*
* expand.c:
* Split from cpp4.c and cpp6.c (support.c).
* Created Standard conforming mode of macro expansion.
* Created is_macro(), squeeze_ws(), skip_macro() as common
routines, expand(), replace(), def_special(), prescan(),
catenate(), stringize(), substitute(), rescan(), disable_repl(),
enable_repl(), is_able_repl() for MODE >= STANDARD, expand(),
conv_st_quote() for MODE < STANDARD.
* Split expcollect() into collect_args() and get_an_arg().
* Renamed macroid() to rescan(), expand() to replace(), expstuff
() to substitute() for MODE < STANDARD, dumpparm() to dump_args().
* Revised most of the functions.
*
* support.c:
* Renamed cpp6.c support.c.
* Created get_unexpandable(), scantoken(), cat_line(), scanop(),
parse_line(), last_is_mbchar(), cnv_digraph(), at_eof(),
xrealloc(), putline(), dumptoken().
* Split getline(), read_a_comment() from get().
* Extended cfatal(), cerror(), cwarn(), removing cierror(),
ciwarn().
* Removed save(), cget().
* Moved macroid(), catenate(), appendstring() from cpp6.c to
expand.c, lookid(), defendel() from cpp6.c to control.c.
* Renamed scanstring() to scanquote(), getmem() to xmalloc().
* Revised most of the functions.
* Revised line splicing and tokenization.
*
* system.c:
* Created this file gathering routines from other files. Moved
sharp(), sharpsub(), getredirection() from cpp1.c to system.c,
doinclude(), openinclude(), hasdirectory(), vmsparse() from cpp2.
c to system.c, setincdirs(), dooptions(), zap_uc() from cpp3.c
to system.c,
* Created setoptlist(), setcplus(), bsl2sl(), put_depend(),
dopragma(), doonce(), included(), dumppath(), is_junk(),
alloc_mem(), print_heap();
* Split reopen_stdout(), setstdin() from main(), put_start_file(),
putfname() from cppmain(), setfiles(), usage(), mem_model(),
is_id() from dooptions(), doold(), dodebug(), doasm(), put_asm()
from control().
* Split setincdirs() to setsysdirs(), setenvdirs(), parse_env(),
set_a_dir().
* Moved type[] from cpp6.c to system.c.
* Revised most of the functions.
*
* system.H:
* Re-written and renamed from cppdef.h.
*
* internal.H:
* Re-written and renamed from cpp.h.
*
* Created Validation Suite for C/C++ preprocessing.
*
* Provided some supplementary tools for preprocessor testing.
*
* Wrote comprehensive documents (in Japanese).
* Edit history of DECUS CPP (MM: Martin Minow)
* 21-May-84 MM "Field test" release
* 11-Jul-84 MM "Official" first release (that's what I thought!)
* 31-Aug-84 MM USENET net.sources release.
* 7-Dec-84 MM Stuff in Nov 12 Draft Standard
* 07-Jun-85 KR Latest revision

541
libraries/mcpp/INSTALL Normal file
View File

@ -0,0 +1,541 @@
This file explains how to generate executables by compiling the MCPP
source. For further details, please refer to mcpp-porting.html.
1. Types of MCPP executables
There are several types of MCPP executable corresponding to its building
methods. The building methods of MCPP have following two axis:
1. stand-alone-build vs subroutine-build
2. compiler-independent-build vs compiler-specific-build
stand-alone-build: The preprocessor which is invoked as a command.
Some of this type is invoked by compiler-driver.
subroutine-build: The preprocessor to be called as a subroutine
(repeatedly, if required) from other main program.
compiler-independent-build: The preprocessor which behaves on its own
not depending on any compiler system. The invocation options, for
example, are the same across the compilers with which MCPP is
compiled. Although it can preprocess source files, it cannot behave
as an integrated part of a compiler system.
compiler-specific-build: The preprocessor to replace (if possible) the
resident preprocessor of certain compiler system. It has some
specifications for the compiler system only and is installed into
the compiler-system-specific directory.
This document does not explain subroutine-build. As for it, please
refer to mcpp-porting.html 3.12. All the explanations below are of
stand-alone-build.
2. Configure and make
To compile MCPP, the configure script can be used on UNIX-like systems
and CygWIN, MinGW. You can do configure and make in any directory. In
this document ${mcpp-dir} represents the path of 'mcpp-${VERSION}'
directory. The ${VERSION} represents the version of MCPP such as 2.6.4
or 2.7.1.
The configure script searches for compilers by name of 'cc' ('c++') and
'gcc' ('g++') according to the path list set in the environment variable
$PATH. So, if you use compilers named like 'gcc-4.3.0' and 'g++-4.3.0',
you have to specify them by CC and CXX environment variables, or link
them to 'gcc' and 'g++', prior to do configure. If you use a pair of
compilers other than the one first found in the path list, you have to
change the $PATH such as:
export PATH=/my/gcc/bin:$PATH
The setting should be kept the same while you do 'configure' and 'make'.
Do not specify a compiler by CC or CXX variable with any directory part,
even in an absolute path, when it is not the first one found in the
$PATH, because $PATH influences everything of configure.
2.1. The compiler-independent-build
If you type the commands as:
${mcpp-dir}/configure; make; make install
the compiler-independent executable will be generated and installed by
name of 'mcpp'. Also a few document files will be installed.
${mcpp-dir}/configure --prefix=/usr; make; make install
will install the executable into 'bin' directory in the directory
specified by '--prefix' option. If this option is omitted, the
directory defaults to '/usr/local'.
'make install' usually requires root privilege, and you can do it by:
sudo make install
or by first 'su', then 'configure; make; make install'.
On FreeBSD, you'd better to use 'gmake' instead of 'make'.
To strip the executable, do:
make install-strip
instead of 'make install'.
To uninstall the executable, do:
make uninstall
If you specify 'DESTDIR=DIR' option with make (un)install, all the files
will be installed under (or uninstalled from) the 'DIR' directory. For
example,
make DESTDIR=/tmp/mcpp install
will install MCPP into '/tmp/mcpp/usr/local/bin/', (Non-existent
directories will be generated. If '--prefix=DIR' option was specified
in configure, '/usr/local' part will be replaced by 'DIR'). This option
is used to make a binary package.
GCC 4.1 or later has the option '-fstack-protector' ('-fstack-protector-
all'). You can enable it by adding "CFLAGS+='-fstack-protector'" option
to make command. The same can be said on GCC-specific-build. Also, you
can use "CFLAGS+='-ggdb -O0'" option to debug mcpp by gdb.
'make install' of compiler-independent-build installs a few documents as
well as the executable. This is for the convenience of making a binary
package.
Note that on Linux, Mac OS X, CygWIN and MinGW, the system's standard
headers have certain defects, and some workarounds are necessary for the
compiler-independent-build of MCPP. See mcpp-manual.html 3.9.9 for this
problem.
2.2. The compiler-specific-build
This line of commands will generate a compiler-specific executable and
will install it into the compiler-specific directory.
${mcpp-dir}/configure --enable-replace-cpp; make; make install
'make install', 'make install-strip', 'make uninstall' are the same as
compiler-independent-build.
The prefix directory is automatocally set from the path of GCC: for
example, '/usr/local' of '/usr/local/bin/gcc'. If you specify --prefix
option for configure and it conflicts with the GCC path, the --prefix
option will be ignored. 'DESTDIR' option of make has also no relevance
to the executable's installation.
For the compiler systems other than GCC, however, it may not be compiled
or installed properly if some porting work has not been done beforehand
and if some of the options are not specified with configure.
2.2.1 When the compiler system is GCC
When the compiler system is GCC, the appropriate settings will be set by
the configure without any options other than '--enable-replace-cpp'.
After configuring, do 'make'.
2.2.1.1. make install
After configuring and 'make', the 'make install' command installs MCPP
into the compiler's directory (e.g. /usr/libexec or /usr/lib/gcc-lib/
SYSTEM/VERSION). This is the directory where cc1 (cpp0), which is
called by gcc, is located. 'make install' saves GCC / cc1, cc1plus
(cpp0) and setups gcc and g++ command appropriately to call MCPP. This
setting is different depending on GCC being V.2.* or V.3.*-4.*. (Refer
section 3.9.5 and 3.9.7 of mcpp-manual.html). In addition, it generates
some GCC-version-dependent header files under 'mcpp-gcc*' directory in
compiler-specific include directory.
2.2.1.2. make check
In the MCPP Validation Suite, there is an edition which can be used as
testsuite of GCC. If GCC / testsuite has been installed, 'make check'
can test MCPP using the testsuite edition of Validation Suite. Because
this edition is to be used as a part of GCC / testsuite, the testsuite
should be installed and ready to execute in advance. GCC / testsuite is
usually a part of the source code of GCC. (It can be a separate package
in some cases.) You can use any version of testsuite from GCC V.2.95.*
to V.4.2.*.
Also, 'configure' needs an option to specify the directory where GCC /
testsuite is located, as:
${mcpp-dir}/configure --with-gcc-testsuite-dir=DIR \
--enable-replace-cpp
If the directory where GCC source is located is ${gcc-source}, this
'DIR' should become:
${gcc-source}/gcc/testsuite
Configured as above, 'make check' after 'make; make install' copies the
testsuite edition of Validation Suite into GCC / testsuite, and applies
required settings according to whether GCC is V.2.* or V.3.*-4.*. When
the name of the gcc command is not 'gcc', for example 'gcc-4.1.2' or
'powerpc-apple-darwin9-gcc-4.0.1', 'make check' links 'gcc' to that name
temporarily, because GCC testsuite expects literal 'gcc' for the name.
Then, the testsuite will be executed. Usually, 'make check' would be
run before 'make install' in the normal software, but this order is
reversed in MCPP. This is because testsuite cannot be applied to MCPP
unless MCPP is called from gcc. Due to this, the option '--enable-
replace-cpp' is also required.
Depending on the location of ${gcc-source} directory, you should do
'sudo make check' instead of 'make check'. In this case, make sure that
gcc is the same between root and the current user.
The testsuite edition of Validation Suite can also be applied to cc1,
cc1plus (cpp0) of GCC V.2.95 and later, not only for MCPP. (Refer cpp-
test.html 3.2.3).
2.2.1.3. make uninstall
When you type 'make uninstall', the executables of MCPP will get deleted.
The header files in mcpp-gcc* directory will be deleted, too. The
settings of gcc and cc1, cc1plus (cpp0) will be reset to the initial
state. When the re-execution of configure is required after completing
'make install' for some reason, 'make uninstall' needs to be done
beforehand. This is because the configure should check GCC, not MCPP.
If you have done 'make check', the 'make uninstall' will also remove the
testsuite edition of Validation Suite. If you want to use Validation
Suite for GCC, copy it manually.
The Makefiles generated by configure are necessary to do 'make
uninstall', so you should not remove them. When you do 'make distclean',
first do 'make uninstall', because it is a little troublesome to
uninstall GCC-specific-MCPP manually. Also you should do 'make
uninstall; make distclean' even before updating configure or Makefile.in,
when you update MCPP.
2.2.2. When the compiler system is Apple-GCC on Mac OS X
Although Mac OS X is one of the UNIX-like systems, it has some
peculiarities such as "framework" directories. Its system compiler is a
GCC with many extensions added by Apple. Moreover, since the appearance
of Intel-Mac, both of the compiler system for x86 and the compiler
system for powerpc, one is a native compiler and the other is a cross
compiler, begun to co-exist in a same machine. And even a so-called
"universal binary", which is a bundle of binaries for x86 and powerpc,
hence is able to work on either machine, has become popular. The
structure of compiler systems is rather complex.
To install MCPP for this complex system, the command sequence of 2.2.1
is not sufficient. Here, I explain the case of Mac OS X / Apple-GCCs
apart from other UNIX. I am using Mac OS X Leopard on Intel-Mac, so I
take the examples of the system. If you use Powerpc-Mac, read the
section below swapping 'i686' and 'powerpc'. On Tiger, read 'darwin9'
as 'darwin8'.
Apple provides GCC 4.0.1, and also provides GCC 3.3 as an addition. I
explain only GCC 4.0.1, and omit GCC 3.3, because it has not been
properly compiled at least on Leopard.
2.2.2.1. Native compiler versus cross compiler
It is simple to compile and install MCPP for a native compiler, i.e. for
x86 on Intel-Mac. The command sequence in 2.2.1 is sufficient for it.
Making of MCPP with a cross compiler, however, is not so easy.
Generally, the configure script of MCPP does not support cross compiling,
because it contains a few tests to be compiled and executed. A binary
for a target environment cannot be run on a build environment usually.
If we test the build environment instead, the results are not
necessarily the same with the target.
Nevertheless, on Mac OS X, we can exceptionally configure cross-
compiling for different CPUs in most cases. First, Intel-Mac
automatically executes a ppc binary with an emulator. Second, if the
build environment and the target differ only in CPU and its related
settings, and OS, its version and GCC's version are all the same between
them, we can substitute most of the tests of the target with that of the
build.
On Intel-Mac, for a compiler-independent-build, you should specify the C
compiler (the name of compiler driver) and C++ compiler by the
environment-variables CC and CXX. There are many gccs and g++s in /usr/
bin of Mac OS X. In Mac OS X Leopard on Intel-Mac, powerpc-apple-
darwin9-gcc-4.0.1 and powerpc-apple-darwin9-g++-4.0.1 are the C compiler
and the C++ compiler for powerpc. (Actually, all the gccs and g++s in
/usr/bin are universal binaries of i386 and ppc.) In addition, you
should specify the target system by --target option. In this case, you
should use the compiler's name removing '-gcc-4.0.1', i.e. powerpc-apple-
darwin9. This is the configure command to make compiler-independent-
build:
${mcpp-dir}/configure --target=powerpc-apple-darwin9 \
CC=powerpc-apple-darwin9-gcc-4.0.1 \
CXX=powerpc-apple-darwin9-g++-4.0.1
On the other hand, ppc-Mac cannot execute an x86 binary, so you cannot
make the compiler-independent-build with this method. Instead, you can
cross-compile it manually, using the difference file and mac_osx.mak.
See mcpp-porting.html#3.1.4 and #3.11, if needed. You can also make a
universal binary on ppc-Mac with its native compiler using the configure,
as explained in the next section.
To make a GCC-specific-build, you should specify the C compiler by
--with-target-cc= option instead of CC and CXX as: (the configure deduce
the name of C++ compiler from the name of C compiler, replacing 'gcc'
with 'g++'.)
${mcpp-dir}/configure --target=powerpc-apple-darwin9 \
--with-target-cc=powerpc-apple-darwin9-gcc-4.0.1 \
--enable-replace-cpp
This configuration does not contain any running test of the target, so
it can be used on ppc-Mac too, changing 'powerpc' with 'i686'.
When the version of the default native compiler (gcc and g++) greatly
differs from that of the cross compiler specified by --with-target-cc=
option, you should specify a native compiler of a version as close as
possible to the target by the environment-variables CC and CXX. The
compiler specified by CC (CXX) is to be used to build MCPP, while the
compiler specified by --with-target-cc= is the target compiler into
which MCPP is installed.
The cross compiler differs from the native compiler in libexec directory,
compiler-specific include directory and predefined macros. The
configure with these options appropriately sets them. These options
should be used for configure, not for make command.
Note that a cross compiler itself runs on a host system, so does a
compiler-specific-build MCPP installed "to a cross compiler". On the
other hand, a compiler-independent-build MCPP compiled "with a cross
compiler" runs on a target system. Also note that both of the GCC-
specific-build for the native compiler and for the cross compiler are
compiled by the native compiler, therefore, if you install both, you
should first install the one for the cross compiler.
2.2.2.2. Making a universal binary
To make a universal binary, specify the CPUs by -arch options and add
them to the 'make' command as "CFLAGS+='-arch i386 -arch ppc'". The
valid CPU types are 'i386', 'x86_64', 'ppc' and 'ppc64'. For example,
this command generates a bundled binary for 4 CPU types.
make CFLAGS+='-arch i386 -arch x86_64 -arch ppc -arch ppc64'
The configure needs no special option for universal binary, it needs
only options for non-universal binary, if any.
GCC has '-isysroot DIR' or '--sysroot=DIR' options, which change root of
system include directories to DIR. These options are not limited to Mac
OS, but are commonly used on Mac OS to compile a universal binary in
order to widen compatibility with older version of Mac OS. For example,
if '-isysroot /Developer/SDKs/MacOSX10.4u.sdk' is specified, /usr/
include becomes /Developer/SDKs/MacOSX10.4u.sdk/usr/include. This is an
example to compile a universal binary compatible with Mac OS X 10.4
(Tiger) on 10.5 (Leopard). When you use this option in making MCPP, you
should also specify the version of SDK by -mmacosx-version-min= option.
Any universal binary of MCPP can be generated with a combination of the
above configure options and these make options, on either of compiler-
independent-build or GCC-specific-build, and on either of native
compiler or cross compiler. This example shows the sequence to generate
a universal binary of compiler-independent-build compatible with Tiger
for i386 and ppc. (Actually, you should write the '*' in one line.)
${mcpp-dir}/configure
make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -arch i386 -arch ppc'
sudo make install
2.2.3. When the compiler system is not GCC
When the compiler system is not GCC, some options need to be specified
in the configure. Also, to use MCPP replacing the preprocessor of the
compiler system, the "porting" or adding source code is required. MCPP
have already been ported to GCC, because the author is using GCC on
Linux, FreeBSD, Mac OS X, CygWIN and MinGW systems, and so the
informations can be collected by the configure. However, as he does not
know any compiler systems on UNIX-like systems other than GCC, he does
not even know what or how it needs to be checked by the configure, let
alone the porting.
For compiler systems other than GCC on UNIX systems, please compile with
the following procedures.
2.2.3.1. Configure by specifying options
First, do configure by specifying some options, for example:
${mcpp-dir}/configure --enable-replace-cpp --bindir=DIR \
--with-cxx-include-dir=CXXDIR \
--enable-SYSTEM-STD-macro=_MACRO=val
Specify the directory where the preprocessor, which is called from the
compiler-driver, is located with --bindir, specify the C++ specific
include directory with --with-cxx-include-dir and specify the predefined
macro of the resident preprocessor with --enable-SYSTEM-STD-macro or
other options.
If you type
${mcpp-dir}/configure --help
some options will be displayed.
Then, after doing 'make; make install', some work for making MCPP
callable from the compiler driver is required. Please see the setup on
GCC for how to do this.
2.2.3.2. "Porting" work
To be able to use the MCPP replacing the preprocessor of the compiler
system, it is required to do "porting" work by adding source code.
These are the execution options for the compiler system or the
implementation of #pragma directives. Especially, when there are some
execution time options which are used frequently but different from MCPP,
they at least need to be implemented. In order to do that, define the
macro to designate the compiler in configed.H, and write some codes in
system.c. (Refer mcpp-porting.html 4.2).
2.2.3.3. Re-configure by adding an option
Once porting of source is completed, re-configure by adding the option
--with-compiler-name=COMPILER. 'COMPILER' is the macro for the compiler
defined in configed.H.
After 'make; make install' is done successfully, do 'make clean; make'
which recompiles MCPP using the installed MCPP. If it passes, it can be
said that basic porting has been done successfully.
2.2.4. The limitations of the configure
In the compilation of compiler-specific-build of MCPP, the
specifications of the target system (the compiler system which will use
MCPP as a preprocessor) must be understood in detail. At the same time
the host system (the compiler system with which MCPP is compiled) need
to be understood. In case these two are not the same, the source code
of MCPP is written with the settings of both systems separately in the
header file (configed.H). However, the configure cannot detect both of
them at the same time. Therefore, it assumes the target system is the
same as the host system.
If these two systems are not the same, Part 2 of the configed.H needs to
be modified.
Cross-compiling is not supported by the configure of MCPP, either. Some
tests which cannot be executed by the cross-compiler are included as
well. In case of cross-compiling, the default values will be set, but
this may not work.
3. 'make' on the Windows compiler systems
Since all compiler systems on Windows other than CygWIN and MinGW are
not subject to the 'configure', they need a bit of modification of the
source in order to do 'make'. As there are difference files for already
ported systems, a patch can be applied by using them. The procedure for
the use of the difference files is explained below.
Even the systems subject to the 'configure' can also be controlled in
detail by editing the makefile and header files directly.
3.1. Applying a patch
The difference files and makefiles for various compiler systems are
available in 'noconfig' directory. The source of MCPP is defaulted to
FreeBSD / GCC 3.4 setting. The difference files are used in order to
modify this source for the particular compiler systems. The makefile is
written for using the make command attached to each compiler system.
In the 'src' directory, run as below. All of the following process
should be done within the 'src' directory.
patch -c < ..\noconfig\which-compiler.dif
copy ..\noconfig\which-compiler.mak Makefile
'patch' is a UNIX command, but it can be used in Windows as it has been
ported. Of course, you can directly edit the noconfig.H file referring
the difference file.
3.2. Modifying noconfig.H and Makefile if required
The settings of various directories in the difference files are based on
the environment of the author, hence you have to modify them.
If the version of the compiler system is different from that of the
difference file, modify the header file noconfig.H. (See noconfig.H
itself and mcpp-porting.html 3.1). Similarly, if the multi-byte
character for normal use is not Japanese, change the macro definition
MBCHAR in noconfig.H.
Also, define BINDIR in the Makefile to the directory in which MCPP
executable should be installed. As for the Makefile for Visual C,
remove '#' of this line and make 'install' target effective.
#install :
3.3. Compiler-independent-build
Now, you can do 'make' and 'make install' successfully for the compiler-
independent executable. (For Visual C, use 'nmake' instead of 'make').
3.4. Compiler-specific-build
To make the compiler-specific-build, rewrite BINDIR in the Makefile to
the directory in which the executables of the compiler system are
located. Then, rewrite this line in noconfig.H:
#define COMPILER INDEPENDENT
Replace 'INDEPENDENT' with the macro to designate the compiler. Then do
'make' and 'make install'. 'COMPILER' can be overwritten also by make
option, hence the file can be left as it is. For example, in Visual C,
'nmake COMPLIER=MSC' and 'nmake COMPILER=MSC install' or in Borland C,
'make -DCOMPILER=BORLANDC' and 'make -DCOMPILER=BORLANDC install'.
If the target system and the compiling system are different, noconfig.H
/ Part 1 should be set to the specifications of the target system and
Part 2 should be set for the compiling system. The Makefile that should
be used is the compiling system's one, and modify the installation
directory to the target system's one.
Since most compiler systems on Windows integrate preprocessor into its
compiler, it is impossible to replace the preprocessor of such a one-
path compiler with MCPP. To use MCPP, a source program should be first
preprocessed with MCPP and then the output should be passed to the
compiler. To use MCPP with a one-path compiler, the procedure should be
written in makefile. For sample procedures, refer to the makefile's
settings used to recompile MCPP using MCPP itself.
In Visual C++, if you create "makefile project" by IDE using the
attached makefile, all the functions of IDE, such as source level debug,
become available. (Refer mcpp-manual.html 2.10)
3.5. Test
On Windows, any include directory is not preset except MinGW/GCC-
specific-build and GygWIN, hence you should specify them by the
environment variable INCLUDE (and CPLUS_INCLUDE, if necessary).
GCC / testsuite cannot be used in Windows, MCPP needs to be checked
directly by preprocessing the test samples in test-t, test-c and test-l
directories. If you use tool/cpp_test.c, it can test some parts
automatically. (Refer cpp-test.html 3.2.2).
For the compiler-specific-build of MCPP, if you re-compile MCPP with the
"pre-preprocess" functionality of MCPP, by using MCPP itself as the
preprocessor of the compiler system, you can check whether it has been
ported successfully for the compiler system. (Refer mcpp-porting.html 3.
7)
4. Please send me the information for porting.
To port to the compiler systems which have not been ported yet, lots of
information is required. It will be great to hear from many people.
Please let me know if you know the values for options of the 'configure',
for compiler systems other than GCC. I would like to work on configure.
ac.
5. Validation Suite
MCPP provides "Validation Suite" which tests and evaluates C/C++
preprocessor comprehensively. Validation Suite has 265 items and can be
applied to any preprocessor as well as MCPP. Refer to 3.1 and 3.2 of
cpp-test.html.
November, 2008
Kiyoshi Matsui <kmatsui@t3.rim.or.jp>

468
libraries/mcpp/INSTALL-jp Normal file
View File

@ -0,0 +1,468 @@
ここでは、MCPP のソースをコンパイルして実行プログラムを生成する方法を
説明します。詳細はさらに mcpp-porting.html を見てください。
1、実行プログラムの種類
MCPP の実行プログラムは build する方法に応じて何種類かあります。Build
する方法には次の2つの次元があります。
1. stand-alone-build vs subroutine-build
2. compiler-independent-build vs compiler-specific-build
stand-alone-build: 1つのコマンドとして単体で動くプリプロセッサです。処
理系のコンパイラ・ドライバから呼び出されるものもあります。
subroutine-build: 他のメインプログラムの中からサブルーチンとして(必要な
ら繰り返し)呼び出されるものです。
compiler-independent-build: 処理系からは独立して動くプリプロセッサです。
実行時オプションなどの仕様は処理系のいかんによらず一定です。プリプロ
セスだけすることができますが、処理系の一部として動作することはできま
せん。
compiler-specific-build: 特定の処理系のプリプロセッサを(もし可能なら)
代替するためのものです。その処理系に専用の仕様を持ち、その処理系の専
用のディレクトリにインストールされます。
Subroutine-build についてはここでは説明は略します。mcpp-porting.html 3.
12 を見てください。以下はすべて stand-alone-build についての説明です。
2、configure と make
MCPP をコンパイルするには、UNIX 系のシステムおよび CygWIN, MinGW では
configure スクリプトを使うことができます。configure と make は任意のディ
レクトリで実行できます。以下の説明では mcpp-${VERSION} ディレクトリのあ
る path を ${mcpp-dir} と表記します。${VERSION} は 2.6.4, 2.7.1 等の
MCPP のバージョンです。
Configure はコンパイラを cc (c++) または gcc (g++) という名前で、環境変
数 $PATH にセットされた path list の順にサーチします。したがって、gcc-4.
3.0, g++-4.3.0 といった名前のコンパイラを使うなら、configure する前にそ
れを環境変数 CC, CXX で指定するか、または gcc, g++ にリンクしておいてく
ださい。もし、path list 上で最初にサーチされるコンパイラ以外のコンパイラ
を使うなら、$PATH を次のように変更しなければなりません。
export PATH=/my/gcc/bin:$PATH
この設定は make が終わるまで維持してください。Path list 上で最初にサーチ
されるコンパイラ以外のコンパイラを CC, CXX で指定してはいけません。たと
え絶対パスで指定してもダメです。Path list は configure のすべてに影響を
与えるからです。
2、1、compiler-independent-build
${mcpp-dir}/configure; make; make install
とすると、compiler-independent 版の実行プログラムが生成されて mcpp とい
う名前でインストールされます。一部のドキュメントもインストールされます。
${mcpp-dir}/configure --prefix=/usr; make; make install
等とした場合は、prefix で指定されたディレクトリの中の bin ディレクトリに
インストールされます。これを指定しないと /usr/local を指定したのと同じこ
とになります。
make install には通常は root 権限が必要なので、
sudo make install
とします。あるいは su してから configure; make; make install とします。
なお、FreeBSD では make ではなく gmake を使ってください。
実行プログラムを strip するには、make install のかわりに
make install-strip
とします。
make uninstall
とすると、MCPP の実行プログラムは削除されます。
make (un)install では DESTDIR=DIR というオプションを指定すると、DIR 以
下のディレクトリにインストールされます。例えば、
make DESTDIR=/tmp/mcpp install
とすると、/tmp/mcpp/usr/local/bin/ に MCPP がインストールされます(存在
しないディレクトリは作成される。configure で --prefix=DIR オプションを指
定していると '/usr/local' の部分が 'DIR' に置き換わる)。バイナリ・パッ
ケージを作るにはこの方法を使います。
GCC 4.1 以降には -fstack-protector (-fstack-protector-all) というオプ
ションがありますが、make で CFLAGS+='-fstack-protector' というオプション
を指定することでこれを有効にすることができます。これは GCC-specific-
build でも同様です。MCPP を gdb でデバッグする時には CFLAGS+='-ggdb -O0'
とします。
compiler-independent-build では make install で最小限のドキュメントが
インストールされるようにしました。これはバイナリ・パッケージを作るつごう
に合わせたものです。
Linux, Mac OS X, CygWIN, MinGW ではシステムの標準ヘッダに欠陥があるの
で、compiler-independent-build の MCPP ではその対策が必要です。この問題
については mcpp-manual.html 3.9.9 を見てください。
2、2、compiler-specific-build
${mcpp-dir}/configure --enable-replace-cpp; make; make install
とすると、compiler-specific 版の実行プログラムが生成されて、その処理系の
専用のディレクトリにインストールされます。
make install-strip, make uninstall は compiler-independent-build と同
じです。
prefix ディレクトリは GCC の path から自動的に設定されます。例えば GCC
の path が /usr/local/bin/gcc であれば、/usr/local を prefix とします。
configure の --prefix オプションを指定しても、それが GCC の path と矛盾
していれば無視されます。また、make での DESTDIR オプションも、実行プログ
ラムのインストールには関係しません。
ただし、GCC 以外の処理系では先に移植作業を行い、configure でさらにいく
つかのオプションを指定しないと、適切なコンパイルとインストールがされませ
ん。
2、2、1、処理系が GCC の場合
2、2、1、1、make install
--enable-replace-cpp オプションで configure した場合、make install で
はコンパイラの置かれるディレクトリ(/usr/libexec, /usr/lib/gcc-lib/i686-
pc-linux-gnu/VERSION 等)に実行プログラムがインストールされます。これは
gcc の呼び出す cc1 (cpp0) が置かれているディレクトリです。make install
は GCC / cc1, cc1plus (cpp0) を保存した上で、gcc, g++ から MCPP が呼び出
されるように適切な設定をします。この設定は GCC が V.2.* であるか V.3.*,
4.* であるかによって違っていますmcpp-manual.html 3.9.5, 3.9.7 を参照の
こと。また、GCC のバージョンに応じたヘッダファイルが compiler-specific
な include directory の中の mcpp-gcc* というディレクトリに生成されます。
2、2、1、2、make check
MCPP の検証セットには GCC の testsuite に対応した edition があります。
GCC / testsuite がインストールされている場合は、make check によってこの
testsuite 版検証セットで MCPP の Standard モードのテストをすることができ
ます。Testsuite 版検証セットは GCC / testsuite の一部として使うようにな
っているので、あらかじめ GCC / testsuite がインストールされ実行できる状
態になっていることが必要です。GCC / testsuite は通常は GCC のソースの一
部となっています別のパッケージとなっている場合もある。GCC V.2.95.*
以降の testsuite が使えますが、V.4.3.* のものには若干の問題があるので、V.
4.2.* までのものを使ってください。
また、configure する時に GCC / testsuite の置かれているディレクトリを
指定しておく必要があります。そのためには次のようにします。
${mcpp-dir}/configure --with-gcc-testsuite-dir=DIR \
--enable-replace-cpp
この 'DIR' は GCC のソースが置かれているディレクトリを ${gcc-source} と
すると、
${gcc-source}/gcc/testsuite
となるはずです。
こうして configure しておいて、make; make install した後で
make check
とすると、検証セットの testsuite 版が GCC / testsuite の中にコピーされ、
GCC が V.2.* であるかそれとも V.3.*, 4.* であるかに応じて必要な設定がさ
れます。Testsuite では gcc の名前は文字通り 'gcc' でなければなりませんが、
MCPP をインストールした gcc の名前が違っている場合は、gcc という名前が一
時的にその名前に symbolic link されます。そして testsuite が実行されます。
通常のソフトウェアでは make install の前に make check しますが、MCPP の
場合は順序が逆になります。gcc から MCPP が呼び出されるようにしておかない
と testsuite が MCPP に適用できないからです。また、このため --enable-
replace-cpp オプションも必要です。
${gcc-source} のありかによっては make check は sudo make check としな
ければなりませんが、その場合は root と現ユーザとで 'which gcc' の結果が
一致していなければならないことに注意してください。
Testsuite 版検証セットは MCPP だけでなく、GCC V.2.95 以降の cc1,
cc1plus (cpp0) にも適用することができますcpp-test.html 3.2.3 参照)。
2、2、1、3、make uninstall
make uninstall とすると、MCPP の実行プログラムは削除されます。
mcpp-gcc* ディレクトリのヘッダファイルも削除されます。gcc, cc1, cc1plus
(cpp0) の設定は初期状態に戻ります。何かのつごうで make install した後で
configure を再実行する場合は、その前に make uninstall しなければなりませ
ん。Configure が調査すべきなのは GCC であり MCPP ではないからです。
GCC / testsuite の中に検証セットがインストールされていれば、それも
make uninstall で削除されます。GCC に検証セットを適用するには、手動で検
証セットをコピーしてください。
GCC-specific-build の configure で生成された何本かの Makefile は MCPP
を uninstall するときに必要なので、そのまま残しておいてください。make
distclean する場合は、その前に make uninstall を実行してください。手動で
uninstall するのは少し手間がかかるからです。同様に、configure や
Makefile.in が更新される場合は、その前に make uninstall; make distclean
しておかなければなりません。MCPP を update する場合は注意してください。
2、2、2、処理系が Mac OS X の Apple-GCC の場合
Mac OS X は UNIX 系とは言え、framework directory 等の独自の要素を持っ
ています。GCC も Apple による多くの拡張を施されたものがシステムコンパイ
ラになっています。さらに Intel-Mac の登場以降は、x86 用のコンパイラシス
テムと powerpc 用のコンパイラシステムとが(片方はネイティブコンパイラで
他方はクロスコンパイラですが同一マシンに共存するようになり、x86 用の実
行プログラムと powerpc 用の実行プログラムを1つに束ねてどちらのマシンで
も動くようにした universal binary というものまで作られるようになってきて
いるので、かなり複雑な構成になっています。
この複雑なシステムに MCPP をインストールするのは、2、2、1、の方法だけ
では足りません。そこで、Mac OS X / Apple-GCC の場合を、別にとりあげて説
明します。私は Intel-Mac の Mac OS X Leopard を使っているのでそれを例に
とりますが、Powerpc-Mac では i686 と powerpc を逆にして読んでください。
また、Tiger では darwin9 を darwin8 に読み替えてください。
なお、ここでとりあげるのは GCC 4.0.1 です。そのほか GCC 3.3 も Apple
によって用意されていますが、少なくとも Leopard 上のものは正しくコンパイ
ルされていないので、とりあげません。
2、2、2、1、ネイティブコンパイラとクロスコンパイラ
まず、native コンパイラIntel-Mac なら i686 用 GCC用の MCPP をイン
ストールのは簡単で、2、2、1、の方法ですみます。
しかし、クロスコンパイラ用の MCPP をインストールするのは、そう簡単では
ありません。MCPP の configure は一般にはクロスコンパイリングに対応してい
ません。サンプルプログラムをコンパイルして run させるテストがいくつか含
まれているからです。ターゲット環境用のバイナリをビルド環境で実行すること
は、普通はできません。また、ビルド環境のテストをしても、その結果はターゲ
ット環境とは違っているかもしれません。
しかし、Mac OS X の場合は例外的に、クロスコンパイルに対応できる場合が
多くあります。まず、Intel-Mac は ppc 用のバイナリをエミュレータで自動実
行させるようになっています。また、CPU が違っても OS とそのバージョンも
GCC のバージョンも同じであれば、ビルド環境でのテストでターゲット環境のテ
ストの多くを代用できます。
Intel-Mac 上での compiler-independent-build ではまず、CC, CXX という環
境変数で C コンパイラと C++ コンパイラを指定します。Mac OS X の /usr/bin
にはいくつもの gcc や g++ がありますが、Intel-Mac の Mac OS X Leopard で
は powerpc-apple-darwin9-gcc-4.0.1, powerpc-apple-darwin9-g++-4.0.1 とい
うのが powerpc 用の C コンパイラと C++ コンパイラです(実際には /usr/bin
の gcc, g++ はすべて i386, ppc 双方のバイナリを合わせた universal binary
ですが)。さらに、ターゲットシステムを --target オプションで指定します。
この場合はコンパイラの名前から -gcc-4.0.1 等の部分を削除した powerpc-
apple-darwin9 を使います。結局、こうなります。
${mcpp-dir}/configure --target=powerpc-apple-darwin9 \
CC=powerpc-apple-darwin9-gcc-4.0.1 \
CXX=powerpc-apple-darwin9-g++-4.0.1
他方で ppc-Mac では x86 のバイナリを実行できないので、この configure
では compiler-independent-build のクロスコンパイルはできません。差分ファ
イルと mac_osx.mak を使った手動コンパイルであればクロスコンパイルもでき
るので、必要なら mcpp-porting.html#3.1.4, #3.11 を見てください。また、
configure でも次節の方法を使えば、ppc-Mac の native compiler で
universal binary を作ることはできます。
GCC-specific-build では CC, CXX は使わず、次のように --with-target-cc=
というオプションで C コンパイラを指定します(その名前の gcc を g++ に変
えたものを C++ コンパイラと解釈します)。
${mcpp-dir}/configure --target=powerpc-apple-darwin9 \
--with-target-cc=powerpc-apple-darwin9-gcc-4.0.1 \
--enable-replace-cpp
これはターゲット環境の実行テストは含まないので、powerpc を i686 に置き
換えれば ppcMac で使えるはずです。
デフォルトのネイティブコンパイラgcc, g++)と --with-target-cc= で指
定するクロスコンパイラとで大きくバージョンが違っている場合は、そのクロス
コンパイラになるべく近いバージョンのネイティブコンパイラを環境変数 CC,
CXX で指定してください。CC (CXX) で指定するのは MCPP をビルドするための
コンパイラであり、--with-target-cc= で指定するのは MCPP をインストールす
るターゲットのコンパイラです。
クロスコンパイラはネイティブコンパイラとは libexec directory, compiler-
specific include directory, 事前定義マクロ等が異なりますが、それらがこの
オプション指定によって適切に設定されます。これらのオプションは make では
なく configure で指定する必要があります。
なお、クロスコンパイラはホストシステム上で動作するものなので、その「ク
ロスコンパイラに」インストールされる compiler-specific-build の MCPP も
同様です。他方で「クロスコンパイラで」コンパイルされた compiler-
independent-build の MCPP は、ターゲットシステムで動くものになります。ま
た、GCC-specific-build はネイティブコンパイラにインストールされるものも
クロスコンパイラにインストールされるものも、ともにネイティブコンパイラで
コンパイルされます。このため、この双方をインストールする場合は、クロスコ
ンパイラ用を先にインストールする必要があります。
2、2、2、2、Universal binary の make
Universal binary を作るには、make する時に CFLAGS+='-arch i386 -arch
ppc' というように、対象とする CPU を -arch オプションで指定します。指定
できる CPU は i386, x86_64, ppc, ppc64 の種類です。make CFLAGS+='-arch
i386 -arch x86_64 -arch ppc -arch ppc64' とすると4種の CPU に対応したも
のができます。configure は universal binary でない場合と同じで、特別なオ
プションは必要ありません。
GCC には -isysroot DIRまたは --sysroot=DIRというオプションがありま
す。これが指定されると、システムヘッダの include directory としてデフォ
ルトの include directory に DIR を頭に付けたものが使われます。このオプシ
ョンは Mac OS に限ったものではありませんが、Mac OS では universal binary
のコンパイルにこれが使われています。Mac OS のバージョン間の互換性の範囲
を広げるためです。例えば、-isysroot /Developer/SDKs/MacOSX10.4u.sdk とす
ると、/usr/include が /Developer/SDKs/MacOSX10.4u.sdk/usr/include となり
ます。この例は Mac OS X 10.5 (Leopard) 上で 10.4 (Tiger) と互換の
universal binary をコンパイルするためのものです。MCPP の make でこれを使
うためには、さらに -mmacosx-version-min= というオプションで SDK と同じバ
ージョンを指定する必要があります。
MCPP の universal binary は、上記の configure オプションとこれらの
make オプションを組み合わせることで、compiler-independent-build, GCC-
specific-build のどちらでも、native-compiler, cross-compiler のどちらで
も生成することができます。例えば compiler-independent-build で Tiger 互
換の i386 と ppc 用のものを作るにはこうします(実際には、'*' の中を \ で
2行に分けることはできない)。
${mcpp-dir}/configure
make CFLAGS+='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-mmacosx-version-min=10.4 -arch i386 -arch ppc'
sudo make install
2、2、3、処理系が GCC でない場合
処理系が GCC でない場合は configure でいくつかのオプションを指定しなけ
ればなりません。また、その処理系のプリプロセッサと置換できるように、ソー
スコードを書き足す「移植」作業が必要です。作者自身は Linux, FreeBSD, Mac
OS X, CygWIN, MinGW 等で GCC を使っているので移植がすんでおり、configure
で情報を収集することもできるのですが、UNIX 系システムの他の処理系につい
ては知らないので、移植はおろが configure で何をどう調べれば良いのかもわ
からないからです。
UNIX 系システムの GCC 以外の処理系では、次のような手順でコンパイルを進
めてください。
2、2、3、1、オプションを指定して configure
まず、いくつかのオプションを指定して configure してみます。例えば次の
ようにします。
${mcpp-dir}/configure --enable-replace-cpp --bindir=DIR \
--with-cxx-include-dir=CXXDIR \
--enable-SYSTEM-STD-macro=_MACRO=val
--bindir で指定するのは、コンパイラドライバから呼び出されるプリプロセ
ッサが置かれるディレクトリです。さらに C++ 固有のインクルードディレクト
リを --with-cxx-include-dir で、また処理系固有の事前定義マクロを
--enable-SYSTEM-STD-macro その他のオプションで指定します。
${mcpp-dir}/configure --help
とするとオプションが表示されます。
そして make; make install して、さらにコンパイラドライバから MCPP が呼
び出されるように細工をします。その方法については、GCC での設定方法を参考
にしてください。
2、2、3、2、「移植」作業
処理系のプリプロセッサを MCPP に置き換えて使うためには、ソースコードを
書き足す「移植」作業が必要です。処理系固有の実行時オプションや #pragma
等の実装です。中でもしばしば使われる実行時オプションで MCPP と異なるもの
があれば、最低限、その実装が必要です。そのためには、configed.H でそのコ
ンパイラを表すマクロを定義した上で、system.c にコードを書き加えます
mcpp-porting.html のことに 4.2 を参照)。
2、2、3、3、オプションを追加して configure しなおす
ソースの移植ができたら、--with-compiler-name=COMPILER というオプション
を追加して configure し直します。COMPILER は configed.H で定義したそのコ
ンパイラを表すマクロです。
make; make install ができたら、さらに make clean; make とすると、MCPP
を使って MCPP のリコンパイルが行われます。これが通れば、最低限の移植はで
きています。
2、2、4、configure の制約
compiler-specific-build の MCPP のコンパイルではターゲット処理系MCPP
をプリプロセッサとして使う予定の処理系)の仕様を詳しく知る必要があります。
同時に、コンパイルする処理系についても別の側面の仕様を知る必要があります。
MCPP のソースはこの両者の処理系が違っていてもかまわないように、両者の設
定を分けてヘッダファイル (configed.H) を書いてあります。しかし、
configure ではこの両者を同時に調べることができません。そのため、ターゲッ
トとする処理系とコンパイルする処理系は同じであるという前提で調査をします。
もしこの両者の処理系が違う場合は、configed.H の Part 2 を編集すること
が必要です。
MCPP の configure は同様にクロスコンパイルにも対応していません。また、
クロスコンパイルでは実行できないテストもいくつか含まれています。クロスコ
ンパイルではその場合はデフォルト値をセットしますが、うまくゆかないかもし
れません。
3、Windows 上の処理系での make
Windows 上の処理系は CygWIN, MinGW 以外は configure の対象にならないの
で、ソースを修正して make することが必要です。すでに移植ずみの処理系につ
いては差分ファイルを用意してあるので、これを使ってパッチをあてることがで
きます。差分ファイルを使う場合の手順を以下に説明します。
また、configure の対象になる処理系でも、ヘッダファイルや makefile を直
接、編集することできめのこまかい制御をすることができます。
3、1、パッチをあてる
noconfig というディレクトリに各種処理系用の差分ファイルと makefile が
用意されています。MCPP のソースはデフォルトでは FreeBSD / GCC 3.4 用の設
定になっています。差分ファイルはこれを別の処理系用に修正するものです。
Makefile は各処理系に付属する make を使うように書かれています。
src ディレクトリに入って次のようにします。以下の作業はすべて src ディ
レクトリで行います。
patch -c < ..\noconfig\which-compiler.dif
copy ..\noconfig\which-compiler.mak Makefile
patch は UNIX 系システムのコマンドですが、Windows にも移植されているの
で、それを使います。もちろん、差分ファイルを見て、エディタで修正してもか
まいません。
3、2、必要ならさらに noconfig.H, Makefile を修正する
差分ファイルでは各種ディレクトリの設定が筆者の環境を元にしているので、
自分の環境に合わせて修正します。
使う処理系が差分ファイルのものとはバージョンが違っている場合は、ヘッダ
ファイル noconfig.H にさらに修正を加えますnoconfig.H そのものおよび
mcpp-porting.html 3.1 を参照)。通常使う multi-byte character が日本語で
はない場合も同様に、nocongig.H の MBCHAR というマクロの定義を書き換えま
す。
また、実行プログラムをインストールするディレクトリを Makefile の
BINDIR という変数に書きます。Visual C 用の Makefile では次の行の # を削
除して、install ターゲットを有効にしてください。
#install :
3、3、compiler-independent-build
これで make して make install すると、compiler-independent 版の実行プ
ログラムが生成されてインストールされますVisual C++ では make ではなく
nmake を使う)。
3、4、compiler-specific-build
compiler-specific 版を生成するためには、まず Makefile の BINDIR をその
処理系の実行プログラムの置かれているディレクトリに書き換えます。そして、
noconfig.H の次の行の 'INDEPENDENT' をそのコンパイラを表すマクロに書き換
えて、'make' し 'make install' します。
#define COMPILER INDEPENDENT
'COMPILER' は make のオプションで上書きすることもできるので、noconfig.H
は必ずしも書き換える必要はありません。例えば、Visual C では 'nmake
COMPILER=MSC' として 'nmake COMPILER=MSC install' します。Borland C では
'make -DCOMPILER=BORLANDC' として 'make -DCOMPILER=BORLANDC install' し
ます。
もし、ターゲット処理系とコンパイルする処理系とが違っている場合は、
noconfig.H / Part 1 をターゲット処理系の仕様に合わせ、Part 2 をコンパイ
ルする処理系の仕様に合わせます。Makefile はコンパイルする処理系用のもの
を使い、インストールするディレクトリをターゲット処理系用に変更します。
しかし、Windows の処理系の多くはプリプロセッサがコンパイラ本体と一体に
なっているので、MCPP をインストールしてもプリプロセッサを置換することが
できません。そうした処理系で MCPP を使うためには、そのように makefile を
書く必要があります。noconfig ディレクトリの各 makefile には、MCPP を使っ
て MCPP をリコンパイルする設定が書いてあるので、それを参考にしてください。
Visual C++ ではそうした makefile を使って、IDE で「メイクファイルプロ
ジェクト」を作成すると、IDE のソースレベルデバッグ等の機能がすべて使えま
mcpp-manual.html 2.10 参照)。
3、5、テスト
Windows では MinGW / GCC-specific-build および CygWIN 以外では include
directory は設定されないので、INCLUDE という環境変数で設定します(必要な
ら CPLUS_INCLUDE も)。
Windows では GCC / testsuite は使えないので、test-t, test-c, test-l デ
ィレクトリにあるテスト用サンプルを直接、プリプロセスして確かめます。tool
/cpp_test.c を使うと、一部のテストだけですが、自動的に実行できますcpp-
test.html 3.2.2 参照)。
compiler-specific-build では、MCPP 自身をプリプロセッサとして使って、
MCPP の "pre-preprocess" という機能を使って MCPP をリコンパイルしてみる
と、その処理系でとりあえず使えるようになったかどうかを確かめることができ
ますmcpp-porting.html 3.7 参照)。
4、移植のための情報をお寄せください
MCPP をまだ移植されてない処理系に移植するためには、多くの情報が必要で
す。みなさんの情報をお待ちしています。
GCC 以外の処理系について configure のオプションで指定する値がおわかり
のかたは教えてください。configure.ac に取り込んでゆきたいと思います。
5、「検証セット」とは
MCPP には「検証セット」というものが付属しています。これは C/C++ プリプ
ロセッサについて 265 項目にわたる徹底的なテストと評価をするものです。
MCPP だけでなく任意のプリプロセッサに適用することができます。その使い方
については、cpp-test.html 3.1, 3.2 を参照してください。
2008/11
松井 潔 <kmatsui@t3.rim.or.jp>

29
libraries/mcpp/LICENSE Normal file
View File

@ -0,0 +1,29 @@
/*-
* Copyright (c) 1998, 2002-2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
* All rights reserved.
*
* This software including the files in this directory is provided under
* the following license.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

View File

@ -0,0 +1,38 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src
if REPLACE_CPP
SUBDIRS += tests .
man_page = mcpp-gcc
else
man_page = mcpp
endif
man1_MANS = $(man_page).1
EXTRA_DIST = $(top_srcdir)/LICENSE $(top_srcdir)/INSTALL* \
$(top_srcdir)/ChangeLog.old $(top_srcdir)/NEWS \
$(top_srcdir)/mcpp.1 $(top_srcdir)/mcpp-gcc.1 $(top_srcdir)/config \
$(top_srcdir)/src/preproc.c $(top_srcdir)/src/noconfig.H \
$(top_srcdir)/src/cc1.c $(top_srcdir)/src/*set_mcpp.sh \
$(top_srcdir)/src/testmain.c $(top_srcdir)/src/mcpp_lib.def \
$(top_srcdir)/tests/*_test.sh $(top_srcdir)/noconfig \
$(top_srcdir)/cpp-test $(top_srcdir)/test-t \
$(top_srcdir)/test-c $(top_srcdir)/test-l $(top_srcdir)/tool \
$(top_srcdir)/doc $(top_srcdir)/doc-jp
if ! REPLACE_CPP
install-exec-hook:
$(top_srcdir)/config/install-sh -d "$(DESTDIR)$(prefix)/share/doc/mcpp"
cp -pf $(top_srcdir)/LICENSE $(top_srcdir)/README $(top_srcdir)/NEWS \
$(DESTDIR)$(prefix)/share/doc/mcpp
cp -pf $(top_srcdir)/doc/mcpp-manual.html \
$(DESTDIR)$(prefix)/share/doc/mcpp
cp -pf $(top_srcdir)/doc-jp/mcpp-manual.html \
$(DESTDIR)$(prefix)/share/doc/mcpp/mcpp-manual-jp.html
uninstall-hook:
rm -rf $(DESTDIR)$(prefix)/share/doc/mcpp
endif

709
libraries/mcpp/Makefile.in Normal file
View File

@ -0,0 +1,709 @@
# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
@REPLACE_CPP_TRUE@am__append_1 = tests .
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure ChangeLog \
INSTALL NEWS config/compile config/config.guess \
config/config.sub config/depcomp config/install-sh \
config/ltmain.sh config/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
depcomp =
am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man1_MANS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = src tests .
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
Target_Cpu = @Target_Cpu@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cpp_call = @cpp_call@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
gcc_maj_ver = @gcc_maj_ver@
gcc_min_ver = @gcc_min_ver@
gcc_path = @gcc_path@
gcc_testsuite_dir = @gcc_testsuite_dir@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_system = @host_system@
host_vendor = @host_vendor@
htmldir = @htmldir@
inc_dir = @inc_dir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cc = @target_cc@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src $(am__append_1)
@REPLACE_CPP_FALSE@man_page = mcpp
@REPLACE_CPP_TRUE@man_page = mcpp-gcc
man1_MANS = $(man_page).1
EXTRA_DIST = $(top_srcdir)/LICENSE $(top_srcdir)/INSTALL* \
$(top_srcdir)/ChangeLog.old $(top_srcdir)/NEWS \
$(top_srcdir)/mcpp.1 $(top_srcdir)/mcpp-gcc.1 $(top_srcdir)/config \
$(top_srcdir)/src/preproc.c $(top_srcdir)/src/noconfig.H \
$(top_srcdir)/src/cc1.c $(top_srcdir)/src/*set_mcpp.sh \
$(top_srcdir)/src/testmain.c $(top_srcdir)/src/mcpp_lib.def \
$(top_srcdir)/tests/*_test.sh $(top_srcdir)/noconfig \
$(top_srcdir)/cpp-test $(top_srcdir)/test-t \
$(top_srcdir)/test-c $(top_srcdir)/test-l $(top_srcdir)/tool \
$(top_srcdir)/doc $(top_srcdir)/doc-jp
all: all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \
cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign --ignore-deps Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(MANS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@REPLACE_CPP_TRUE@install-exec-hook:
@REPLACE_CPP_TRUE@uninstall-hook:
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-man
install-dvi: install-dvi-recursive
install-exec-am:
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-recursive
install-info: install-info-recursive
install-man: install-man1
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-man
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
uninstall-man: uninstall-man1
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-exec-am install-strip uninstall-am
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-libtool distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-exec-hook install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-hook uninstall-man uninstall-man1
@REPLACE_CPP_FALSE@install-exec-hook:
@REPLACE_CPP_FALSE@ $(top_srcdir)/config/install-sh -d "$(DESTDIR)$(prefix)/share/doc/mcpp"
@REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/LICENSE $(top_srcdir)/README $(top_srcdir)/NEWS \
@REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp
@REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/doc/mcpp-manual.html \
@REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp
@REPLACE_CPP_FALSE@ cp -pf $(top_srcdir)/doc-jp/mcpp-manual.html \
@REPLACE_CPP_FALSE@ $(DESTDIR)$(prefix)/share/doc/mcpp/mcpp-manual-jp.html
@REPLACE_CPP_FALSE@uninstall-hook:
@REPLACE_CPP_FALSE@ rm -rf $(DESTDIR)$(prefix)/share/doc/mcpp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

120
libraries/mcpp/NEWS Normal file
View File

@ -0,0 +1,120 @@
This file summarizes new major features of each MCPP release. (kmatsui)
MCPP V.2.7.2 (2008/11)
1. This is a bug-fixed version of V.2.7.1, fixing several bugs of the
previous release.
2. Enabled some CPU-specific predefined macros in compiler-independent-
build as well as compiler-specific-build.
MCPP V.2.7.1 (2008/05)
1. This is a bug-fixed version of V.2.7, fixing several bugs of the
previous release.
2. Made subroutine-build also install an mcpp executable and minimal
documents as well as libmcpp for a convenience of library package.
MCPP V.2.7 (2008/03)
1. Implemented -K option to enable macro notification mode. This mode
is designed for C/C++ refactoring tools and embeds macro annotations
into comments. This mode is also enabled by '#pragma MCPP debug
macro_call' sub-directive.
2. Fixed several bugs of the previous release, including a bug of UTF-8
multibyte character handling.
3. Ported to Mac OS X / GCC and Visual C++ 2008.
4. Made GCC-specific-build closer to GCC.
5. Added documentation on source checking of firefox 3.0pre.
MCPP V.2.6.4 (2007/05)
1. This is a bug-fixed version of V.2.6.3, fixing memory leaks in
subroutine-build, and fixing a bug of accessing non-allocated memory.
2. Also changed the installation directory of some documents in stand-
alone-and-compiler-independent-build by configure or by binary
packages.
MCPP V.2.6.3 (2007/04)
1. Revised subtle points of #include and '#pragma once' handling, such
as dereferencing symbolic linked directory and others.
2. Relaxed syntax checking and token checking in lang_asm mode.
Implemented variadic macro of GCC3-specification for GCC-specific-
build. Increased compatibility of GCC-specific-build to GCC.
3. Implemented optional memory buffer output (other than file) in
subroutine-build.
4. Added 'mcpplib' target to make subroutine-build in configure.ac and
noconfig/*.mak.
5. Abolished 'install-data' and 'uninstall-data' targets of configured
makefile. On the other hand, made 'install' target install also
mcpp-manual.html.
6. Provided stand-alone-and-compiler-independent-build binary packages
port, rpm, deb, zip and their corresponding source packages on
SourceForge.
7. Added documentation on source checking of glibc 2.4.
MCPP V.2.6.2 (2006/11)
1. Fixed several bugs of the previous release.
2. Added subroutine-build to use MCPP as a subroutine from other main
program.
3. Changed the terms of building methods in the documents. The building
methods now have two axis:
1. stand-alone-build vs subroutine-build
2. compiler-independent-build vs compiler-specific-build
Refer to INSTALL #1.
Note that this change of terminology does not affect the two
building methods of stand-alone preprocessor so far: 'compiler-
independent-build' and 'compiler-specific-build'. ('compiler-
independent-build' was called 'stand-alone-build' in the previous
releases).
4. Rewrote and converted the text files in 'doc' and 'doc-jp'
directories into html files.
MCPP V.2.6.1 (2006/08)
1. Fixed several bugs of the previous release.
2. Revised path-list handling on CygWIN.
3. Added porting to MinGW/MSYS.
MCPP V.2.6 (2006/07)
1. Integrated STANDARD mode and PRE_STANDARD mode into one executable,
differentiating the modes by the execution time options.
2. Changed --enable-maintainer-mode option of configure to --enable-
replace-cpp option which generates compiler-specific-build of mcpp.
3. Made compiler-independent-build really independent from any compiler-
systems. It no longer requires GCC-specific header files.
4. Removed settings for pre-C90 compiler.
Removed settings for MS-DOS compiler, DJGPP and Plan9.
5. Added portings to GCC V.4.0, CygWIN 1.5.18, Visual C++ 2005 and LCC-
Win32 2006-03.

53
libraries/mcpp/README Normal file
View File

@ -0,0 +1,53 @@
<< What is MCPP >>
MCPP is a C/C++ preprocessor with the following features:
1. Implements all of C90, C99 and C++98 features. It has the highest
conformance.
2. Accompanies a validation suite to test the C/C++ preprocessors
comprehensively. When it is applied to the existing preprocessors,
MCPP shows outstanding result.
3. Has a variety of accurate diagnostic messages. This allows
examination of most preprocessing problems of source, like potential
bugs or portability problems.
4. Has various #pragma directives to output debug information.
5. Supports the various encodings of multi-byte characters for Japan,
China, Taiwan and Korea.
6. Highly portable. Supports many compiler systems on UNIX-like
systems and Windows. It can replace resident preprocessor of the
compiler system. It can also behave independently from any compiler
systems. Moreover, it can be built as a subroutine from any other
main program, too.
7. Preprocessors of various behavior specifications can be generated
from the source.
8. Is an open source software released under BSD-style-license.
9. Full documentations in Japanese and English are attached.
MCPP is probably the best C preprocessor in the world.
MCPP was selected as one of the "Exploratory Software Projects" of the
Information-technology Promotion Agency (IPA), Japan, in year 2002 and
2003. With its achievements, the author was evaluated as one of the
highest rank programmers.
The sources and documents of MCPP are found at:
http://mcpp.sourceforge.net/
Please read mcpp-summary.pdf for the overview of MCPP and Validation
Suite.
Please read INSTALL (INSTALL-jp) for how to install MCPP on your system
from the source. Refer to the above web page for installation of the
binary packages of MCPP.
All the files except mcpp-summary.pdf are normal text files. In the
.tar.gz file, newline of the text files are [LF], and encoding of
INSTALL-jp is EUC-JP. In the .zip file, newline of the text files are
[CR][LF], and encoding of INSTALL-jp is shift-JIS.
I would like to hear from many C programmers for reviews, comments and
the interest to participate in development.
Kiyoshi Matsui <kmatsui@t3.rim.or.jp>

6964
libraries/mcpp/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
libraries/mcpp/bin/mcpp.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,142 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

1500
libraries/mcpp/config/config.guess vendored Normal file

File diff suppressed because it is too large Load Diff

1608
libraries/mcpp/config/config.sub vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
#! /bin/sh
# split from configure.ac to work around a problem of backslash handling
mount | grep ' on / ' | sed 's, on / .*,,' | tr '\\' '/'

View File

@ -0,0 +1,530 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -0,0 +1,323 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [BIGFIVE], [bigfive], [¥\ÁZ])

View File

@ -0,0 +1,2 @@
AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [ISO2022_JP], [iso2022_jp], [$B0\F0(B])

View File

@ -0,0 +1,2 @@
AC_CHECK_MBCHAR_IS_ESCAPE_FREE( [SJIS], [sjis], [•\Ž¦])

View File

@ -0,0 +1,3 @@
#! /bin/sh
# split from configure.ac to work around a problem of backslash handling
/tmp/a.exe | tr '\\' '/'

View File

@ -0,0 +1,360 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

23147
libraries/mcpp/configure vendored Normal file

File diff suppressed because it is too large Load Diff

778
libraries/mcpp/configure.ac Normal file
View File

@ -0,0 +1,778 @@
dnl configure.ac for MCPP 2003/11, 2008/11 kmatsui
dnl Process this file with autoconf to produce a configure script.
dnl WARNING: This script does not assume cross-compiling.
dnl To cross-compile you must edit here and there of this file.
AC_INIT( mcpp, 2.7.2, kmatsui@t3.rim.or.jp)
AC_CONFIG_SRCDIR( src/main.c)
AM_CONFIG_HEADER( src/config.h)
AC_CONFIG_AUX_DIR( config)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE( no-dependencies)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_EGREP
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
dnl WARNING: Configure must check the characteristics of target compiler.
dnl MCPP may modify the behavior of the target compiler-system.
dnl You must uninstall MCPP before re-configuring.
AC_MSG_CHECKING( [whether the cpp is target preprocessor])
mcpp=`$CPP $CFLAGS -xc -v /dev/null 2>&1 | grep 'MCPP'`
if test "x$mcpp" != x; then
AC_MSG_ERROR( Do 'make uninstall' before configuring again.)
fi
AC_MSG_RESULT( yes)
dnl Define host system and target system
case $host_os in
linux*)
AC_DEFINE( [HOST_SYSTEM], [SYS_LINUX], [Define the host system.])
ac_c_define_HOST_SYSTEM=[SYS_LINUX]
;;
freebsd*)
AC_DEFINE( [HOST_SYSTEM], [SYS_FREEBSD])
ac_c_define_HOST_SYSTEM=[SYS_FREEBSD]
;;
darwin*)
AC_DEFINE( [HOST_SYSTEM], [SYS_MAC])
ac_c_define_HOST_SYSTEM=[SYS_MAC]
;;
cygwin*)
AC_DEFINE( [HOST_SYSTEM], [SYS_CYGWIN])
ac_c_define_HOST_SYSTEM=[SYS_CYGWIN]
;;
mingw*)
AC_DEFINE( [HOST_SYSTEM], [SYS_MINGW])
ac_c_define_HOST_SYSTEM=[SYS_MINGW]
;;
*)
AC_MSG_WARN( [Unsupported host OS, assuming to be an UNIX variant])
AC_DEFINE( [HOST_SYSTEM], [SYS_UNIX])
ac_c_define_HOST_SYSTEM=[SYS_UNIX]
;;
esac
host_system=$ac_c_define_HOST_SYSTEM
case $target_os in
linux*)
AC_DEFINE( [SYSTEM], [SYS_LINUX], [Define the target system.])
;;
freebsd*)
AC_DEFINE( [SYSTEM], [SYS_FREEBSD])
;;
darwin*)
AC_DEFINE( [SYSTEM], [SYS_MAC])
;;
cygwin*)
AC_DEFINE( [SYSTEM], [SYS_CYGWIN])
;;
mingw*)
AC_DEFINE( [SYSTEM], [SYS_MINGW])
;;
*)
AC_MSG_WARN( Unsupported target OS, assuming to be an UNIX variant)
AC_DEFINE( [SYSTEM], [SYS_UNIX])
;;
esac
## --enable-replace-cpp option
AC_ARG_ENABLE( replace-cpp,
AC_HELP_STRING( [--enable-replace-cpp],
[Replace the resident preprocessor with mcpp]),
, ## the compiler name will be defined later
AC_DEFINE( [COMPILER], [INDEPENDENT], [Define the target compiler.])
## else define COMPILER as INDEPENDENT
)
## Generally this configure does not support cross-compiling.
## Nevertheless, it can configure cross-compiler of Apple-GCC (i686 vs ppc).
if test x$enable_replace_cpp = xyes \
&& test $ac_c_define_HOST_SYSTEM = SYS_MAC \
&& test $host_cpu != $target_cpu; then
## Enable to build mcpp into cross-compiler of Apple-GCC
## --with-target-cc option
AC_ARG_WITH( target_cc,
AC_HELP_STRING( [--with-target-cc],
[Specify the target compiler to build mcpp into on Mac OS X]),
if test x${withval+set} = xset; then
target_cc=$withval
target_name=`echo $target_cc | sed 's/-gcc.*$//'`
if test $target_name != $target_alias; then
AC_MSG_ERROR( [The argument of --with-target-cc option conflicts with --target option.])
fi
AC_SUBST( [target_cc])
fi
)
fi
dnl Define a target specific macro.
AC_MSG_CHECKING( for target cpu)
## These are not predefined macros of MCPP. MCPP will define predefined macros
## on compile time based on the CPU macro, and possibly redefine them at an
## execution time.
case $target_cpu in
x86_64|amd64)
Target_Cpu=x86_64
;;
i?86*)
Target_Cpu=i386
;;
powerpc64|ppc64)
Target_Cpu=ppc64
;;
powerpc|ppc|ppc7400)
Target_Cpu=ppc
;;
*)
Target_Cpu=$target_cpu
;;
esac
AC_MSG_RESULT( $Target_Cpu)
AC_DEFINE_UNQUOTED( [CPU], "$Target_Cpu", [Define the cpu-specific-macro.])
## Build into cross-compiler on Mac OS
if test x$enable_replace_cpp = xyes \
&& test $ac_c_define_HOST_SYSTEM = SYS_MAC \
&& test x${target_cc+set} = xset; then
arch_opt="-arch $Target_Cpu"
fi
dnl Checks for header files.
AC_CHECK_HEADERS( [unistd.h, stdint.h, inttypes.h])
dnl Checks for typedefs, and compiler characteristics.
AC_CHECK_TYPES( [intmax_t, long long])
dnl Check for library functions.
AC_CHECK_FUNCS( [stpcpy])
dnl Checks for some system characteristics.
AC_CACHE_CHECK( if the cases of filename are folded,
ac_cv_fname_fold,
[touch hJkL
[ac_cv_fname_fold=no]
AC_RUN_IFELSE( [[
#include <stdio.h>
#include <errno.h>
void exit();
int main( void)
{
if (fopen( "HjKl", "r") == NULL)
exit( errno);
else
exit( 0);
} ]],
[ac_cv_fname_fold=yes],
[],
AC_MSG_WARN( cannot run on cross-compiling so assumes that the cases of filename are not folded.)
)
rm hJkL],
)
if test x$ac_cv_fname_fold = xyes; then
AC_DEFINE( [FNAME_FOLD], 1,
[Define if the cases of file name are folded.])
fi
dnl Checks for some host compiler characteristics.
AC_DEFINE_UNQUOTED( [OBJEXT], ["$ac_cv_objext"],
[Define the suffix of object file.])
dnl Check printf length modifier of the longest integer.
# AC_CHECK_MOD_LL( modifier, additional include header)
# Try the printf length modifier for the longest integer.
# The redundant sscanf() is for some compilers which cannot handle
# long long integer token.
AC_DEFUN([AC_CHECK_MOD_LL], [
AC_CACHE_CHECK( [printf length modifier for the longest integer],
[ac_cv_c_printf_modifier],
AC_RUN_IFELSE( [[
#include <stdio.h>
#include <assert.h>
int strcmp();
void exit();
$3
int main( void)
{ char buf@<:@ 20@:>@;
$1 num;
sscanf( "1234567890123456789", "%$2d", &num);
sprintf( buf, "%$2d", num);
assert( strcmp( buf, "1234567890123456789") == 0);
exit( 0);
} ]],
[ac_cv_c_printf_modifier=$2],
,
AC_MSG_WARN( cannot run on cross-compiling so assumes the length modifier of long long is "%ll")
AC_DEFINE( [LL_FORM], "ll",
[Define printf length modifier for the longest integer.])
[ac_cv_c_printf_modifier=ll]
)
)
] )
if test x$ac_cv_type_intmax_t = xyes; then
AC_CHECK_MOD_LL( [intmax_t], [j], [#include <stdint.h>])
if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \
|| test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then
sleep 1 # wait for cleanup
fi
fi
if test x$ac_cv_type_long_long = xyes; then
for modifier in ll I64 q L
do
AC_CHECK_MOD_LL( [long long], ${modifier})
if test x${ac_cv_c_printf_modifier+set} = xset; then
break
fi
if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \
|| test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then
sleep 1 # wait for cleanup
fi
done
fi
if test x${ac_cv_c_printf_modifier+set} = xset; then
AC_DEFINE_UNQUOTED( [LL_FORM], "$ac_cv_c_printf_modifier",
[Define printf length modifier for the longest integer.])
fi
if test $ac_c_define_HOST_SYSTEM = SYS_FREEBSD && \
test x$mcpp_ac_c_define_SYSTEM_SP_STD != x__FreeBSD__; then
fbsd_ver=`echo '__FreeBSD__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'`
AC_DEFINE_UNQUOTED( [SYSTEM_EXT_VAL], "$fbsd_ver",
[Define the version of FreeBSD.])
fi
if test x$ac_cv_c_compiler_gnu = xyes; then
AC_DEFINE( [HOST_COMPILER], [GNUC], [Define the host compiler.])
AC_DEFINE( [HOST_CMP_NAME], "GCC", [Define the host compiler name.])
AC_MSG_CHECKING( for value of __GNUC__)
gcc_maj_ver=`echo '__GNUC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'`
AC_MSG_RESULT( $gcc_maj_ver)
AC_DEFINE_UNQUOTED( [GCC_MAJOR_VERSION], "$gcc_maj_ver",
[Define gcc major version.])
AC_MSG_CHECKING( for value of __GNUC_MINOR__)
gcc_min_ver=`echo __GNUC_MINOR__ | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'`
AC_MSG_RESULT( $gcc_min_ver)
AC_DEFINE_UNQUOTED( [GCC_MINOR_VERSION], "$gcc_min_ver",
[Define gcc minor version.])
cw=`pwd`
if test x$srcdir = "x." || test x$srcdir = x; then
src_dir=$cw
else
src_dir=$srcdir
fi
if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN; then
AC_CACHE_CHECK( the root directory,
ac_cv_cygwin_root,
[ac_cv_cygwin_root=`$src_dir/config/cygwin_root`]
)
AC_DEFINE_UNQUOTED( [CYGWIN_ROOT_DIRECTORY], "$ac_cv_cygwin_root",
[Define root directory of CYGWIN.])
fi
if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then
AC_CACHE_CHECK( the root directory,
ac_cv_msys_root,
cd /tmp
cat > getcwd.c <<\_EOF
#include <stdio.h>
#include <unistd.h>
#include <limits.h>
int main( int argc, char ** argv)
{ char buf@<:@ PATH_MAX@:>@;
getcwd( buf, PATH_MAX);
puts( buf);
return 0;
}
_EOF
$CC getcwd.c
cd /
[ac_cv_msys_root=`$src_dir/config/mingw_root`]
)
AC_CACHE_CHECK( the /mingw directory,
ac_cv_mingw_dir,
cd /mingw
[ac_cv_mingw_dir=`$src_dir/config/mingw_root`]
)
cd $cw
rm -f /tmp/getcwd.c /tmp/a.exe
AC_DEFINE_UNQUOTED( [MSYS_ROOT_DIRECTORY], "$ac_cv_msys_root",
[Define root directory of MSYS.])
AC_DEFINE_UNQUOTED( [MINGW_DIRECTORY], "$ac_cv_mingw_dir",
[Define /mingw directory.])
fi
else # not gcc
# mcpp_AC_C_DEFINE( SYSTEM | CPU | COMPILER, STD | OLD, $enableval)
# Specify the target-specific predefined macro.
AC_DEFUN([mcpp_AC_C_DEFINE], [
name=`echo $3 | sed 's/=.*//'`
mcpp_macro=$1_SP_$2
stripped_mcpp_macro=`echo $mcpp_macro | sed 's/STD//'`
if test x$stripped_mcpp_macro != x$mcpp_macro; then
stripped_name=`echo $name | sed 's/^_//'`
if test x$stripped_name = x$name; then
AC_MSG_ERROR( The macro name '$name' should begin with '_'.)
fi
else
stripped_name=`echo $name | sed 's/^@<:@A-Za-z@:>@//'`
if test x$stripped_name = x$name; then
AC_MSG_ERROR( The macro name '$name' should begin with an alphabetic letter.)
fi
fi
if test x$name = x$3; then
[replace=1]
else
[replace=`echo $3 | sed 's/^.*=//'`]
fi
AC_DEFINE_UNQUOTED( [$mcpp_macro], "$name")
AC_DEFINE_UNQUOTED( [${mcpp_macro}_VAL], "$replace")
mcpp_ac_c_define_$1_$2=$name
])
# mcpp_AC_C_PREDEF( SYSTEM | CPU | COMPILER, STD | OLD, additional description)
# Specify the target-specific predefined macro via mcpp_AC_C_DEFINE.
AC_DEFUN([mcpp_AC_C_PREDEF], [
AC_ARG_ENABLE( $1-$2-macro,
AC_HELP_STRING( --enable-$1-$2-macro=name@<:@=replace@:>@,
[specify the $1-specific $2-style predefined macro. $3]),
if test x$enableval = xyes || test x$enableval = xno; then
AC_MSG_ERROR( This option requires an argument as 'name@<:@=replace@:>@'.)
fi
mcpp_AC_C_DEFINE( $1, $2, $enableval)
AH_TEMPLATE( [$1_SP_$2],
[Define the name of $1-specific $2-style predefined macro.])
AH_TEMPLATE( [$1_SP_$2_VAL],
[Define the value of $1-specific $2-style predefined macro.])
)
])
mcpp_AC_C_PREDEF( [SYSTEM], [STD],
[In all this and the following 5 options,
'STD'-style name begins with an '_',
'OLD'-style name begins with an alphabetic and
if '=replace' is missing the macro is defined as 1.]
)
mcpp_AC_C_PREDEF( [SYSTEM], [OLD])
mcpp_AC_C_PREDEF( [CPU], [STD])
mcpp_AC_C_PREDEF( [CPU], [OLD])
mcpp_AC_C_PREDEF( [COMPILER], [STD])
mcpp_AC_C_PREDEF( [COMPILER], [OLD])
fi
## MacOS has "framework" directories.
if test $ac_c_define_HOST_SYSTEM = SYS_MAC; then
AC_MSG_CHECKING( for the MacOS-specific framework directory)
frameworks=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed 's/^ *//' | sed 's/ .*$//' | $EGREP '/Frameworks$'`
n=1
for dir in $frameworks
do
case $n in
1) framework1=$dir;;
2) framework2=$dir;;
3) framework3=$dir;;
esac
let n=n+1
done
if test x${framework1+set} = xset; then
AC_DEFINE_UNQUOTED( [FRAMEWORK1], "$framework1",
[Define MacOS-specific framework directory 1.])
AC_MSG_RESULT( $framework1)
else
AC_MSG_RESULT( none)
fi
if test x${framework2+set} = xset; then
AC_DEFINE_UNQUOTED( [FRAMEWORK2], "$framework2",
[Define MacOS-specific framework directory 2.])
AC_MSG_RESULT( $framework2)
fi
if test x${framework3+set} = xset; then
AC_DEFINE_UNQUOTED( [FRAMEWORK3], "$framework3",
[Define MacOS-specific framework directory 3.])
AC_MSG_RESULT( $framework3)
fi
fi ## SYS_MAC
## --enable-mcpplib option
AC_ARG_ENABLE( mcpplib,
AC_HELP_STRING( [--enable-mcpplib],
[Build libmcpp rather than stand-alone mcpp])
)
if test x$enable_mcpplib = xyes; then ## mcpplib mode
AC_DEFINE( [MCPP_LIB], 1, [Define if build libmcpp])
if test x$enable_replace_cpp = xyes; then
AC_MSG_WARN( Ignores enable-replace-cpp option)
[enable_replace_cpp=no]
fi
else
if test x$enable_replace_cpp = xyes; then ## replace-cpp mode
dnl Check the characteristics of target compiler.
dnl Note: The following 3 hundred and more lines are for replace-cpp-mode.
dnl Target-compiler-specific configuration need these lines.
dnl These lines are not used in compiler-independent configuration.
dnl Check which header file CPP includes,
dnl relative to CURRENT or SOURCE directory.
# AC_C_INCLUDE_PREF( CURRENT | SOURCE | NEXT)
# Check the include preference ('NEXT' means CURRENT & SOURCE)
AC_DEFUN([AC_C_INCLUDE_PREF], [
AC_EGREP_CPP( $1, [
#include "../next/header.h"
],
[ac_cv_c_include_pref=$1],
)
])
AC_CACHE_CHECK( include preference - relative to current or source directory,
ac_cv_c_include_pref,
mkdir mcpp-tmp
cd mcpp-tmp
mkdir dir ../next ../next/dir
echo '#include "dir/what.h"' > ../next/header.h
echo '#include "next.h"' >> ../next/header.h
echo 'CURRENT' > dir/what.h
echo 'SOURCE' > ../next/dir/what.h
echo 'NEXT' > ../next/next.h
AC_C_INCLUDE_PREF( [SOURCE])
if test x$ac_cv_c_include_pref != xSOURCE; then
AC_C_INCLUDE_PREF( [CURRENT])
if test x$ac_cv_c_include_pref = xCURRENT; then
AC_C_INCLUDE_PREF( [NEXT])
if test x$ac_cv_c_include_pref = xNEXT; then
[ac_cv_c_include_pref="(CURRENT & SOURCE)"]
fi
else
AC_MSG_ERROR( Failed to include header file.)
fi
fi
cd ..
rm -rf mcpp-tmp next
if test $ac_c_define_HOST_SYSTEM = SYS_CYGWIN \
|| test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then
sleep 1 # wait for cleanup
fi
)
AC_DEFINE_UNQUOTED( [SEARCH_INIT], $ac_cv_c_include_pref,
[Define include preference.])
AC_CACHE_CHECK( if the argument of pragma is macro expanded,
ac_cv_c_pragma_is_expanded,
AC_COMPILE_IFELSE( [[
#define once
#pragma once]],
[ac_cv_c_pragma_is_expanded=no],
[ac_cv_c_pragma_is_expanded=yes]
)
)
if test x$ac_cv_c_pragma_is_expanded = xyes; then
AC_DEFINE( [EXPAND_PRAGMA], 1,
[Define if the argument of pragma is macro expanded.])
fi
AC_CACHE_CHECK( if digraphs can be used,
ac_cv_c_digraph,
[AC_PREPROC_IFELSE( [
%:if 1
%:endif],
[ac_cv_c_digraph=yes],
[ac_cv_c_digraph=no]
)]
)
if test x$ac_cv_c_digraph = xyes; then
AC_DEFINE( [HAVE_DIGRAPHS], 1, [Define if digraphs are available.])
fi
AC_CACHE_CHECK( preprocessor output format of line directive,
ac_cv_c_line_format,
[ac_cv_c_line_format=\"`echo '#line 4321' | $CPP - | grep 432 | sed 's/432.*$//'`\"]
## Note: the output line number may be 4320 on GCC 2.* or other preprocessors.
)
AC_DEFINE_UNQUOTED( [LINE_PREFIX], $ac_cv_c_line_format,
[Define output format of line directive.])
if test "x$ac_cv_c_line_format" = "x\"#line \""; then
ac_cv_c_std_line_prefix=1
else
ac_cv_c_std_line_prefix=0
fi
AC_DEFINE_UNQUOTED( [STD_LINE_PREFIX], $ac_cv_c_std_line_prefix,
[Define whether output format of line directive is C source style.])
AC_CACHE_CHECK( default value of __STDC__,
ac_cv_c_stdc,
[stdc=`echo '__STDC__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'`]
if test x"$stdc" = x"__STDC__"; then
[ac_cv_c_stdc=0]
else
[ac_cv_c_stdc=$stdc]
fi
)
AC_DEFINE_UNQUOTED( [STDC], $ac_cv_c_stdc,
[Define the default value of __STDC__.])
AC_CACHE_CHECK( default value of __STDC_VERSION__,
ac_cv_c_stdc_ver,
[stdc_ver=`echo '__STDC_VERSION__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ .*//'`]
if test x"$stdc_ver" = x"__STDC_VERSION__"; then
[ac_cv_c_stdc_ver=0]
else
[ac_cv_c_stdc_ver=$stdc_ver]
fi
)
AC_DEFINE_UNQUOTED( [STDC_VERSION], $ac_cv_c_stdc_ver,
[Define the default value of __STDC_VERSION__.])
if test x${ac_cv_c_compiler_gnu} != xyes; then
# Specify the compiler's name
AC_ARG_WITH( compiler-name,
AC_HELP_STRING( [--with-compiler-name=NAME],
[specify the compiler name which is used as the definition of COMPILER macro]),
AC_DEFINE_UNQUOTED( [COMPILER], $compiler_name, [specify the compiler name]),
AC_MSG_ERROR( --with-compiler-name=NAME option should be specified to define [COMPILER] macro.)
)
# Specify the C++ header file directory
AC_ARG_WITH( cxx-include-dir,
AC_HELP_STRING( [--with-cxx-include-dir=directory],
[specify the C++ include directory by absolute path [[none]]]),
[case "${withval}" in
[\\/]* | [A-Za-z]:[\\/]*)
cxx_include_dir=`echo $withval | sed 's,/$,,'; 's,\\$,,'`
AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR1], $cxx_include_dir,
[Define the C++ include directory.])
;;
*) AC_MSG_ERROR( $withval should be an absolute path.) ;;
esac]
)
fi # not gcc
dnl Define compiler specific elements.
AC_MSG_NOTICE( checking for some compiler specific elements)
# Define GCC specific elements.
if test x$ac_cv_c_compiler_gnu = xyes; then
AC_DEFINE( [COMPILER], [GNUC], [Define the target compiler.])
cpp_call=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | $EGREP '/cpp|/cc1' | sed 's/^ *//; s/ .*//'`
AC_MSG_CHECKING( for the directory to install mcpp)
cpp_name=`expr $cpp_call : '.*/\(.*\)'`
bindir=`expr $cpp_call : "\(.*\)/$cpp_name"`
AC_MSG_RESULT( $bindir)
AC_PATH_PROG( [gcc_path], [$CC], , [$PATH])
cc_path=`echo $CC | $EGREP "/"`
if test x$cc_path != x; then
AC_MSG_ERROR( [Environment variables CC and CXX for GCC-specific-build should not contain a directory part.]);
fi
## force to set $prefix to GCC's prefix
## (i.e. "/usr/local" of "/usr/local/bin/gcc")
gcc_prefix=`echo $gcc_path | $EGREP "/bin/$CC\$" | sed "s,/bin/$CC\$,,"`
if test "x$gcc_prefix" != xNONE; then
if test "x$prefix" != xNONE && "x$gcc_prefix" != "x$prefix"; then
AC_MSG_WARN( [Ignored --prefix option, since it conflicts with GCC path])
fi
prefix=$gcc_prefix
else
if test "x$prefix" = xNONE; then
prefix=$ac_default_prefix
fi
fi
lang_save=$LANG
export LANG=C
AC_MSG_CHECKING( for the compiler-specific C include directory)
exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|End of search list"
c_include_dirs=`$CPP $CFLAGS $arch_opt -xc -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed 's/^ *//' | $EGREP -v "$exclude"`
n=1
for dir in $c_include_dirs
do
case $n in
1) c_include_dir1=$dir;;
2) c_include_dir2=$dir;;
3) c_include_dir3=$dir;;
esac
let n=n+1
done
if test x${c_include_dir1+set} = xset; then
AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR1], "$c_include_dir1",
[Define compiler-specific C include directory 1.])
AC_MSG_RESULT( $c_include_dir1)
else
AC_MSG_RESULT( none)
fi
if test x${c_include_dir2+set} = xset; then
AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR2], "$c_include_dir2",
[Define compiler-specific C include directory 2.])
AC_MSG_RESULT( $c_include_dir2)
fi
if test x${c_include_dir3+set} = xset; then
AC_DEFINE_UNQUOTED( [C_INCLUDE_DIR3], "$c_include_dir3",
[Define compiler-specific C include directory 3.])
AC_MSG_RESULT( $c_include_dir3)
fi
AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_PUSH( C++)
AC_MSG_CHECKING( for the compiler-specific C++ include directory)
exclude="^/usr(/local|)/include\$|^${prefix}(/local|)/include\$|/Frameworks|^${c_include_dir1}\$|^${c_include_dir2}\$|^${c_include_dir3}\$"
cxx_include_dirs=`${CXXCPP} ${CXXFLAGS} $arch_opt -xc++ -v /dev/null 2>&1 | sed '1,/<...> search starts here/d' | sed '/End of search list/q' | sed '/End of search list/d' | sed 's/^ *//' | $EGREP -v "$exclude"`
n=1
for dir in ${cxx_include_dirs}
do
case $n in
1) cxx_include_dir1=$dir;;
2) cxx_include_dir2=$dir;;
3) cxx_include_dir3=$dir;;
4) cxx_include_dir4=$dir;;
esac
let n=n+1
done
if test x${cxx_include_dir1+set} = xset; then
AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR1], "$cxx_include_dir1",
[Define compiler-specific C++ include directory 1.])
AC_MSG_RESULT( $cxx_include_dir1)
fi
if test x${cxx_include_dir2+set} = xset; then
AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR2], "$cxx_include_dir2",
[Define compiler-specific C++ include directory 2.])
AC_MSG_RESULT( $cxx_include_dir2)
fi
if test x${cxx_include_dir3+set} = xset; then
AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR3], "$cxx_include_dir3",
[Define compiler-specific C++ include directory 3.])
AC_MSG_RESULT( $cxx_include_dir3)
fi
if test x${cxx_include_dir4+set} = xset; then
AC_DEFINE_UNQUOTED( [CPLUS_INCLUDE_DIR4], "$cxx_include_dir4",
[Define compiler-specific C++ include directory 4.])
AC_MSG_RESULT( $cxx_include_dir4)
fi
AC_LANG_POP( C++)
export LANG=$lang_save
## the directory into which mcpp_g*.h header files are generated
## '/mcpp-gcc' will be appended to 'inc_dir'
if test $ac_c_define_HOST_SYSTEM = SYS_MINGW; then
inc_dir=$c_include_dir2
else
if test x${c_include_dir1+set} = xset; then
inc_dir=$c_include_dir1
else
inc_dir="$prefix"/include
fi
fi
AC_DEFINE_UNQUOTED( [INC_DIR], "$inc_dir",
[Define include directory to install mcpp_g*.h header files.])
AC_SUBST( [CPPFLAGS])
AC_SUBST( [host_system])
AC_SUBST( [Target_Cpu])
AC_SUBST( [inc_dir])
AC_SUBST( [gcc_maj_ver])
AC_SUBST( [gcc_min_ver])
AC_SUBST( [cpp_call])
AC_PROG_LN_S
if test x$gcc_maj_ver = x2; then
AC_CACHE_CHECK( for value of predefined macro '__SIZE_TYPE__',
size_type,
[size_type=`echo '__SIZE_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *//'`]
)
AC_DEFINE_UNQUOTED( [COMPILER_SP1_VAL], "$size_type",
[Define the type of size_t.])
AC_CACHE_CHECK( for value of predefined macro '__PTRDIFF_TYPE__',
ptrdiff_type,
[ptrdiff_type=`echo '__PTRDIFF_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'`]
)
AC_DEFINE_UNQUOTED( [COMPILER_SP2_VAL], "$ptrdiff_type",
[Define the type of ptrdiff_t.])
AC_CACHE_CHECK( for value of predefined macro '__WCHAR_TYPE__',
wchar_type,
[wchar_type=`echo '__WCHAR_TYPE__' | $CPP - | sed 's/^ *//' | $EGREP -v '^#|^$' | sed 's/ *$//'`]
)
AC_DEFINE_UNQUOTED( [COMPILER_SP3_VAL], "$wchar_type",
[Define the type of wchar_t.])
fi
fi
## Handling of multi-byte characters containing '0x5c' codes:
## These tests cannot be executed without appropriate options for the
## compiler. So, here we define all of these macros as FALSE.
## User should edit config.h by hand after executing this script.
## These should be 0 for GCC at least upto V.4.1.
AC_DEFINE( [SJIS_IS_ESCAPE_FREE], 0,
[Define if '0x5c' in SJIS multi-byte character is safe.])
AC_DEFINE( [ISO2022_JP_IS_ESCAPE_FREE], 0,
[Define if '0x5c' in ISO2022-JP multi-byte character is safe.])
AC_DEFINE( [BIGFIVE_IS_ESCAPE_FREE], 0,
[Define if '0x5c' in BIG5 multi-byte character is safe.])
fi ## replace-cpp mode
fi ## build-cpp mode or replace-cpp mode
AC_ARG_WITH( [gcc-testsuite-dir],
AC_HELP_STRING( [--with-gcc-testsuite-dir=directory],
[specify the gcc testsuite directory to do make check.
e.g. /usr/src/rpm/SOURCES/gcc-2.95.4/gcc/testsuite,
/usr/local/src/gcc-3.2/gcc/testsuite, etc.
The testsuite of mcpp uses gcc testsuite, hence needs gcc source
or at least gcc testsuite.
This option needs --enable-replace-cpp option.]),
if test x${withval+set} = xset; then
if test x$enable_replace_cpp = xyes; then
[gcc_testsuite_dir=`echo $withval | sed 's,/$,,'`]
else
AC_MSG_ERROR( [--with-gcc-testsuite-dir option requires --enable-replace-cpp option.])
fi
else
AC_MSG_ERROR( [--with-gcc-testsuite-dir option requires an argument.])
fi
)
AC_SUBST( [gcc_testsuite_dir])
AM_CONDITIONAL( [GNUC], test x$ac_cv_c_compiler_gnu = xyes)
AM_CONDITIONAL( [MCPP_LIB], test x$enable_mcpplib = xyes)
AM_CONDITIONAL( [REPLACE_CPP], test x$enable_replace_cpp = xyes)
AM_CONDITIONAL( [MINGW], test $ac_c_define_HOST_SYSTEM = SYS_MINGW)
dnl Final output.
AC_OUTPUT( Makefile src/Makefile tests/Makefile)

View File

@ -0,0 +1,29 @@
/*-
* Copyright (c) 1998, 2002-2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
* All rights reserved.
*
* This software including the files in this directory is provided under
* the following license.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

View File

@ -0,0 +1,22 @@
# cpp-test.exp 2002/12
# to test cpp-test
# imported from dg.exp of GNU C
# Load support procs.
load_lib gcc-dg.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
}
# Initialize `dg'.
dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
# All done.
dg-finish

View File

@ -0,0 +1,389 @@
/* ifdef127.h */
#ifdef X01
#else
#ifdef X02
#else
#ifdef X03
#else
#ifdef X04
#else
#ifdef X05
#else
#ifdef X06
#else
#ifdef X07
#else
#ifdef X08
#else
#ifdef X09
#else
#ifdef X0A
#else
#ifdef X0B
#else
#ifdef X0C
#else
#ifdef X0D
#else
#ifdef X0E
#else
#ifdef X0F
ifdef_nest = 0x0f;
#else
#ifdef X10
#else
#ifdef X11
#else
#ifdef X12
#else
#ifdef X13
#else
#ifdef X14
#else
#ifdef X15
#else
#ifdef X16
#else
#ifdef X17
#else
#ifdef X18
#else
#ifdef X19
#else
#ifdef X1A
#else
#ifdef X1B
#else
#ifdef X1C
#else
#ifdef X1D
#else
#ifdef X1E
#else
#ifdef X1F
ifdef_nest = 0x1f;
#else
#ifdef X20
#else
#ifdef X21
#else
#ifdef X22
#else
#ifdef X23
#else
#ifdef X24
#else
#ifdef X25
#else
#ifdef X26
#else
#ifdef X27
#else
#ifdef X28
#else
#ifdef X29
#else
#ifdef X2A
#else
#ifdef X2B
#else
#ifdef X2C
#else
#ifdef X2D
#else
#ifdef X2E
#else
#ifdef X2F
#else
#ifdef X30
#else
#ifdef X31
#else
#ifdef X32
#else
#ifdef X33
#else
#ifdef X34
#else
#ifdef X35
#else
#ifdef X36
#else
#ifdef X37
#else
#ifdef X38
#else
#ifdef X39
#else
#ifdef X3A
#else
#ifdef X3B
#else
#ifdef X3C
#else
#ifdef X3D
#else
#ifdef X3E
#else
#ifdef X3F
ifdef_nest = 0x3f;
#else
#ifdef X40
#else
#ifdef X41
#else
#ifdef X42
#else
#ifdef X43
#else
#ifdef X44
#else
#ifdef X45
#else
#ifdef X46
#else
#ifdef X47
#else
#ifdef X48
#else
#ifdef X49
#else
#ifdef X4A
#else
#ifdef X4B
#else
#ifdef X4C
#else
#ifdef X4D
#else
#ifdef X4E
#else
#ifdef X4F
#else
#ifdef X50
#else
#ifdef X51
#else
#ifdef X52
#else
#ifdef X53
#else
#ifdef X54
#else
#ifdef X55
#else
#ifdef X56
#else
#ifdef X57
#else
#ifdef X58
#else
#ifdef X59
#else
#ifdef X5A
#else
#ifdef X5B
#else
#ifdef X5C
#else
#ifdef X5D
#else
#ifdef X5E
#else
#ifdef X5F
#else
#ifdef X60
#else
#ifdef X61
#else
#ifdef X62
#else
#ifdef X63
#else
#ifdef X64
#else
#ifdef X65
#else
#ifdef X66
#else
#ifdef X67
#else
#ifdef X68
#else
#ifdef X69
#else
#ifdef X6A
#else
#ifdef X6B
#else
#ifdef X6C
#else
#ifdef X6D
#else
#ifdef X6E
#else
#ifdef X6F
#else
#ifdef X70
#else
#ifdef X71
#else
#ifdef X72
#else
#ifdef X73
#else
#ifdef X74
#else
#ifdef X75
#else
#ifdef X76
#else
#ifdef X77
#else
#ifdef X78
#else
#ifdef X79
#else
#ifdef X7A
#else
#ifdef X7B
#else
#ifdef X7C
#else
#ifdef X7D
#else
#ifdef X7E
#else
#ifdef X7F
ifdef_nest = 0x7f;
#else
#include "ifdef255.h"
#endif /* X7F */
#endif /* X7E */
#endif /* X7D */
#endif /* X7C */
#endif /* X7B */
#endif /* X7A */
#endif /* X79 */
#endif /* X78 */
#endif /* X77 */
#endif /* X76 */
#endif /* X75 */
#endif /* X74 */
#endif /* X73 */
#endif /* X72 */
#endif /* X71 */
#endif /* X70 */
#endif /* X6F */
#endif /* X6E */
#endif /* X6D */
#endif /* X6C */
#endif /* X6B */
#endif /* X6A */
#endif /* X69 */
#endif /* X68 */
#endif /* X67 */
#endif /* X66 */
#endif /* X65 */
#endif /* X64 */
#endif /* X63 */
#endif /* X62 */
#endif /* X61 */
#endif /* X60 */
#endif /* X5F */
#endif /* X5E */
#endif /* X5D */
#endif /* X5C */
#endif /* X5B */
#endif /* X5A */
#endif /* X59 */
#endif /* X58 */
#endif /* X57 */
#endif /* X56 */
#endif /* X55 */
#endif /* X54 */
#endif /* X53 */
#endif /* X52 */
#endif /* X51 */
#endif /* X50 */
#endif /* X4F */
#endif /* X4E */
#endif /* X4D */
#endif /* X4C */
#endif /* X4B */
#endif /* X4A */
#endif /* X49 */
#endif /* X48 */
#endif /* X47 */
#endif /* X46 */
#endif /* X45 */
#endif /* X44 */
#endif /* X43 */
#endif /* X42 */
#endif /* X41 */
#endif /* X40 */
#endif /* X3F */
#endif /* X3E */
#endif /* X3D */
#endif /* X3C */
#endif /* X3B */
#endif /* X3A */
#endif /* X39 */
#endif /* X38 */
#endif /* X37 */
#endif /* X36 */
#endif /* X35 */
#endif /* X34 */
#endif /* X33 */
#endif /* X32 */
#endif /* X31 */
#endif /* X30 */
#endif /* X2F */
#endif /* X2E */
#endif /* X2D */
#endif /* X2C */
#endif /* X2B */
#endif /* X2A */
#endif /* X29 */
#endif /* X28 */
#endif /* X27 */
#endif /* X26 */
#endif /* X25 */
#endif /* X24 */
#endif /* X23 */
#endif /* X22 */
#endif /* X21 */
#endif /* X20 */
#endif /* X1F */
#endif /* X1E */
#endif /* X1D */
#endif /* X1C */
#endif /* X1B */
#endif /* X1A */
#endif /* X19 */
#endif /* X18 */
#endif /* X17 */
#endif /* X16 */
#endif /* X15 */
#endif /* X14 */
#endif /* X13 */
#endif /* X12 */
#endif /* X11 */
#endif /* X10 */
#endif /* X0F */
#endif /* X0E */
#endif /* X0D */
#endif /* X0C */
#endif /* X0B */
#endif /* X0A */
#endif /* X09 */
#endif /* X08 */
#endif /* X07 */
#endif /* X06 */
#endif /* X05 */
#endif /* X04 */
#endif /* X03 */
#endif /* X02 */
#endif /* X01 */

View File

@ -0,0 +1,388 @@
/* ifdef255.h */
#ifdef X80
#else
#ifdef X81
#else
#ifdef X82
#else
#ifdef X83
#else
#ifdef X84
#else
#ifdef X85
#else
#ifdef X86
#else
#ifdef X87
#else
#ifdef X88
#else
#ifdef X89
#else
#ifdef X8A
#else
#ifdef X8B
#else
#ifdef X8C
#else
#ifdef X8D
#else
#ifdef X8E
#else
#ifdef X8F
#else
#ifdef X90
#else
#ifdef X91
#else
#ifdef X92
#else
#ifdef X93
#else
#ifdef X94
#else
#ifdef X95
#else
#ifdef X96
#else
#ifdef X97
#else
#ifdef X98
#else
#ifdef X99
#else
#ifdef X9A
#else
#ifdef X9B
#else
#ifdef X9C
#else
#ifdef X9D
#else
#ifdef X9E
#else
#ifdef X9F
#else
#ifdef XA0
#else
#ifdef XA1
#else
#ifdef XA2
#else
#ifdef XA3
#else
#ifdef XA4
#else
#ifdef XA5
#else
#ifdef XA6
#else
#ifdef XA7
#else
#ifdef XA8
#else
#ifdef XA9
#else
#ifdef XAA
#else
#ifdef XAB
#else
#ifdef XAC
#else
#ifdef XAD
#else
#ifdef XAE
#else
#ifdef XAF
#else
#ifdef XB0
#else
#ifdef XB1
#else
#ifdef XB2
#else
#ifdef XB3
#else
#ifdef XB4
#else
#ifdef XB5
#else
#ifdef XB6
#else
#ifdef XB7
#else
#ifdef XB8
#else
#ifdef XB9
#else
#ifdef XBA
#else
#ifdef XBB
#else
#ifdef XBC
#else
#ifdef XBD
#else
#ifdef XBE
#else
#ifdef XBF
#else
#ifdef XC0
#else
#ifdef XC1
#else
#ifdef XC2
#else
#ifdef XC3
#else
#ifdef XC4
#else
#ifdef XC5
#else
#ifdef XC6
#else
#ifdef XC7
#else
#ifdef XC8
#else
#ifdef XC9
#else
#ifdef XCA
#else
#ifdef XCB
#else
#ifdef XCC
#else
#ifdef XCD
#else
#ifdef XCE
#else
#ifdef XCF
#else
#ifdef XD0
#else
#ifdef XD1
#else
#ifdef XD2
#else
#ifdef XD3
#else
#ifdef XD4
#else
#ifdef XD5
#else
#ifdef XD6
#else
#ifdef XD7
#else
#ifdef XD8
#else
#ifdef XD9
#else
#ifdef XDA
#else
#ifdef XDB
#else
#ifdef XDC
#else
#ifdef XDD
#else
#ifdef XDE
#else
#ifdef XDF
#else
#ifdef XE0
#else
#ifdef XE1
#else
#ifdef XE2
#else
#ifdef XE3
#else
#ifdef XE4
#else
#ifdef XE5
#else
#ifdef XE6
#else
#ifdef XE7
#else
#ifdef XE8
#else
#ifdef XE9
#else
#ifdef XEA
#else
#ifdef XEB
#else
#ifdef XEC
#else
#ifdef XED
#else
#ifdef XEE
#else
#ifdef XEF
#else
#ifdef XF0
#else
#ifdef XF1
#else
#ifdef XF2
#else
#ifdef XF3
#else
#ifdef XF4
#else
#ifdef XF5
#else
#ifdef XF6
#else
#ifdef XF7
#else
#ifdef XF8
#else
#ifdef XF9
#else
#ifdef XFA
#else
#ifdef XFB
#else
#ifdef XFC
#else
#ifdef XFD
#else
#ifdef XFE
#else
#ifdef XFF
ifdef_nest = 0xff;
#else
ifdef_nest = 0xff;
#endif /* XFF */
#endif /* XFE */
#endif /* XFD */
#endif /* XFC */
#endif /* XFB */
#endif /* XFA */
#endif /* XF9 */
#endif /* XF8 */
#endif /* XF7 */
#endif /* XF6 */
#endif /* XF5 */
#endif /* XF4 */
#endif /* XF3 */
#endif /* XF2 */
#endif /* XF1 */
#endif /* XF0 */
#endif /* XEF */
#endif /* XEE */
#endif /* XED */
#endif /* XEC */
#endif /* XEB */
#endif /* XEA */
#endif /* XE9 */
#endif /* XE8 */
#endif /* XE7 */
#endif /* XE6 */
#endif /* XE5 */
#endif /* XE4 */
#endif /* XE3 */
#endif /* XE2 */
#endif /* XE1 */
#endif /* XE0 */
#endif /* XDF */
#endif /* XDE */
#endif /* XDD */
#endif /* XDC */
#endif /* XDB */
#endif /* XDA */
#endif /* XD9 */
#endif /* XD8 */
#endif /* XD7 */
#endif /* XD6 */
#endif /* XD5 */
#endif /* XD4 */
#endif /* XD3 */
#endif /* XD2 */
#endif /* XD1 */
#endif /* XD0 */
#endif /* XCF */
#endif /* XCE */
#endif /* XCD */
#endif /* XCC */
#endif /* XCB */
#endif /* XCA */
#endif /* XC9 */
#endif /* XC8 */
#endif /* XC7 */
#endif /* XC6 */
#endif /* XC5 */
#endif /* XC4 */
#endif /* XC3 */
#endif /* XC2 */
#endif /* XC1 */
#endif /* XC0 */
#endif /* XBF */
#endif /* XBE */
#endif /* XBD */
#endif /* XBC */
#endif /* XBB */
#endif /* XBA */
#endif /* XB9 */
#endif /* XB8 */
#endif /* XB7 */
#endif /* XB6 */
#endif /* XB5 */
#endif /* XB4 */
#endif /* XB3 */
#endif /* XB2 */
#endif /* XB1 */
#endif /* XB0 */
#endif /* XAF */
#endif /* XAE */
#endif /* XAD */
#endif /* XAC */
#endif /* XAB */
#endif /* XAA */
#endif /* XA9 */
#endif /* XA8 */
#endif /* XA7 */
#endif /* XA6 */
#endif /* XA5 */
#endif /* XA4 */
#endif /* XA3 */
#endif /* XA2 */
#endif /* XA1 */
#endif /* XA0 */
#endif /* X9F */
#endif /* X9E */
#endif /* X9D */
#endif /* X9C */
#endif /* X9B */
#endif /* X9A */
#endif /* X99 */
#endif /* X98 */
#endif /* X97 */
#endif /* X96 */
#endif /* X95 */
#endif /* X94 */
#endif /* X93 */
#endif /* X92 */
#endif /* X91 */
#endif /* X90 */
#endif /* X8F */
#endif /* X8E */
#endif /* X8D */
#endif /* X8C */
#endif /* X8B */
#endif /* X8A */
#endif /* X89 */
#endif /* X88 */
#endif /* X87 */
#endif /* X86 */
#endif /* X85 */
#endif /* X84 */
#endif /* X83 */
#endif /* X82 */
#endif /* X81 */
#endif /* X80 */

View File

@ -0,0 +1,24 @@
/* l_37_1.h: Translation limits larger than C99 / 1. */
/* 37.1L: Number of parameters in macro. */
#define glue255( \
a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0, \
a1, b1, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, n1, o1, p1, \
a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, \
a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, \
a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l4, m4, n4, o4, p4, \
a5, b5, c5, d5, e5, f5, g5, h5, i5, j5, k5, l5, m5, n5, o5, p5, \
a6, b6, c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6, o6, p6, \
a7, b7, c7, d7, e7, f7, g7, h7, i7, j7, k7, l7, m7, n7, o7, p7, \
a8, b8, c8, d8, e8, f8, g8, h8, i8, j8, k8, l8, m8, n8, o8, p8, \
a9, b9, c9, d9, e9, f9, g9, h9, i9, j9, k9, l9, m9, n9, o9, p9, \
aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, \
ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb, \
ac, bc, cc, dc, ec, fc, gc, hc, ic, jc, kc, lc, mc, nc, oc, pc, \
ad, bd, cd, dd, ed, fd, gd, hd, id, jd, kd, ld, md, nd, od, pd, \
ae, be, ce, de, ee, fe, ge, he, ie, je, ke, le, me, ne, oe, pe, \
af, bf, cf, df, ef, ff, gf, hf, if, jf, kf, lf, mf, nf, of) \
a0 ## b0 ## c0 ## d0 ## e0 ## f0 ## g0 ## h0 ## \
p0 ## p1 ## p2 ## p3 ## p4 ## p5 ## p6 ## p7 ## \
p8 ## p9 ## pa ## pb ## pc ## pd ## pe ## of

View File

@ -0,0 +1,33 @@
/* l_37_2.c: Translation limits larger than C99 / 2. */
/* 37.2L: Number of arguments in macro call. */
#include "l_37_1.h"
/* A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6P7P8P9PAPBPCPDPEOF; */
glue255(
A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0,
A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, L1, M1, N1, O1, P1,
A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, L2, M2, N2, O2, P2,
A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, L3, M3, N3, O3, P3,
A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, L4, M4, N4, O4, P4,
A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, L5, M5, N5, O5, P5,
A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, L6, M6, N6, O6, P6,
A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, L7, M7, N7, O7, P7,
A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, K8, L8, M8, N8, O8, P8,
A9, B9, C9, D9, E9, F9, G9, H9, I9, J9, K9, L9, M9, N9, O9, P9,
AA, BA, CA, DA, EA, FA, GA, HA, IA, JA, KA, LA, MA, NA, OA, PA,
AB, BB, CB, DB, EB, FB, GB, HB, IB, JB, KB, LB, MB, NB, OB, PB,
AC, BC, CC, DC, EC, FC, GC, HC, IC, JC, KC, LC, MC, NC, OC, PC,
AD, BD, CD, DD, ED, FD, GD, HD, ID, JD, KD, LD, MD, ND, OD, PD,
AE, BE, CE, DE, EE, FE, GE, HE, IE, JE, KE, LE, ME, NE, OE, PE,
AF, BF, CF, DF, EF, FF, GF, HF, IF, JF, KF, LF, MF, NF, OF);
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| More than 127 (parameters|arguments)" "translation limit" { target *-*-* } 0 }
{ dg-final { if ![file exist l_37_2.i] { return } } }
{ dg-final { if \{ [grep l_37_2.i "A0B0C0D0E0F0G0H0P0P1P2P3P4P5P6P7P8P9PAPBPCPDPEOF"] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "more than 127 parameters" } }
*/

View File

@ -0,0 +1,28 @@
/* l_37_3.c: Translation limits larger than C99 / 3. */
/* 37.3L: Significant initial characters in an internal identifier or a
macro name. */
/* Name of 127 bytes long. */
int
A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 127;
#ifndef X7F
/* Name of 255 bytes long. */
int
A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde = 255;
#endif
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| Identifier longer than 63 bytes" "translation limit" { target *-*-* } 9 }
{ dg-warning "| Identifier longer than 63 bytes" "translation limit" { target *-*-* } 16 }
{ dg-final { if ![file exist l_37_3.i] { return } } }
{ dg-final { if \{ [grep l_37_3.i "A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefB123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefC123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefD123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde"] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "l_37_3.c: identifier longer than 63 bytes" } }
*/

View File

@ -0,0 +1,18 @@
/* l_37_4.c: Translation limits larger than C99 / 4. */
/* 37.4L: Nested conditional inclusion. */
/*
* Define one of the macros X7F or XFF, or 255 nesting of #ifdef will be
* tested.
*/
#include "ifdef127.h"
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| More than 63 nesting of #if" "translation limit" { target *-*-* } 0 }
{ dg-final { if ![file exist l_37_4_.i] { return } } }
{ dg-final { if \{ [grep l_37_4_.i "ifdef_nest = 0xff"] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "l_37_4_.c: more than 63 nesting of #if" } }
*/

View File

@ -0,0 +1,16 @@
/* l_37_5.c: Translation limits larger than C99 / 5. */
/* 37.5L: Nested source file inclusion. */
/* Define one of the macros X1F, X3F or it will test 127 levels of
#include */
#include "nest1.h"
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| More than 15 nesting of #include" "translation limit" { target *-*-* } 0 }
{ dg-final { if ![file exist l_37_5_.i] { return } } }
{ dg-final { if \{ [grep l_37_5_.i "nest = 0x7f"] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "l_37_5_.c: more than 15 nesting of #include" } }
*/

View File

@ -0,0 +1,84 @@
/* l_37_6.c: Translation limits larger than C99 / 6. */
/* 37.6L: Parenthesized expression. */
#ifndef X3F
/* nest = 127; */
#if \
(0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \
(0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \
(0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \
(0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \
(0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \
(0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \
(0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \
(0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \
(0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \
(0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \
(0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \
(0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \
(0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \
(0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \
(0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \
(0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + 0x7F) \
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \
== -0x80
nest = 127;
#endif
#ifndef X7F
/* nest = 255; */
#if \
(0x00 + (0x01 - (0x02 + (0x03 - (0x04 + (0x05 - (0x06 + (0x07 - \
(0x08 + (0x09 - (0x0A + (0x0B - (0x0C + (0x0D - (0x0E + (0x0F - \
(0x10 + (0x11 - (0x12 + (0x13 - (0x14 + (0x15 - (0x16 + (0x17 - \
(0x18 + (0x19 - (0x1A + (0x1B - (0x1C + (0x1D - (0x1E + (0x1F - \
(0x20 + (0x21 - (0x22 + (0x23 - (0x24 + (0x25 - (0x26 + (0x27 - \
(0x28 + (0x29 - (0x2A + (0x2B - (0x2C + (0x2D - (0x2E + (0x2F - \
(0x30 + (0x31 - (0x32 + (0x33 - (0x34 + (0x35 - (0x36 + (0x37 - \
(0x38 + (0x39 - (0x3A + (0x3B - (0x3C + (0x3D - (0x3E + (0x3F - \
(0x40 + (0x41 - (0x42 + (0x43 - (0x44 + (0x45 - (0x46 + (0x47 - \
(0x48 + (0x49 - (0x4A + (0x4B - (0x4C + (0x4D - (0x4E + (0x4F - \
(0x50 + (0x51 - (0x52 + (0x53 - (0x54 + (0x55 - (0x56 + (0x57 - \
(0x58 + (0x59 - (0x5A + (0x5B - (0x5C + (0x5D - (0x5E + (0x5F - \
(0x60 + (0x61 - (0x62 + (0x63 - (0x64 + (0x65 - (0x66 + (0x67 - \
(0x68 + (0x69 - (0x6A + (0x6B - (0x6C + (0x6D - (0x6E + (0x6F - \
(0x70 + (0x71 - (0x72 + (0x73 - (0x74 + (0x75 - (0x76 + (0x77 - \
(0x78 + (0x79 - (0x7A + (0x7B - (0x7C + (0x7D - (0x7E + (0x7F - \
(0x80 + (0x81 - (0x82 + (0x83 - (0x84 + (0x85 - (0x86 + (0x87 - \
(0x88 + (0x89 - (0x8A + (0x8B - (0x8C + (0x8D - (0x8E + (0x8F - \
(0x90 + (0x91 - (0x92 + (0x93 - (0x94 + (0x95 - (0x96 + (0x97 - \
(0x98 + (0x99 - (0x9A + (0x9B - (0x9C + (0x9D - (0x9E + (0x9F - \
(0xA0 + (0xA1 - (0xA2 + (0xA3 - (0xA4 + (0xA5 - (0xA6 + (0xA7 - \
(0xA8 + (0xA9 - (0xAA + (0xAB - (0xAC + (0xAD - (0xAE + (0xAF - \
(0xB0 + (0xB1 - (0xB2 + (0xB3 - (0xB4 + (0xB5 - (0xB6 + (0xB7 - \
(0xB8 + (0xB9 - (0xBA + (0xBB - (0xBC + (0xBD - (0xBE + (0xBF - \
(0xC0 + (0xC1 - (0xC2 + (0xC3 - (0xC4 + (0xC5 - (0xC6 + (0xC7 - \
(0xC8 + (0xC9 - (0xCA + (0xCB - (0xCC + (0xCD - (0xCE + (0xCF - \
(0xD0 + (0xD1 - (0xD2 + (0xD3 - (0xD4 + (0xD5 - (0xD6 + (0xD7 - \
(0xD8 + (0xD9 - (0xDA + (0xDB - (0xDC + (0xDD - (0xDE + (0xDF - \
(0xE0 + (0xE1 - (0xE2 + (0xE3 - (0xE4 + (0xE5 - (0xE6 + (0xE7 - \
(0xE8 + (0xE9 - (0xEA + (0xEB - (0xEC + (0xED - (0xEE + (0xEF - \
(0xF0 + (0xF1 - (0xF2 + (0xF3 - (0xF4 + (0xF5 - (0xF6 + (0xF7 - \
(0xF8 + (0xF9 - (0xFA + (0xFB - (0xFC + (0xFD - (0xFE + 0xFF) \
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \
== -0x100
nest = 255;
#endif
#endif
#endif
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| More than 63 nesting of parens" "translation limit" { target *-*-* } 25 }
{ dg-warning "| More than 63 nesting of parens" "translation limit" { target *-*-* } 68 }
{ dg-final { if ![file exist l_37_6_.i] { return } } }
{ dg-final { if \{ [grep l_37_6_.i "nest = 127"] != "" \} \{ } }
{ dg-final { if \{ [grep l_37_6_.i "nest = 255"] != "" \} \{ } }
{ dg-final { return \} \} } }
{ dg-final { fail "l_37_6_.c: more than 63 nesting of parens" } }
*/

View File

@ -0,0 +1,144 @@
/* l_37_7.c: Translation limits larger than C99 / 7. */
/* 37.7L: Characters in a string (after concatenation). */
/* 8191 bytes long. */
char *string8189 =
"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
A123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
B123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
C123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
D123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
E123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
F123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
G123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
1123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
3123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
4123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
5123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
6123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
7123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
8123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
9123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
a123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
b123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
c123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
d123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
e123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\
f123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd"
;
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| Quotation longer than 4095 bytes" "translation limit" { target *-*-* } 133 }
{ dg-final { if ![file exist l_37_7_.i] { return } } }
{ dg-final { if \{ [grep l_37_7_.i "abcd\""] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "l_37_7_.c: quotation longer than 4095 bytes" } }
*/

View File

@ -0,0 +1,18 @@
/* l_37_8.c: Translation limits larger than C99 / 8. */
/* 37.8L: Length of logical source line. */
/* Define one of the macros X03FF, X07FF, X0FFF, X1FFF or it will test
the line of 0x3fff bytes long. */
#include "longline.t"
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| Logical source line longer than 4095 bytes" "translation limit" { target *-*-* } 673 }
{ dg-warning "| Logical source line longer than 4095 bytes" "translation limit" { target *-*-* } 1532 }
{ dg-final { if ![file exist l_37_8_.i] { return } } }
{ dg-final { if \{ [grep l_37_8_.i "pushback"] != "" \} \{ } }
{ dg-final { if \{ [grep l_37_8_.i "s_name"] != "" \} \{ } }
{ dg-final { return \} \} } }
{ dg-final { fail "l_37_8_.c: logical source line longer than 4095 bytes" } }
*/

View File

@ -0,0 +1,23 @@
/* l_37_9.c: Translation limits larger than C99 / 9. */
/* 37.9L: Number of macro definitions. */
#include "m8191.h"
#ifdef X0FFF
/* 0x0fff; */
GBM;
#else
/* 0x1fff; */
MDA;
#endif
/* { dg-do preprocess }
{ dg-options "-std=c99 -pedantic" }
{ dg-warning "| More than 4095 macros defined" "translation limit" { target *-*-* } 0 }
{ dg-final { if ![file exist l_37_9_.i] { return } } }
{ dg-final { if \{ [grep l_37_9_.i "0x1fff"] != "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "l_37_9_.c: defining more than 4095 macros" } }
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
/* nest1.h */
#include "nest2.h"

View File

@ -0,0 +1,2 @@
/* nest10.h */
#include "nest11.h"

View File

@ -0,0 +1,2 @@
/* nest100.h */
#include "nest101.h"

View File

@ -0,0 +1,2 @@
/* nest101.h */
#include "nest102.h"

View File

@ -0,0 +1,2 @@
/* nest102.h */
#include "nest103.h"

View File

@ -0,0 +1,2 @@
/* nest103.h */
#include "nest104.h"

View File

@ -0,0 +1,2 @@
/* nest104.h */
#include "nest105.h"

View File

@ -0,0 +1,2 @@
/* nest105.h */
#include "nest106.h"

View File

@ -0,0 +1,2 @@
/* nest106.h */
#include "nest107.h"

View File

@ -0,0 +1,2 @@
/* nest107.h */
#include "nest108.h"

View File

@ -0,0 +1,2 @@
/* nest108.h */
#include "nest109.h"

View File

@ -0,0 +1,2 @@
/* nest109.h */
#include "nest110.h"

View File

@ -0,0 +1,2 @@
/* nest11.h */
#include "nest12.h"

View File

@ -0,0 +1,2 @@
/* nest110.h */
#include "nest111.h"

View File

@ -0,0 +1,2 @@
/* nest111.h */
#include "nest112.h"

View File

@ -0,0 +1,2 @@
/* nest112.h */
#include "nest113.h"

View File

@ -0,0 +1,2 @@
/* nest113.h */
#include "nest114.h"

View File

@ -0,0 +1,2 @@
/* nest114.h */
#include "nest115.h"

View File

@ -0,0 +1,2 @@
/* nest115.h */
#include "nest116.h"

View File

@ -0,0 +1,2 @@
/* nest116.h */
#include "nest117.h"

View File

@ -0,0 +1,2 @@
/* nest117.h */
#include "nest118.h"

View File

@ -0,0 +1,2 @@
/* nest118.h */
#include "nest119.h"

View File

@ -0,0 +1,2 @@
/* nest119.h */
#include "nest120.h"

View File

@ -0,0 +1,2 @@
/* nest12.h */
#include "nest13.h"

View File

@ -0,0 +1,2 @@
/* nest120.h */
#include "nest121.h"

View File

@ -0,0 +1,2 @@
/* nest121.h */
#include "nest122.h"

View File

@ -0,0 +1,2 @@
/* nest122.h */
#include "nest123.h"

View File

@ -0,0 +1,2 @@
/* nest123.h */
#include "nest124.h"

View File

@ -0,0 +1,2 @@
/* nest124.h */
#include "nest125.h"

View File

@ -0,0 +1,2 @@
/* nest125.h */
#include "nest126.h"

View File

@ -0,0 +1,2 @@
/* nest126.h */
#include "nest127.h"

View File

@ -0,0 +1,2 @@
/* nest127.h */
nest = 0x7f;

View File

@ -0,0 +1,2 @@
/* nest13.h */
#include "nest14.h"

View File

@ -0,0 +1,2 @@
/* nest14.h */
#include "nest15.h"

View File

@ -0,0 +1,6 @@
/* nest15.h */
#ifdef X0F
nest = 0x0f;
#else
#include "nest16.h"
#endif

View File

@ -0,0 +1,2 @@
/* nest16.h */
#include "nest17.h"

View File

@ -0,0 +1,2 @@
/* nest17.h */
#include "nest18.h"

View File

@ -0,0 +1,2 @@
/* nest18.h */
#include "nest19.h"

View File

@ -0,0 +1,2 @@
/* nest19.h */
#include "nest20.h"

View File

@ -0,0 +1,2 @@
/* nest2.h */
#include "nest3.h"

View File

@ -0,0 +1,2 @@
/* nest20.h */
#include "nest21.h"

View File

@ -0,0 +1,2 @@
/* nest21.h */
#include "nest22.h"

View File

@ -0,0 +1,2 @@
/* nest22.h */
#include "nest23.h"

View File

@ -0,0 +1,2 @@
/* nest23.h */
#include "nest24.h"

View File

@ -0,0 +1,2 @@
/* nest24.h */
#include "nest25.h"

View File

@ -0,0 +1,2 @@
/* nest25.h */
#include "nest26.h"

View File

@ -0,0 +1,2 @@
/* nest26.h */
#include "nest27.h"

View File

@ -0,0 +1,2 @@
/* nest27.h */
#include "nest28.h"

View File

@ -0,0 +1,2 @@
/* nest28.h */
#include "nest29.h"

View File

@ -0,0 +1,2 @@
/* nest29.h */
#include "nest30.h"

View File

@ -0,0 +1,2 @@
/* nest3.h */
#include "nest4.h"

View File

@ -0,0 +1,2 @@
/* nest30.h */
#include "nest31.h"

View File

@ -0,0 +1,6 @@
/* nest31.h */
#ifdef X1F
nest = 0x1f;
#else
#include "nest32.h"
#endif

View File

@ -0,0 +1,2 @@
/* nest32.h */
#include "nest33.h"

View File

@ -0,0 +1,2 @@
/* nest33.h */
#include "nest34.h"

View File

@ -0,0 +1,2 @@
/* nest34.h */
#include "nest35.h"

View File

@ -0,0 +1,2 @@
/* nest35.h */
#include "nest36.h"

View File

@ -0,0 +1,2 @@
/* nest36.h */
#include "nest37.h"

Some files were not shown because too many files have changed in this diff Show More