Re: [AD] 4.3.10plus build system

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


On 2007-12-23, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
>  Hello!
> 
>  I've been working on merging AGL's and Allegro's build system last night so 
>  here are the results. This is only for unix but, from what I've seen, it 
>  will be even easier on Windows because there is no autotools. I don't think 
>  I can do much for other systems.
> 
>  What the user needs to do in order to build and install Allegro + AGL:
>  ./configure
>  make
>  make install

Excellent!

> 
>  To build an program using Allegro and AGL the user would need to do the same 
>  as before merging the build system. i.e. They act like separate libs after 
>  installed.
> 
> 
>  How it is done:
> 
>  - fix.sh
>  It just calls addons/allegrogl/finx.sh at the end.
> 
>  - The configure script
>  There is a new option called --with-allegrogl. If not given it defaults to 
>  "auto". If "auto" then AGL is enabled if GL/gl.h, GL/glx.h and GL/glu.h 
>  header files are present on the system. Values "yes" and "no" do not perform 
>  any test.
>  [review: should we perform more advanced test, like try to compile and link 
>  a little OpenGL program to test or OpenGL presence?]

Yes, it shouldn't be hard.

>  [review: should probably make it foolproof if --with-x=no was given or 
>  similar]
>  When AGL is detected, current directory is changed to addons/allegrogl/ and 
>  configure script is run, intercepting allegro's configure script. Looks fine 
>  to me.
> 
> 
>  - makefiles
>  There is a new makefile in addons/allegrogl/make/ called makefile.add which 
>  defines all targets to be run from allegro's makefile. Added just some new 
>  targets to allegro's makefile.in. AGL's makefile.unx tweaked to  link with 
>  not-yet-installed allegro.
> 
> 
>  All in all, small modifications have been done to the build system and it 
>  should be easy to add new addons following these patterns.

Great.

> 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,10 @@
>  @SET_MAKE@
>  
>  
> +# -------- include addons' targets -------
> +include addons/allegrogl/make/makefile.add

Add a newline there to be consistent.

> Index: configure.in
> ===================================================================
> --- configure.in	(revision 9564)
> +++ configure.in	(working copy)
> @@ -160,6 +160,44 @@
>  
>  #-----------------------------------------------------------------------------#
>  
> +#-----------------------------------------------------------------------------#
> +#
> +# Addons
> +#
> +
> +dnl With AllegroGL addon
> +AC_ARG_ENABLE(allegrogl,
> +[  --with-allegrogl[=x]      build AllegroGL addon library [default=auto]],
> +test "X$enableval" != "Xno" && allegro_with_allegrogl=yes,
> +allegro_with_allegrogl=auto)
> +
> +if test "X$allegro_with_allegrogl" = "Xauto"; then
> +  AC_CHECK_HEADERS([GL/gl.h GL/glx.h GL/glu.h],
> +                   [allegro_with_allegrogl=yes],
> +                   [allegro_with_allegrogl=no],,)
> +fi
> +
> +if test "X$allegro_with_allegrogl" = "Xyes"; then
> +  _addons="AllegroGL $_addons"
> +  echo ""
> +  echo "Running AllegroGL configure script..."
> +  echo ""
> +  cd addons/allegrogl/
> +  ./configure
> +  cd ../../
> +  echo ""
> +  echo "... Continuing with Allegro configure script..."
> +  echo ""
> +  WITH_ALLEGROGL=yes
> +fi
> +

It's simpler and cleaner to use a subshell.  Since the AllegroGL configure
might fail, I suggest something like:

    if ( cd addons/allegrogl ; ./configure )
    then
	WITH_ALLEGROGL=yes
    else
	WITH_ALLEGROGL=no
    fi

(untested)

> Index: fix.sh
> ===================================================================
> --- fix.sh	(revision 9564)
> +++ fix.sh	(working copy)
> @@ -167,4 +167,9 @@
>     esac
>  fi
>  
> +# run fix.sh for addons
> +cd addons/allegrogl/
> +./fix.sh $1
> +cd ../../

Same here.

Looks fine otherwise.

Peter





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