I have code that I want to compile on all unix systems, but if -m64 i available and it works, I want the configure script to use it. How do I get autoconf to check to see if -m64 works and, if so, use it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
my_save_cflags="$CFLAGS" CFLAGS=-m64 AC_MSG_CHECKING([whether CC supports -m64]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes])] [AM_CFLAGS=-m64], [AC_MSG_RESULT([no])] ) CFLAGS="$my_save_cflags" AC_SUBST([AM_CFLAGS])Using AM_CFLAGS to add -m64 to the build assumes automake
(or the use of AM_CFLAGS in your own non-automade makefiles.)