dpm-postgres (1.7.4.7-1) lcgdm-shliblink.patch

Summary

 config/Imake.rules  |    2 +-
 dicomcopy/Imakefile |    8 ++++----
 dli/Imakefile       |    6 +++---
 dpm/Imakefile       |   19 ++++++++++---------
 dpmcopy/Imakefile   |   10 +++++-----
 lib/Imakefile       |   10 +++++-----
 ns/Imakefile        |   18 +++++++++---------
 ns/Imakefile.dpns   |    6 +++---
 ns/Imakefile.lfc    |   19 ++++++++++---------
 rfio/Imakefile      |   14 +++++++-------
 security/Imakefile  |    4 ++--
 shlib/Imakefile     |    5 ++---
 srmv1/Imakefile     |    8 ++++----
 srmv2.2/Imakefile   |    8 ++++----
 srmv2/Imakefile     |    8 ++++----
 15 files changed, 73 insertions(+), 72 deletions(-)

    
download this patch

Patch contents

diff -ur lcgdm-1.7.4.4.orig/config/Imake.rules lcgdm-1.7.4.4/config/Imake.rules
--- lcgdm-1.7.4.4.orig/config/Imake.rules	2010-04-03 11:36:00.643794299 +0200
+++ lcgdm-1.7.4.4/config/Imake.rules	2010-04-03 11:36:19.959544559 +0200
@@ -95,7 +95,7 @@
 #ifndef NormalProgramTarget
 #define NormalProgramTarget(program,objects,deplibs,libs) \
 ProgramTargetName(program): objects deplibs		@@\
-	$(CC) -o $@ $(LDFLAGS) objects libs
+	LD_LIBRARY_PATH=../shlib $(CC) -o $@ $(LDFLAGS) objects libs
 #endif
 
 #ifndef MakeSubdirs
diff -ur lcgdm-1.7.4.4.orig/dicomcopy/Imakefile lcgdm-1.7.4.4/dicomcopy/Imakefile
--- lcgdm-1.7.4.4.orig/dicomcopy/Imakefile	2010-04-03 11:35:57.283543277 +0200
+++ lcgdm-1.7.4.4/dicomcopy/Imakefile	2010-04-03 17:13:13.445544982 +0200
@@ -27,7 +27,7 @@
 #if SOLARIS
 LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl -ldl
 #else
-LIBS = -L../shlib -ldpm -llcgdm $(LIBCSEC) -ldl
+LIBS = -L../shlib -ldpm -llcgdm -ldl
 #endif
 SPOOL = DicomcopySpool
 LOGFILE = FileName($(SPOOL),log)
@@ -42,7 +42,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 DBCREAT = create_dicomcopy_tables_mysql.sql
 #else
 #if UsePostgres
@@ -64,7 +64,7 @@
 
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
@@ -146,7 +146,7 @@
 NormalLibraryTarget(dicomcopy,dicomcopy_inc_reqctr.Osuf send2dicomcopyd.Osuf)
 
 SharedLibraryTargetName(dpm_dicom): dpm_dicomcopyfile.Osuf
-	$(CC) $(SHLIBLDFLAGS) -o $@ dpm_dicomcopyfile.Osuf
+	$(CC) $(SHLIBLDFLAGS) -o $@ dpm_dicomcopyfile.Osuf -L../shlib -ldpm -llcgdm
 
 install: $(BIN) $(DPMSHAREDIR) $(SYSCONFDIR) $(IPROGS_D) $(SPOOL)
 
diff -ur lcgdm-1.7.4.4.orig/dli/Imakefile lcgdm-1.7.4.4/dli/Imakefile
--- lcgdm-1.7.4.4.orig/dli/Imakefile	2010-03-30 07:04:18.000000000 +0200
+++ lcgdm-1.7.4.4/dli/Imakefile	2010-04-03 11:36:44.917544729 +0200
@@ -20,9 +20,9 @@
 SOAPFLG = -DWITH_IPV6
 INCLUDES = FileName(..,h)
 #if SOLARIS
-LIBS = -L../lib -llfc -ldl -lsocket -lnsl
+LIBS = -L../shlib -llfc -llcgdm -lsocket -lnsl
 #else
-LIBS = -L../lib -llfc -ldl
+LIBS = -L../shlib -llfc -llcgdm
 #endif
 SPOOL = DliSpool
 LOGFILE = FileName($(SPOOL),log)
