depend.m4 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # DO_DEPS
  2. # ------------------------------
  3. dnl EGG_CHECK_DEPMODE()
  4. dnl
  5. AC_DEFUN(EGG_CHECK_DEPMODE, [dnl
  6. CCDEPMODE=gcc
  7. num=`$CC -dumpversion | sed "s/^\\\(.\\\).*/\\\1/"`
  8. if test $num = "3"; then
  9. CCDEPMODE=gcc3
  10. fi
  11. AC_SUBST(CCDEPMODE)dnl
  12. ])dnl
  13. AC_DEFUN([DO_DEPS],
  14. [
  15. files="src/Makefile.in src/compat/Makefile.in src/crypto/Makefile.in src/mod/channels.mod/Makefile src/mod/compress.mod/Makefile src/mod/console.mod/Makefile src/mod/ctcp.mod/Makefile src/mod/dns.mod/Makefile.in src/mod/irc.mod/Makefile src/mod/notes.mod/Makefile src/mod/server.mod/Makefile src/mod/share.mod/Makefile src/mod/transfer.mod/Makefile src/mod/update.mod/Makefile"
  16. for mf in $files; do
  17. # Strip MF so we end up with the name of the file.
  18. # echo "MF: $mf"
  19. mf=`echo "$mf" | sed -e 's/:.*$//'`
  20. dirpart=`AS_DIRNAME("$mf")`
  21. # echo "dirpart: $dirpart mf: $mf"
  22. # rm -rf "$dirpart/.deps/"
  23. rm -f "$dirpart/.deps/includes"
  24. test -d "$dirpart/.deps" || mkdir "$dirpart/.deps"
  25. for file in `sed -n -e '
  26. /^OBJS = .*\\\\$/ {
  27. s/^OBJS = //
  28. :loop
  29. s/\\\\$//
  30. p
  31. n
  32. /\\\\$/ b loop
  33. p
  34. }
  35. /^OBJS = / s/^OBJS = //p' < "$mf"`;
  36. do
  37. base=`basename $file .o`
  38. test -f "$dirpart/$base.c" || continue
  39. if ! test -f "$dirpart/.deps/$base.Po"; then
  40. echo '# dummy' > "$dirpart/.deps/$base.Po"
  41. #Remove the .o file, because it needs to be recompiled for its dependancies.
  42. if test -f "$dirpart/$base.o"; then
  43. rm -f "$dirpart/$base.o"
  44. fi
  45. fi
  46. echo "include .deps/$base.Po" >> "$dirpart/.deps/includes"
  47. echo "_$base.c:" >> "$dirpart/.deps/includes"
  48. done
  49. done
  50. ])# DO_DEPS