Re: [AD] 4.3.10plus build system

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


Here is the new patch. Along with the changes you proposed I also changed a few things:

1. There is no "auto" argument for --enable-allegrogl, only "yes" and "no". "yes" is default. This is how all other configure options in allegro work. Autodetection is still there.

2. Removed any checks for OpenGL presence from Allegro's configure.in. This is performed in AllegroGL's configure anyway.

3. The --prefix option is passed to AllegroGL's configure script.
I did it only for --prefix because it is the most used one IMO. If the user wants to pass any custom (and no so custom, like --enable-shared) options to AllegroGL's configure script he can do it by running it manually.

I'd appreciate if someone tests it (I did) before I commit it.


--
Milan Mimica
http://sparklet.sf.net
Index: addons/allegrogl/configure.in
===================================================================
--- addons/allegrogl/configure.in	(revision 9569)
+++ addons/allegrogl/configure.in	(working copy)
@@ -137,10 +137,6 @@
 fi
 
 
-dnl Check Allegro is installed
-AM_PATH_ALLEGRO([4.2.0], ,AC_MSG_ERROR([AllegroGL requires Allegro >= 4.2.0 to be installed!]))
-
-
 CPPFLAGS="$allegro_CFLAGS $CPPFLAGS"
 
 
@@ -154,7 +150,6 @@
 AC_SUBST(LIB_PATH_U)
 AC_SUBST(LIB_LINKS_U)
 AC_SUBST(SHARED)
-AC_SUBST(ALLEGRO_CONFIG)
 
 dnl Additional substitutions for the generic driver
 
Index: addons/allegrogl/fix.sh
===================================================================
--- addons/allegrogl/fix.sh	(revision 9569)
+++ addons/allegrogl/fix.sh	(working copy)
@@ -15,14 +15,6 @@
 
 mkdir -p obj/unix/debug obj/unix/release lib/unix
 
-echo Done.
-echo
-echo "Run './configure' to configure ('./configure --help' for help)."
-echo "Then run 'make' to build, and 'make install' to install."
-echo
-echo "(If this is a CVS version, you must run 'autoconf' to generate the"
-echo "configure script.)"
-echo
 }
 
 proc_fix()
Index: addons/allegrogl/make/makefile.add
===================================================================
--- addons/allegrogl/make/makefile.add	(revision 0)
+++ addons/allegrogl/make/makefile.add	(revision 0)
@@ -0,0 +1,18 @@
+# makefile that is included into allegro's main makefile
+allegrogl_lib:
+	$(MAKE) -C addons/allegrogl/ lib
+
+allegrogl_install:
+	$(MAKE) -C addons/allegrogl/ install
+
+allegrogl_clean:
+	$(MAKE) -C addons/allegrogl/ clean
+
+allegrogl_distclean:
+	$(MAKE) -C addons/allegrogl/ distclean
+
+allegrogl_uninstall:
+	$(MAKE) -C addons/allegrogl/ uninstall
+
+allegrogl_programs:
+	 $(MAKE) -C addons/allegrogl/ examples
Index: addons/allegrogl/make/makefile.unx
===================================================================
--- addons/allegrogl/make/makefile.unx	(revision 9569)
+++ addons/allegrogl/make/makefile.unx	(working copy)
@@ -23,7 +23,7 @@
 LDFLAGS = @LDFLAGS@ -L$(LIB_DIR)
 DEFS = @DEFS@
 LIB_BUILDER = @LIB_BUILDER@
-ALLEGRO_CONFIG = @ALLEGRO_CONFIG@
+ALLEGRO_CONFIG = ../../allegro-config
 
 # Programs
 CC = @CC@
@@ -52,6 +52,9 @@
 GENERAL_LIB_OBJS = $(addprefix $(OBJ_DIR)/, $(notdir $(C_SOURCE:.c=.o)))
 EXAMPLES = $(addprefix $(EXAMPLE_DIR)/, $(EXAMP_SOURCE:.c= ))
 
+ALLEGRO_INCLUDE = -I../../include
+
+
 #-----------------------------------#
 # --- Objects for common targets ---#
 
@@ -83,9 +86,9 @@
 endif
 
 ifdef DEBUGALLEG