@@ -62,7 +62,7 @@
 	$(CC) -c -g -I$(GSOAP_LOCATION)/include $(SOAPFLG) $(GSOAP_LOCATION)/src/stdsoap2.c
 
 NormalProgramTarget(lfc-dli,$(SRV_OBJS), $(DEPLIB), $(MTLDFLAGS) $(LIBS) $(MTLDLIBS))
-NormalProgramTarget(lfc-dli-client,lfc-dli-client.Osuf dliC.Osuf dliClient.Osuf stdsoap2.Osuf,$(DEPLIB),$(LIBS))
+NormalProgramTarget(lfc-dli-client,lfc-dli-client.Osuf dliC.Osuf dliClient.Osuf stdsoap2.Osuf,$(DEPLIB),)
 rc.lfc-dli: lfc-dli.scripts
 	$(CP) $? $@
 lfc-dli.conf.templ: lfc-dli.sysconfig
diff -ur lcgdm-1.7.4.4.orig/dpm/Imakefile lcgdm-1.7.4.4/dpm/Imakefile
--- lcgdm-1.7.4.4.orig/dpm/Imakefile	2010-04-03 11:35:57.283543277 +0200
+++ lcgdm-1.7.4.4/dpm/Imakefile	2010-04-03 13:11:20.501544293 +0200
@@ -10,8 +10,9 @@
 PYTHON_VERSION=$(shell python -c "import sys; print sys.version[:3]")
 PYTHON_PREFIX=$(shell python -c "import os; import sys; print os.path.normpath(sys.prefix)")
 INCLUDE_PYTHON=-I$(shell python -c "from distutils import sysconfig; print sysconfig.get_python_inc(0,prefix='${PYTHON_PREFIX}')")
-PYTHON_LIB=$(shell python -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,1,prefix='${PYTHON_PREFIX}')")
+PYTHON_LIB=-L$(shell python -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDEST')")/config -lpython$(PYTHON_VERSION) $(shell python -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBS'), sysconfig.get_config_var('SYSLIBS')")
 INCLUDE_PERL=-I$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";')
+PERL_LIB=-L$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";') -lperl $(shell perl -MConfig -e 'print $$Config{perllibs};')
 SWIG_LOCATION = SwigLocation
 SWIG = SWIG_LIB=SwigLib $(SWIG_LOCATION)/bin/swig
 #endif
@@ -28,7 +29,7 @@
 GLOBUS_FLAVOUR=GlobusFlavour/**/pthr
 #endif
 GLOBUS_LIBS=-L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR) -lglobus_common_$(GLOBUS_FLAVOUR)
-GGC_LIB=-lglobus_gass_copy_$(GLOBUS_FLAVOUR) -lglobus_ftp_client_$(GLOBUS_FLAVOUR)
+GGC_LIB=-lglobus_gass_copy_$(GLOBUS_FLAVOUR) -lglobus_ftp_client_$(GLOBUS_FLAVOUR) -lglobus_common_$(GLOBUS_FLAVOUR)
 LIBCSEC += $(GLOBUS_LIBS)
 #endif
 LIBCSEC += -ldl
@@ -41,12 +42,12 @@
 #endif 
 INCLUDES = FileName(..,h)
 #if SOLARIS
-LIBS = -L../lib -ldpm $(LIBCSEC) -lsocket -lnsl
+LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl
 #else
 #if _WIN32
 LIBS = ..\lib\dpm.lib wsock32.lib advapi32.lib
 #else
-LIBS = -L../lib -ldpm $(LIBCSEC)
+LIBS = -L../shlib -ldpm -llcgdm
 #endif
 #endif
 LIBUUID =
@@ -77,7 +78,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 DBCREAT = create_dpm_tables_mysql.sql
 #else
 #if UsePostgres
@@ -109,7 +110,7 @@
 
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
@@ -418,21 +419,21 @@
 	RemoveFiles(dpm_perlwrap.o dpm_perlwrap.c)
 	$(SWIG) -perl -I$(INCLUDES) -DNSTYPE_DPNS -o dpm_perlwrap.c dpm.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PERL) -Dbool=char -D_GNU_SOURCE -DNSTYPE_DPNS dpm_perlwrap.c
