-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
96 lines (78 loc) · 2.96 KB
/
configure.ac
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
dnl Hey Emacs, I want this in -*- autoconf -*- mode, please.
dnl Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
dnl Please see COPYING for a description your rights and responsibilities
dnl with this software.
dnl Process this file with autoconf to produce a configure script.
dnl ----------------------------- HOST SYSTEM -----------------------------------
AC_PREREQ(2.54)
AC_INIT([GNU lightning], 1.2c, [email protected], lightning)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux)
AC_CONFIG_SRCDIR([lightning.h])
AC_CANONICAL_TARGET
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH:/sbin)
AC_EXEEXT
BACKENDS="LIGHTNING_BACKENDS"
AC_SUBST(BACKENDS)
case "$target_cpu" in
i?86) LIGHTNING_TARGET=LIGHTNING_I386 ;;
x86_64) LIGHTNING_TARGET=LIGHTNING_X86_64 ;;
sparc*) LIGHTNING_TARGET=LIGHTNING_SPARC ;;
powerpc) LIGHTNING_TARGET=LIGHTNING_PPC ;;
mips64*) LIGHTNING_TARGET=LIGHTNING_MIPS64 ;;
mips*) LIGHTNING_TARGET=LIGHTNING_MIPS ;;
arm*) LIGHTNING_TARGET=LIGHTNING_ARM ;;
*) ;;
esac
LIGHTNING_CONFIGURE_LINKS(
[AC_DEFINE_UNQUOTED(LIGHTNING_TARGET, [AS_TR_CPP([$LIGHTNING_TARGET])],
[Used to pick the appropriate disassembler, for debugging])],
[AC_MSG_ERROR([cpu $target_cpu not supported])])
AC_SUBST(cpu)
AM_CONDITIONAL(LIGHTNING_MAIN, :)
dnl ---------------------------- COMMAND LINE ---------------------------------
AC_ARG_ENABLE( disassembling,
[ --enable-disassembling make the test programs disassemble the code
enabled by default if host != target],
, enable_disassembling=no)
AM_CONDITIONAL(REGRESSION_TESTING, test "$host_cpu" = "$target_cpu")
if test "$host_cpu" != "$target_cpu"; then
AC_DEFINE(LIGHTNING_CROSS, 1,
[Define if test programs should not run the compiled code])
enable_disassembling=yes
fi
if test "$enable_disassembling" != no; then
AC_DEFINE(LIGHTNING_DISASSEMBLE, 1,
[Define if the test programs should disassemble the code they produce])
LIBDISASS="libdisass.a"
else
LIBDISASS=
fi
AM_CONDITIONAL(DISASS, test "$enable_disassembling" != no)
test "$enable_disassembling" != no &&
AC_SUBST(LIBDISASS)
AC_ARG_ENABLE( assertions,
[ --enable-assertions perform internal consistency checks],
, enable_assertions=no)
if test "$enable_assertions" != no; then
AC_DEFINE(_ASM_SAFETY, 1, [Define to enable assertions])
fi
dnl --------------------------- PRODUCE OUTPUT --------------------------------
AC_CONFIG_FILES(Makefile doc/Makefile tests/Makefile opcode/Makefile
lightning/Makefile)
AC_CONFIG_FILES(lightningize, chmod +x lightningize)
AC_CONFIG_SUBDIRS([contrib/check])
AC_OUTPUT
# A small sanity check
echo "#include <stdio.h>" > confdefs.h # dummy input file
CPPFLAGS="$CPPFLAGS -I. -I$srcdir -I$srcdir/lightning/$cpu"
AC_TRY_COMPILE([#include "lightning.h"], , ,
AC_MSG_WARN(the compiler that was found could not compile GNU lightning))