XCOMM $XFree86: Xi18nLib.conf,v 1.8 2002/11/25 14:04:54 eich Exp $
XCOMM $XdotOrg: xc/lib/X11/xlibi18n/Xi18nLib.conf,v 1.1.4.3.2.1 2004/03/04 17:46:48 eich Exp $

#define DoNormalLib NO
#define DoSharedLib YES
#define DoDebugLib DebugLibX11
#define DoProfileLib ProfileLibX11
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"

#include <Threads.tmpl>

     SOXI18NREV = 2
     POSTLOCALE = common
#if defined (LibDirName)
     POSTLOCALELIB = LibDirName
#else
     POSTLOCALELIB = lib
#endif

#if Malloc0ReturnsNull
     MALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
#endif
#if NeedLibInsideFlag
    LIB_DEFINES = -D_XLIBINT_
#endif

DYNAMIC_DEFINES = -DDYNAMIC_LOAD
        DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(SUNSOFT_DEFINES)

#include <Library.tmpl>

#if defined(HPArchitecture) && OSMajorVersion > 9
    EXTRA_SHLIBLDFLAGS = +s +b $(USRLIBDIR)
#else
    EXTRA_SHLIBLDFLAGS = 
#endif

#if defined(SparcArchitecture)
#if defined(HasSunC) && HasSunC
CFLAGS += -xregs=no%appl
#endif
#if HasGcc
CFLAGS += -mno-app-regs
#endif
#endif

all::
	$(_NULLCMD_)
.c.o:
	$(_NULLCMD_)
	$(_NULLCMD_)
	$(_NULLCMD_)
	$(RM) $@
	$(CC) -c $(CFLAGS) $(_NOOP_) $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $*.c

clean::
	rm -rf *.so.$(SOXI18NREV)

lint::
	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)

#ifndef LinkBuildXi18nLibrary
# ifdef UseInstalled
#  define LinkBuildXi18nLibrary(libname) $(_NULLCMD_)
# else
#  define LinkBuildXi18nLibrary(libname,rev)				@@\
AllTarget(AllTarget(Concat(lib,libname.so.rev)))			@@\
	MakeDir($(BUILDI18NDIR)/$(POSTLOCALELIB)/$(POSTLOCALE))	@@\
	RemoveFile($(BUILDI18NDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)/libname.so.$(SOXI18NREV))	@@\
	cd $(BUILDI18NDIR)/$(POSTLOCALELIB)/$(POSTLOCALE) && $(LN) $(BUILDI18NTOP)/$(CURRENT_DIR)/Concat(lib,libname.so.rev) ./libname.so.rev
# endif
#endif

#ifndef Xi18nLibraryTarget
# if 0 /* !CrossCompiling */
#  define	Xi18nLibraryTarget(libname)		@@\
all:: libname.so.$(SOXI18NREV)			@@\
libname.so.$(SOXI18NREV): $(OBJS)		@@\
	$(RM) $@~				@@\
	(cd .; T=`echo $@ | sed 's/\.[^\.]*$$//'`; $(LD) -o ./$@~ $(SHLIBLDFLAGS) $(OBJS) $(REQUIREDLIBS) $(EXTRA_SHLIBLDFLAGS); $(RM) $$T && $(LN) $@ $$T) @@\
	$(RM) $@				@@\
	$(MV) $@~ $@				@@\
install:: libname.so.$(SOXI18NREV)		@@\
	@if [ -d $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE) ]; then set +x; \ @@\
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)); fi @@\
	$(RM) $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)/libname.so.$(SOXI18NREV)	@@\
	$(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) libname.so.$(SOXI18NREV) $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)
# else
#  define Xi18nLibraryTarget(libname)				@@\
DependTarget()							@@\
SharedLibraryTarget(libname,$(SOXI18NREV),$(OBJS),.,.)		@@\
LinkBuildXi18nLibrary(libname,$(SOXI18NREV))			@@\
install:: Concat(lib,libname.so.$(SOXI18NREV))			@@\
	MakeDir($(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE))		@@\
	$(RM) $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)/libname.so.$(SOXI18NREV)	@@\
	$(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) Concat(lib,libname.so.$(SOXI18NREV)) $(DESTDIR)$(XLOCALEDIR)/$(POSTLOCALELIB)/$(POSTLOCALE)/libname.so.$(SOXI18NREV)

# endif
#endif
