s48_osx_arch_check.m4 709 B

123456789101112131415161718192021222324252627
  1. ### s48_osx_arch_check.m4 --- S48_OSX_ARCH_CHECK macro -*- Autoconf -*-
  2. # serial 1
  3. dnl
  4. dnl
  5. dnl Tests if it can compile and link with "-arch"-Flag on MacOSX,
  6. dnl keeps the "-arch"-Flag in the CFLAGS and LDFLAGS if test is
  7. dnl successfull.
  8. AC_DEFUN([S48_OSX_ARCH_CHECK], [dnl
  9. AC_MSG_CHECKING([for gcc argument $1])
  10. save_CFLAGS="$CFLAGS"
  11. save_LDFLAGS="$LDFLAGS"
  12. CFLAGS="$CFLAGS -arch $1"
  13. LDFLAGS="$LDFLAGS -arch $1"
  14. compiles=0
  15. links=0
  16. AC_TRY_COMPILE([],[],compiles=1, compiles=0)
  17. AC_TRY_LINK([],[],links=1, links=0)
  18. if test "$links" = "1" -a "$compiles" = "1"; then
  19. AC_MSG_RESULT([OK])
  20. else
  21. CFLAGS="$save_CFLAGS"
  22. LDFLAGS="$save_LDFLAGS"
  23. AC_MSG_RESULT([failed])
  24. fi
  25. ])
  26. ### s48_osx_arch_check.m4 ends here