1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

OpenIndiana and Solaris port

This commit is contained in:
Ulrich Wilkens 2014-10-28 19:46:43 +01:00 committed by Jon Trulson
parent 42e891d9e7
commit 01d6c363fa
296 changed files with 1049 additions and 1091 deletions

View file

@ -36,7 +36,7 @@ XCOMM $TOG: DtInfo.rules /main/21 1997/09/05 11:31:01 samborn $
* library building stuff
*/
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
# define makelibT(libname) @@\
makelib(libname) @@\
@@\
@ -61,7 +61,7 @@ Concat3(subdir/libname/lib,libname,T.a): FRC @@\
echo STR(*** Making lib libname Templates ***) ; \ @@\
$(MAKE) Concat3(libname/lib,libname,T.a) ; \ @@\
)
#else /* not defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 */
#else /* not defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5 */
# define makelibT(libname) @@\
makelib(libname)
#endif
@ -153,7 +153,7 @@ Concat(lib,libname.a): objlist @@\
$(LD) -r -o $@ objlist
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
#define SimpleLibraryT(libname,objlist,libdir) @@\
SimpleLibrary(libname,objlist,libdir) @@\
@@\
@ -198,7 +198,7 @@ Concat(lib,libname.a): objlist otherdeps @@\
@echo STR(*** Making NotSoSimpleLibrary libname.a) @@\
$(LD) -r -o $@ objlist
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3
#if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 5
#define NotSoSimpleLibraryT(libname,objlist,libdir,otherdeps) @@\
NotSoSimpleLibrary(libname,objlist,libdir,otherdeps) @@\
@@\

View file

@ -590,6 +590,8 @@ LINTXMWIDGETLIB = $(MWIDGETSRC)/llib-l/Xm.ln
/* check for existence of Dtinfo Motif Documents */
#if defined(LinuxArchitecture)
MOTIF_DOC = $(shell if test -f $(MDOCSRC)/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; fi)
#elif defined(SunArchitecture)
MOTIF_DOC :sh = if test -f ../imports/motif/doc/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; else echo; fi
#elif defined(BSDArchitecture)
MOTIF_DOC != if test -f $(MDOCSRC)/C/guides/bookcase.bc; then echo -D_MOTIFDOC_; else echo; fi
#else

View file

@ -232,12 +232,9 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $
#endif
#ifndef UseNSGMLS
# ifdef SunArchitecture
# define UseNSGMLS NO
# else
# define UseNSGMLS YES
# endif
# define UseNSGMLS YES
#endif
#ifndef SGMLParser
# if UseNSGMLS
# define SGMLDir $(NSGMLSSRC)

View file

@ -56,7 +56,22 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $
# endif
# if defined(SunArchitecture)
# define HasSunCplusplus YES
# ifndef HasSunC
# define HasSunC NO
# endif
# ifndef HasSunCplusplus
# define HasSunCplusplus HasSunC
# endif
# ifndef HasGcc2
# if HasSunC
# define HasGcc2 NO
# else
# define HasGcc2 YES
# endif
# endif
# ifndef HasGcc2ForCplusplus
# define HasGcc2ForCplusplus HasGcc2
# endif
# endif
# if defined(UXPArchitecture) || defined(USLArchitecture) \
@ -91,6 +106,8 @@ XCOMM site: $TOG: site.def /main/23 1998/03/19 18:43:26 mgreess $
# define MotifProjectRoot /usr/local
# elif defined(NetBSDArchitecture)
# define MotifProjectRoot /usr/pkg
# elif defined(SunArchitecture)
# define MotifProjectRoot /usr/X11
# endif
#endif

View file