-	LDLIBS += `$(ALLEGRO_CONFIG) --libs debug` $(LIBS)
+	LDLIBS +=  -L../../lib/unix `$(ALLEGRO_CONFIG) --libs debug` $(LIBS)
 else
-	LDLIBS += `$(ALLEGRO_CONFIG) --libs` $(LIBS)
+	LDLIBS +=  -L../../lib/unix `$(ALLEGRO_CONFIG) --libs` $(LIBS)
 endif
 
 ifdef MESABUILD
@@ -106,6 +109,8 @@
 	endif
 endif
 
+CPPFLAGS += $(ALLEGRO_INCLUDE)
+
 .PHONY: all
 .PRECIOUS: %.o
 
Index: addons/allegrogl/make/makefile.lst
===================================================================
--- addons/allegrogl/make/makefile.lst	(revision 9569)
+++ addons/allegrogl/make/makefile.lst	(working copy)
@@ -19,7 +19,6 @@
 all: examples lib
 	@echo -
 	@echo Success!
-	@echo Now run 'make install' to install AllegroGL.
 
 
 #----------------------------------#
Index: makefile.in
===================================================================
--- makefile.in	(revision 9564)
+++ makefile.in	(working copy)
@@ -93,6 +93,18 @@
 ALLEGRO_LIB_TARGETS = @ALLEGRO_LIB_TARGETS@
 ALLEGRO_MODULE_TARGETS = @ALLEGRO_MODULE_TARGETS@
 
+WITH_ALLEGROGL = @WITH_ALLEGROGL@
+
+ifdef WITH_ALLEGROGL
+	ADDON_INSTALL_TARGETS += allegrogl_install
+	ADDON_UNINSTALL_TARGETS += allegrogl_uninstall
+	ADDON_CLEAN_TARGETS += allegrogl_clean
+	ADDON_VERYCLEAN_TARGETS += allegrogl_veryclean
+	ADDON_LIB_TARGETS += allegrogl_lib
+	ADDON_EXE_TARGETS += allegrogl_programs
+endif
+
+
 PLUGIN_LIB = @PLUGIN_LIB@
 obj_unix_plugins_h = $(OBJDIR)/plugins.h
 
@@ -119,7 +131,11 @@
 @SET_MAKE@
 
 
+# -------- include addons' targets -------
 
+include addons/allegrogl/make/makefile.add
+
+
 # -------- list of sources for libraries and programs --------
 
 include $(srcdir)/makefile.lst
@@ -350,19 +366,21 @@
 
 ifdef CROSSCOMPILE
 
-full-build: lib modules programs
+full-build: lib modules addons programs
 
 else
 
-full-build: lib modules programs docs
+full-build: lib modules addons programs docs
 
 endif
 
 lib: $(ALLEGRO_LIB_TARGETS)
 
+addons: $(ADDON_LIB_TARGETS)
+
 modules: $(ALLEGRO_MODULE_TARGETS)
 
-programs: $(ALLEGRO_EXE_TARGETS)
+programs: $(ALLEGRO_EXE_TARGETS) $(ADDON_EXE_TARGETS)
 
 suid: $(ALLEGRO_EXE_TARGETS)
 	chown root.allegro $?
@@ -404,7 +422,7 @@
 
 # -------- rules for deleting the generated files --------
 
