scoLib.rules revision 11d341ca
1XCOMM $XdotOrg: util/cf/scoLib.rules,v 1.3 2005/11/08 06:33:24 jkj Exp $
2XCOMM $Xorg: scoLib.rules,v 1.3 2000/08/17 19:41:48 cpqbld Exp $
3XCOMM $XFree86: xc/config/cf/scoLib.rules,v 1.10 2003/12/18 16:38:34 dawes Exp $
4
5#ifndef UseExportLists
6# define UseExportLists	YES
7#endif
8
9#ifndef SCOAbsShlibPath
10# define SCOAbsShlibPath NO
11#endif
12
13#if SCOAbsShlibPath
14# define SCOShlibFlags -h $(SHLIBDIR)/$@
15#else
16# ifndef ExtraLoadFlags
17#  define ExtraLoadFlags -R $(USRLIBDIRPATH)
18#  endif
19# define SCOShlibFlags -R $(SHLIBDIR) -h $@
20#endif
21
22/*
23 * SharedLibraryTarget3 - generate rules to create a shared library;
24 * build it into a different name so that we do not hose people by having
25 * the library gone for long periods.  
26 *
27 * Work around SCO sh enviroment size problem.
28 */
29#ifndef SharedLibraryTarget3
30#define SharedLibraryTarget3(libname,rev,solist1,solist2,solist3,down,up)	@@\
31AllTarget(Concat(lib,libname.so.rev))					@@\
32									@@\
33Concat(lib,libname.so.rev): solist1 solist2 solist3 $(EXTRALIBRARYDEPS)	@@\
34	$(RM) $@~							@@\
35	echo -n $(LD) -o up/$@~ $(SHLIBLDFLAGS) SCOShlibFlags solist1 " " > Concat(down/lib,cmd) 	@@\
36	echo -n solist2 " " >> Concat(down/lib,cmd)			@@\
37	echo -n solist3 " " >> Concat(down/lib,cmd)			@@\
38	echo -n $(REQUIREDLIBS) >> Concat(down/lib,cmd)			@@\
39	(cd down; $(SHELL) Concat(./lib,cmd))				@@\
40	$(RM) $@ Concat(lib,tmp1) Concat(lib,tmp2)			@@\
41	$(MV) $@~ $@							@@\
42	@if $(SOSYMLINK); then (set -x; \				@@\
43	  $(RM) Concat(lib,libname.so); \				@@\
44	  $(LN) $@ Concat(lib,libname.so)); fi				@@\
45	LinkBuildLibrary($@)						@@\
46	LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))	@@\
47									@@\
48clean::									@@\
49	$(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
50
51#endif /* SharedLibraryTarget */
52
53#ifndef LinkWithExports
54# if UseExportLists
55#  define LinkWithExports(libname,rev,solist,down,up) \
56	(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) SCOShlibFlags solist $(REQUIREDLIBS))	@@\
57	if [ -f Concat(lib,libname.elist) ]; then \			@@\
58	    $(RM) down/$@.exports $@.list; \				@@\
59	    $(CPP) $(ALLINCLUDES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(DEFINES) Concat(lib,libname.elist) | CppSedMagic >$@.list; \	@@\
60	    $(EXPORTLISTGEN) $@~ $@.list > down/$@.exports; \		@@\
61	    (cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) SCOShlibFlags ShlibExportListOpt($@.exports) solist $(REQUIREDLIBS)); \	@@\
62	    $(RM) down/$@.exports $@.list; \				@@\
63	fi;
64# else
65#  define LinkWithExports(libname,rev,solist,down,up) \
66	(cd down; $(CCENVSETUP) $(LD) -o up/$@~ $(SHLIBLDFLAGS) SCOShlibFlags solist $(REQUIREDLIBS))
67# endif
68#endif
69