Hi,

(Branden: I hope you don't mind the CC)

this is my first (actually second) go at sanitizing the X configuration
on the GNU platform. This process will take some time, with several steps
involved. First step is to get the configuration fixed and the Debian rules
files adapted, so we can build the libs and the clients from the Debian
packages (we will get the servers for free, too, although they will not
cooperate with the Hurd out of the box).

There are a couple of XXX marks, please look through them and comment if you
can. The issues are: Will X work with our CThreads? Will X notice that shm
fails and deal? Should we define NO_ALLOCA? What about rpath? etc.

The Shared library rules are straight from their Linux counter parts, with
the a.out garbage stripped. Same for the config, with some adjustments from
the prior file and the c thread stuff. I could imagine that both could share
the same file at least for *Lib.{rules,tmpl}. We could even use the Linux
files by defining appropriate symbols (UseElfFormat etc), but it would be a
bit clumsy because of the binutils version mess and the rpath mess (see
ExtraLoadFlags).

Probably we also need to restrict the number of servers we build.

The next step is to adjust imake, it needs some work or the defaults
will be wrong.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
[EMAIL PROTECTED],     [EMAIL PROTECTED]    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       [EMAIL PROTECTED]
XCOMM platform:  $XFree86: xc/config/cf/gnu.cf,v 1.2.2.2 1998/12/22 12:27:31 hohndel 
Exp $

#ifndef OSName
#define OSName                  DefaultOSName
#endif
#ifndef OSVendor
#define OSVendor                /**/
#endif
#ifndef OSMajorVersion
#define OSMajorVersion          DefaultOSMajorVersion
#endif
#ifndef OSMinorVersion
#define OSMinorVersion          DefaultOSMinorVersion
#endif
#ifndef OSTeenyVersion
#define OSTeenyVersion          DefaultOSTeenyVersion
#endif
XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)

#define GNUSourceDefines      -D_POSIX_C_SOURCE=199309L \
                              -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L \
                              -D_BSD_SOURCE -D_SVID_SOURCE -D__ELF__
#define XawI18nDefines        -DHAS_WCHAR_H -DHAS_WCTYPE_H -DNO_WIDEC_H

XCOMM XXX Can we do this?
#define HasCThreads             YES
#define ThreadedX               YES
#define HasThreadSafeAPI        YES
#define ThreadsLibraries        -lthreads
#define SystemMTDefines         -D_REENTRANT

#define HasSecureRPC            YES
#ifndef HasLibCrypt
#define HasLibCrypt             YES
#endif

#define HasGcc                  YES
#define HasGcc2                 YES
#ifndef HasGcc2ForCplusplus
# define HasGcc2ForCplusplus    YES
#endif
#define GccUsesGas              YES
#define UseGas                  YES
#define GnuCpp                  YES
#ifndef HasShadowPasswd
# define HasShadowPasswd        YES
#endif
#define HasPutenv               YES

XCOMM XXX Not implemented and will always fail, should we say YES anyway?
#define HasShm                  NO

#define HasBSD44Sockets         YES
#define HasSockets              YES
#define HasSnprintf             YES
#define HasMkstemp              YES
#ifndef HasPam
#define HasPam                  NO
#endif

#define AvoidNullMakeCommand    YES
#define StripInstalledPrograms  YES
#define CompressAllFonts        YES
XCOMM XXX TEST!!!
#define Malloc0ReturnsNull      NO
#define Malloc0ReturnsNull      YES
#define NeedConstPrototypes     YES
#define NeedFunctionPrototypes  YES
#define NeedNestedPrototypes    YES
#define NeedVarargsPrototypes   YES
#ifndef NeedWidePrototypes
#define NeedWidePrototypes      NO
#endif
#define SetTtyGroup             YES

#ifndef UseStaticTermcapLib
#define UseStaticTermcapLib     NO
#endif

#define MkdirHierCmd            mkdir -p
#define CcCmd                   gcc
#define AsCmd                   as
#define LdCmd                   ld

XCOMM XXX -DUSE_GAS???
#define AsmDefines              -D__ELF__
#define CplusplusCmd            c++
#if UseStaticTermcapLib
#define TermcapLibrary          StaticLibrary(/usr/lib,ncurses)
#else
#define TermcapLibrary          -lncurses
#endif
#ifndef BuildDynamicLoading
#define BuildDynamicLoading     YES
#endif
#define CppCmd                  /lib/cpp
#ifdef USE_BYACC
#define YaccCmd                 byacc
#else
#define YaccCmd                 bison -y
#endif
#define LexCmd                  flex -l
#define LexLib                  -lfl
#define PreProcessCmd           CcCmd -E
#define PostIncDir              DefaultGccIncludeDir
#define LdCombineFlags          -r
#define LdPostLib               /* Never needed */
#define HasWChar32              YES
#define StandardCppDefines      -traditional StandardDefines

