[Mono-devel-list] gacutil flags revisited

Mike Kestner mkestner at ximian.com
Tue Nov 2 16:54:53 EST 2004


I'd like to revisit a nagging problem related to gacutil.  

The current implementation of gacutil provides two flags that are
similar but are a constant source of confusion related to gac
installation.  To specify a specific gac path, you can provide either
-root or -gacdir.  

The difference between the two is related to the additional use of a
-package flag.  If you use -root, the link to the installed assembly
that is created in the -package dir is "redirected" to the system
gacdir.  This allows for packaging builds which are installed to
temporary directories but end up with unbroken links when "redirected"
by the package installer.  Think DESTDIR.  

-gacdir on the other hand makes -package links point at the assembly
path as installed.  Think make install from source without DESTDIR.

I've been working around this distinction in Gtk# by adding a
GACUTIL_FLAGS variable to my Makefiles which can be overridden by
packagers.  For non-win32 builds, I specify -gacdir in the configure.in
which gets AC_SUBSTituted into the Makefiles so that normal make install
to prefixed directories works as expected for source builders.  A
packager can override with a different GACUTIL_FLAGS value to specify
the -root option instead of -gacdir.

While the above solution works, it is another barrier to overcome for
new packagers, and I've seen people struggling to come up with similar
solutions in other packages recently, like evolution-sharp.  I think the
source of the problem is that there is already a well-established
paradigm for packaging (DESTDIR) but the the current gacutil
implementation makes everyone use a different unfamiliar mechanism.  I'd
like to see us fix gacutil to take advantage of DESTDIR directly.

My suggestion is to make gacutil respect DESTDIR.  To support backward
compatibility, I would leave -root and -gacdir exactly as they are.  We
would add a new flag (call it -libdir, perhaps). If gacutil detects that
DESTDIR is set, it should perform the current -root linkages while
prepending DESTDIR to the -libdir path for the temporary installation
target.  If DESTDIR is not set, the -gacdir linkages are performed and
everything goes directly into -libdir.

This would allow the following syntax in Makefiles:

install-data-local:
	$(GACUTIL) -i $(ASSEMBLY) -f -libdir $(libdir)

and it would work for prefixed source builds and redirected package
builds with no additional effort.

And then peace and tranquility would rule the land.  

-- 
Mike Kestner <mkestner at ximian.com>




More information about the Mono-devel-list mailing list