From 8e4d14743035ba59b16e5c84246916f43487d455 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Thu, 15 Nov 2007 08:59:57 -0800 Subject: autoconf: Configurable demos directories The user can request specific demos directories to build in. For example: ./configure --with-demos="demos,xdemos" The drawback is that we don't check for the necessary libararies in that case, only that the directory in progs/ exists. --- configure.ac | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index db6a7850a4..32fdf480c5 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,39 @@ AC_SUBST(GLU_DIRS) AC_SUBST(DRIVER_DIRS) AC_SUBST(WINDOW_SYSTEM) +dnl +dnl User supplied program configuration +dnl +if test -d "$srcdir/progs/demos"; then + default_demos=yes +else + default_demos=no +fi +AC_ARG_WITH(demos, + [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@], + [optional comma delimited demo directories to build + @<:@default=yes if source available@:>@])], + with_demos="$withval", + with_demos="$default_demos") +if test "x$with_demos" = x; then + with_demos=no +fi + +dnl If $with_demos is yes, directories will be added as libs available +PROGRAM_DIRS="" +case "$with_demos" in +no|yes) ;; +*) + # verify the requested demos directories exist + demos=`IFS=,; echo $with_demos` + for demo in $demos; do + test -d "$srcdir/progs/$demo" || \ + AC_MSG_ERROR([Program directory '$demo' doesn't exist]) + done + PROGRAM_DIRS="$demos" + ;; +esac + dnl dnl Find out if X is available. The variables have_x or no_x will be dnl set and used later in the driver setups @@ -381,7 +414,7 @@ if test "x$enable_glu" = xyes; then osmesa) # If GLU is available and we have libOSMesa (not 16 or 32), # we can build the osdemos - if test "$osmesa_bits" = 8; then + if test "$with_demos" = yes && test "$osmesa_bits" = 8; then PROGRAM_DIRS="$PROGRAM_DIRS osdemos" fi @@ -391,7 +424,9 @@ if test "x$enable_glu" = xyes; then ;; *) # If GLU is available, we can build the xdemos - PROGRAM_DIRS="$PROGRAM_DIRS xdemos" + if test "$with_demos" = yes; then + PROGRAM_DIRS="$PROGRAM_DIRS xdemos" + fi GLU_LIB_DEPS="-lm" GLU_MESA_DEPS='-l$(GL_LIB)' @@ -470,7 +505,9 @@ if test "x$enable_glut" = xyes; then GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" # If glut is available, we can build most programs - PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl" + if test "$with_demos" = yes; then + PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl" + fi GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)' fi -- cgit v1.2.3