XCOMM i386Architecture
#define OptimizedCDebugFlags    DefaultGcc2i386Opt
#define GNUMachineDefines       -D__i386__
XCOMM XXX Does it grok PART_NET?
#define ServerOSDefines         XFree86ServerOSDefines -DDDXTIME -DPART_NET
XCOMM XXX Really NO_ALLOCA?
#define ServerExtraDefines      -DGCCUSESGAS XFree86ServerDefines -DNO_ALLOCA

#define StandardDefines         -D__GNU__ GNUMachineDefines GNUSourceDefines

#define DlLibrary               -rdynamic -ldl
#if BuildDynamicLoading
#define ServerExtraSysLibs      DlLibrary
#else
#define ServerExtraSysLibs      /**/
#endif

#define ConnectionFlags         -DUNIXCONN -DTCPCONN

#define HasZlib                 YES

/* Some of these man page defaults are overriden in the above OS sections */
#ifndef ManSuffix
# define ManSuffix      1x
#endif
#ifndef ManDir
# define ManDir         $(MANSOURCEPATH)1
#endif
#ifndef LibManSuffix
# define LibManSuffix   3x
#endif
#ifndef LibmanDir
# define LibmanDir      $(MANSOURCEPATH)3
#endif
#ifndef FileManSuffix
# define FileManSuffix  5x
#endif
#ifndef FileManDir
# define FileManDir     $(MANSOURCEPATH)5
#endif

#ifndef StaticLibrary
#define StaticLibrary(libpath,libname) -Wl,-Bstatic Concat(-L,libpath) 
Concat(-l,libname) -Wl,-Bdynamic
#endif

#define HasGnuMake      YES

#define MakeNamedTargetSubdir(dir,flags,subname)\
        $(MAKE) -C dir $(MFLAGS) $(PARALLELMFLAGS) flags subname


#define UseGccMakeDepend        YES

#define XserverNeedsSetUID      YES




#define HasSharedLibraries      YES
#include <gnuLib.rules>

XCOMM XXX Might need this if they are not careful with slashes.
XCOMM #define DirFailPrefix -

XCOMM XXX BSD defines it, Linux not.
XCOMM #define HasNdbm           YES
XCOMM #define HasPoll           YES

#include <xfree86.cf>
/*
 * GNU/Hurd shared library rules
 *
 * $XFree86: xc/config/cf/gnuLib.rules,v 1.1.2.2 1998/12/22 12:27:32 hohndel Exp $
 */

/*
 * GNU/Hurd shared library rules
 * Cloned from Linux (ELF) shared library rules
 *
 */

#ifndef HasSharedLibraries
#define HasSharedLibraries YES
#endif
#ifndef ForceNormalLib
#define ForceNormalLib NO
#endif

#undef SpecialMalloc
#define SpecialMalloc NO
#undef UseInternalMalloc
#define UseInternalMalloc NO

#define BaseShLibReqs   -lc

#ifndef SharedDataSeparation
#define SharedDataSeparation NO
#endif
#ifndef SharedCodeDef
#define SharedCodeDef /**/
#endif
#ifndef SharedLibraryDef
#define SharedLibraryDef /**/
#endif
#ifndef ShLibIncludeFile
#define ShLibIncludeFile <gnuLib.tmpl>
#endif
#ifndef SharedLibraryLoadFlags
XCOMM XXX To rpath or not to rpath...
XCOMM #define SharedLibraryLoadFlags -shared -Wl,-rpath=$(USRLIBDIR)
#define SharedLibraryLoadFlags -shared
#endif
#ifndef PositionIndependentCFlags
#define PositionIndependentCFlags -fPIC
#endif
#ifndef PositionIndependentCplusplusFlags
#define PositionIndependentCplusplusFlags -fPIC
#endif
#ifndef ExtraLoadFlags
#ifdef UseInstalled
XCOMM XXX Maybe superfluous.
#define ExtraLoadFlags -Wl,-rpath-link=$(USRLIBDIRPATH)
#else
#define ExtraLoadFlags -Wl,-rpath-link=$(BUILDLIBDIR)
#endif
#endif