@ -16,42 +16,40 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe
/*
* Compiler setup. This sun.cf file knows what options to use with
* certain compilers, including Sun C, CenterLine C, and gcc. It
* also understands how to set some of the options for various C++
* compilers, including Sun C++ and CenterLine C++.
* certain compilers, including Sun C and gcc. It also understands
* how to set some of the options for various C++ compilers, including
* Sun C++ and g++.
*
* === C Compiler Setup ==========================================
*
* For SunPro C, define HasSunC to YES in site.def.
* For CenterLine C, define HasCenterLineC to YES in site.def
* For gcc or gcc2, define HasGcc or HasGcc2 to YES in site.def
* For other compilers, define HasSunC to NO in site.def, then
* For SunPro C, define HasSunC to YES in host.def.
* For Gnu gcc, define HasGcc2 to YES in host.def
* For other compilers, define HasSunC to NO in host.def, then
* provide appropriate values for the various compiler related
* configuration varibles used here.
*
* If you don't tell us which C compiler you have, we assume you have
* the SunPro C compiler under Solaris 2.x, and the bundled /bin/cc
* the Gcc C compiler under Solaris 5.x.
* under SunOS 4.1.x
*
* === C++ Compiler Setup ==========================================
*
* For SunPro C++, define HasSunCplusplus to YES in site.def
* For CenterLine C++, define HasCenterLineCplusplus to YES in site.def
* For Gnu g++ 2.6.x, define HasGcc2ForCplusplus to YES in site.def
* For other compilers, define HasCplusplus to YES in site.def, and
* For SunPro C++, define HasSunCplusplus to YES in host.def
* For Gnu g++ 4.x, define HasGcc2ForCplusplus to YES in host.def
* For other compilers, define HasCplusplus to YES in host.def, and
* check to see if you need to provide values for CplusplusOptions
* and/or DefaultCplusplusOptions.
*
* In any case, you may also need to set CplusplusDependIncludes.
*
* If you say you have the SunPro C++ compiler, we assume you have
* version 3.0.x of the compiler. If you have version 4.0.x instead,
* define CplusplusCompilerMajorVersion as 4 in site.def.
* version 5.0.x of the compiler. If you have version 4.0.x instead,
* define CplusplusCompilerMajorVersion as 4 in host.def.
*
*/
#ifndef HasSunC
# if (HasCenterLineC || HasGcc || HasGcc2 || OSMajorVersion < 5)
# if (HasGcc || HasGcc2 || OSMajorVersion < 5)
# define HasSunC NO
# else
# define HasSunC YES
@ -89,22 +87,44 @@ XCOMM SunPro C CCompilerMajorVersion./**/CCompilerMinorVersion
XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
#endif
#if HasCenterLineC
# ifndef CcCmd
# define CcCmd clcc
#if HasGcc2
# ifndef CCompilerMajorVersion
# define CCompilerMajorVersion DefaultGnuCCompilerMajorVersion
# endif
# ifndef CCompilerMinorVersion
# define CCompilerMinorVersion DefaultGnuCCompilerMinorVersion
# endif
XCOMM Gnu C CCompilerMajorVersion./**/CCompilerMinorVersion
#endif
#if HasCenterLineCplusplus
#if HasGcc2ForCplusplus
# ifndef HasCplusplus
# define HasCplusplus YES
# endif
# ifndef DefaultCplusplusOptions
# define DefaultCplusplusOptions -Xa
# ifndef CplusplusCompilerMajorVersion
# ifdef DefaultGnuCplusplusCompilerMajorVersion
# define CplusplusCompilerMajorVersion DefaultGnuCplusplusCompilerMajorVersion
# else
# define CplusplusCompilerMajorVersion 4
# endif
# endif
# ifndef CplusplusOptions
# define CplusplusOptions -Xa
# ifndef CplusplusCompilerMinorVersion
# ifdef DefaultGnuCplusplusCompilerMinorVersion
# define CplusplusCompilerMinorVersion DefaultGnuCplusplusCompilerMinorVersion
# else
# define CplusplusCompilerMinorVersion 6
# endif
# endif
XCOMM Gnu C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
#endif
#if OSMajorVersion > 4
#define MkdirHierCmd mkdir -p
#endif
#ifndef OptimizedCDebugFlags
# define OptimizedCDebugFlags -O2
#endif
#if OSMajorVersion < 4 || (OSMajorVersion == 4 && OSMinorVersion < 1)
@ -144,20 +164,23 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
#define ConnectionFlags -DTCPCONN -DUNIXCONN -DLOCALCONN
#if HasSunC
/*
* Assume /opt/SUNWspro/bin/ contains symlinks to the appropriate tools
* Assume /opt/solarisstudio/bin/ contains symlinks to the appropriate tools
*/
#ifndef CcCmd
# define CcCmd /opt/SUNWspro/bin/cc
# define CcCmd /opt/solarisstudio/bin/cc
#endif
#ifndef CplusplusCmd
# define CplusplusCmd /opt/SUNWspro/bin/CC
# define CplusplusCmd /opt/solarisstudio/bin/CC
#endif
#ifndef CplusplusFilt
# define CplusplusFilt /opt/SUNWspro/bin/c++filt
# define CplusplusFilt /opt/solarisstudio/bin/c++filt
#endif
#ifndef CplusplusLibC
#define CplusplusLibC -L/opt/solarisstudio/lib -lCrun
#endif
#ifndef CplusplusDependIncludes
#if CplusplusCompilerMajorVersion > 3
# define CplusplusDependIncludes -I/opt/SUNWspro/SC4.0/include/CC
# define CplusplusDependIncludes -I/opt/solarisstudio/prod/include/CC -I/opt/solarisstudio/prod/include/CC/Cstd
#elif CplusplusCompilerMajorVersion > 2
# define CplusplusDependIncludes -I/opt/SUNWspro/SC3.0/include/CC
#else
@ -165,7 +188,6 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
#endif
#endif
#endif
# if HasSunC && (CCompilerMajorVersion < 3)
# define BootstrapCFlags -DSVR4
# else
@ -208,7 +230,7 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
# endif
# endif /* OSMinorVersion > 1 */
# ifndef UseExportLists
# define UseExportLists YES
# define UseExportLists NO
# endif
# define HasVFork NO
# define InstKmemFlags -g sys -m 2711
@ -217,11 +239,11 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
* Set flags for position independent code before including sv4Lib.rules
* if the compiler in use doesn't use standard SVR4 flags
*/
# if HasSunC || HasCenterLineC
# if HasSunC
# define PositionIndependentCFlags -Kpic
# define LargePositionIndependentCFlags -KPIC
# endif
# if HasSunCplusplus || HasCenterLineCplusplus
# if HasSunCplusplus
# define PositionIndependentCplusplusFlags -pic
# define LargePositionIndependentCplusplusFlags -PIC
# endif
@ -255,12 +277,10 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
# endif
# endif
# if HasGcc2
# ifndef OptimizedCDebugFlags
# ifdef i386Architecture
# define OptimizedCDebugFlags -m486 DefaultGcc2i386Opt
# else
# define OptimizedCDebugFlags -O2
# endif
# define SharedLibraryLoadFlags -shared
# define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
# ifdef i386Architecture
# define CcCmd gcc
# endif
# else
# define SharedLibraryCcCmd cc
@ -296,28 +316,24 @@ XCOMM SunPro C++ CplusplusCompilerMajorVersion./**/CplusplusCompilerMinorVersion
# endif
# endif
/* Set compiler-dependent options for CenterLine C */
# if HasCenterLineC
# ifndef DefaultCCOptions
# define DefaultCCOptions -Xt -w1 -DANSICPP -U__HIGHC__
# endif
# ifndef NeedConstPrototypes
# define NeedConstPrototypes YES
# endif
# ifndef NeedNestedPrototypes
# define NeedNestedPrototypes YES
# endif
# ifndef NeedVarargsPrototypes
# define NeedVarargsPrototypes YES
# endif
# endif
# define PexCCOptions DefaultCCOptions
#endif /* HasGcc || HasGcc2 (else) */
#if HasGcc2
CXXDEPENDINCLUDE :sh = CcCmd -v -x c++ /dev/null -fsyntax-only \
2>&1 | sed -n 's/^ \(\/.*[cg]++.*\)/-I\1/p'
#define CplusplusDependIncludes $(CXXDEPENDINCLUDE)
#endif
#if HasGcc2ForCplusplus
#define CplusplusCmd g++
#ifndef CplusplusLibC
#define CplusplusLibC -L/usr/gnu/lib -lstdc++
#endif
#endif /* HasGcc2ForCplusplus */
#if OSMajorVersion < 5
# define SharedAllocateLocalDefines -DINCLUDE_ALLOCA_H
# define LibraryCCOptions /* don't want special floating point */
@ -346,8 +362,12 @@ man_keywords:: @@\
#define SharedXdmcpRev 6
#endif
#define MotifDefines \
-DNO_ISDIR -DNO_REGCOMP -DNO_ALLOCA -DBOGUS_MB_MAX -DNO_CONST
#define DependFileName .depend
#if HasSunC
#define DependDefines -D__BUILTIN_VA_ARG_INCR
#endif
#define LdPreLib -L/usr/X11/lib -L$(BUILDLIBDIR)
#define PamUnixDefines -DPAM_NIS
#define TtLargePICTable YES
#define DtSvcDefines -DMULTIBYTE -DNO_REGCOMP
@ -355,6 +375,11 @@ man_keywords:: @@\
#define DtWidgetDefines DtSearchDefines
#define DtPrintDefines DtSearchDefines
/* For DtHelp TIFF processing routines. */
#if defined(AMD64Architecture) || defined(i386Architecture)
#define LSBBitOrder YES
#endif
#define baseDtMailDefines \
-DSunOS=OSMajorVersion\#\#OSMinorVersion -DMMAP_NORESERVE -DSPRO_V2
#ifndef i386Architecture
@ -367,10 +392,15 @@ man_keywords:: @@\
#define TtClientExtraLibs ExtraLibraries -ldl -lintl
#define ExportListGenSource elistgen.sun
#ifndef TopMotifInclude
# define TopMotifInclude /usr/X11/include
#endif
#define ShlibExportListOpt(filename) -M filename
#define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB)
#define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB)
#define CdeProjectDefines \
-DMULTIBYTE -DNLS16 -DMESSAGE_CAT -D_XOPEN_VERSION=4 \
-D_XOPEN_SOURCE -D__EXTENSIONS__ \
-DMULTIBYTE -DNLS16 -DMESSAGE_CAT -D__EXTENSIONS__ \
-DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion

View file

@ -55,15 +55,15 @@ XCOMM $TOG: sunLib.tmpl /main/47 1997/12/12 14:53:33 kaleb $
# define SharedPamDialAuthReqs $(LDPRELIBS) -lpam $(LDPOSTLIBS) SharedThreadReqs
# define SharedPamRhostsAuthReqs $(LDPRELIBS) -lpam $(LDPOSTLIBS) -lsocket SharedThreadReqs
# define SharedPamDceAuthReqs $(LDPRELIBS) -lpam $(LDPOSTLIBS) -ldce -lnsl -lsocket SharedThreadReqs
# define SharedTtReqs -lnsl -lsocket -lintl -ldl -lc -lw
# define SharedDtSvcReqs $(LDPRELIBS) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) SharedThreadReqs -lgen -lc -lsocket -lnsl -ldl
# define SharedTtReqs $(XTOOLLIB) -lnsl -lsocket -lintl -ldl -lc -lw $(CXXLIB)
# define SharedDtSvcReqs $(LDPRELIBS) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) SharedThreadReqs -lgen -lc -lsocket -lnsl -ldl $(CXXLIB)
# define SharedDtMmdbReqs $(LDPRELIBS) $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) SharedThreadReqs -lgen -lc -lsocket -lnsl -ldl
# define SharedDtSearchReqs -lm -lc
# define SharedDtWidgetReqs $(LDPRELIBS) $(DTSVCLIB) $(XMLIB) -lintl $(LDPOSTLIBS) -lw -lm -lc
# define SharedDtHelpReqs $(LDPRELIBS) $(DTSVCLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) -lw -lgen -lm -lc
# define SharedDtHelpReqs $(LDPRELIBS) $(DTSVCLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) -lw -lgen -lm -lc -ljpeg
# define SharedDtPrintReqs $(LDPRELIBS) $(DTSVCLIB) $(DTHELPLIB) $(XMLIB) -lintl $(LDPOSTLIBS) -lw -lm -lc
# define SharedDtTermReqs SharedDtHelpReqs -ldl -lgen
# define SharedDtMrmReqs $(LDPRELIBS) $(DTTERMLIB) $(DTPRINTLIB) $(DTHELPLIB) $(DTWIDGETLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) -lw -lsocket -lnsl -lc
# define SharedDtMrmReqs $(LDPRELIBS) $(DTTERMLIB) $(DTPRINTLIB) $(DTHELPLIB) $(DTWIDGETLIB) $(MRESOURCELIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB) $(LDPOSTLIBS) -lw -lsocket -lnsl -lc $(CXXLIB)
# define SharedDtMailReqs $(LDPRELIBS) -lw $(CXXLIB) -lm -ldl
# define SharedCsaReqs $(LDPRELIBS) $(DTSVCLIB) $(XMLIB) SharedXmReqs
@ -74,10 +74,10 @@ ICONV_INBUF_DEFINE = -DICONV_INBUF_CONST=const
# if HasCplusplus
# if HasGcc2ForCplusplus
UNSHARED_CXXLIB = -static -lC
UNSHARED_CXXLIB =
# elif HasSunCplusplus
# if CplusplusCompilerMajorVersion > 3
UNSHARED_CXXLIB = -lC
UNSHARED_CXXLIB =
# else
UNSHARED_CXXLIB = -Bstatic -lC -Bdynamic -lm -lc -Bstatic
# endif

