/[cvs]/eggdrop1.9/misc/modconfig
ViewVC logotype

Contents of /eggdrop1.9/misc/modconfig

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.8 - (show annotations) (download)
Wed Oct 10 01:20:09 2001 UTC (17 years, 6 months ago) by ite
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
* Refactored the tree (especially src/modules.c) to use the libltdl
  wrapper. Modules are configured to be lt_dlopened or dl_preopened (if
  the system doesn't support shared libraries).
* Should compile modules on more SunOs environments and on Beos too.
* Libtoolized the package: modules and internal libraries build system
  more protable than ever.
* Wiped out old makefiles in favour of automake and Makefile.am's
  files.
* Misc cleanups.
* Updated bootstrap script
* Moved doc/AUTHORS to ./AUTHORS
* Updated config.guess and config.sub
* Changed misc/ to ./ temporairly
* Got rid of misc/modconfig, and more in general of the old module
  configuration stuff, in favor of an incoming ./configure parametrized
  choice.
* Moved configure macros from aclocal.m4 to acinclude.m4 since aclocal.m4
  is now generated by aclocal on bootstrap.
* Removed no more necessary macros like EGG_EXEEXT because of
  libltdl+automake power ;P
* Removed EGG_CHECK_LIBSAFE_SSCANF macro that wasn't necessary anymore
  after gettext support.
* Added preliminary EGG_DEBUG_OPTIONS macro.
* Heavily stripped EGG_CHECK_OS macro and got rid of some system
  specific defines that were dead because of libltdl.
* Updated .cvsignore files.
* Improved make dist target.
* make static is gone in favor of ./configure --disable-shared.
* make debug is gone in favor of future ./configure --with-debug
  options.
* Others targets are gone in favor of more GNU standard targets.
* Updated po/eggdrop.pot.
# Egglib is now compiled and linked in the core.
* Moved compress.mod's specific configure macros to the top configure script.
* Switched to gettext 0.10.40 and pre-gettextized the devel tree.

1 #! /bin/sh
2 #
3 # modconfig
4 #
5 # Copyright (C) 2000, 2001 Eggheads Development Team
6 # Written by Fabian Knittel
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 # $Id: modconfig,v 1.7 2001/07/09 15:57:04 guppy Exp $
23
24
25 mc_pn=`echo $0 | sed -e 's/^.*\///'`
26 mc_top_srcdir=
27 mc_srcdir=
28 mc_bindir=.
29
30 mc_flag_quiet=no
31 mc_flag_onlynew=no
32
33
34 # Read options
35 while true; do
36 case ${1} in
37 --top_srcdir=*)
38 mc_top_srcdir=`echo ${1} | sed -e 's/^--top_srcdir=//'`
39 ;;
40 --top_srcdir)
41 shift
42 mc_top_srcdir=${1}
43 ;;
44 --srcdir=*)
45 mc_srcdir=`echo ${1} | sed -e 's/^--srcdir=//'`
46 ;;
47 --srcdir)
48 shift
49 mc_srcdir=${1}
50 ;;
51 --bindir=*)
52 mc_bindir=`echo ${1} | sed -e 's/^--bindir=//'`
53 ;;
54 --bindir)
55 shift
56 mc_bindir=${1}
57 ;;
58 --quiet|-q)
59 mc_flag_quiet=yes
60 ;;
61 --only-new|-n)
62 mc_flag_onlynew=yes
63 ;;
64 --*)
65 echo "${mc_pn}: warning: unknown option \`${1}'." 2>&1
66 ;;
67 *)
68 # Non-option parameter.
69 break
70 ;;
71 esac
72
73 # Break out of loop if there are no more arguments to process.
74 if shift; then
75 :
76 else
77 break;
78 fi
79 done
80
81 # Find srcdir and top_srcdir
82 if test "x${mc_srcdir}" = x; then
83 if test "x${mc_top_srcdir}" != x; then
84 mc_srcdir=${mc_top_srcdir}/src
85 else
86 echo "${mc_pn}: error: could not find src directory." 2>&1
87 exit 1
88 fi
89 fi
90 if test "x${mc_top_srcdir}" = x; then
91 if test "x${mc_srcdir}" != x; then
92 mc_top_srcdir=${mc_srcdir}/..
93 else
94 echo "${mc_pn}: error: could not find top src directory." 2>&1
95 exit 1
96 fi
97 fi
98
99
100 #
101 # Files
102 #
103
104 # List of all selected modules (including the `.mod' at the end)
105 mc_fmodules=${mc_bindir}/.modules
106
107 # List of all modules we have detected so far.
108 mc_fknownmods=${mc_bindir}/.known_modules
109
110 # List of modules disabled by default
111 mc_fdisabledmods=${mc_top_srcdir}/disabled_modules
112
113 mc_mod_dir=${mc_srcdir}/mod
114
115 mc_mod_bin_dir=${mc_bindir}/src/mod
116 mc_fMakefile=${mc_mod_bin_dir}/Makefile
117
118 mc_fstatic_h=${mc_mod_dir}/static.h
119
120
121 # File descriptor usage:
122 # 1 Standard output
123 # 2 Errors
124 #
125 # 6 Misc messages and warnings
126 # 7 Goes to /dev/null
127 exec 7>/dev/null
128 if test "${mc_flag_quiet}" = yes; then
129 exec 6>&7
130 else
131 exec 6>&1
132 fi
133
134 # Detect flags needed to achieve 'echo -n' (originally from GNU autoconf) ...
135 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
136 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
137 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null
138 then
139 mc_n= mc_c='
140 ' mc_t=' '
141 else
142 mc_n=-n mc_c= mc_t=
143 fi
144 else
145 mc_n= mc_c='\c' mc_t=
146 fi
147
148 # This helps us call ourself.
149 mc_self_call="$0 --srcdir=${mc_srcdir} --top_srcdir=${mc_topsrcdir}"
150
151 # Assign parameters
152 mc_cmd=$1
153 if test "x${mc_cmd}" != x; then
154 shift
155 mc_paras=$*
156 fi
157
158 case x${mc_cmd} in
159 xhelp)
160 #
161 # Display help
162 #
163
164 cat 1>&6 <<EOF
165 Usage: ${mc_pn} [OPTIONS] COMMAND
166
167 Commands:
168 add Add a module to the list of active eggdrop modules.
169 del Remove a module from that list.
170 clear Clear the list.
171 static.h Create \`src/mod/static.h'.
172 Makefile Create \`src/mod/Makefile'.
173 configure Interactively select modules.
174 is-configured Exits 0/1 depending on wether modules where
175 configured or not.
176 update-depends Check all module dependencies and add modules missing.
177 help Displays this information.
178 detect-modules Find all available modules.
179 modules-still-exist Check wether all known modules still exist.
180 eggautoconf Recreate the configure scripts in every module dir.
181
182 Options:
183 --top_srcdir=DIR Top directory (At least one of these two
184 --srcdir=DIR Source directory directories MUST be supplied.)
185 --bindir=DIR Binary directory
186 --quiet [-q] Quiet mode. Only show errors.
187
188 Options specific to the \`configure' command:
189
190 --only-new [-n] Only query new modules.
191 EOF
192 ;;
193 xis-configured)
194 #
195 # Determine wether the modules were configured yet.
196 #
197
198 if test -r "${mc_fmodules}"; then
199 exit 0
200 else
201 exit 1
202 fi
203 ;;
204 xmodules-still-exist)
205 #
206 # Check wether all known modules still exist.
207 #
208
209 if ${mc_self_call} -q is-configured; then
210 mc_known_mods=`cat ${mc_fknownmods}`
211
212 echo ${mc_n} "checking for removed modules...${mc_c}" 1>&6
213 # Check wether all known mods still exist
214 for mc_mod in ${mc_known_mods}; do
215 echo ${mc_n} ".${mc_c}" >&6
216 if test ! -d ${mc_mod_dir}/${mc_mod}; then
217 grep -v "^${mc_mod}$" ${mc_fknownmods} > ${mc_fknownmods}_new
218 mv ${mc_fknownmods}_new ${mc_fknownmods}
219 fi
220 done
221 echo " done." 1>&6
222 fi
223 ;;
224 xdetect-modules)
225 #
226 # Detect modules. Active modules will be added to the `.modules' file. The
227 # behaviour changes as soon as `.modules' already exists.
228 #
229
230 echo ${mc_n} "detecting modules...${mc_c}" >&6
231
232 if ${mc_self_call} -q is-configured; then
233 mc_mods_configured=yes
234
235 mv ${mc_fmodules} ${mc_fmodules}_old
236
237 mc_fmodules_old=${mc_fmodules}
238 mc_fmodules=${mc_fmodules}_old
239 else
240 mc_mods_configured=no
241
242 mc_fmodules_old=
243 fi
244
245 mc_mods=`echo ${mc_srcdir}/mod/*.mod | sed -e 's/\.mod//g'`
246 if test "${mc_mods}" = "${mc_srcdir}/mod/*"; then
247 echo "${mc_pn}: error: no modules detected." >&2
248 exit 1
249 fi
250
251 # Add them again.
252 mc_mods=`echo ${mc_mods} | sed -e 's/\.mod//g'`
253 for mc_mod in ${mc_mods}; do
254 mc_mod=`echo ${mc_mod} | sed -e 's/.*\///g'`
255 mc_new_mod_state=disabled
256 echo ${mc_n} ".${mc_c}" >&6
257
258 # Do we have an existing configuration?
259 if (test "${mc_mods_configured}" = yes); then
260 # Is the module active?
261 if (grep "^${mc_mod}.mod\$" ${mc_fmodules} 1>&7 2>&1)
262 then
263 mc_new_mod_state=enabled
264 else
265 # Was it configured before?
266 if (grep "^${mc_mod}.mod\$" ${mc_fknownmods} 1>&7 2>&1); then
267 :
268 else
269 mc_new_mod_state=enabled
270 fi
271 fi
272 else
273 if (sed s/\ //g ${mc_fdisabledmods} 2>&1 | grep "^${mc_mod}\$" 1>&7 2>&1)
274 then
275 :
276 else
277 mc_new_mod_state=enabled
278 fi
279 fi
280 if test "${mc_new_mod_state}" = enabled; then
281 ${mc_self_call} -q add ${mc_mod}
282 else
283 ${mc_self_call} -q del ${mc_mod}
284 fi
285 done
286
287 if test "x${mc_fmodules_old}" != x; then
288 # mc_fmodules actually points to the .modules_old file.
289 rm -f ${mc_fmodules}
290 touch ${mc_fmodules_old}
291 fi
292
293 echo " done." >&6
294 ;;
295 xMakefile)
296 #
297 # Build `src/mod/Makefile'
298 #
299
300 echo ${mc_n} "building ${mc_fMakefile}... ${mc_c}" 1>&6
301
302 # Check for selected modules
303 if test -r ${mc_fmodules}; then
304 # Convert newlines to spaces.
305 mc_sel_modules=`cat ${mc_fmodules} | \
306 awk '{ printf("%s ", $0); }'`
307 else
308 echo "${mc_pn}: error: no modules selected. You did not run \`make config' yet." 1>&2;
309 exit 1
310 fi
311
312 mc_mod_objs=`echo ${mc_sel_modules} | sed -e 's/.mod/.mod_o/g'`
313 mc_mod_libs=`echo ${mc_sel_modules} | sed -e 's/.mod/.mod_so/g'`
314
315 if test ! -f ${mc_fMakefile}; then
316 echo "failed." 1>&6
317 echo "${mc_pn}: error: make file template not found." 1>&2
318 exit 1
319 fi
320
321 # The following sed expression modifies src/mod/Makefile to
322 # hold the new module names.
323 if (cat "${mc_fMakefile}" | \
324 sed -e "s/^\(mods =\).*$/\1 ${mc_sel_modules}/g" \
325 -e "s/^\(mod_objs =\).*$/\1 ${mc_mod_objs}/g" \
326 -e "s/^\(mod_libs =\).*$/\1 ${mc_mod_libs}/g" \
327 1> "${mc_fMakefile}_new"); then
328 mv "${mc_fMakefile}_new" "${mc_fMakefile}"
329 else
330 echo "failed." 1>&6
331 echo "${mc_pn}: sed failed to build ${mc_fMakefile}." 1>&2
332 exit 1
333 fi
334
335 echo "done." 1>&6
336 ;;
337 xstatic.h)
338 #
339 # Build `static.h'
340 #
341
342 echo ${mc_n} "building static.h..." 1>&6
343
344 # Check for selected modules
345 if test ! -r ${mc_fmodules}; then
346 echo " failed." 1>&6
347 echo "${mc_pn}: error: no modules selected. You did not run \`make config' yet." 1>&2;
348 exit 1
349 fi
350 mc_sel_modules=`cat ${mc_fmodules} | sed -e 's/.mod//g'`
351
352
353 # Note: All data is written to `src/mod/static.h' which is
354 # later included into `src/main.c'.
355
356 # Remove old static.h
357 rm -f ${mc_fstatic_h}
358
359 # Header
360 cat 1>> ${mc_fstatic_h} << EOF
361 /* src/mod/static.h -- header file for static compiles.
362 *
363 * NOTE: Do not edit directly. Instead, re-run \`make config'.
364 */
365
366 #ifndef _EGG_MOD_STATIC_H
367 #define _EGG_MOD_STATIC_H
368
369 EOF
370
371 # Create declarations for module _start functions
372 for mc_mod in ${mc_sel_modules}; do
373 echo ${mc_n} ".${mc_c}" 1>&6
374 echo "char *${mc_mod}_start();" 1>> ${mc_fstatic_h}
375 done
376 echo 1>> ${mc_fstatic_h}
377
378 # The link_statics() function ...
379 echo "static void link_statics()" 1>> ${mc_fstatic_h}
380 echo "{" 1>> ${mc_fstatic_h}
381 for mc_mod in ${mc_sel_modules}; do
382 echo " check_static(\"${mc_mod}\", ${mc_mod}_start);" 1>> ${mc_fstatic_h}
383 done
384 cat 1>> ${mc_fstatic_h} << EOF
385 }
386
387 #endif /* _EGG_MOD_STATIC_H */
388 EOF
389
390 echo " done." 1>&6
391 ;;
392 xdel)
393 #
394 # Remove a module from the list
395 #
396
397 if test "x${mc_paras}" = x; then
398 echo "${mc_pn}: error: no modules specified." 2>&1
399 exit 1
400 fi
401
402 mc_nfmodules="${mc_fmodules}_new"
403
404 # Remove trailing `.mod'
405 mc_mods=`echo ${mc_paras} | sed -e 's/.mod//g'`
406 for mc_mod in ${mc_mods}; do
407 # Remove any path information
408 mc_mod=`echo ${mc_mod} | sed -e 's/.*\///'`
409 echo "${mc_pn}: disabling eggdrop module: ${mc_mod}" 1>&6
410
411 # Add module to the list of known modules.
412 if grep "^${mc_mod}.mod$" ${mc_fknownmods} 1>&7 2>&7; then
413 if test ! -d ${mc_mod_dir}/${mc_mod}.mod; then
414 grep -v "^${mc_mod}.mod$" ${mc_fknownmods} \
415 > ${mc_fknownmods}_new
416 mv ${mc_fknownmods}_new ${mc_fknownmods}
417 fi
418 else
419 if test ! -d ${mc_mod_dir}/${mc_mod}.mod; then
420 :
421 else
422 echo ${mc_mod}.mod 1>> ${mc_fknownmods}
423 fi
424 fi
425
426 # In case there are any active modules ...
427 if test -r ${mc_fmodules}; then
428 # Remove module from list of active modules.
429 if grep -v "^${mc_mod}.mod$" ${mc_fmodules} \
430 1> ${mc_nfmodules}
431 then
432 :
433 else
434 echo "${mc_pn}: error: building new module file failed" 1>&2
435 echo "grepping for ${mc_mod}.mod in ${mc_fmodules} and writing to ${mc_nfmodules}"
436 kill -STOP $$
437 exit 1
438 fi
439 mv ${mc_nfmodules} ${mc_fmodules}
440 fi
441 done
442 ;;
443 xadd)
444 #
445 # Add a module to the list
446 #
447
448 if test "x${mc_paras}" = x; then
449 echo "${mc_pn}: error: no modules specified." 2>&1
450 exit 1
451 fi
452
453 # Remove trailing `.mod'
454 mc_mods=`echo ${mc_paras} | sed -e 's/.mod//g'`
455 for mc_mod in ${mc_mods}; do
456 # Remove any path information
457 mc_mod=`echo ${mc_mod} | sed -e 's/.*\///'`
458
459 # Add module to the list of known modules.
460 if grep "^${mc_mod}.mod$" ${mc_fknownmods} 1>&7 2>&7; then
461 if test ! -d ${mc_mod_dir}/${mc_mod}.mod; then
462 grep -v "^${mc_mod}.mod$" ${mc_fknownmods} \
463 > ${mc_fknownmods}_new
464 mv ${mc_fknownmods}_new ${mc_fknownmods}
465 fi
466 else
467 if test ! -d ${mc_mod_dir}/${mc_mod}.mod; then
468 :
469 else
470 echo ${mc_mod}.mod 1>> ${mc_fknownmods}
471 fi
472 fi
473
474 # Add module to the list of active modules.
475 if grep "^${mc_mod}.mod$" ${mc_fmodules} 1>&7 2>&7; then
476 :
477 else
478 if test ! -d ${mc_mod_dir}/${mc_mod}.mod; then
479 echo "${mc_pn}: warning: module does not exist: \`${mc_mod}', ignoring." 1>&2
480 else
481 echo "${mc_pn}: enabling eggdrop module: ${mc_mod}" 1>&6
482
483 # Add it to the file
484 echo ${mc_mod}.mod 1>> ${mc_fmodules}
485 fi
486 fi
487 done
488 ;;
489 xclear)
490 #
491 # Clear list of modules
492 #
493
494 echo "${mc_pn}: cleared list of eggdrop modules." 1>&6
495 rm -f ${mc_fmodules}
496 touch ${mc_fmodules}
497 ;;
498 xupdate-depends)
499 #
500 # Check the dependencies and add modules which are depended on, but
501 # aren't enabled.
502 #
503
504 mc_all_depends=
505 mc_missing=
506
507 echo ${mc_n} "calculating dependencies...${mc_c}" 1>&6
508
509 # Check for selected modules
510 if test ! -r ${mc_fmodules}; then
511 echo " failed." 1>&6
512 echo "${mc_pn}: error: no modules selected. You did not run configure yet." 1>&2
513 exit 1
514 fi
515 mc_sel_modules=`cat ${mc_fmodules}`
516
517 mc_new_mods="${mc_sel_modules}"
518 while (test "x${mc_new_mods}" != x); do
519 mc_mod_list="${mc_new_mods}"
520 mc_new_mods=
521
522 # Go through every module in the list
523 for mc_mod in ${mc_mod_list}; do
524 echo ${mc_n} ".${mc_c}" 1>&6
525
526 # We have an info file, don't we?
527 if (test ! -f ${mc_mod_dir}/${mc_mod}/modinfo); then
528 continue
529 fi
530
531 # Figure out the module's dependencies
532 mc_mod_depends=`grep "^DEPENDS:" ${mc_mod_dir}/${mc_mod}/modinfo | sed -e 's/^DEPENDS://'`
533
534 # Check wether the dependencies are fulfilled
535 for mc_m_depend in ${mc_mod_depends}; do
536 if ((echo ${mc_sel_modules} | \
537 grep " ${mc_m_depend}" 1>&7 2>&7) || \
538 (echo ${mc_sel_modules} | \
539 grep "^${mc_m_depend}" 1>&7 2>&7))
540 then
541 :
542 else
543 # Does the module actually exist?
544 if test ! -d ${mc_mod_dir}/${mc_m_depend}.mod
545 then
546 mc_missing="${mc_missing} ${mc_m_depend}"
547 continue
548 fi
549
550 # This one is missing. Add it to the
551 # list.
552 mc_all_depends="${mc_all_depends} ${mc_m_depend}"
553 mc_sel_modules="${mc_sel_modules} ${mc_m_depend}"
554
555 # Add to list of modules to check in
556 # next dependency cycle.
557 mc_new_mods="${mc_new_mods} ${mc_m_depend}.mod"
558 fi
559 done
560 done
561 done
562 echo " done." 1>&6
563
564 # Warn about missing modules.
565 if test "x${mc_missing}" != x; then
566 cat 1>&2 <<EOF
567 ${mc_pn}: warning:
568
569 The following modules were not found but are needed:
570
571 `echo ${mc_missing} | sed -e 's/ /, /g'`
572
573 EOF
574 echo ${mc_n} "Press enter to continue... ${mc_c}"
575 read mc_ask_response
576 fi
577
578 if test "x${mc_all_depends}" != x; then
579 echo ${mc_n} "adding modules needed to match dependencies... ${mc_c}" 1>&6
580 echo ${mc_all_depends} | sed -e 's/ /, /g' 1>&6
581
582 # Add the modules
583 ${mc_self_call} -q add ${mc_all_depends}
584
585 # Update the makefile
586 ${mc_self_call} -q Makefile
587 fi
588 ;;
589 xconfigure)
590 #
591 # Interactive module selection
592 #
593
594 cat 1>&6 <<EOF
595
596 -*- Eggdrop Interactive Module Selection -*-
597
598 EOF
599
600 # Check for selected modules
601 if test ! -r ${mc_fmodules}; then
602 echo "${mc_pn}: error: no modules selected. You did not run configure yet." 1>&2
603 exit 1
604 fi
605
606 # Read current list
607 mc_sel_modules=`cat ${mc_fmodules}`
608
609 # Detect available modules
610 mc_mods=`echo ${mc_mod_dir}/*.mod`
611
612 # Error out if we have no available modules
613 if test "${mc_mods}" = "echo ${mc_mod_dir}/*.mod"; then
614 echo "${mc_pn}: error: no modules found." 1>&2
615 exit 1
616 fi
617
618 # Loop through each available module
619 for mc_mod in ${mc_mods}; do
620 # Remove directory information from name
621 mc_mod=`echo ${mc_mod} | sed -e 's/.*\///'`
622
623 # Only ask for new modules?
624 if test "${mc_flag_onlynew}" = yes; then
625 # Did we already query for that module?
626 if grep "^${mc_mod}$" ${mc_fknownmods} 1>&7 2>&7; then
627 continue
628 fi
629 fi
630
631 # Remove .mod ending
632 mc_modname=`echo ${mc_mod} | sed -e 's/.mod//g'`
633
634 # Note: We need to make sure that we only catch module names
635 # that match _exactly_. e.g. don't mix bseen and seen.
636 if ((echo ${mc_sel_modules} | grep " ${mc_mod}" 1>&7 2>&7) ||
637 (echo ${mc_sel_modules} | grep "^${mc_mod}" 1>&7 2>&7))
638 then
639 # The module is selected.
640 mc_mstate="enabled"
641 mc_mdisp="(E)nable / (d)isable [E/d]"
642 else
643 # The module is NOT selected.
644 mc_mstate="disabled"
645 mc_mdisp="(e)nable / (D)isable [e/D]"
646 fi
647
648 # Display description
649 if test -r ${mc_mod_dir}/${mc_mod}/modinfo; then
650 echo "" 1>&6
651 grep "^DESC:" ${mc_mod_dir}/${mc_mod}/modinfo | \
652 sed -e 's/^DESC:/ /' 1>&6
653 echo "" 1>&6
654 fi
655
656 while true; do
657 echo ${mc_n} "\`${mc_modname}' is ${mc_mstate}, ${mc_mdisp} ${mc_c}" 1>&6
658 read mc_ask_response;
659
660 if (test "${mc_ask_response}" = D); then
661 mc_ask_response=d;
662 fi
663 if (test "${mc_ask_response}" = E); then
664 mc_ask_response=e;
665 fi
666
667 # If the user just presses [return] or
668 # if the selected state matches the old state,
669 # then we change nothing.
670 if ((test "x${mc_ask_response}" = x) || \
671 ((test "${mc_ask_response}" = d) && \
672 (test "${mc_mstate}" = disabled)) || \
673 ((test "${mc_ask_response}" = e) && \
674 (test "${mc_mstate}" = enabled))); then
675 echo "Changing nothing." 1>&6
676 break;
677 fi
678 if (test "${mc_ask_response}" = e); then
679 # Add it to the list.
680 mc_sel_modules="${mc_sel_modules} ${mc_mod}"
681 echo "Enabled module ${mc_modname}." 1>&6
682 break;
683 fi
684 if (test "${mc_ask_response}" = d); then
685 # Remove module from list.
686 mc_sel_modules=`echo ${mc_sel_modules} | sed -e "s/ ${mc_mod}//g" -e "s/^${mc_mod}//g"`
687 echo "Disabled module ${mc_modname}." 1>&6
688 break;
689 fi
690 done
691 echo "" 1>&6
692 done
693
694 echo ${mc_n} "recreating list of active modules... ${mc_c}" 1>&6
695 ${mc_self_call} -q clear
696 if (${mc_self_call} -q add ${mc_sel_modules}); then
697 echo "done." 1>&6
698 else
699 echo "failed!" 1>&6
700 exit 1
701 fi
702 ;;
703 xeggautoconf)
704 #
705 # Recreate the eggdrop specific configure scripts for every module.
706 #
707
708 # Detect available modules
709 mc_mods=`echo ${mc_mod_dir}/*.mod`
710
711 # Error out if we have no available modules
712 if test "${mc_mods}" = "echo ${mc_mod_dir}/*.mod"; then
713 echo "${mc_pn}: error: no modules found." 1>&2
714 exit 1
715 fi
716
717 # Loop through each available module
718 for mc_modd in ${mc_mods}; do
719 # Skip modules without their own configure script.
720 if test ! -r "${mc_modd}/configure.in"; then
721 continue
722 fi
723
724 # Remove directory information from name
725 mc_mod=`echo ${mc_modd} | sed -e 's/.*\///'`
726 echo "creating configure for module \`${mc_mod}'."
727 (cd ${mc_modd} && ../eggautoconf)
728 done
729 ;;
730 *)
731 if test "x${mc_cmd}" = x; then
732 echo "${mc_pn}: error: no command supplied." 1>&2
733 else
734 echo "${mc_pn}: error: ${mc_cmd}: unknown command." 1>&2
735 fi
736 ${mc_self_call} help
737 ;;
738 esac
739
740 exit 0

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23