home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / X11R6 / lib / X11 / config / lnxLib.rules < prev    next >
Text File  |  1999-09-03  |  20KB  |  571 lines

  1. XCOMM $XConsortium: lnxLib.rules /main/13 1996/09/28 16:11:01 rws $
  2. XCOMM $XFree86: xc/config/cf/lnxLib.rules,v 3.28.2.4 1998/12/18 11:56:08 dawes Exp $
  3.  
  4. /*
  5.  * Linux shared library rules (DLL & ELF versions)
  6.  */
  7. #ifndef HasSharedLibraries
  8. #define HasSharedLibraries YES
  9. #endif
  10. #ifndef ForceNormalLib
  11. #define ForceNormalLib NO
  12. #endif
  13.  
  14. #define SharedOldX NO
  15.  
  16. #if UseElfFormat
  17.  
  18. #if (LinuxCLibMajorVersion >= 5 && LinuxCLibMinorVersion >= 4) || LinuxCLibMajorVersion >= 6
  19. #undef SpecialMalloc
  20. #define SpecialMalloc NO
  21. #undef UseInternalMalloc
  22. #define UseInternalMalloc NO
  23. #endif
  24.  
  25. #if LinuxCLibMajorVersion <= 5
  26. /*
  27.  *    #define BaseShLibReqs    -lc
  28.  *
  29.  * I don't want to use this since the normal ELF executables should
  30.  * be linked with libc.so. If it is not, i.e., static, the variables in
  31.  * libc.so which is loaded in because of the other shared libraries
  32.  * may have different values than the ones in the static ELF
  33.  * executables. That happens if the binaries are linked with libg.a
  34.  * or libc_p.a.
  35.  *
  36.  * If an ELF executable linked with libg.a or libc_p.a loads a shared
  37.  * object which needs libc.so via dlopen (), I think it should fail.
  38.  * It is a very bad idea. The moral story is DON'T USE dlopen () IN
  39.  * ELF EXECUTABLES LINKED WITH libg.a OR libc_p.a. H.J.
  40.  *
  41.  */
  42. #define BaseShLibReqs
  43. #else
  44. /* With GNU libc 2 this works fine. */
  45. #define BaseShLibReqs    -lc
  46. #endif
  47.  
  48. #ifndef SharedDataSeparation
  49. #define SharedDataSeparation NO
  50. #endif
  51. #ifndef SharedCodeDef
  52. #define SharedCodeDef /**/
  53. #endif
  54. #ifndef SharedLibraryDef
  55. #define SharedLibraryDef /**/
  56. #endif
  57. #ifndef ShLibIncludeFile
  58. #define ShLibIncludeFile <lnxLib.tmpl>
  59. #endif
  60. #ifndef SharedLibraryLoadFlags
  61. #define SharedLibraryLoadFlags -shared
  62. #endif
  63. #ifndef PositionIndependentCFlags
  64. #define PositionIndependentCFlags -fPIC
  65. #endif
  66. #ifndef PositionIndependentCplusplusFlags
  67. #define PositionIndependentCplusplusFlags -fPIC
  68. #endif
  69. #ifndef ExtraLoadFlags
  70. #if LinuxBinUtilsMajorVersion >= 26
  71. #ifdef UseInstalled
  72. #if LinuxBinUtilsMajorVersion < 27
  73. #define ExtraLoadFlags -Wl,-rpath-link,$(USRLIBDIRPATH)
  74. #endif
  75. #else
  76. #define ExtraLoadFlags -Wl,-rpath-link,$(BUILDLIBDIR)
  77. #endif
  78. #else
  79. #define ExtraLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
  80. #endif
  81. #endif
  82.  
  83. /*
  84.  * InstallSharedLibrary - generate rules to install the shared library.
  85.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  86.  */
  87. #ifndef InstallSharedLibrary
  88. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  89. install:: Concat(lib,libname.so.rev)                     @@\
  90.     MakeDir($(DESTDIR)dest)                        @@\
  91.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  92.     @T=`echo Concat($(DESTDIR)dest/lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`;\
  93.       set -x; $(RM) $$T && $(LN) Concat(lib,libname.so.rev) $$T    @@\
  94.     $(RM) Concat($(DESTDIR)dest/lib,libname.so)            @@\
  95.     $(LN) Concat(lib,libname.so.rev) Concat($(DESTDIR)dest/lib,libname.so)
  96. #endif /* InstallSharedLibrary */
  97.  
  98. /*
  99.  * InstallSharedLibraryData - generate rules to install the shared library data
  100.  */
  101. #ifndef InstallSharedLibraryData
  102. #define    InstallSharedLibraryData(libname,rev,dest)
  103. #endif /* InstallSharedLibraryData */
  104.  
  105.  
  106. /*
  107.  * SharedLibraryTarget - generate rules to create a shared library;
  108.  * build it into a different name so that we do not hose people by having
  109.  * the library gone for long periods.
  110.  */
  111. #ifndef SharedLibraryTarget
  112. #ifdef UseInstalled
  113. #define LinkBuildSonameLibrary(lib) true
  114. #else
  115. #define LinkBuildSonameLibrary(lib) (RemoveFile($(BUILDLIBDIR)/lib); \
  116.     cd $(BUILDLIBDIR); $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/lib .)
  117. #endif
  118.  
  119. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  120. AllTarget(Concat(lib,libname.so.rev))                    @@\
  121.                                     @@\
  122. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  123.     $(RM) $@~                            @@\
  124.     @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \        @@\
  125.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  126.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  127.         LinkBuildSonameLibrary($$SONAME)            @@\
  128.     $(RM) $@                             @@\
  129.     $(MV) $@~ $@                            @@\
  130.     $(RM) Concat(lib,libname.so)                    @@\
  131.     $(LN) $@ Concat(lib,libname.so)                    @@\
  132.     LinkBuildLibrary($@)                        @@\
  133.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  134.                                     @@\
  135. clean::                                    @@\
  136.     @MAJREV=`expr rev : '\(.*\)\.'`; \                @@\
  137.     set -x; $(RM) Concat(lib,libname.so.$$MAJREV)            @@\
  138.     $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
  139.  
  140. #endif /* SharedLibraryTarget */
  141.  
  142. #ifndef SharedDepModuleTarget
  143. #define SharedDepModuleTarget(name,deps,solist)                @@\
  144. AllTarget(name)                                @@\
  145.                                     @@\
  146. name: deps                                @@\
  147.     $(RM) $@~                            @@\
  148.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  149.     $(RM) $@                            @@\
  150.     $(MV) $@~ $@                            @@\
  151.                                     @@\
  152. clean::                                    @@\
  153.     $(RM) name
  154.  
  155. #endif /* SharedDepModuleTarget */
  156.  
  157. /*
  158.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  159.  */
  160. #ifndef SharedLibraryDataTarget
  161. #define SharedLibraryDataTarget(libname,rev,salist)
  162. #endif /* SharedLibraryTarget */
  163.  
  164. #else /* UseElfFormat */
  165.  
  166. #ifndef SharedDataSeparation
  167. #define SharedDataSeparation NO
  168. #endif
  169. #ifndef SharedCodeDef
  170. #define SharedCodeDef /**/
  171. #endif
  172. #ifndef SharedLibraryDef
  173. #define SharedLibraryDef /**/
  174. #endif
  175. #ifndef ShLibIncludeFile
  176. #define ShLibIncludeFile <lnxLib.tmpl>
  177. #endif
  178. #ifndef SharedLibraryLoadFlags
  179. #define SharedLibraryLoadFlags /**/
  180. #endif
  181. #ifndef PositionIndependentCFlags
  182. #define PositionIndependentCFlags -B/usr/bin/jump
  183. #endif
  184.  
  185. /*
  186.  * These definitions are now extended to work with the X sources and
  187.  * external sources wishing to build shared libs.
  188.  *
  189.  * A library can create it's own shlibs (.so) or can be incorporated into
  190.  * another "host" lib. All libraries generate stub (.sa) files.
  191.  * A "host" lib does all the work to generate the stubs for itself and its
  192.  * "guests", invoking the "guest" Makefiles to create the objects for
  193.  * inclusion into the "host" shlib. A "guest" lib will ask the "host" to
  194.  * create the stubfiles, then copy its own into its directory.
  195.  * Most external libs are "host" libs; the concept of "guest" is a holdover
  196.  * from older libs during the days of scarce shared library address space.
  197.  *
  198.  * To create a simple "host" shared lib, Xfoo, define:
  199.  *
  200.  *  JUMP_ROOT_Xfoo = <source directory>
  201.  *  JUMP_IS_HOST_Xfoo = YES
  202.  *  JUMP_STUBLIBS_Xfoo = libXfoo.sa
  203.  *  JUMP_DIR_Xfoo = $(JUMP_ROOT_Xfoo)/shared        <work directory>
  204.  *  JUMP_DEFS_Xfoo = -DFOO                <defs for jump files>
  205.  *  JUMP_VARS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_vars    <see DLL docs>
  206.  *  JUMP_FUNCS_Xfoo = $(JUMP_ROOT_Xfoo)/jump_funcs    <see DLL docs>
  207.  *  JUMP_IGNORE_Xfoo = $(JUMP_ROOT_Xfoo)/jump_ignore    <see DLL docs>
  208.  *  JUMP_EXPORT_Xfoo = $(JUMP_DIR_Xfoo)/jump.vars    <exported symbols>
  209.  *  JUMP_IMPORT_Xfoo = $(JUMP_EXPORT_Xbar)        <imported symbols>
  210.  *  JUMP_ADDRESS_Xfoo = 0xXXXXXXXX            <fill in with address>
  211.  *  JUMP_JUMPTABLESIZE_Xfoo = 0x4000            <adjust if necessary>
  212.  *  JUMP_GOTSIZE_Xfoo = 4096                <adjust if necessary>
  213.  *  JUMP_STUBNAMES_Xfoo = libXfoo            <and others>
  214.  *  JUMP_STUBS_IMPORT_Xfoo = /usr/lib/libc.sa        <and others>
  215.  *  JUMP_LDLIBS_Xfoo = `$(CC) --print-libgcc-file-name` -lc <and others>
  216.  *
  217.  * To create a complex "host", you need to add
  218.  *  JUMP_SIBARS_Xt = jump/libXbar.a~            <and others>
  219.  * These are the archives of the shared objects of the "guest" libs. They
  220.  * need to be added to the JUMP_LDLIBS_Xfoo lines.
  221.  *
  222.  * For further clarification, study the definitions of libXaw, a simple "host"
  223.  * lib, libXt, a complex "host" lib, and libXmu, one of libXts "guests".
  224.  *
  225.  * As a hint of how to start (with the DLL docs), touch jump_vars, jump_funcs
  226.  * and jump_ignore, then compile. Then massage the jump.vars and jump.funcs
  227.  * files in the shared subdirectory into jump_xxx files.
  228.  */
  229.  
  230. #ifndef UseInstalled
  231. XCOMM These are only needed to build the server
  232.  
  233. #if LinuxElfDefault
  234. LIBC_SA = /usr/i486-linuxaout/lib/libc.sa
  235. LIBM_SA = /usr/i486-linuxaout/lib/libm.sa
  236. #else
  237. LIBC_SA = /usr/lib/libc.sa
  238. LIBM_SA = /usr/lib/libm.sa
  239. #endif
  240.  
  241. JUMP_LDLIBS_libc = `$(CC) --print-libgcc-file-name` -lc
  242.  
  243. XCOMM libX11.so (X11, SM, ICE)
  244. JUMP_ROOT_X11 = $(XLIBSRC)
  245. JUMP_IS_HOST_X11 = YES
  246. JUMP_STUBLIBS_X11 = libX11.sa libSM.sa libICE.sa
  247. JUMP_SIBDIRS_X11 = $(JUMP_ROOT_SM) $(JUMP_ROOT_ICE)
  248. JUMP_DIR_X11 = $(JUMP_ROOT_X11)/shared
  249. JUMP_DEFS_X11 = $(XDMAUTHDEFS) $(XKB_DEFINES)
  250. JUMP_VARS_X11 = $(JUMP_ROOT_X11)/jump_vars
  251. JUMP_FUNCS_X11 = $(JUMP_ROOT_X11)/jump_funcs
  252. JUMP_IGNORE_X11 = $(JUMP_ROOT_X11)/jump_ignore
  253. JUMP_EXPORT_X11 = $(JUMP_DIR_X11)/jump.vars
  254. JUMP_ADDRESS_X11 = 0x60200000
  255. JUMP_JUMPTABLESIZE_X11 = 0x4000
  256. JUMP_GOTSIZE_X11 = 4096
  257. JUMP_STUBNAMES_X11 = libX11 libSM libICE
  258. JUMP_STUBS_IMPORT_X11 = $(LIBC_SA)
  259. JUMP_SIBARS_X11 = jump/libSM.a~ jump/libICE.a~
  260. JUMP_LDLIBS_X11 = $(JUMP_SIBARS_X11) $(JUMP_LDLIBS_libc)
  261.  
  262. XCOMM libSM (part of libX11.so)
  263. JUMP_ROOT_SM = $(SMSRC)
  264. JUMP_IS_HOST_SM = NO
  265. JUMP_HOST_SM = $(JUMP_ROOT_X11)
  266. JUMP_DIR_SM = $(JUMP_DIR_X11)
  267.  
  268. XCOMM libICE (part of libX11.so)
  269. JUMP_ROOT_ICE = $(ICESRC)
  270. JUMP_IS_HOST_ICE = NO
  271. JUMP_HOST_ICE = $(JUMP_ROOT_X11)
  272. JUMP_DIR_ICE = $(JUMP_DIR_X11)
  273.  
  274. XCOMM libXt.so (Xt, Xmu, Xext, Xi, Xtst, Xp)
  275. JUMP_ROOT_Xt = $(TOOLKITSRC)
  276. JUMP_IS_HOST_Xt = YES
  277. JUMP_STUBLIBS_Xt = libXt.sa libXmu.sa libXext.sa libXi.sa libXtst.sa libXp.sa
  278. JUMP_SUBDIRS_Xt = $(JUMP_ROOT_X11)
  279. JUMP_SIBDIRS_Xt = $(JUMP_ROOT_Xmu) $(JUMP_ROOT_Xext) \
  280.     $(JUMP_ROOT_Xi) $(JUMP_ROOT_Xtst) $(JUMP_ROOT_Xp)
  281. JUMP_DIR_Xt = $(JUMP_ROOT_Xt)/shared
  282. JUMP_VARS_Xt = $(JUMP_ROOT_Xt)/jump_vars
  283. JUMP_FUNCS_Xt = $(JUMP_ROOT_Xt)/jump_funcs
  284. JUMP_IGNORE_Xt = $(JUMP_ROOT_Xt)/jump_ignore
  285. JUMP_EXPORT_Xt = $(JUMP_DIR_Xt)/jump.vars
  286. JUMP_IMPORT_Xt = $(JUMP_EXPORT_X11)
  287. JUMP_ADDRESS_Xt = 0x602a0000
  288. JUMP_JUMPTABLESIZE_Xt = 0x4000
  289. JUMP_GOTSIZE_Xt = 4096
  290. JUMP_STUBNAMES_Xt = libXt libXmu libXext libXi libXtst libXp
  291. JUMP_STUBS_IMPORT_Xt = $(JUMP_STUBS_IMPORT_X11)
  292. JUMP_SIBARS_Xt = jump/libXmu.a~ jump/libXext.a~ jump/libXi.a~ jump/libXtst.a~ jump/libXp.a~
  293. JUMP_LDLIBS_Xt = $(JUMP_SIBARS_Xt) $(JUMP_ROOT_ICE)/libICE.sa \
  294.     $(JUMP_ROOT_SM)/libSM.sa $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc)
  295.  
  296. XCOMM libXmu (part of libXt.so)
  297. JUMP_ROOT_Xmu = $(XMUSRC)
  298. JUMP_IS_HOST_Xmu = NO
  299. JUMP_HOST_Xmu = $(JUMP_ROOT_Xt)
  300. JUMP_DIR_Xmu = $(JUMP_DIR_Xt)
  301.  
  302. XCOMM libXext (part of libXt.so)
  303. JUMP_ROOT_Xext = $(XEXTLIBSRC)
  304. JUMP_IS_HOST_Xext = NO
  305. JUMP_HOST_Xext = $(JUMP_ROOT_Xt)
  306. JUMP_DIR_Xext = $(JUMP_DIR_Xt)
  307.  
  308. XCOMM libXi (part of libXt.so)
  309. JUMP_ROOT_Xi = $(XILIBSRC)
  310. JUMP_IS_HOST_Xi = NO
  311. JUMP_HOST_Xi = $(JUMP_ROOT_Xt)
  312. JUMP_DIR_Xi = $(JUMP_DIR_Xt)
  313.  
  314. XCOMM libXtst (part of libXt.so)
  315. JUMP_ROOT_Xtst = $(XTESTLIBSRC)
  316. JUMP_IS_HOST_Xtst = NO
  317. JUMP_HOST_Xtst = $(JUMP_ROOT_Xt)
  318. JUMP_DIR_Xtst = $(JUMP_DIR_Xt)
  319.  
  320. XCOMM libXp (part of libXt.so)
  321. JUMP_ROOT_Xp = $(XPLIBSRC)
  322. JUMP_IS_HOST_Xp = NO
  323. JUMP_HOST_Xp = $(JUMP_ROOT_Xt)
  324. JUMP_DIR_Xp = $(JUMP_DIR_Xt)
  325.  
  326. XCOMM libXaw.so (Xaw)
  327. JUMP_ROOT_Xaw = $(AWIDGETSRC)
  328. JUMP_IS_HOST_Xaw = YES
  329. JUMP_STUBLIBS_Xaw = libXaw.sa
  330. JUMP_SUBDIRS_Xaw = $(JUMP_ROOT_Xt)
  331. JUMP_DIR_Xaw = $(JUMP_ROOT_Xaw)/shared
  332. JUMP_VARS_Xaw = $(JUMP_ROOT_Xaw)/jump_vars
  333. JUMP_FUNCS_Xaw = $(JUMP_ROOT_Xaw)/jump_funcs
  334. JUMP_IGNORE_Xaw = $(JUMP_ROOT_Xaw)/jump_ignore
  335. JUMP_EXPORT_Xaw = $(JUMP_DIR_Xaw)/jump.vars
  336. JUMP_IMPORT_Xaw = $(JUMP_EXPORT_Xt) $(JUMP_EXPORT_X11)
  337. JUMP_ADDRESS_Xaw = 0x60300000
  338. JUMP_JUMPTABLESIZE_Xaw = 0x4000
  339. JUMP_GOTSIZE_Xaw = 4096
  340. JUMP_STUBNAMES_Xaw = libXaw
  341. JUMP_STUBS_IMPORT_Xaw = $(JUMP_STUBS_IMPORT_X11)
  342. JUMP_LDLIBS_Xaw = $(JUMP_ROOT_Xt)/libXt.sa $(JUMP_ROOT_Xt)/libXmu.sa \
  343.     $(JUMP_ROOT_Xt)/libXext.sa $(JUMP_ROOT_X11)/libX11.sa \
  344.     $(JUMP_LDLIBS_libc)
  345.  
  346. # libPEX.so (PEX5)
  347. JUMP_ROOT_PEX5 = $(PEXLIBSRC)
  348. JUMP_IS_HOST_PEX5 = YES
  349. JUMP_STUBLIBS_PEX5 = libPEX5.sa
  350. JUMP_SUBDIRS_PEX5 = $(JUMP_ROOT_X11)
  351. JUMP_DIR_PEX5 = $(JUMP_ROOT_PEX5)/shared
  352. JUMP_VARS_PEX5 = $(JUMP_ROOT_PEX5)/jump_vars
  353. JUMP_FUNCS_PEX5 = $(JUMP_ROOT_PEX5)/jump_funcs
  354. JUMP_IGNORE_PEX5 = $(JUMP_ROOT_PEX5)/jump_ignore
  355. JUMP_EXPORT_PEX5 = $(JUMP_DIR_PEX5)/jump.vars
  356. JUMP_IMPORT_PEX5 = $(JUMP_EXPORT_X11)
  357. JUMP_ADDRESS_PEX5 = 0x60b00000
  358. JUMP_JUMPTABLESIZE_PEX5 = 0x4000
  359. JUMP_GOTSIZE_PEX5 = 4096
  360. JUMP_STUBNAMES_PEX5 = libPEX5
  361. JUMP_STUBS_IMPORT_PEX5 = $(JUMP_STUBS_IMPORT_X11) $(LIBM_SA)
  362. JUMP_LDLIBS_PEX5 = $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc) -lm
  363.  
  364. # libXIE.so (XIE)
  365. JUMP_ROOT_XIE = $(XIELIBSRC)
  366. JUMP_IS_HOST_XIE = YES
  367. JUMP_STUBLIBS_XIE = libXIE.sa
  368. JUMP_SUBDIRS_XIE = $(JUMP_ROOT_X11)
  369. JUMP_DIR_XIE = $(JUMP_ROOT_XIE)/shared
  370. JUMP_VARS_XIE = $(JUMP_ROOT_XIE)/jump_vars
  371. JUMP_FUNCS_XIE = $(JUMP_ROOT_XIE)/jump_funcs
  372. JUMP_IGNORE_XIE = $(JUMP_ROOT_XIE)/jump_ignore
  373. JUMP_EXPORT_XIE = $(JUMP_DIR_XIE)/jump.vars
  374. JUMP_IMPORT_XIE = $(JUMP_EXPORT_X11)
  375. JUMP_ADDRESS_XIE = 0x60be0000
  376. JUMP_JUMPTABLESIZE_XIE = 0x4000
  377. JUMP_GOTSIZE_XIE = 4096
  378. JUMP_STUBNAMES_XIE = libXIE
  379. JUMP_STUBS_IMPORT_XIE = $(JUMP_STUBS_IMPORT_X11) $(LIBM_SA)
  380. JUMP_LDLIBS_XIE = $(JUMP_ROOT_X11)/libX11.sa $(JUMP_LDLIBS_libc) -lm
  381.  
  382. #endif /* !UseInstalled */
  383.  
  384. /*
  385.  * SharedLibraryDataTarget - generate rules to create shared data file
  386.  */
  387. #ifndef SharedLibraryDataTarget
  388. #define SharedLibraryDataTarget(libname,rev,salist)
  389. #endif
  390.  
  391. /*
  392.  * SharedLibraryTarget - generate rules to create a shared library;
  393.  * There are two basic flavors of libs: self-generating, which create
  394.  * their own (and possibly other) libs, and hosted, which rely on another
  395.  * lib for all the work.
  396.  */
  397. #ifndef SharedLibraryTarget
  398. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  399. XCOMM This logic is such to compile the libs in their proper order,    @@\
  400. XCOMM remain dependent on subsidiary libs, and yet minimize local work    @@\
  401.                                     @@\
  402. JUMP_DIR=./jump                                @@\
  403. JUMP_LIB=Concat(lib,libname)                        @@\
  404.                                     @@\
  405. XCOMM  this is needed for newer gnumake versions            @@\
  406. export JUMP_DIR JUMP_LIB                        @@\
  407.                                     @@\
  408. JUMP_IS_HOST=$(Concat(JUMP_IS_HOST_,libname))                @@\
  409. JUMP_AR=$(JUMP_DIR)/Concat(lib,libname.a~)                @@\
  410. JUMP_SA=Concat(lib,libname.sa)                        @@\
  411. JUMP_SO=Concat(lib,libname.so.rev)                    @@\
  412.                                     @@\
  413. JUMP_HOST=$(Concat(JUMP_HOST_,libname))                    @@\
  414.                                     @@\
  415. INSTSOLIBFLAGS=-m 0555                            @@\
  416.                                     @@\
  417. AllTarget($(BUILDLIBDIR)/$(JUMP_SA))                    @@\
  418.                                     @@\
  419. $(BUILDLIBDIR)/$(JUMP_SA): $(JUMP_SA)                    @@\
  420.     LinkBuildLibrary($(JUMP_SA))                    @@\
  421.                                     @@\
  422. $(JUMP_SA) $(Concat(JUMP_STUBLIBS_,libname)) do_JUMP_SA: \
  423.         down/mk_JUMP_SA_$(JUMP_IS_HOST)                @@\
  424.                                     @@\
  425. down/mk_JUMP_SA_0:: mk_JUMP_HOST                    @@\
  426.                                     @@\
  427. down/mk_JUMP_SA_0:: $(JUMP_HOST)/$(JUMP_SA)                @@\
  428.     $(RM) $(JUMP_SA)                        @@\
  429.     $(LN) $(JUMP_HOST)/$(JUMP_SA) $(JUMP_SA)            @@\
  430.     touch $@                            @@\
  431.                                     @@\
  432. down/mk_JUMP_SA_1:: $(JUMP_SO)                        @@\
  433.                                     @@\
  434. down/mk_JUMP_SA_1:: down/mk_JUMP_SO_2                    @@\
  435.     $(RM) $(Concat(JUMP_STUBLIBS_,libname))                @@\
  436.     mkstubs -v rev -l $(JUMP_LIB) \
  437.         -a $(Concat(JUMP_ADDRESS_,libname)) \
  438.         -j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
  439.         -g $(Concat(JUMP_GOTSIZE_,libname)) \
  440.         -- $(Concat(JUMP_STUBNAMES_,libname))            @@\
  441.     verify-shlib -l $(JUMP_SO) \
  442.         $(Concat(JUMP_STUBLIBS_,libname))            @@\
  443.     $(MV) verify.out $(JUMP_DIR)                    @@\
  444.     touch $@                            @@\
  445.                                     @@\
  446. mk_JUMP_HOST:                                @@\
  447.     @echo checking stub library $(JUMP_SA) in $(JUMP_HOST)...    @@\
  448.     @(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) $(JUMP_SA)) || exit 1    @@\
  449.     @echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...    @@\
  450.                                     @@\
  451. $(JUMP_SO): down/mk_JUMP_SO_$(JUMP_IS_HOST)                @@\
  452.                                     @@\
  453. down/mk_JUMP_SO_0:                            @@\
  454.                                     @@\
  455. down/mk_JUMP_SO_1:: $(JUMP_AR) mk_JUMP_SIBDIRS down/mk_JUMP_SO_2    @@\
  456.                                     @@\
  457. down/mk_JUMP_SO_2: down/mk_JUMP_AR $(Concat(JUMP_SIBARS_,libname))    @@\
  458.     $(RM) $(JUMP_SO)                        @@\
  459.     mkimage -f -v rev -l $(JUMP_LIB) \
  460.         -a $(Concat(JUMP_ADDRESS_,libname)) \
  461.         -j $(Concat(JUMP_JUMPTABLESIZE_,libname)) \
  462.         -g $(Concat(JUMP_GOTSIZE_,libname)) \
  463.         -- $(JUMP_AR) $(Concat(JUMP_LDLIBS_,libname))        @@\
  464.     $(RM) $(JUMP_DIR)/__jump.s $(JUMP_DIR)/__jump.o            @@\
  465.     LinkBuildLibrary($(JUMP_SO))                    @@\
  466.     touch $@                            @@\
  467.                                     @@\
  468. mk_JUMP_SIBDIRS:                            @@\
  469.     @for d in $(Concat(JUMP_SIBDIRS_,libname)); do \
  470.         echo checking ar library in $$d...; \
  471.         (cd $$d ; $(MAKE) $(MFLAGS) fastdo_JUMP_AR) || exit 1; \
  472.         echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
  473.                                     @@\
  474. fastdo_JUMP_AR: $(JUMP_DIR) down/mk_JUMP_AR                @@\
  475.                                     @@\
  476. $(JUMP_AR) do_JUMP_AR:: jumpsetup down/mk_JUMP_AR            @@\
  477.                                     @@\
  478. jumpsetup: $(JUMP_DIR) jumpsetup_$(JUMP_IS_HOST)            @@\
  479.                                     @@\
  480. $(JUMP_DIR):                                @@\
  481.     $(RM) jump                            @@\
  482.     LibMkdir($(Concat(JUMP_DIR_,libname)))                @@\
  483.     $(LN) $(Concat(JUMP_DIR_,libname)) jump                @@\
  484.                                     @@\
  485. jumpsetup_0:                                @@\
  486.     @echo doing jump setup in host $(JUMP_HOST)...            @@\
  487.     @(cd $(JUMP_HOST); $(MAKE) $(MFLAGS) jumpsetup) || exit 1    @@\
  488.     @echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...    @@\
  489.                                     @@\
  490. jumpsetup_1::                                @@\
  491.     @for d in $(Concat(JUMP_SUBDIRS_,libname)); do \
  492.         echo checking stub library in $$d...; \
  493.         (cd $$d ; $(MAKE) $(MFLAGS) do_JUMP_SA) || exit 1; \
  494.         echo ok. continuing in $(Concat(JUMP_ROOT_,libname))...;done@@\
  495.                                     @@\
  496. jumpsetup_1:: $(JUMP_DIR)/jump.funcs $(JUMP_DIR)/jump.vars \
  497.     $(JUMP_DIR)/jump.ignore $(JUMP_DIR)/jump.import            @@\
  498.                                     @@\
  499. $(JUMP_DIR)/jump.funcs: $(Concat(JUMP_FUNCS_,libname))            @@\
  500.     $(RM) $(JUMP_DIR)/jump.funcs                    @@\
  501.     cat $(Concat(JUMP_FUNCS_,libname)) | \
  502.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  503.                                     @@\
  504. $(JUMP_DIR)/jump.vars: $(Concat(JUMP_VARS_,libname))            @@\
  505.     $(RM) $(JUMP_DIR)/jump.vars                    @@\
  506.     cat $(Concat(JUMP_VARS_,libname)) | \
  507.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  508.                                     @@\
  509. $(JUMP_DIR)/jump.ignore: $(Concat(JUMP_IGNORE_,libname))        @@\
  510.     $(RM) $(JUMP_DIR)/jump.ignore                    @@\
  511.     cat $(Concat(JUMP_IGNORE_,libname)) | \
  512.         $(CPP) $(ALLDEFINES) $(Concat(JUMP_DEFS_,libname)) > $@    @@\
  513.                                     @@\
  514. $(JUMP_DIR)/jump.import: $(JUMP_DIR)/stubs.import \
  515.         $(Concat(JUMP_IMPORT_,libname))                @@\
  516.     $(RM) $(JUMP_DIR)/jump.import                    @@\
  517.     cat $(JUMP_DIR)/stubs.import $(Concat(JUMP_IMPORT_,libname)) > $@ @@\
  518.                                     @@\
  519. $(JUMP_DIR)/stubs.import: $(Concat(JUMP_STUBS_IMPORT_,libname))        @@\
  520.     $(RM) $(JUMP_DIR)/stubs.import                    @@\
  521.     nm --no-cplus $(Concat(JUMP_STUBS_IMPORT_,libname)) | grep '__GOT__' | \
  522.         sed 's/__GOT__/_/' > $@                    @@\
  523.                                     @@\
  524. down/mk_JUMP_AR: solist                            @@\
  525.     $(RM) $(JUMP_AR)                        @@\
  526.     @if [ -s $(JUMP_DIR)/jump.log ]; then \
  527.         echo "Error: Leftover globals for shared lib"; \
  528.         exit 1; fi                        @@\
  529.     (cd down; $(AR) up/$(JUMP_AR) solist) || exit 1            @@\
  530.     $(RANLIB) $(JUMP_AR)                        @@\
  531.     touch $@                            @@\
  532.                                     @@\
  533. clean:: jumpclean                            @@\
  534.                                     @@\
  535. jumpclean: jumpclean_$(JUMP_IS_HOST)                    @@\
  536.     $(RM) $(JUMP_SA) down/mk_JUMP_AR                @@\
  537.     $(RM) -r $(JUMP_DIR)                        @@\
  538.                                     @@\
  539. jumpclean_0:                                @@\
  540.     $(RM) down/mk_JUMP_SA_0                        @@\
  541.     $(RM) $(JUMP_HOST)/$(JUMP_SA)                    @@\
  542.                                     @@\
  543. jumpclean_1:                                @@\
  544.     $(RM) -r $(JUMP_SO) $(Concat(JUMP_DIR_,libname)) \        @@\
  545.         down/mk_JUMP_SA_1 down/mk_JUMP_SO_1 down/mk_JUMP_SO_2
  546. #endif /* SharedLibraryTarget */
  547.  
  548. /*
  549.  * InstallSharedLibrary - generate rules to install the shared library.
  550.  */
  551. #ifndef InstallSharedLibrary
  552. #define    InstallSharedLibrary(libname,rev,dest)                @@\
  553. install:: $(JUMP_SA) $(JUMP_SO)                        @@\
  554.     MakeDir($(DESTDIR)dest)                        @@\
  555.     @if [ "$(JUMP_IS_HOST)" = YES ]; then \
  556.         (T=$(DESTDIR)dest/`echo $(JUMP_SO)|sed 's/\.[^\.]*$$//'`;\
  557.         set -x; \
  558.         $(INSTALL) -s -c $(INSTSOLIBFLAGS) $(JUMP_SO) $(DESTDIR)dest; \
  559.         $(RM) $$T && $(LN) $(JUMP_SO) $$T); fi            @@\
  560.     $(INSTALL) -c $(INSTLIBFLAGS) $(JUMP_SA) $(DESTDIR)dest
  561. #endif /* InstallSharedLibrary */
  562.  
  563. /*
  564.  * InstallSharedLibraryData - generate rules to install the shared library data
  565.  */
  566. #ifndef InstallSharedLibraryData
  567. #define    InstallSharedLibraryData(libname,rev,dest)
  568. #endif /* InstallSharedLibraryData */
  569.  
  570. #endif /* UseElfFormat */
  571.