fi
done
])
+
+dnl remove duplicates out of a list.
+dnl dnl argument is the name of a variable to be checked and cleaned up
+AC_DEFUN([SQUID_CLEANUP_MODULES_LIST],[
+squid_cleanup_tmp_outlist=""
+for squid_cleanup_tmp in $$1
+do
+ squid_cleanup_tmp_dupe=0
+ for squid_cleanup_tmp2 in $squid_cleanup_tmp_outlist
+ do
+ if test "$squid_cleanup_tmp" = "$squid_cleanup_tmp2"; then
+ squid_cleanup_tmp_dupe=1
+ break
+ fi
+ done
+ if test $squid_cleanup_tmp_dupe -eq 0; then
+ squid_cleanup_tmp_outlist="${squid_cleanup_tmp_outlist} $squid_cleanup_tmp"
+ fi
+done
+$1=$squid_cleanup_tmp_outlist
+unset squid_cleanup_tmp_outlist
+unset squid_cleanup_tmp_dupe
+unset squid_cleanup_tmp2
+unset squid_cleanup_tmp
+])
+
+dnl check that all the modules supplied as a whitespace-separated list (second
+dnl argument) exist as members of the basedir passed as first argument
+dnl call AC_MESG_ERROR if any module does not
+AC_DEFUN([SQUID_CHECK_EXISTING_MODULES],[
+ for squid_module_check_exist_tmp in $2
+ do
+ if ! test -d $1/$squid_module_check_exist_tmp
+ then
+ AC_MSG_ERROR([$squid_module_check_exist_tmp not found in $1])
+ fi
+ done
+])
AC_MSG_NOTICE([With dl])
fi
+AC_MSG_CHECKING([for DiskIO modules to be enabled])
squid_disk_module_candidates=""
squid_opt_enable_diskio=auto #values: 0(no), 1(yes), "auto"(=yes+detect modules)
AC_ARG_ENABLE(disk-io,
*)
squid_opt_enable_diskio=1
squid_disk_module_candidates=" `echo $enableval| sed -e 's/,/ /g;s/ */ /g'` "
+ SQUID_CLEANUP_MODULES_LIST([squid_disk_module_candidates])
;;
esac
])
+# if requested to autodetect, find out what we have
if test $squid_opt_enable_diskio = "auto"; then
squid_opt_enable_diskio=1
- AC_MSG_CHECKING([for available DiskIO modules])
SQUID_LOOK_FOR_MODULES([$srcdir/src/DiskIO],[squid_disk_module_candidates])
- AC_MSG_RESULT([$squid_disk_module_candidates])
fi
+
+AC_MSG_RESULT([${squid_disk_module_candidates_output:-none}])
AC_DEFINE_UNQUOTED([USE_DISKIO],[$squid_opt_enable_diskio],
[DiskIO modules are expected to be available.])
DISK_MODULES=
DISK_LINKOBJS=
for module in $squid_disk_module_candidates none; do
+ # maybe not needed
if test "$module" = "none"; then
continue
fi
dnl Check what Storage formats are wanted.
dnl This version will error out with a message saying why if a required DiskIO is missing.
-AC_ARG_ENABLE(storeio,
- AS_HELP_STRING([--enable-storeio="list of modules"],[Build support for the list of store I/O modules.
+squid_opt_enable_diskio=auto
+AC_ARG_ENABLE([storeio],
+ AS_HELP_STRING([--enable-storeio="list of modules"],
+ [Build support for the list of store I/O modules.
The default is only to build the "ufs" module.
See src/fs for a list of available modules, or
Programmers Guide section <not yet written>
for details on how to build your custom store module]),
[ case $enableval in
yes)
- for dir in $srcdir/src/fs/*; do
- module="`basename $dir`"
- if test -d "$dir" && test "$module" != CVS && test "$module" != coss; then
- STORE_MODULES="$STORE_MODULES $module"
- fi
- done
+ squid_opt_enable_diskio=auto
;;
no)
+ squid_opt_enable_diskio=no
;;
*)
- STORE_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
+ squid_opt_enable_diskio=yes
+ squid_storeio_module_candidates="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`"
;;
esac
-],
-[ if test -z "$STORE_MODULES"; then
- STORE_MODULES="ufs"
- fi
])
-if test -n "$STORE_MODULES"; then
+if test "$squid_opt_enable_diskio" = "auto"; then
+ squid_opt_enable_diskio=yes
+ AC_MSG_CHECKING([for available StoreIO modules])
+ SQUID_LOOK_FOR_MODULES([$srcdir/src/fs],[squid_storeio_module_candidates])
+ AC_MSG_RESULT([$squid_storeio_module_candidates])
+fi
+
+if test -n "$squid_disk_module_candidates"; then
dnl ensure that all modules a) exist and b) only include once.
- STORE_MODULES_FULL=$STORE_MODULES
- STORE_MODULES=
- for module in $STORE_MODULES_FULL; do
- have_mod=`echo "$STORE_MODULES" | grep "$module"`
+ squid_disk_module_candidates_FULL=$squid_disk_module_candidates
+ squid_disk_module_candidates=
+ for module in $squid_disk_module_candidates_FULL; do
+ have_mod=`echo "$squid_disk_module_candidates" | grep "$module"`
if test "$have_mod" != ""; then
AC_MSG_NOTICE([Removing duplicate $module from storeio])
elif test -d $srcdir/src/fs/$module; then
- STORE_MODULES="$STORE_MODULES $module"
+ squid_disk_module_candidates="$squid_disk_module_candidates $module"
else
AC_MSG_ERROR(storeio $module does not exist)
fi
done
- for module in $STORE_MODULES_FULL; do
+ for module in $squid_disk_module_candidates_FULL; do
case "$module" in
coss)
echo "WARNING: COSS Support is not stable yet in Squid-3. Please do not use."
;;
esac
done
- AC_MSG_NOTICE([Store modules built: $STORE_MODULES])
+ AC_MSG_NOTICE([Store modules built: $squid_disk_module_candidates])
fi
-for fs in $STORE_MODULES none; do
+for fs in $squid_disk_module_candidates none; do
case "$fs" in
diskd)
if ! test "$FOUND_DISKIO_BLOCKING" = "yes" && ! test "$FOUND_DISKIO_DISKDAEMON" = "yes" ; then
if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then
AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs])
- STORE_MODULES="$STORE_MODULES ufs"
+ squid_disk_module_candidates="$squid_disk_module_candidates ufs"
dnl
dnl Automake om MinGW needs explicit exe extension
dnl for STORE_TESTS substition
AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
-dnl got final STORE_MODULES, build library lists
+dnl got final squid_disk_module_candidates, build library lists
dnl This list will not be needed when each fs library has its own Makefile
STORE_LIBS_TO_BUILD=
dnl File system libraries to link executables with.
dnl These are the same as STORE_LIBS_TO_BUILD, but with a path
STORE_LIBS_TO_ADD=
-for fs in $STORE_MODULES; do
+for fs in $squid_disk_module_candidates; do
STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`