-	$(CC) $(SHLIBLDFLAGS) -o dpm.so dpm_perlwrap.o $(LIBS) -ldpm
+	$(CC) $(SHLIBLDFLAGS) -o dpm.so dpm_perlwrap.o $(PERL_LIB) $(LIBS)
 
 dpm.py : _dpm.so
 _dpm.so : dpm.i ../h/dpm_api.h ../h/dpns_api.h ../h/Cns_api.h
 	RemoveFiles(dpm_wrap.o dpm_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_DPNS dpm.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PYTHON) -DNSTYPE_DPNS dpm_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _dpm.so dpm_wrap.o $(LIBS) -ldpm
+	$(CC) $(SHLIBLDFLAGS) -o _dpm.so dpm_wrap.o $(PYTHON_LIB) $(LIBS)
 
 dpm2.py : _dpm2.so
 _dpm2.so : dpm2.i ../h/dpm_api.h ../h/dpns_api.h ../h/Cns_api.h
 	RemoveFiles(dpm2_wrap.o dpm2_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -I../ns -DNSTYPE_DPNS dpm2.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) $(INCLUDE_PYTHON) -DNSTYPE_DPNS dpm2_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _dpm2.so dpm2_wrap.o $(LIBS) -ldpm
+	$(CC) $(SHLIBLDFLAGS) -o _dpm2.so dpm2_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(dpm.so,root,root,0755,$(PERLDIR))
 InstallTarget(dpm.pm,root,root,0644,$(PERLDIR))
diff -ur lcgdm-1.7.4.4.orig/dpmcopy/Imakefile lcgdm-1.7.4.4/dpmcopy/Imakefile
--- lcgdm-1.7.4.4.orig/dpmcopy/Imakefile	2010-03-30 07:04:16.000000000 +0200
+++ lcgdm-1.7.4.4/dpmcopy/Imakefile	2010-04-03 13:46:34.253544868 +0200
@@ -23,7 +23,7 @@
 GLOBUS_FLAVOUR=GlobusFlavour
 VOMS_FLAVOUR=GlobusFlavour
 GLOBUS_LIBS=-L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR) -lglobus_common_$(GLOBUS_FLAVOUR)
-GGC_LIB=-lglobus_gass_copy_$(GLOBUS_FLAVOUR) -lglobus_ftp_client_$(GLOBUS_FLAVOUR)
+GGC_LIB=-lglobus_gass_copy_$(GLOBUS_FLAVOUR) -lglobus_ftp_client_$(GLOBUS_FLAVOUR) -lglobus_common_$(GLOBUS_FLAVOUR)
 GSOAP_LOCATION=GsoapLocation
 GSOAP_VERSION=GsoapVersion
 WSDL2H_FLAGS=GsoapWsdl2hFlags
@@ -37,9 +37,9 @@
 SOAPFLG = -DWITH_IPV6
 INCLUDES = FileName(..,h)
 #if SOLARIS
-LIBS = -L../lib -ldpm $(LIBCSEC) -lsocket -lnsl
+LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl
 #else
-LIBS = -L../lib -ldpm $(LIBCSEC)
+LIBS = -L../shlib -ldpm -llcgdm
 #endif
 SPOOL = DpmcopySpool
 LOGFILE = FileName($(SPOOL),log)
@@ -53,7 +53,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 #else
 #if UsePostgres
 DBOBJS = dpm_libpq_ifce.Osuf
@@ -73,7 +73,7 @@
  
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
diff -ur lcgdm-1.7.4.4.orig/lib/Imakefile lcgdm-1.7.4.4/lib/Imakefile
--- lcgdm-1.7.4.4.orig/lib/Imakefile	2010-03-30 07:04:16.000000000 +0200
+++ lcgdm-1.7.4.4/lib/Imakefile	2010-04-03 11:36:19.961544880 +0200
@@ -34,7 +34,9 @@
 install: $(LIB) FileName($(LIB),LibraryTargetName(dpm))
 
 export: $(EXPORTLIB)/libdpm.a
-#else
+#endif
+#endif
+
 COMM Libraries to include in LibraryTargetame(lcgdm)
 
 all:	LibraryTargetName(lcgdm)
@@ -42,16 +44,14 @@
 install: $(LIB) FileName($(LIB),LibraryTargetName(lcgdm))
 
 export: $(EXPORTLIB)/liblcgdm.a
