X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;h=5f358087509badc11851f87b11d204e2853631cc;hb=0498114186f126d786cc0f3cf6686a43b8513e62;hp=6fc3085c031e29db893a02746899c545a6aa8d29;hpb=480a0746507ce73d26f528b56dc3ed80195096e0;p=pspp-builds.git diff --git a/acinclude.m4 b/acinclude.m4 index 6fc3085c..5f358087 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -63,10 +63,10 @@ AC_DEFUN([PSPP_OFF_T], `--disable-largefile' or `CFLAGS=-ansi'.])]) ]) -dnl Check whether a warning flag is accepted. +dnl Check whether a C compiler option is accepted. dnl If so, add it to CFLAGS. -dnl Example: PSPP_ENABLE_WARNING(-Wdeclaration-after-statement) -AC_DEFUN([PSPP_ENABLE_WARNING], +dnl Example: PSPP_ENABLE_OPTION(-Wdeclaration-after-statement) +AC_DEFUN([PSPP_ENABLE_OPTION], [ m4_define([pspp_cv_name], [pspp_cv_[]m4_translit([$1], [-], [_])])dnl AC_CACHE_CHECK([whether $CC accepts $1], [pspp_cv_name], @@ -150,4 +150,39 @@ AC_DEFUN([PSPP_READLINE], AC_SUBST(LTLIBREADLINE) ]) +dnl Check for build tools. Adapted from bfd library. + +AC_DEFUN([PSPP_CC_FOR_BUILD], +[# Put a plausible default for CC_FOR_BUILD in Makefile. +if test -z "$CC_FOR_BUILD"; then + if test "x$cross_compiling" = "xno"; then + CC_FOR_BUILD='$(CC)' + else + CC_FOR_BUILD=cc + fi +fi +AC_SUBST(CC_FOR_BUILD) +# Also set EXEEXT_FOR_BUILD. +if test "x$cross_compiling" = "xno"; then + EXEEXT_FOR_BUILD='$(EXEEXT)' +else + AC_CACHE_CHECK([for build system executable suffix], pspp_cv_build_exeext, + [rm -f conftest* + echo 'int main () { return 0; }' > conftest.c + pspp_cv_build_exeext= + ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 + for file in conftest.*; do + case $file in # ( + *.c | *.o | *.obj | *.ilk | *.pdb) ;; # ( + *) pspp_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + rm -f conftest* + test x"${pspp_cv_build_exeext}" = x && pspp_cv_build_exeext=no]) + EXEEXT_FOR_BUILD="" + test x"${pspp_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${pspp_cv_build_exeex +t} +fi +AC_SUBST(EXEEXT_FOR_BUILD)]) + dnl aclocal.m4 ends here