-clean:
+clean: $(ADDON_CLEAN_TARGETS)
 
    define RM_OBJ_CLEAN_FILES
       $(foreach file, $(OBJ_CLEAN_FILES), rm -f $(file)
@@ -419,7 +437,7 @@
 	$(RM_OBJ_CLEAN_FILES)
 	$(RM_OTHER_CLEAN_FILES)
 
-distclean: clean
+distclean: clean $(ADDON_DISTCLEAN_TARGETS)
 
    define RM_DISTCLEAN_FILES
       $(foreach file, $(DISTCLEAN_FILES) $(ALLEGRO_LIB_X_EXES), rm -f $(file)
@@ -428,7 +446,7 @@
 
 	$(RM_DISTCLEAN_FILES)
 
-veryclean: distclean
+veryclean: distclean 
 
    define RM_VERYCLEAN_FILES
       $(foreach file, $(VERYCLEAN_FILES), rm -f $(file)
@@ -442,11 +460,9 @@
 	rm -f configure include/allegro/platform/alunixac.hin
 	rm -rf autom4te*
 
-
-
 # -------- rules for installing the files --------
 
-install: $(INSTALL_TARGETS)
+install: $(ADDON_INSTALL_TARGETS) $(INSTALL_TARGETS)
 
 mini-install: install-headers install-lib
 	@echo "Your end-user version of Allegro is now installed"
@@ -590,7 +606,7 @@
 
 # -------- rules for uninstalling the files --------
 
-uninstall: uninstall-lib uninstall-modules uninstall-headers uninstall-programs uninstall-info uninstall-man uninstall-misc
+uninstall: uninstall-lib uninstall-modules uninstall-headers uninstall-programs uninstall-info uninstall-man uninstall-misc $(ADDON_UNINSTALL_TARGETS)
 	@echo
 	@echo "All gone. Don't you feel sad now?"
 	@echo
@@ -706,7 +722,7 @@
 install-gzipped-info install-bzipped-info install-man install-gzipped-man \
 install-bzipped-man depend \
 uninstall uninstall-lib uninstall-modules uninstall-headers \
-uninstall-programs uninstall-info uninstall-man
+uninstall-programs uninstall-info uninstall-man addons
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
Index: configure.in
===================================================================
--- configure.in	(revision 9564)
+++ configure.in	(working copy)
@@ -325,6 +325,7 @@
 AC_SUBST(PROG_LDFLAGS)
 AC_SUBST(LIB_TO_LINK)
 AC_SUBST(LINK_WITH_STATIC_LIBS)
+AC_SUBST(WITH_ALLEGROGL)
 
 dnl Which libraries to build (static, shared, normal, debugging, profiling)?
 ALLEGRO_LIB_TARGETS=
@@ -727,8 +728,48 @@
 fi
 AC_SUBST(ALLEGRO_MODULE_TARGETS)
 
+
 #-----------------------------------------------------------------------------#
+#
+# Addons
+#
 
+dnl With AllegroGL addon
+AC_ARG_ENABLE(allegrogl,
+[  --enable-allegrogl[=x]  build AllegroGL addon library [default=yes]],
+test "X$enableval" != "Xno" && allegro_with_allegrogl=yes,
+allegro_with_allegrogl=yes)
+
+dnl Build up configure options for AllegroGL
+agl_config_opt="$agl_config_opt --prefix=$prefix"
+
+if test "$allegro_with_allegrogl" = "yes"; then
+  echo ""
+  echo "Running AllegroGL configure script..."
+  echo "./configure $agl_config_opt"
+  if (cd addons/allegrogl && ./configure $agl_config_opt && cd ../../); then
+    _addons="AllegroGL, $_addons"
+    WITH_ALLEGROGL=yes
+  else
+    echo ""
+    echo "... AllegroGL configure script failed (AllegroGL disabled) ..."
+    echo ""
+    WITH_ALLEGROGL=no
+  fi
+  echo ""
+  echo "... Continuing with Allegro configure script ..."
+  echo ""
+else
+  allegro_with_allegrogl=no
+fi
+  
+AC_MSG_CHECKING(for AllegroGL support)
+AC_MSG_RESULT($allegro_with_allegrogl)
+
+test -z "$_addons" && _addons="none"
+
+#-----------------------------------------------------------------------------#
+
 dnl Additional libraries.
 LIBS="-lm $LIBS"
 
@@ -886,6 +927,7 @@
  Generated code: $_code_features
  Generated libraries:$_libraries
  Compiled programs: $_programs
+ With addons: $_addons
  $_warnmode
  $_x11
  $_linux_console
@@ -978,6 +1020,8 @@
 AC_OUTPUT(makefile:makefile.in allegro-config:misc/allegro-config.in,
   [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
 
+chmod a+x allegro-config
+
 dnl The makefile doesn't work with non-GNU make so test for its presence.
 if ${MAKE-make} -v -f /dev/null 2>/dev/null | grep -i "gnu" >/dev/null; then
   gnu_make="yes"
Index: fix.sh
===================================================================
--- fix.sh	(revision 9564)
+++ fix.sh	(working copy)
@@ -167,4 +167,11 @@
    esac
 fi
 
+# run fix.sh for addons
+cd addons/allegrogl/
+if !(./fix.sh $1); then
+	echo "Error occured while executing AllegroGL's fix.sh!"
+fi
+cd ../../
+
 echo "Done!"


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