-#endif
-#endif
 
 exportman: 
 
 exportshr: 
 
-liblfc.a: $(COMMONLIB) $(NSLIB) $(SECURITYLIB)
+liblfc.a: $(NSLIB)
 
-libdpm.a: $(COMMONLIB) $(RFIOLIB) $(NSLIB) $(DPMLIB) $(SECURITYLIB)
+libdpm.a: $(RFIOLIB) $(NSLIB) $(DPMLIB)
 
 liblcgdm.a: $(COMMONLIB) $(SECURITYLIB)
 
diff -ur lcgdm-1.7.4.4.orig/ns/Imakefile lcgdm-1.7.4.4/ns/Imakefile
--- lcgdm-1.7.4.4.orig/ns/Imakefile	2010-03-30 07:04:17.000000000 +0200
+++ lcgdm-1.7.4.4/ns/Imakefile	2010-04-03 12:00:26.054545073 +0200
@@ -36,27 +36,27 @@
 INCLUDES = FileName(..,h)
 TOPLIBRARYNAME = TopLibraryName
 #if _AIX
-LIBS = -L../lib -l$(TOPLIBRARYNAME)
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm
 #else
 #if defined(__alpha) && defined(__osf__)
-LIBS = -no_so -L../lib -l$(TOPLIBRARYNAME) -so_archive
+LIBS = -no_so -L../shlib -l$(TOPLIBRARYNAME) -llcgdm -so_archive
 #else
 #if hpux
-LIBS = -L../lib -l$(TOPLIBRARYNAME)
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm
 #else
 #if linux
-LIBS = -L../lib -l$(TOPLIBRARYNAME) $(LIBCSEC) -lnsl
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm
 #else
 #if sgi
-LIBS = -L../lib -l$(TOPLIBRARYNAME)
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm
 #else
 #if SOLARIS
-LIBS = -L../lib -l$(TOPLIBRARYNAME) -lsocket -lnsl
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm -lsocket -lnsl
 #else
 #if _WIN32
 LIBS = ..\lib\$(TOPLIBRARYNAME).lib wsock32.lib advapi32.lib
 #else
-LIBS = -L../lib -l$(TOPLIBRARYNAME)
+LIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm
 #endif
 #endif
 #endif
@@ -71,7 +71,7 @@
 #if _WIN32
 NSLIB = ns.lib
 #else
-NSLIB = -L. -lns
+NSLIB =
 #endif
 SPOOL = NsSpool
 LOGFILE = FileName($(SPOOL),log)
@@ -98,7 +98,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 #else
 #if UsePostgres
 DBOBJS = Cns_libpq_ifce.Osuf
