[AD] 3.9.33 Unix patch (non-root users and ld.so.conf advice)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

I've modified the Unix makefile so that if it's installing
shared libraries it checks that the target directory is listed
in /etc/ld.so.conf, and if not it prints a warning that programs
may not run in this state.  The main motivation for this is that
many Linux distributions don't have /usr/local/lib listed in
/etc/ld.so.conf.  I also changed the order of installation
so that the warning is visible when the installation finishes.

I also modified `readme.uni' to include more details of how to
install Allegro when you don't have root access to the system,
which is sort of related to the above problem.  I updated the
information about depending on other libraries like X, GGI, and
SVGAlib.

I'm not sure whether the test on /etc/ld.so.conf is appropriate
for other platforms, so if anybody uses one it'd be good to know
whether this should only occur on Linux systems, and also
whether the LD_LIBRARY_PATH environment variable is universal or
Linux-specific.

Something else I considered was adding an option to
`allegro-config' which would make it output a string of
environment variable modifications, for use when Allegro is not
installed to the usual place.  It's an easy change; the idea
then is that instead of putting all the modifications in their
.bash_profile, they just have to add (or type themselves):

    `allegro_config --env`

I didn't implement this, but I can if people think it would be
useful.  It's true that not many people use Allegro without
having root access to machines -- unless you have console access
to a machine you can't do graphics efficiently, and if you have
console access you probably know the owner of the machine anyway
-- but there have been people asking about this in the past.

I'm attaching a diff for everything apart from `allegro-config'.

George

