upc3.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #! /bin/sh
  2. # Copyright (C) 2006-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Test that C and Unified Parallel C link safely.
  17. . test-init.sh
  18. cat >> configure.ac << 'END'
  19. AC_PROG_CC
  20. AM_PROG_UPC
  21. AC_OUTPUT
  22. END
  23. cat > hello.upc << 'END'
  24. #include <stdio.h>
  25. #include <upc.h>
  26. #include "message.h"
  27. int
  28. main (void)
  29. {
  30. printf ("Thread %d says, '%s'\n", MYTHREAD, message());
  31. return 0;
  32. }
  33. END
  34. cat > message.h << 'END'
  35. const char *message (void);
  36. END
  37. cat > mix.c << 'END'
  38. #include "message.h"
  39. const char *
  40. message (void)
  41. {
  42. return "Hello.";
  43. }
  44. END
  45. cat > Makefile.am << 'END'
  46. bin_PROGRAMS = hello
  47. hello_SOURCES = hello.upc mix.c message.h
  48. hello_LDADD = -lm
  49. END
  50. $ACLOCAL
  51. $AUTOMAKE
  52. $AUTOCONF
  53. ./configure || exit $?
  54. $MAKE distcheck
  55. :