diff -ur lcgdm-1.7.4.4.orig/ns/Imakefile.dpns lcgdm-1.7.4.4/ns/Imakefile.dpns
--- lcgdm-1.7.4.4.orig/ns/Imakefile.dpns	2010-03-30 07:04:17.000000000 +0200
+++ lcgdm-1.7.4.4/ns/Imakefile.dpns	2010-04-03 11:36:19.962544517 +0200
@@ -22,7 +22,7 @@
  
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
@@ -299,9 +299,9 @@
 NormalProgramTarget(dpns-chown,nschown.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
 #if UseOracle && !defined(_WIN32)
 dpnsdaemon: $(NSDAEMON_OBJS) $(DEPLIB)
-	$(MAKE) -f oralink.mk dpnsdaemon NSDAEMON_OBJS="$(NSDAEMON_OBJS)" CLDFLAGS=$(MTLDFLAGS) LIBS="$(LIBS) $(MTLDLIBS) $(LIBUUID)"
+	$(MAKE) -f oralink.mk dpnsdaemon NSDAEMON_OBJS="$(NSDAEMON_OBJS)" CLDFLAGS=$(MTLDFLAGS) LIBS="-L../shlib -llcgdm $(MTLDLIBS) $(LIBUUID)"
 #else
-NormalProgramTarget(dpnsdaemon,$(NSDAEMON_OBJS), $(DEPLIB), $(MTLDFLAGS) $(LIBS) $(MTLDLIBS) $(LIBORA) $(LIBMYS) $(LIBPOS) $(LIBUUID))
+NormalProgramTarget(dpnsdaemon,$(NSDAEMON_OBJS), $(DEPLIB), $(MTLDFLAGS) -L../shlib -llcgdm $(MTLDLIBS) $(LIBORA) $(LIBMYS) $(LIBPOS) $(LIBUUID))
 #endif
 NormalProgramTarget(dpns-entergrpmap,nsentergrpmap.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
 NormalProgramTarget(dpns-enterusrmap,nsenterusrmap.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
diff -ur lcgdm-1.7.4.4.orig/ns/Imakefile.lfc lcgdm-1.7.4.4/ns/Imakefile.lfc
--- lcgdm-1.7.4.4.orig/ns/Imakefile.lfc	2010-04-03 11:35:57.284544450 +0200
+++ lcgdm-1.7.4.4/ns/Imakefile.lfc	2010-04-03 12:22:50.062545793 +0200
@@ -24,15 +24,16 @@
 PYTHON_VERSION=$(shell python -c "import sys; print sys.version[:3]")
 PYTHON_PREFIX=$(shell python -c "import os; import sys; print os.path.normpath(sys.prefix)")
 INCLUDE_PYTHON=-I$(shell python -c "from distutils import sysconfig; print sysconfig.get_python_inc(0,prefix='${PYTHON_PREFIX}')")
-PYTHON_LIB=$(shell python -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,1,prefix='${PYTHON_PREFIX}')")
+PYTHON_LIB=-L$(shell python -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDEST')")/config -lpython$(PYTHON_VERSION) $(shell python -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBS'), sysconfig.get_config_var('SYSLIBS')")
 INCLUDE_PERL=-I$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";')
 SWIG_LOCATION = SwigLocation
+PERL_LIB=-L$(shell perl -MConfig -e 'print $$Config{archlibexp}, "/CORE";') -lperl $(shell perl -MConfig -e 'print $$Config{perllibs};')
 SWIG = SWIG_LIB=SwigLib $(SWIG_LOCATION)/bin/swig
 #endif
 
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,lfc)
+DEPLIB = DepSharedLibraryTargetName(shlib,lfc)
 
 COMM######################### RULES ##############################
 
@@ -366,9 +367,9 @@
 NormalProgramTarget(lfc-chown,nschown.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
 #if UseOracle && !defined(_WIN32)
 lfcdaemon: $(NSDAEMON_OBJS) $(DEPLIB)
-	$(MAKE) -f oralink.mk lfcdaemon NSDAEMON_OBJS="$(NSDAEMON_OBJS)" CLDFLAGS=$(MTLDFLAGS) LIBS="$(LIBS) $(MTLDLIBS) $(LIBUUID)"
+	$(MAKE) -f oralink.mk lfcdaemon NSDAEMON_OBJS="$(NSDAEMON_OBJS)" CLDFLAGS=$(MTLDFLAGS) LIBS="-L../shlib -llcgdm $(MTLDLIBS) $(LIBUUID)"
 #else
-NormalProgramTarget(lfcdaemon,$(NSDAEMON_OBJS), $(DEPLIB), $(MTLDFLAGS) $(LIBS) $(MTLDLIBS) $(LIBORA) $(LIBMYS) $(LIBPOS) $(LIBUUID))
+NormalProgramTarget(lfcdaemon,$(NSDAEMON_OBJS), $(DEPLIB), $(MTLDFLAGS) -L../shlib -llcgdm $(MTLDLIBS) $(LIBORA) $(LIBMYS) $(LIBPOS) $(LIBUUID))
 #endif
 NormalProgramTarget(lfc-delcomment,nsdelcomment.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
 NormalProgramTarget(lfc-entergrpmap,nsentergrpmap.Osuf,LibraryTargetName(ns) $(DEPLIB),$(NSLIB) $(LIBS))
@@ -466,14 +467,14 @@
 	RemoveFiles(lfc_perlwrap.o lfc_perlwrap.c)
 	$(SWIG) -perl -I$(INCLUDES) -DNSTYPE_LFC -o lfc_perlwrap.c lfc.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PERL) -Dbool=char -D_GNU_SOURCE lfc_perlwrap.c
-	$(CC) $(SHLIBLDFLAGS) -o lfc.so lfc_perlwrap.o $(LIBS) -llfc
+	$(CC) $(SHLIBLDFLAGS) -o lfc.so lfc_perlwrap.o $(PERL_LIB) $(LIBS)
 
 lfc.py : _lfc.so
 _lfc.so : lfc.i ../h/lfc_api.h ../h/Cns_api.h
 	RemoveFiles(lfc_wrap.o lfc_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _lfc.so lfc_wrap.o $(LIBS) -llfc
+	$(CC) $(SHLIBLDFLAGS) -o _lfc.so lfc_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(lfc.so,root,root,0755,$(PERLDIR))
 InstallTarget(lfc.pm,root,root,0644,$(PERLDIR))
@@ -485,7 +486,7 @@
 	RemoveFiles(lfc2_wrap.o lfc2_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc2.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc2_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _lfc2.so lfc2_wrap.o $(LIBS) -llfc
+	$(CC) $(SHLIBLDFLAGS) -o _lfc2.so lfc2_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(_lfc2.so,root,root,0755,$(PYTHONDIR))
 InstallTarget(lfc2.py,root,root,0644,$(PYTHONDIR))
@@ -495,7 +496,7 @@
 	RemoveFiles(lfcthr_wrap.o lfcthr_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfcthr.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfcthr_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _lfcthr.so lfcthr_wrap.o $(LIBS) -llfc
+	$(CC) $(SHLIBLDFLAGS) -o _lfcthr.so lfcthr_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(_lfcthr.so,root,root,0755,$(PYTHONDIR))
 InstallTarget(lfcthr.py,root,root,0644,$(PYTHONDIR))
@@ -505,7 +506,7 @@
 	RemoveFiles(lfc2thr_wrap.o lfc2thr_wrap.c)
 	$(SWIG) -python -I$(INCLUDES) -DNSTYPE_LFC lfc2thr.i
 	$(CC) -c $(MTCCFLAGS) -I$(INCLUDES) -DNSTYPE_LFC $(INCLUDE_PYTHON) lfc2thr_wrap.c
-	$(CC) $(SHLIBLDFLAGS) -o _lfc2thr.so lfc2thr_wrap.o $(LIBS) -llfc
+	$(CC) $(SHLIBLDFLAGS) -o _lfc2thr.so lfc2thr_wrap.o $(PYTHON_LIB) $(LIBS)
 
 InstallTarget(_lfc2thr.so,root,root,0755,$(PYTHONDIR))
 InstallTarget(lfc2thr.py,root,root,0644,$(PYTHONDIR))
diff -ur lcgdm-1.7.4.4.orig/rfio/Imakefile lcgdm-1.7.4.4/rfio/Imakefile
--- lcgdm-1.7.4.4.orig/rfio/Imakefile	2010-03-30 07:04:16.000000000 +0200
+++ lcgdm-1.7.4.4/rfio/Imakefile	2010-04-03 13:05:06.320544757 +0200
@@ -94,24 +94,24 @@
 #endif
 FFLAGS = $(FFOPTFLAGS) $(FPPUFL)
 #if defined(__alpha) && defined(__osf__)
-LDLIBS = -no_so -L../lib -l$(TOPLIBRARYNAME) -so_archive
+LDLIBS = -no_so -L../shlib -l$(TOPLIBRARYNAME) -llcgdm -so_archive
 #else
 #if linux
-LDLIBS = -L../lib -l$(TOPLIBRARYNAME) $(LIBCSEC) -lnsl $(MTLDLIBS)
+LDLIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm $(MTLDLIBS)
 #else
 #if SOLARIS
-LDLIBS = -L../lib -l$(TOPLIBRARYNAME) -lsocket -lnsl
+LDLIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm -lsocket -lnsl
 #else
 #if sgi
-LDLIBS =  -L../lib -l$(TOPLIBRARYNAME) $(MTLDLIBS)
+LDLIBS =  -L../shlib -l$(TOPLIBRARYNAME) -llcgdm $(MTLDLIBS)
 #else
 #if __Lynx__
-LDLIBS = -L../lib -l$(TOPLIBRARYNAME) -lnsl -lbsd
+LDLIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm -lnsl -lbsd
 #else
 #if _WIN32
 LDLIBS = ..\lib\$(TOPLIBRARYNAME).lib ws2_32.lib advapi32.lib mpr.lib
 #else
-LDLIBS = -L../lib -l$(TOPLIBRARYNAME) $(MTLDLIBS)
+LDLIBS = -L../shlib -l$(TOPLIBRARYNAME) -llcgdm $(MTLDLIBS)
 #endif
 #endif
 #endif
@@ -121,7 +121,7 @@
 #if _WIN32
 RFIOLIB = rfio.lib
 #else
-RFIOLIB = -L. -lrfio
+RFIOLIB =
 #endif
 LIBS = $(OPTLIBS)
 
diff -ur lcgdm-1.7.4.4.orig/security/Imakefile lcgdm-1.7.4.4/security/Imakefile
--- lcgdm-1.7.4.4.orig/security/Imakefile	2010-04-03 11:36:00.644794634 +0200
+++ lcgdm-1.7.4.4/security/Imakefile	2010-04-03 11:36:19.963544573 +0200
@@ -49,9 +49,9 @@
 #define GSIMech GSI
 #define SecAuthMechGSI       -DGSI
 #define SecIncludeDirGSI -I$(GLOBUS_LOCATION)/include/$(GLOBUS_FLAVOUR_NONPTHR) $(VOMS_INCLUDE) 
-#define SecLibsGSI -L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR_NONPTHR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR_NONPTHR) $(VOMS_LIB)
+#define SecLibsGSI -L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR_NONPTHR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR_NONPTHR) -lglobus_gsi_credential_$(GLOBUS_FLAVOUR_NONPTHR) -lglobus_gsi_callback_$(GLOBUS_FLAVOUR_NONPTHR) -lglobus_common_$(GLOBUS_FLAVOUR_NONPTHR) $(VOMS_LIB) -lssl -lcrypto
 #define SecIncludeDirGSIpthr -I$(GLOBUS_LOCATION)/include/$(GLOBUS_FLAVOUR) $(VOMS_INCLUDE)
-#define SecLibsGSIpthr -L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR)  $(VOMS_LIB)
+#define SecLibsGSIpthr -L$(GLOBUS_LOCATION)/lib -lglobus_gssapi_gsi_$(GLOBUS_FLAVOUR) -lglobus_gss_assist_$(GLOBUS_FLAVOUR) -lglobus_gsi_credential_$(GLOBUS_FLAVOUR) -lglobus_gsi_callback_$(GLOBUS_FLAVOUR) -lglobus_common_$(GLOBUS_FLAVOUR) $(VOMS_LIB) -lssl -lcrypto
 #else
 #define GSIMech
 #endif
diff -ur lcgdm-1.7.4.4.orig/shlib/Imakefile lcgdm-1.7.4.4/shlib/Imakefile
--- lcgdm-1.7.4.4.orig/shlib/Imakefile	2010-04-03 11:36:00.644794634 +0200
+++ lcgdm-1.7.4.4/shlib/Imakefile	2010-04-03 11:36:19.964543441 +0200
@@ -35,7 +35,6 @@
 install: $(LIB) FileName($(LIB),SharedLibraryTargetName(dpm))
 
 export: $(EXPORTLIB)/SharedLibraryTargetName(dpm)
-#else
 #endif
 #endif
 
@@ -60,7 +59,7 @@
 	@mkdir tmp
 	@for i in $^ ;\
 	do (cd tmp; case $$i in *.a) $(AR) x ../$$i; rm -f $(SYMTABNAM) ;; esac) done
-	(cd tmp; $(CC) $(SHLIBLDFLAGS) -Wl,-soname,$@.`echo $(VERSION)|cut -f1 -d.` -o ../$@ *.o $(SHLIBREQLIBS) -L .. -llcgdm $(LIBCSEC))
+	(cd tmp; $(CC) $(SHLIBLDFLAGS) -Wl,-soname,$@.`echo $(VERSION)|cut -f1 -d.` -o ../$@ *.o -L .. -llcgdm $(LIBCSEC))
 	@-rm $@.`echo $(VERSION)|cut -f1 -d.`
 	@-ln -s $@ $@.`echo $(VERSION)|cut -f1 -d.`
 	@-rm -rf tmp
@@ -71,7 +70,7 @@
 	@mkdir tmp
 	@for i in $^ ;\
 	do (cd tmp; $(AR) x ../$$i; rm -f $(SYMTABNAM)) done
-	(cd tmp; $(CC) $(SHLIBLDFLAGS) -Wl,-soname,$@.`echo $(VERSION)|cut -f1 -d.` -o ../$@ *.o $(SHLIBREQLIBS) $(LIBCSEC))
+	(cd tmp; $(CC) $(SHLIBLDFLAGS) -Wl,-soname,$@.`echo $(VERSION)|cut -f1 -d.` -o ../$@ *.o $(SHLIBREQLIBS) -ldl $(LIBCSEC))
 	@-rm $@.`echo $(VERSION)|cut -f1 -d.`
 	@-ln -s $@ $@.`echo $(VERSION)|cut -f1 -d.`
 	@-rm -rf tmp
diff -ur lcgdm-1.7.4.4.orig/srmv1/Imakefile lcgdm-1.7.4.4/srmv1/Imakefile
--- lcgdm-1.7.4.4.orig/srmv1/Imakefile	2010-03-30 07:04:18.000000000 +0200
+++ lcgdm-1.7.4.4/srmv1/Imakefile	2010-04-03 13:06:57.023545111 +0200
@@ -41,9 +41,9 @@
 SOAPFLG = -DWITH_IPV6
 INCLUDES = FileName(..,h)
 #if SOLARIS
-LIBS = -L../lib -ldpm $(LIBCSEC) -lsocket -lnsl
+LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl
 #else
-LIBS = -L../lib -ldpm $(LIBCSEC)
+LIBS = -L../shlib -ldpm -llcgdm
 #endif
 #ifndef darwin   
 LIBS += -luuid
@@ -60,7 +60,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 #else
 #if UsePostgres
 DBOBJS = ../dpm/dpm_libpq_ifce.Osuf
@@ -80,7 +80,7 @@
  
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
diff -ur lcgdm-1.7.4.4.orig/srmv2/Imakefile lcgdm-1.7.4.4/srmv2/Imakefile
--- lcgdm-1.7.4.4.orig/srmv2/Imakefile	2010-03-30 07:04:18.000000000 +0200
+++ lcgdm-1.7.4.4/srmv2/Imakefile	2010-04-03 13:07:20.482545044 +0200
@@ -41,9 +41,9 @@
 SOAPFLG = -DWITH_IPV6
 INCLUDES = FileName(..,h)
 #if SOLARIS
-LIBS = -L../lib -ldpm $(LIBCSEC) -lsocket -lnsl
+LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl
 #else
-LIBS = -L../lib -ldpm $(LIBCSEC)
+LIBS = -L../shlib -ldpm -llcgdm
 #endif
 #ifndef darwin   
 LIBS += -luuid
@@ -60,7 +60,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 #else
 #if UsePostgres
 DBOBJS = ../dpm/dpm_libpq_ifce.Osuf
@@ -80,7 +80,7 @@
  
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################
 
diff -ur lcgdm-1.7.4.4.orig/srmv2.2/Imakefile lcgdm-1.7.4.4/srmv2.2/Imakefile
--- lcgdm-1.7.4.4.orig/srmv2.2/Imakefile	2010-03-30 07:04:16.000000000 +0200
+++ lcgdm-1.7.4.4/srmv2.2/Imakefile	2010-04-03 13:07:34.992543914 +0200
@@ -42,9 +42,9 @@
 INCLUDES = FileName(..,h)
 BACKEND_LIBS = DepLibraryTargetName(dpmcopy,dpmcopy)
 #if SOLARIS
-LIBS = -L../lib -ldpm $(LIBCSEC) -lsocket -lnsl
+LIBS = -L../shlib -ldpm -llcgdm -lsocket -lnsl
 #else
-LIBS = -L../lib -ldpm $(LIBCSEC)
+LIBS = -L../shlib -ldpm -llcgdm
 #endif
 #ifndef darwin   
 LIBS += -luuid
@@ -61,7 +61,7 @@
 MYSFLG = -DUSE_MYSQL
 MYSQL_LOCATION = MySQLLocation
 MYSINC = -I$(MYSQL_LOCATION)/include/mysql
-LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient -lz -lm
+LIBMYS = -L$(MYSQL_LOCATION)/$(_lib)/mysql -lmysqlclient
 #else
 #if UsePostgres
 DBOBJS = ../dpm/dpm_libpq_ifce.Osuf
@@ -81,7 +81,7 @@
  
 COMM######################### DEPENDENCY LIBRARIES ###############
  
-DEPLIB = DepLibraryTargetName(lib,dpm)
+DEPLIB = DepSharedLibraryTargetName(shlib,dpm)
 
 COMM######################### RULES ##############################