/*
 * InstallSharedLibrary - generate rules to install the shared library.
 * NOTE: file must be executable, hence "INSTBINFLAGS"
 */
#ifndef InstallSharedLibrary
#define InstallSharedLibrary(libname,rev,dest)                          @@\
install:: Concat(lib,libname.so.rev)                                    @@\
        MakeDir($(DESTDIR)dest)                                         @@\
        $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) 
$(DESTDIR)dest @@\
        @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\
          set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T     @@\
        $(RM) Concat($(DESTDIR)dest/lib,libname.so)                     @@\
        $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
#endif /* InstallSharedLibrary */

/*
 * InstallSharedLibraryData - generate rules to install the shared library data
 */
#ifndef InstallSharedLibraryData
#define InstallSharedLibraryData(libname,rev,dest)
#endif /* InstallSharedLibraryData */


/*
 * SharedLibraryTarget - generate rules to create a shared library;
 * build it into a different name so that we do not hose people by having
 * the library gone for long periods.
 */
#ifndef SharedLibraryTarget
#ifdef UseInstalled  
#define LinkBuildSonameLibrary(lib) true
#else
#define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); \
        cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
#endif

#define SharedLibraryTarget(libname,rev,solist,down,up)                 @@\
AllTarget(Concat(lib,libname.so.rev))                                   @@\
                                                                        @@\
Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)                 @@\
        $(RM) $@~                                                       @@\
        @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \             @@\
                (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist 
$(REQUIREDLIBS) BaseShLibReqs); \ @@\
                $(RM) $$SONAME; $(LN) $@ $$SONAME; \                    @@\
                LinkBuildSonameLibrary($$SONAME)                        @@\
        $(RM) $@                                                        @@\
        $(MV) $@~ $@                                                    @@\
        $(RM) Concat(lib,libname.so)                                    @@\
        $(LN) $@ Concat(lib,libname.so)                                 @@\
        LinkBuildLibrary($@)                                            @@\
        LinkBuildLibrary(Concat(lib,libname.so))                        @@\
                                                                        @@\
clean::                                                                 @@\
        @MAJREV=`expr rev : '\(.*\)\.'`; \                              @@\
        set -x; $(RM) Concat(lib,libname.so.$$MAJREV)                   @@\
        $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)

#endif /* SharedLibraryTarget */

#ifndef SharedDepModuleTarget
#define SharedDepModuleTarget(name,deps,solist)                         @@\
AllTarget(name)                                                         @@\
                                                                        @@\
name: deps                                                              @@\
        $(RM) $@~                                                       @@\
        $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
        $(RM) $@                                                        @@\
        $(MV) $@~ $@                                                    @@\
                                                                        @@\
clean::                                                                 @@\
        $(RM) name

#endif /* SharedDepModuleTarget */

/*
 * SharedLibraryDataTarget - generate rules to create shlib data file;
 */
#ifndef SharedLibraryDataTarget
#define SharedLibraryDataTarget(libname,rev,salist)
#endif /* SharedLibraryTarget */

/*
 * GNU Hurd shared library template
 *
 * $XFree86: xc/config/cf/gnuLib.tmpl,v 1.1.2.2 1998/12/22 12:27:32 hohndel Exp $
 */

#ifndef FixupLibReferences
#define FixupLibReferences()                                            @@\
XMULIBONLY = -lXmu                                                      @@\
XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
#endif

#ifndef XawClientLibs
#define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XLIB)
#endif

#define CplusplusLibC

#define SharedX11Reqs
#define SharedOldXReqs  $(LDPRELIB) $(XLIBONLY)
#define SharedXtReqs    $(LDPRELIB) $(XLIBONLY) $(SMLIB) $(ICELIB)
#define SharedXawReqs   $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
#define SharedXmuReqs   $(LDPRELIB) $(XTOOLLIB) $(XLIB)
#define SharedXextReqs  $(LDPRELIB) $(XLIBONLY)
#define SharedXiReqs    $(LDPRELIB) $(XLIB)
#define SharedPexReqs   $(LDPRELIB) $(XLIBONLY) MathLibrary
#define SharedXtstReqs  $(LDPRELIB) $(XLIB)
#define SharedXieReqs   $(LDPRELIB) $(XLIBONLY)
#define SharedSMReqs    $(LDPRELIB) $(ICELIB)

Reply via email to