depend.m4 1.8 KB

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