summaryrefslogtreecommitdiff
path: root/lib/make/aclocal.m4
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-12 14:46:30 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-05-12 14:46:30 +0000
commita54a7e15d90d2a52a0d1df36db0c18b70df54073 (patch)
treea64ce08b988fc40ce16d4df8b6621bce7841158f /lib/make/aclocal.m4
parentb7d3f2b9e7597a728a317b98d205be822ce5304a (diff)
Preliminary support for cross-compilation.
Setting BUILD=, or HOST=, or TARGET= will pass --build=, ... to the configure process. If cross compiling you need to set ENDIAN - either big or little SIZEOF_LONG_INT SIZEOF_INT SIZEOF_SHORT_INT SIZEOF_LONG_DOUBLE SIZEOF_DOUBLE SIZEOF_SHORT SIZEOF_POINTER otherwise you'll get an error. You may also set NULL_DEVICE to tell it the location of the null device. If you don't set this you'll just get a warning, and it will default to /dev/null. This is weakly tested, as I am limited in what I can cross compile for. Fixed semantics for DEBUG to be as in previous commit, except DEBUG=DEFINES define CCTK_DEBUG and not DEBUG in the header files. Partially dealt with PR 340 -- -g -O2 no longer automatically appear as the compilation flags. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1652 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/aclocal.m4')
-rw-r--r--lib/make/aclocal.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4
index 82f2b805..8e03db08 100644
--- a/lib/make/aclocal.m4
+++ b/lib/make/aclocal.m4
@@ -147,3 +147,32 @@ fi
fi
)dnl
+AC_DEFUN(CCTK_PROG_CC_WORKS,
+[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_COMPILER([main(){return(0);} PilotMain(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
+AC_LANG_RESTORE
+AC_MSG_RESULT($ac_cv_prog_cc_works)
+if test $ac_cv_prog_cc_works = no; then
+ AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.])
+fi
+AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler])
+AC_MSG_RESULT($ac_cv_prog_cc_cross)
+cross_compiling=$ac_cv_prog_cc_cross
+])
+
+AC_DEFUN(CCTK_PROG_CXX_WORKS,
+[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILER([int main(){return(0);} extern "C" int PilotMain(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
+AC_LANG_RESTORE
+AC_MSG_RESULT($ac_cv_prog_cxx_works)
+if test $ac_cv_prog_cxx_works = no; then
+ AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.])
+fi
+AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler])
+AC_MSG_RESULT($ac_cv_prog_cxx_cross)
+cross_compiling=$ac_cv_prog_cxx_cross
+])