1
0

depend.m4 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. GCC3="-Wpacked -Wno-unused-parameter -Wmissing-format-attribute -Wdisabled-optimization"
  11. fi
  12. AC_SUBST(CCDEPMODE)dnl
  13. AC_SUBST(GCC3)dnl
  14. ])dnl
  15. AC_DEFUN([DO_DEPS],
  16. [
  17. 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"
  18. for mf in $files; do
  19. # Strip MF so we end up with the name of the file.
  20. # echo "MF: $mf"
  21. mf=`echo "$mf" | sed -e 's/:.*$//'`
  22. dirpart=`AS_DIRNAME("$mf")`
  23. # echo "dirpart: $dirpart mf: $mf"
  24. # rm -rf "$dirpart/.deps/"
  25. rm -f "$dirpart/.deps/includes"
  26. test -d "$dirpart/.deps" || mkdir "$dirpart/.deps"
  27. for file in `sed -n -e '
  28. /^OBJS = .*\\\\$/ {
  29. s/^OBJS = //
  30. :loop
  31. s/\\\\$//
  32. p
  33. n
  34. /\\\\$/ b loop
  35. p
  36. }
  37. /^OBJS = / s/^OBJS = //p' < "$mf"`;
  38. do
  39. base=`basename $file .o`
  40. test -f "$dirpart/$base.c" || continue
  41. if ! test -f "$dirpart/.deps/$base.Po"; then
  42. echo '# dummy' > "$dirpart/.deps/$base.Po"
  43. #Remove the .o file, because it needs to be recompiled for its dependancies.
  44. if test -f "$dirpart/$base.o"; then
  45. rm -f "$dirpart/$base.o"
  46. fi
  47. fi
  48. echo "include .deps/$base.Po" >> "$dirpart/.deps/includes"
  49. echo "_$base.c:" >> "$dirpart/.deps/includes"
  50. done
  51. done
  52. ])# DO_DEPS