View file

@ -61,8 +61,17 @@ install:: Concat(lib,libname.so.rev) @@\
#endif /* InstallSharedLibraryData */
#ifndef LinkWithExports
# if UseExportLists
# define LinkWithExports(libname,rev,solist,down,up) \
# if defined(SunArchitecture)
# if HasGcc2
# define LinkWithExports(libname,rev,solist,down,up) \
(cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$@ solist $(REQUIREDLIBS))
# else
# define LinkWithExports(libname,rev,solist,down,up) \
(cd down; $(CCENVSETUP) $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))
# endif
# else
# if UseExportLists
# define LinkWithExports(libname,rev,solist,down,up) \
(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS)) @@\
if [ -f Concat(lib,libname.elist) ]; then \ @@\
$(RM) down/$@.exports $@.list; \ @@\
@ -71,9 +80,10 @@ install:: Concat(lib,libname.so.rev) @@\
(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ ShlibExportListOpt($@.exports) solist $(REQUIREDLIBS)); \ @@\
$(RM) down/$@.exports $@.list; \ @@\
fi;
# else
# define LinkWithExports(libname,rev,solist,down,up) \
# else
# define LinkWithExports(libname,rev,solist,down,up) \
(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist $(REQUIREDLIBS))
# endif
# endif
#endif

