|
|
@@ -164,12 +164,9 @@ Commands:
|
|
|
add Add a module to the list of active eggdrop modules.
|
|
|
del Remove a module from that list.
|
|
|
clear Clear the list.
|
|
|
- static.h Create \`src/mod/static.h'.
|
|
|
- Makefile Create \`src/mod/Makefile'.
|
|
|
configure Interactively select modules.
|
|
|
is-configured Exits 0/1 depending on wether modules where
|
|
|
configured or not.
|
|
|
- update-depends Check all module dependencies and add modules missing.
|
|
|
help Displays this information.
|
|
|
detect-modules Find all available modules.
|
|
|
modules-still-exist Check wether all known modules still exist.
|
|
|
@@ -283,107 +280,6 @@ xdetect-modules)
|
|
|
|
|
|
echo " done." >&6
|
|
|
;;
|
|
|
-xMakefile)
|
|
|
-#
|
|
|
-# Build `src/mod/Makefile'
|
|
|
-#
|
|
|
-
|
|
|
- echo ${mc_n} "building ${mc_fMakefile}... ${mc_c}" 1>&6
|
|
|
-
|
|
|
- # Check for selected modules
|
|
|
- if test -r ${mc_fmodules}; then
|
|
|
- # Convert newlines to spaces.
|
|
|
- mc_sel_modules=`cat ${mc_fmodules} | \
|
|
|
- awk '{ printf("%s ", $0); }'`
|
|
|
- else
|
|
|
- echo "${mc_pn}: error: no modules selected. You did not run \`make config' yet." 1>&2;
|
|
|
- exit 1
|
|
|
- fi
|
|
|
-
|
|
|
- mc_mod_objs=`echo ${mc_sel_modules} | sed -e 's/\.mod/.mod_o/g'`
|
|
|
-
|
|
|
- if test ! -f ${mc_fMakefile}; then
|
|
|
- echo "failed." 1>&6
|
|
|
- echo "${mc_pn}: error: make file template not found." 1>&2
|
|
|
- exit 1
|
|
|
- fi
|
|
|
-
|
|
|
- # The following sed expression modifies src/mod/Makefile to
|
|
|
- # hold the new module names.
|
|
|
- if (cat "${mc_fMakefile}" | \
|
|
|
- sed -e "s/^\(mods =\).*$/\1 ${mc_sel_modules}/g" \
|
|
|
- -e "s/^\(mod_objs =\).*$/\1 ${mc_mod_objs}/g" \
|
|
|
- 1> "${mc_fMakefile}_new"); then
|
|
|
- mv "${mc_fMakefile}_new" "${mc_fMakefile}"
|
|
|
- else
|
|
|
- echo "failed." 1>&6
|
|
|
- echo "${mc_pn}: sed failed to build ${mc_fMakefile}." 1>&2
|
|
|
- exit 1
|
|
|
- fi
|
|
|
-
|
|
|
- echo "done." 1>&6
|
|
|
-;;
|
|
|
-xstatic.h)
|
|
|
-#
|
|
|
-# Build `static.h'
|
|
|
-#
|
|
|
-
|
|
|
- echo ${mc_n} "building static.h..." 1>&6
|
|
|
-
|
|
|
- # Check for selected modules
|
|
|
- if test ! -r ${mc_fmodules}; then
|
|
|
- echo " failed." 1>&6
|
|
|
- echo "${mc_pn}: error: no modules selected. You did not run \`make config' yet." 1>&2;
|
|
|
- exit 1
|
|
|
- fi
|
|
|
- mc_sel_modules=`cat ${mc_fmodules} | sed -e 's/\.mod//g'`
|
|
|
-
|
|
|
-
|
|
|
- # Note: All data is written to `src/mod/static.h' which is
|
|
|
- # later included into `src/main.c'.
|
|
|
-
|
|
|
- # Remove old static.h
|
|
|
- rm -f ${mc_fstatic_h}
|
|
|
-
|
|
|
- # Header
|
|
|
- cat 1>> ${mc_fstatic_h} << EOF
|
|
|
-/* src/mod/static.h -- header file for static compiles.
|
|
|
- *
|
|
|
- * NOTE: Do not edit directly. Instead, re-run \`make config'.
|
|
|
- */
|
|
|
-
|
|
|
-#ifndef _EGG_MOD_STATIC_H
|
|
|
-#define _EGG_MOD_STATIC_H
|
|
|
-
|
|
|
-EOF
|
|
|
-
|
|
|
- # Create declarations for module _start functions
|
|
|
- for mc_mod in ${mc_sel_modules}; do
|
|
|
- echo ${mc_n} ".${mc_c}" 1>&6
|
|
|
-if test ${mc_mod} = "server" || test ${mc_mod} = "irc";then echo "#ifdef LEAF" 1>> ${mc_fstatic_h};fi
|
|
|
- echo "char *${mc_mod}_start();" 1>> ${mc_fstatic_h}
|
|
|
-if test ${mc_mod} = "server" || test ${mc_mod} = "irc";then echo "#endif" 1>> ${mc_fstatic_h};fi
|
|
|
-
|
|
|
- done
|
|
|
- echo 1>> ${mc_fstatic_h}
|
|
|
-
|
|
|
- # The link_statics() function ...
|
|
|
- echo "static void link_statics()" 1>> ${mc_fstatic_h}
|
|
|
- echo "{" 1>> ${mc_fstatic_h}
|
|
|
- for mc_mod in ${mc_sel_modules}; do
|
|
|
-if test ${mc_mod} = "server" || test ${mc_mod} = "irc";then echo "#ifdef LEAF" 1>> ${mc_fstatic_h};fi
|
|
|
- echo " check_static(\"${mc_mod}\", ${mc_mod}_start);" 1>> ${mc_fstatic_h}
|
|
|
-if test ${mc_mod} = "server" || test ${mc_mod} = "irc";then echo "#endif" 1>> ${mc_fstatic_h};fi
|
|
|
-
|
|
|
- done
|
|
|
- cat 1>> ${mc_fstatic_h} << EOF
|
|
|
-}
|
|
|
-
|
|
|
-#endif /* _EGG_MOD_STATIC_H */
|
|
|
-EOF
|
|
|
-
|
|
|
- echo " done." 1>&6
|
|
|
-;;
|
|
|
xdel)
|
|
|
#
|
|
|
# Remove a module from the list
|
|
|
@@ -490,97 +386,6 @@ xclear)
|
|
|
rm -f ${mc_fmodules}
|
|
|
touch ${mc_fmodules}
|
|
|
;;
|
|
|
-xupdate-depends)
|
|
|
-#
|
|
|
-# Check the dependencies and add modules which are depended on, but
|
|
|
-# aren't enabled.
|
|
|
-#
|
|
|
-
|
|
|
- mc_all_depends=
|
|
|
- mc_missing=
|
|
|
-
|
|
|
- echo ${mc_n} "calculating dependencies...${mc_c}" 1>&6
|
|
|
-
|
|
|
- # Check for selected modules
|
|
|
- if test ! -r ${mc_fmodules}; then
|
|
|
- echo " failed." 1>&6
|
|
|
- echo "${mc_pn}: error: no modules selected. You did not run configure yet." 1>&2
|
|
|
- exit 1
|
|
|
- fi
|
|
|
- mc_sel_modules=`cat ${mc_fmodules}`
|
|
|
-
|
|
|
- mc_new_mods="${mc_sel_modules}"
|
|
|
- while (test "x${mc_new_mods}" != x); do
|
|
|
- mc_mod_list="${mc_new_mods}"
|
|
|
- mc_new_mods=
|
|
|
-
|
|
|
- # Go through every module in the list
|
|
|
- for mc_mod in ${mc_mod_list}; do
|
|
|
- echo ${mc_n} ".${mc_c}" 1>&6
|
|
|
-
|
|
|
- # We have an info file, don't we?
|
|
|
- if (test ! -f ${mc_mod_dir}/${mc_mod}/modinfo); then
|
|
|
- continue
|
|
|
- fi
|
|
|
-
|
|
|
- # Figure out the module's dependencies
|
|
|
- mc_mod_depends=`grep "^DEPENDS:" ${mc_mod_dir}/${mc_mod}/modinfo | sed -e 's/^DEPENDS://'`
|
|
|
-
|
|
|
- # Check wether the dependencies are fulfilled
|
|
|
- for mc_m_depend in ${mc_mod_depends}; do
|
|
|
- if (echo ${mc_sel_modules} | \
|
|
|
- grep " ${mc_m_depend}" 1>&7 2>&7) || \
|
|
|
- (echo ${mc_sel_modules} | \
|
|
|
- grep "^${mc_m_depend}" 1>&7 2>&7)
|
|
|
- then
|
|
|
- :
|
|
|
- else
|
|
|
- # Does the module actually exist?
|
|
|
- if test ! -d ${mc_mod_dir}/${mc_m_depend}.mod
|
|
|
- then
|
|
|
- mc_missing="${mc_missing} ${mc_m_depend}"
|
|
|
- continue
|
|
|
- fi
|
|
|
-
|
|
|
- # This one is missing. Add it to the
|
|
|
- # list.
|
|
|
- mc_all_depends="${mc_all_depends} ${mc_m_depend}"
|
|
|
- mc_sel_modules="${mc_sel_modules} ${mc_m_depend}"
|
|
|
-
|
|
|
- # Add to list of modules to check in
|
|
|
- # next dependency cycle.
|
|
|
- mc_new_mods="${mc_new_mods} ${mc_m_depend}.mod"
|
|
|
- fi
|
|
|
- done
|
|
|
- done
|
|
|
- done
|
|
|
- echo " done." 1>&6
|
|
|
-
|
|
|
- # Warn about missing modules.
|
|
|
- if test "x${mc_missing}" != x; then
|
|
|
- cat 1>&2 <<EOF
|
|
|
-${mc_pn}: warning:
|
|
|
-
|
|
|
- The following modules were not found but are needed:
|
|
|
-
|
|
|
- `echo ${mc_missing} | sed -e 's/ /, /g'`
|
|
|
-
|
|
|
-EOF
|
|
|
- echo ${mc_n} "Press enter to continue... ${mc_c}"
|
|
|
- read mc_ask_response
|
|
|
- fi
|
|
|
-
|
|
|
- if test "x${mc_all_depends}" != x; then
|
|
|
- echo ${mc_n} "adding modules needed to match dependencies... ${mc_c}" 1>&6
|
|
|
- echo ${mc_all_depends} | sed -e 's/ /, /g' 1>&6
|
|
|
-
|
|
|
- # Add the modules
|
|
|
- ${mc_self_call} -q add ${mc_all_depends}
|
|
|
-
|
|
|
- # Update the makefile
|
|
|
- ${mc_self_call} -q Makefile
|
|
|
- fi
|
|
|
-;;
|
|
|
xconfigure)
|
|
|
#
|
|
|
# Interactive module selection
|