aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/config/cf/Imake.rules
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-12-29 21:44:56 +0100
committerMihai Moldovan <ionic@ionic.de>2017-12-30 03:36:11 +0100
commitffc09a73d3fad32f3765caf62546a3e7cc5b9cd8 (patch)
treee323cc999612bcdebc977fdcb0ee6d5769f5969e /nx-X11/config/cf/Imake.rules
parent44f8c424e70311283b274c3e9fddbd7ca928f003 (diff)
downloadnx-libs-ffc09a73d3fad32f3765caf62546a3e7cc5b9cd8.tar.gz
nx-libs-ffc09a73d3fad32f3765caf62546a3e7cc5b9cd8.tar.bz2
nx-libs-ffc09a73d3fad32f3765caf62546a3e7cc5b9cd8.zip
nx-X11: build programs with a temporary RPATH/RUNPATH value and a relinked version with the system location.
While the install target explicitly installs the relinked system-location version of a program, we do not actually use this. Currently, we copy nxagent directly out of the build root.
Diffstat (limited to 'nx-X11/config/cf/Imake.rules')
-rw-r--r--nx-X11/config/cf/Imake.rules37
1 files changed, 33 insertions, 4 deletions
diff --git a/nx-X11/config/cf/Imake.rules b/nx-X11/config/cf/Imake.rules
index f53a15bba..46538a683 100644
--- a/nx-X11/config/cf/Imake.rules
+++ b/nx-X11/config/cf/Imake.rules
@@ -21,6 +21,7 @@ XCOMM ---------------------------------------------------------------------
* _MUseCat (a,b,c)
* ProgramTargetName (target)
* HostProgramTargetName (target)
+ * ProgramRelinkName (target)
* RunProgram (progvar,options)
* RunProgramWithSetup (setup,progvar,options)
* RemoveFile (file)
@@ -44,6 +45,7 @@ XCOMM ---------------------------------------------------------------------
* BuildIncludes (srclist,dstsubdir,dstupdir)
* LinkRule (program,options,objects,libraries)
* HostLinkRule (program,options,objects,libraries)
+ * LinkInstallRule (program,options,objects,libraries)
* NoCmpScript (target)
* NoConfigRec (target)
* NormalProgramTarget (program,objects,deplibs,locallibs,syslibs)
@@ -76,6 +78,7 @@ XCOMM ---------------------------------------------------------------------
* InstallNonExecFileNoClobber (file,dest)
* InstallNonExec (file,dest)
* InstallProgramWithFlags (program,dest,flags)
+ * RelinkProgram (program,objects,libs,syslibs)
* InstallProgram (program,dest)
* InstallScript (program,dest)
* InstallNamedProg (srcname,dstname,dest)
@@ -316,6 +319,10 @@ XCOMM special target for clearmake @@\
#define HostProgramTargetName(target)target
#endif
+#ifndef ProgramRelinkName
+#define ProgramRelinkName(target)Concat(target,-relink)
+#endif
+
#ifndef RunProgram
#define RunProgram(progvar,options) $(progvar) options
#endif
@@ -610,6 +617,14 @@ $(CCLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
#endif /* LinkRule */
/*
+ * LinkRule - link a program, suitable for later installation
+ */
+#ifndef LinkInstallRule
+#define LinkInstallRule(program,options,objects,libraries) \
+$(CCLINK) -o program options objects libraries $(EXTRA_INSTALL_LOAD_FLAGS)
+#endif /* LinkInstallRule */
+
+/*
* HostLinkRule - link a utility to be used on the build host
* (differs from LinkRule if cross compiling)
*/
@@ -1101,6 +1116,7 @@ CplusplusProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib)
#ifndef ServerTargetWithFlags
#define ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,flags) @@\
AllTarget(ProgramTargetName(server)) @@\
+AllTarget(ProgramRelinkName(server)) @@\
ProgramTargetName(server): subdirs objects libs @@\
MoveToBakFile($@) @@\
LinkRule($@,$(SERVERLDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
@@ -1118,10 +1134,12 @@ PurifyLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
ProofProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
ProofLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
@@\
+RelinkProgram(ProgramTargetName(server),objects,libs,syslibs) @@\
InstallProgramWithFlags(server,$(BINDIR),flags) @@\
@@\
clean:: @@\
- RemoveFile(ProgramTargetName(server))
+ RemoveFile(ProgramTargetName(server)) @@\
+ RemoveFile(ProgramRelinkName(server))
#endif /* ServerTargetWithFlags */
/*
@@ -1586,17 +1604,28 @@ install:: file @@\
/*
+ * RelinkProgram - relinks an executable program in preparation of installation
+ */
+#ifndef RelinkProgram
+#define RelinkProgram(program,objects,libs,syslibs) @@\
+ProgramRelinkName(program): program @@\
+ MoveToBakFile($@) @@\
+ LinkInstallRule($@,$(SERVERLDOPTIONS),objects,libs $(LDLIBS) syslibs)
+#endif /* RelinkProgram */
+
+
+/*
* InstallProgramWithFlags - generate rules to install an executable program
* using given install flags.
*/
#ifndef InstallProgramWithFlags
#if StripInstalledPrograms && CrossCompiling
-#define InstallProgramWithFlags(program,dest,flags) @@\
-InstallTarget(install,ProgramTargetName(program),$(INSTPGMFLAGS) flags,dest) @@\
+#define InstallProgramWithFlags(program,dest,flags) @@\
+InstallTarget(install,ProgramRelinkName(program),$(INSTPGMFLAGS) flags,dest) @@\
CrossStripCmd $(DESTDIR)dest/ProgramTargetName(program)
#else
#define InstallProgramWithFlags(program,dest,flags) @@\
-InstallTarget(install,ProgramTargetName(program),$(INSTPGMFLAGS) flags,dest)
+InstallTarget(install,ProgramRelinkName(program),$(INSTPGMFLAGS) flags,dest)
#endif /* StripInstalledPrograms && CrossCompiling */
#endif /* InstallProgramWithFlags */