~ubuntu-branches/ubuntu/lucid/pitivi/lucid

« back to all changes in this revision

Viewing changes to common/m4/as-objc.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-05-27 14:22:49 UTC
  • mfrom: (1.2.1 upstream) (3.1.13 experimental)
  • Revision ID: james.westby@ubuntu.com-20090527142249-tj0qnkc37320ylml
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
# AC_PROG_OBJC([LIST-OF-COMPILERS])
 
4
#
 
5
AC_DEFUN([AS_PROG_OBJC],
 
6
[
 
7
AC_CHECK_TOOLS(OBJC,
 
8
        [m4_default([$1], [objcc objc gcc cc CC])],
 
9
        none)
 
10
AC_SUBST(OBJC)
 
11
OBJC_LDFLAGS="-lobjc"
 
12
AC_SUBST(OBJC_LDFLAGS)
 
13
if test "x$OBJC" != xnone ; then
 
14
  _AM_DEPENDENCIES(OBJC)
 
15
  AC_MSG_CHECKING([if Objective C compiler works])
 
16
  cat >>conftest.m <<EOF
 
17
#include <objc/Object.h>
 
18
@interface Moo:Object
 
19
{
 
20
}
 
21
- moo;
 
22
int main();
 
23
@end
 
24
 
 
25
@implementation Moo
 
26
- moo
 
27
{
 
28
  exit(0);
 
29
}
 
30
 
 
31
int main()
 
32
{
 
33
  id moo;
 
34
  moo = [[Moo new]];
 
35
  [[moo moo]];
 
36
  return 1;
 
37
}
 
38
@end
 
39
EOF
 
40
  ${OBJC} conftest.m ${OBJC_LDFLAGS} >&5 2>&5
 
41
  if test -f a.out -o -f a.exe ; then
 
42
    result=yes
 
43
  else
 
44
    result=no
 
45
    echo failed program is: >&5
 
46
    cat conftest.m >&5
 
47
  fi
 
48
  rm -f conftest.m a.out a.exe
 
49
  AC_MSG_RESULT([$result])
 
50
else
 
51
  _AM_DEPENDENCIES(OBJC)
 
52
fi
 
53
 
 
54
])
 
55
 
 
56