View file

@ -101,10 +101,10 @@ XCOMM $TOG: svr4.cf /main/17 1997/06/08 20:08:31 kaleb $
#define DefaultCCOptions -Xa -Dasm=__asm
#endif
#endif
#ifndef DefaultCDebugFlags
#if !defined(DefaultCDebugFlags) && !defined(OptimizedCDebugFlags)
#if HasGcc2
#ifdef i386Architecture
#define DefaultCDebugFlags -m486 DefaultGcc2i386Opt
#define DefaultCDebugFlags -O2
#else
#define DefaultCDebugFlags -O2
#endif

View file

@ -7,6 +7,7 @@ XCOMM not exist. Since BUILDLIBDIR may not exist yet suppress its use.
DEPLIBS =
DEPEND_DEFINES = $(DEPENDDEFINES)
INCLUDES = -I$(TOP)/include $(TOP_X_INCLUDES)/X11
CPP_PROGRAM = CppCmd
CPP_DEFINES = -DCPP_PROGRAM="\"$(CPP_PROGRAM)\""

View file

@ -1096,8 +1096,12 @@ get_sun_compiler_versions(FILE *inFile)
{
char buf[PATH_MAX];
char cmd[PATH_MAX];
static char* sunpro_cc = "/opt/SUNWspro/bin/cc";
static char* sunpro_CC = "/opt/SUNWspro/bin/CC";
static char* sunpro_cc = "/opt/solarisstudio/bin/cc";
static char* sunpro_CC = "/opt/solarisstudio/bin/CC";
static char* gnu_cc1 = "/usr/bin/gcc";
static char* gnu_cc2 = "/usr/gnu/bin/gcc";
static char* gnu_CC1 = "/usr/bin/g++";
static char* gnu_CC2 = "/usr/gnu/bin/g++";
int cmajor, cminor;
char* vptr;
struct stat sb;
@ -1142,6 +1146,56 @@ get_sun_compiler_versions(FILE *inFile)
pclose (ccproc);
}
}
cmd[0] = '\0';
if (lstat (gnu_cc1, &sb) == 0) {
strncpy (cmd, gnu_cc1, PATH_MAX);
}
else if (lstat (gnu_cc2, &sb) == 0) {
strncpy (cmd, gnu_cc2, PATH_MAX);
}
if (cmd[0] != '\0') {
strncat (cmd, " --version 2>&1", 15);
if ((ccproc = popen (cmd, "r")) != NULL) {
if (fgets (buf, PATH_MAX, ccproc) != NULL) {
vptr = strrchr (buf, 'G');
for (; !isdigit(*vptr); vptr++);
ret = sscanf (vptr, "%d.%d", &cmajor, &cminor);
fprintf (inFile,
"#define DefaultGnuCCompilerMajorVersion %d\n",
cmajor);
fprintf (inFile,
"#define DefaultGnuCCompilerMinorVersion %d\n",
cminor);
}
while (fgets (buf, PATH_MAX, ccproc) != NULL) {};
pclose (ccproc);
}
}
cmd[0] = '\0';
if (lstat (gnu_CC1, &sb) == 0) {
strncpy (cmd, gnu_CC1, PATH_MAX);
}
else if (lstat (gnu_CC2, &sb) == 0) {
strncpy (cmd, gnu_CC2, PATH_MAX);
}
if (cmd[0] != '\0') {
strncat (cmd, " --version 2>&1", 15);
if ((ccproc = popen (cmd, "r")) != NULL) {
if (fgets (buf, PATH_MAX, ccproc) != NULL) {
vptr = strrchr (buf, 'G');
for (; !isdigit(*vptr); vptr++);
ret = sscanf (vptr, "%d.%d", &cmajor, &cminor);
fprintf (inFile,
"#define DefaultGnuCplusplusCompilerMajorVersion %d\n",
cmajor);
fprintf (inFile,
"#define DefaultGnuCplusplusCompilerMinorVersion %d\n",
cminor);
}
while (fgets (buf, PATH_MAX, ccproc) != NULL) {};
pclose (ccproc);
}
}
(void) ret;
}
#endif
@ -1152,6 +1206,10 @@ get_gcc_incdir(FILE *inFile)
static char* gcc_path[] = {
#ifdef linux
"/usr/bin/cc", /* for Linux PostIncDir */
#endif
#ifdef sun
"/usr/bin/gcc",
"/usr/gnu/bin/gcc",
#endif
"/usr/local/bin/gcc",
"/opt/gnu/bin/gcc"

View file

@ -1,4 +1,4 @@
XCOMM $TOG: Imakefile /main/27 1997/04/30 15:38:09 kaleb $
XCOMM $tog: Imakefile /main/27 1997/04/30 15:38:09 kaleb $
SRCS = include.c main.c parse.c pr.c cppsetup.c ifparser.c
OBJS = include.o main.o parse.o pr.o cppsetup.o ifparser.o
@ -28,6 +28,7 @@ INC_DEFINES = $(PREINC_DEFINES) $(STDINC_DEFINES) $(POSTINC_DEFINES)
OSUF = .Osuf
OSUF_DEFINES = -DOBJSUFFIX=\"$(OSUF)\"
MAIN_DEFINES = $(INC_DEFINES) $(SIGNAL_DEFINES) $(OSUF_DEFINES)
DEPEND_DEFINES = $(DEPENDDEFINES)
INCLUDES = -I$(IMAKESRC) -I$(TOP)/include $(TOP_X_INCLUDES)/X11
DEPLIBS =

View file

@ -81,7 +81,6 @@
#include "ifparser.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

View file

@ -77,6 +77,7 @@
* ParseIfExpression parse a string for #if
*/
#include <stdlib.h>
#include <stdio.h>
#define const /**/

View file

@ -525,7 +525,8 @@ char *our_getline(filep)
lineno = filep->f_line;
for(bol = p--; ++p < eof; ) {
if (*p == '/' && *(p+1) == '*') { /* consume comments */
if (*p == '/' && (p+1) < eof && *(p+1) == '*') {
/* consume C comments */
*p++ = ' ', *p++ = ' ';
while (*p) {
if (*p == '*' && *(p+1) == '/') {
@ -538,15 +539,31 @@ char *our_getline(filep)
}
continue;
}
#ifdef WIN32
else if (*p == '/' && *(p+1) == '/') { /* consume comments */
*p++ = ' ', *p++ = ' ';
while (*p && *p != '\n')
*p++ = ' ';
lineno++;
continue;
else if (*p == '/' && (p+1) < eof && *(p+1) == '/') {
/* consume C++ comments */
*p++ = ' ';
*p++ = ' ';
while (p < eof && *p) {
if (*p == '\\' && (p+1) < eof &&
*(p+1) == '\n') {
*(p++) = ' ';
lineno++;
}
else if (*p == '?' && (p+3) < eof &&
*(p+1) == '?' &&
*(p+2) == '/' &&
*(p+3) == '\n') {
*(p++) = ' ';
*(p++) = ' ';
*(p++) = ' ';
lineno++;
}
else if (*p == '\n')
break; /* to process end of line */
*(p++) = ' ';
}
--p;
}
#endif
else if (*p == '\\') {
if (*(p+1) == '\n') {
*p = ' ';

View file

@ -60,6 +60,7 @@ add_include(filep, file, file_red, include, dot, failOK)
struct inclist *file, *file_red;
char *include;
boolean dot;
boolean failOK;
{
register struct inclist *newfile;
register struct filepointer *content;

View file

@ -13,6 +13,8 @@ CMKDIRHIER = mkdirhier.exe
PROGRAMS = xmkmf $(MDEP_PROG) mergelib ProgramTargetName(makestrs) $(EXPORTLISTGEN) $(CMKDIRHIER)
DEPLIBS =
DEPEND_DEFINES = $(DEPENDDEFINES)
#ifndef Win32Architecture
EXTRA_LIBRARIES =
#endif

View file

@ -308,6 +308,7 @@ static void WriteHeader (tagline, phile, abi)
static void WriteSourceLine (te, abi, fudge)
TableEnt* te;
int abi;
int fudge;
{
char* c;