Index: cygwin.rules =================================================================== RCS file: /cvs/xc/config/cf/cygwin.rules,v retrieving revision 3.19 diff -u -r3.19 cygwin.rules --- cygwin.rules 2002/04/15 09:22:33 3.19 +++ cygwin.rules 2002/09/28 15:06:06 @@ -52,7 +52,15 @@ #define UseExportLists YES #endif +#define SharedLibraryName(libname, rev) \ +Concat3(cyg,libname,-$(shell echo rev|sed s=\\..*==).dll) +#define ImportLibraryName(libname, rev) \ +Concat3(lib,libname,-$(shell echo rev|sed s=\\..*==).dll.a) + +#define ShortImportLibraryName(libname, rev) \ +Concat3(lib,libname,.dll.a) + /* * SharedDepLibraryTarget - generate rules to create a shared library. */ @@ -75,22 +83,23 @@ */ #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\ -AllTarget(Concat3(lib,libname,.dll)) @@\ +AllTarget(SharedLibraryName(libname,rev)) @@\ @@\ CppFileTarget(libname.def,libname-def.cpp,-DLIBRARY_VERSION=rev,$(ICONFIGFILES)) @@\ @@\ @@\ @@\ -Concat3(lib,libname,.dll): deplist libname.def @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ - MakeDLL(libname,solist) @@\ - LinkBuildLibrary(Concat3(lib,libname,.a)) @@\ - LinkBuildDLL(Concat3(lib,libname,.dll)) @@\ +SharedLibraryName(libname,rev): deplist libname.def @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ + MakeDLL(libname,solist,rev) @@\ + LinkBuildLibrary(ImportLibraryName(libname,rev)) @@\ + LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname)) @@\ + LinkBuildDLL(SharedLibraryName(libname,rev)) @@\ @@\ clean:: @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ #endif /* SharedDepLibraryTarget */ @@ -116,22 +125,23 @@ */ #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up) @@\ -AllTarget(Concat3(lib,libname,.dll)) @@\ +AllTarget(SharedLibraryName(libname,rev)) @@\ @@\ CppFileTarget(libname.def,libname-def.cpp,-DLIBRARY_VERSION=rev,$(ICONFIGFILES)) @@\ @@\ @@\ - @@\ -Concat3(lib,libname,.dll): deplist libname.def @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ - MakeCplusplusDLL(libname,solist) @@\ - LinkBuildLibrary(Concat3(lib,libname,.a)) @@\ - LinkBuildDLL(Concat3(lib,libname,.dll)) @@\ @@\ -clean:: @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ +SharedLibraryName(libname,rev): deplist libname.def @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ + MakeCplusplusDLL(libname,solist,rev) @@\ + LinkBuildLibrary(ImportLibraryName(libname,rev)) @@\ + LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname)) @@\ + LinkBuildDLL(SharedLibraryName(libname,rev)) @@\ + @@\ +clean:: @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ #endif /* SharedDepCplusplusLibraryTarget */ @@ -173,22 +183,22 @@ * MakeDllProg */ -#define MakeDLLProg(libname,solist,prog) @@\ - prog -shared -Wl,--out-implib=Concat3(lib,libname,.a) -Wl,--enable-auto-import --def libname.def -o Concat3(lib,libname,.dll) solist $(REQUIREDLIBS) +#define MakeDLLProg(libname,solist,prog,rev) @@\ + prog -shared -Wl,--out-implib=ImportLibraryName(libname,rev) -Wl,--enable-auto-import --def libname.def -Wl,--exclude-libs,ALL -o SharedLibraryName(libname,rev) solist $(REQUIREDLIBS) /* * MakeDll */ -#define MakeDLL(libname,solist) @@\ - MakeDLLProg(libname,solist,$(CC)) +#define MakeDLL(libname,solist,rev) @@\ + MakeDLLProg(libname,solist,$(CC),rev) /* * MakeCplusplusDll */ -#define MakeCplusplusDLL(libname,solist) @@\ - MakeDLLProg(libname,solist,$(CXX)) +#define MakeCplusplusDLL(libname,solist,rev) @@\ + MakeDLLProg(libname,solist,$(CXX),rev) @@ -197,29 +207,42 @@ */ #define SharedLibraryTarget(libname,rev,solist,down,up) @@\ -AllTarget(Concat3(lib,libname,.dll)) @@\ +AllTarget(SharedLibraryName(libname,rev)) @@\ @@\ CppFileTarget(libname.def,libname-def.cpp,-DLIBRARY_VERSION=rev,$(ICONFIGFILES)) @@\ @@\ @@\ -Concat3(lib,libname,.dll): solist libname.def @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ - MakeDLL(libname,solist) @@\ - LinkBuildLibrary(Concat3(lib,libname,.a)) @@\ - LinkBuildDLL(Concat3(lib,libname,.dll)) @@\ -clean:: @@\ - RemoveFile(LibraryTargetName(libname)) @@\ - RemoveFile(Concat3(lib,libname,.dll)) @@\ +SharedLibraryName(libname,rev): solist libname.def @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ + MakeDLL(libname,solist,rev) @@\ + LinkBuildLibrary(ImportLibraryName(libname,rev)) @@\ + LinkImportLibrary(ImportLibraryName(libname,rev),LibraryTargetName(libname)) @@\ + LinkBuildDLL(SharedLibraryName(libname,rev)) @@\ +clean:: @@\ + RemoveFile(ImportLibraryName(libname,rev)) @@\ + RemoveFile(SharedLibraryName(libname,rev)) @@\ /* + * InstallLink + */ + +#ifndef InstallLink +#define InstallLink(step, file, link, dest) @@\ +step:: @@\ + MakeDir($(DESTDIR)dest) @@\ + $(LN) -sf file $(DESTDIR)dest/link +#endif + +/* * InstallSharedLibrary */ #define InstallSharedLibrary(libname,rev,dest) @@\ -InstallTarget(install,LibraryTargetName(libname),$(INSTLIBFLAGS),$(USRLIBDIR)) @@\ -InstallTarget(install,Concat3(lib,libname,.dll),$(INSTLIBFLAGS),$(BINDIR)) +InstallTarget(install,ImportLibraryName(libname,rev),$(INSTLIBFLAGS),$(USRLIBDIR)) @@\ +InstallTarget(install,SharedLibraryName(libname,rev),$(INSTLIBFLAGS),$(BINDIR)) @@\ +InstallLink(install,ImportLibraryName(libname,rev),ShortImportLibraryName(libname,rev),$(USRLIBDIR)) /* @@ -263,6 +286,16 @@ RemoveFile($(BUILDBINDIR)/lib) @@\ cd $(BUILDBINDIR) && $(CP) $(BUILDBINTOP)/$(CURRENT_DIR)/lib . #endif + +#ifndef LinkImportLibrary +#ifdef UseInstalled +#define LinkImportLibrary(lib, importlib) $(_NULLCMD_) +#else +#define LinkImportLibrary(lib, importlib) MakeDir($(BUILDLIBDIR)) @@\ + RemoveFile($(BUILDLIBDIR)/importlib) @@\ + cd $(BUILDLIBDIR) && $(LN) lib importlib +#endif +#endif /* LinkImportLibrary */ /*