-- 
Random project update:
22/06/2000: AllegroGL documentation:  http://allegrogl.sourceforge.net/
        See under `Documentation' for the AllegroGL Reference Manual in
        various formats.

Index: makefile.in
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.in,v
retrieving revision 1.4
diff -u -r1.4 makefile.in
--- makefile.in	2000/08/07 12:39:44	1.4
+++ makefile.in	2000/10/15 19:51:12
@@ -230,10 +230,11 @@
 
 install: $(INSTALL_TARGETS)
 
-mini-install: install-lib install-headers
+mini-install: install-headers install-lib
 	@echo "Your end-user version of Allegro is now installed"
 
-full-install: install-lib install-headers install-programs
+full-install: install-headers install-programs install-lib
+	@echo ""
 	@echo "Run make install-man if you wish to install the man pages"
 	@echo "Run make install-info if you wish to install the info documentation"
 	@echo "You may conserve space by instead running make install-gzipped-man"
@@ -257,7 +258,14 @@
 	$(mkinstalldirs) $(bindir)
 	@echo Installing allegro-config to $(bindir)
 	@$(INSTALL_PROGRAM) allegro-config $(bindir)
-	-$(LDCONFIG) $(libdir)
+	@if test -n "$(LIBDIR)/liball*-$(shared_version).so"; then \
+		grep -q $(libdir) /etc/ld.so.conf && ($(LDCONFIG) $(libdir) || true) || (\
+			echo "" ; \
+			echo "Warning: shared library destination $(libdir) is not in ldd search path." ; \
+			echo "Unless you add it to /etc/ld.so.conf, you must set LD_LIBRARY_PATH to include"; \
+			echo "$(libdir) each time you want to run an Allegro program." ; \
+		) ; \
+	fi
 
 install-headers:
 	$(mkinstalldirs) $(includedir)/allegro
Index: readme.uni
===================================================================
RCS file: /cvsroot/alleg/allegro/readme.uni,v
retrieving revision 1.2
diff -u -r1.2 readme.uni
--- readme.uni	2000/10/10 08:09:43	1.2
+++ readme.uni	2000/10/15 19:51:16
@@ -59,7 +59,8 @@
 
       make
 
-   And finally you install it:
+   And finally you install it (as root -- see below for information on what
+   to do if you can't be root):
 
       su -c "make install"
 
@@ -133,27 +134,66 @@
    probably be a new major version of the library.
 
    Allegro can interface with a lot of other libraries -- in particular, 
-   various X libraries, GGI and SVGAlib. Whether you use Allegro itself as a 
-   shared library or static, these other libraries are usually linked 
-   shared. This means that your program won't even load on a user's machine 
-   unless he/she has all these libraries installed!
-
-   This makes it difficult to distribute precompiled versions of your 
-   Allegro programs, since you don't know what other libraries will be 
-   available on the target machine, and hence cannot know which options to 
-   include when configuring Allegro. If you want to distribute in binary 
-   form, one option would be to include several versions of the shared 
-   libraries, covering all the possibilities -- GGI only, SVGAlib only, both 
-   GGI and SVGAlib but not X, etc. The user installs whichever one matches 
-   their system, and doesn't need redundant shared libraries that'll never 
-   get used. There are a lot of possible combinations, though. 
-   Alternatively, you could configure Allegro using all possible external 
-   libraries, which will require your users to install all of these before 
-   they can run your program. That is simple for you, but not so much fun 
-   for them! Or the easiest option is, of course, to distribute your 
-   programs in source form. That way the user can configure Allegro for 
-   themselves, and will always end up using exactly the right set of 
-   libraries for their particular system.
+   various X libraries, GGI and SVGAlib. If you link statically to Allegro,
+   your program will depend upon all these other libraries so you may want
+   to link statically to them too. If you link dynamically to Allegro, your
+   binary will only depend upon the Allegro version (and things like libc);
+   in this case your binary is more easily portable, but it does depend
+   upon the way Allegro was configured (e.g. enable/disable GGI). Hopefully
+   this dependence will go away in the future.
+
+   The easiest way to make your program portable is to distribute it in 
+   source form. That way the users can configure Allegro for themselves, 
+   and will always end up using exactly the right set of libraries for 
+   their particular system.
+
+
+
+==================================================
+============ What if you're not root? ============
+==================================================
+
+   Allegro can be installed on a system where you don't have root 
+   privileges. Using the standard configure script option `--prefix' you 
+   can change the target directories for installation -- for example,
+   you can write:
+
+      ./configure --prefix=~
+
+   Then binaries will be installed to the `bin' subdirectory of your home
+   directory, libraries to `lib', etc.  Now you need to set up your system
+   so that it knows where to find a few things, if this has not been done
+   already.  You might want to add these commands to your .bash_profile
+   or similar startup script.  If you use a csh-style shell, you want to
+   use `setenv', not `export'.
+
+
+   * Your PATH must include the `bin' directory:
+
+	export PATH=$PATH:$HOME/bin
+
+
+   * If you are using Allegro as a shared library, you need to tell the 
+     dynamic loader where to find the Allegro libraries:
+
+	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
+
+
+   * GCC needs to know where to find header and library files:
+
+	export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/include
+	export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/include
+	export LIBRARY_PATH=$LIBRARY_PATH:$HOME/lib
+
+
+   (Note: in fact `allegro-config' can handle the last step for you, if
+   you use it for compilation as well as linking:
+
+	gcc -c mygame.c `allegro-config --cflags`
+	gcc -o mygame mygame.o `allegro-config --libs`
+
+   But, it's better to set the environment variables too.  Most people
+   don't tend to bother with `allegro-config' when compiling.)
 
 
 
Index: include/allegro/alunixac.hin
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/alunixac.hin,v
retrieving revision 1.2
diff -u -r1.2 alunixac.hin
--- include/allegro/alunixac.hin	2000/08/07 13:32:51	1.2
+++ include/allegro/alunixac.hin	2000/10/15 19:51:21
@@ -88,6 +88,9 @@
 /* Define if XF86DGA extension is supported.  */
 #undef ALLEGRO_XWINDOWS_WITH_XF86DGA
 
+/* Define if DGA version 2.0 or newer is supported */
+#undef ALLEGRO_XWINDOWS_WITH_XF86DGA2
+
 /* Define if OSS DIGI driver is supported.  */
 #undef ALLEGRO_WITH_OSSDIGI
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/