diff --git a/README.md b/README.md index 44d3912..c4e686a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # mcpp +C/C++ preprocessor defines and expands macros and processes '#if', +'#include' and some other directives. + +MCPP is an alternative C/C++ preprocessor with the highest conformance. +It supports multiple standards: K&R, ISO C90, ISO C99, and ISO C++98. +MCPP is especially useful for debugging a source program which uses +complicated macros and also useful for checking portability of a source. + +Though mcpp could be built as a replacement of GCC's resident +proprocessor or as a stand-alone program without using library build of +mcpp, this package installs only a program named 'mcpp' which links +shared library of mcpp and behaves independent from GCC. + diff --git a/mcpp-manual.html.patch b/mcpp-manual.html.patch new file mode 100644 index 0000000..2900d52 --- /dev/null +++ b/mcpp-manual.html.patch @@ -0,0 +1,17 @@ +*** doc-jp/mcpp-manual.html 2007-04-02 00:20:16.000000000 +0900 +--- doc-jp/mcpp-manual.html.utf8 2007-04-24 18:12:39.000000000 +0900 +*************** +*** 1,6 **** + + +! + + + +--- 1,6 ---- + + +! + + + diff --git a/mcpp.spec b/mcpp.spec new file mode 100644 index 0000000..222cb92 --- /dev/null +++ b/mcpp.spec @@ -0,0 +1,118 @@ +Name: mcpp +Version: 2.7.2 +Release: 2mamba +Summary: Alternative C/C++ preprocessor +Group: Development/Languages +Vendor: openmamba +Distribution: openmamba +Packager: gil +URL: http://mcpp.sourceforge.net/ +Source: http://downloads.sourceforge.net/project/mcpp/mcpp/V.%{version}/mcpp-%{version}.tar.gz +Patch0: mcpp-manual.html.patch +# from http://www.zeroc.com/forums/patches/4445-patch-1-mcpp-2-7-2-a.html +Patch1: patch.mcpp.2.7.2.txt +License: BSD +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +## AUTOBUILDREQ-END +Requires: libmcpp = %{?epoch:%epoch:}%{version}-%{release} +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +C/C++ preprocessor defines and expands macros and processes '#if', +'#include' and some other directives. + +MCPP is an alternative C/C++ preprocessor with the highest conformance. +It supports multiple standards: K&R, ISO C90, ISO C99, and ISO C++98. +MCPP is especially useful for debugging a source program which uses +complicated macros and also useful for checking portability of a source. + +Though mcpp could be built as a replacement of GCC's resident +proprocessor or as a stand-alone program without using library build of +mcpp, this package installs only a program named 'mcpp' which links +shared library of mcpp and behaves independent from GCC. + +%package -n libmcpp +Group: System/Libraries +Summary: Libraries for MCPP + +%description -n libmcpp +MCPP is an alternative C/C++ preprocessor with the highest conformance. + +This package provides a library build of mcpp. + +%package -n libmcpp-devel +Group: Development/Libraries +Summary: Libraries and headers for MCPP +Requires: libmcpp = %{?epoch:%epoch:}%{version}-%{release} + +%description -n libmcpp-devel +MCPP is an alternative C/C++ preprocessor with the highest conformance. + +This package contains libraries and header files need for development. + +%package doc +Summary: Documentation for MCPP +Group: Documentation + +%description doc +MCPP is an alternative C/C++ preprocessor with the highest conformance. + +The %{name}-doc package contains the documentation for MCPP. + +%prep + +%setup -q -n mcpp-%{version} +%patch0 -p0 -b -z.euc-jp +%patch1 -p1 + +%build +%configure \ + --enable-mcpplib \ + --disable-static +make CFLAGS="%{optflags}" + +%install +iconv -f euc-jp -t utf-8 doc-jp/mcpp-manual.html > doc-jp/mcpp-manual-jp.html +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +make DESTDIR=%{buildroot} install + +rm -rf %{buildroot}%{_docdir}/%{name} +rm -rf %{buildroot}%{_libdir}/libmcpp.*a +install -m 644 mcpp-gcc.1 %{buildroot}%{_mandir}/man1/ + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/mcpp +%{_mandir}/man1/mcpp.1.gz +%{_mandir}/man1/mcpp-gcc.1.gz +%doc ChangeLog ChangeLog.old LICENSE NEWS README + +%post -n libmcpp -p /sbin/ldconfig +%postun -n libmcpp -p /sbin/ldconfig + +%files -n libmcpp +%defattr(-,root,root) +%{_libdir}/libmcpp.so.0 +%{_libdir}/libmcpp.so.0.3.0 + +%files -n libmcpp-devel +%defattr(-,root,root) +%{_includedir}/mcpp_lib.h +%{_includedir}/mcpp_out.h +%{_libdir}/libmcpp.so + +%files doc +%defattr(-,root,root) +%lang(ja) %doc doc-jp/mcpp-manual-jp.html +%lang(en) %doc doc/mcpp-manual.html + +%changelog +* Mon Jan 17 2011 gil 2.7.2-2mamba +- rebuilt devel + +* Mon Jan 05 2009 gil 2.7.2-1mamba +- package created by autospec diff --git a/patch.mcpp.2.7.2.txt b/patch.mcpp.2.7.2.txt new file mode 100644 index 0000000..f51aefe --- /dev/null +++ b/patch.mcpp.2.7.2.txt @@ -0,0 +1,54 @@ +diff -c -r -N ../mcpp-2.7.2-old/src/internal.H ./src/internal.H +*** ../mcpp-2.7.2-old/src/internal.H 2008-08-27 10:31:16.000000000 -0230 +--- ./src/internal.H 2009-05-21 09:49:31.000000000 -0230 +*************** +*** 390,395 **** +--- 390,397 ---- + extern char identifier[]; /* Lastly scanned name */ + extern IFINFO ifstack[]; /* Information of #if nesting */ + extern char work_buf[]; ++ extern FILEINFO * sh_file; ++ extern int sh_line; + /* Temporary buffer for directive line and macro expansion */ + + /* main.c */ +diff -c -r -N ../mcpp-2.7.2-old/src/main.c ./src/main.c +*** ../mcpp-2.7.2-old/src/main.c 2008-11-05 05:04:46.000000000 -0330 +--- ./src/main.c 2009-05-21 09:47:50.000000000 -0230 +*************** +*** 326,331 **** +--- 326,333 ---- + = FALSE; + option_flags.trig = TRIGRAPHS_INIT; + option_flags.dig = DIGRAPHS_INIT; ++ sh_file = NULL; ++ sh_line = 0; + } + + int mcpp_lib_main +diff -c -r -N ../mcpp-2.7.2-old/src/system.c ./src/system.c +*** ../mcpp-2.7.2-old/src/system.c 2008-11-26 06:23:51.000000000 -0330 +--- ./src/system.c 2009-05-21 09:48:50.000000000 -0230 +*************** +*** 3858,3863 **** +--- 3858,3866 ---- + } + #endif + ++ FILEINFO* sh_file; ++ int sh_line; ++ + void sharp( + FILEINFO * sharp_file, + int flag /* Flag to append to the line for GCC */ +*************** +*** 3868,3875 **** + * else (i.e. 'sharp_file' is NULL) 'infile'. + */ + { +- static FILEINFO * sh_file; +- static int sh_line; + FILEINFO * file; + int line; + +--- 3871,3876 ----