File: lightning.m4

package info (click to toggle)
gnu-smalltalk 3.1-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 33,300 kB
  • ctags: 13,999
  • sloc: ansic: 88,106; sh: 23,223; asm: 7,889; perl: 4,493; cpp: 3,539; awk: 1,483; yacc: 1,355; xml: 1,272; makefile: 1,192; lex: 843; sed: 258; objc: 124
file content (64 lines) | stat: -rw-r--r-- 1,960 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
dnl I'd like this to be edited in -*- Autoconf -*- mode...
dnl
# serial 2 LIGHTNING_CONFIGURE_IF_NOT_FOUND
m4_define([LIGHTNING_BACKENDS], [i386:-32 i386:-64 sparc ppc])

AC_DEFUN([LIGHTNING_CONFIGURE_LINKS], [

suffix=
case "$host_cpu" in
  i?86)	   cpu=i386; suffix=-32 ;;
  x86_64)  cpu=i386; suffix=-64 ;;
  sparc*)  cpu=sparc	        ;;
  powerpc) cpu=ppc	        ;;
  *)			        ;;
esac
if test -n "$cpu" && test -d "$srcdir/lightning/$cpu"; then
  $1
  lightning_frag=`cd $srcdir && pwd`/lightning/$cpu/Makefile.frag
  test -f $lightning_frag || lightning_frag=/dev/null

  asm_src=lightning/$cpu/asm.h
  test -f $srcdir/lightning/$cpu/asm$suffix.h && asm_src=lightning/$cpu/asm$suffix.h
  AC_CONFIG_LINKS(lightning/asm.h:$asm_src, [], [asm_src=$asm_src])

  fp_src=lightning/$cpu/fp.h
  test -f $srcdir/lightning/$cpu/fp$suffix.h && fp_src=lightning/$cpu/fp$suffix.h
  AC_CONFIG_LINKS(lightning/fp.h:$fp_src, [], [fp_src=$fp_src])

  core_src=lightning/$cpu/core.h
  test -f $srcdir/lightning/$cpu/core$suffix.h && core_src=lightning/$cpu/core$suffix.h
  AC_CONFIG_LINKS(lightning/core.h:$core_src, [], [core_src=$core_src])

  funcs_src=lightning/$cpu/funcs.h
  test -f $srcdir/lightning/$cpu/funcs$suffix.h && funcs_src=lightning/$cpu/funcs$suffix.h
  AC_CONFIG_LINKS(lightning/funcs.h:$funcs_src, [], [funcs_src=$funcs_src])
else
  $2
  lightning_frag=/dev/null
fi
AC_SUBST_FILE(lightning_frag)

])

AC_DEFUN([LIGHTNING_CONFIGURE_IF_NOT_FOUND], [
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_CHECK_HEADER(lightning.h)
AM_CONDITIONAL(LIGHTNING_MAIN, (exit 1))
AM_CONDITIONAL(HAVE_INSTALLED_LIGHTNING, test "$ac_cv_header_lightning_h" = yes)

lightning=
if test "$ac_cv_header_lightning_h" = yes; then
  lightning=yes
else
  LIGHTNING_CONFIGURE_LINKS(lightning=yes, lightning=no)
fi

AS_IF([test "$lightning" = yes], [
  AC_DEFINE(HAVE_LIGHTNING, 1, [Define if GNU lightning can be used])
  $1
], [$2])
unset lightning

])dnl