-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
176 lines (158 loc) · 4.09 KB
/
configure.in
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(SkyEye, 1.2.6, [email protected], skyeye)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([utils/main/skyeye.c])
AC_CONFIG_HEADER([config.h])
# some common header path we should include them
COMMON_INCLUDES="-I\$(top_srcdir)/utils/config -I\$(top_srcdir)/utils/main -I\$(top_srcdir)/utils/main -I\$(top_srcdir)/utils -I\$(top_srcdir)/device"
AC_SUBST(COMMON_INCLUDES)
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_RANLIB
# according to host type, we can select different macro
dbct=false
case $host in
i[[3456]]86-*-linux*)
#dbct=true
;;
*-*-mingw32*)
CFLAGS="$CFLAGS -mms-bitfields"
LIBS="$LIBS -lmsvcrt -lws2_32 -lwinmm -ladvapi32"
#dbct=true
;;
*-*-cygwin*)
LIBS="$LIBS -L /usr/lib/w32api -lwinmm -ladvapi32"
#dbct=true
;;
*-*-beos*|*-*-haiku*)
# TODO
;;
esac
# check GCC & DBCT
if test "$GCC" = "yes" ; then
AC_MSG_CHECKING(for gcc)
if test -z "$ac_cv_prog_CC" ; then
gcc_exec="$CC"
else
gcc_exec="$ac_cv_prog_CC"
fi
case `$gcc_exec -dumpversion | sed -e 's,\..*,.,' -e q` in
3.*)
;;
[[456789]].*)
dbct=false
;;
*)
AC_MSG_ERROR([**** gcc < 3.0 !!!])
;;
esac
AC_MSG_RESULT([done])
else
dbct=false
fi
AM_CONDITIONAL([DBCT], [test x$dbct = xtrue])
# check LCD
LCD_CFLAGS=
LCD_LIBS=
lcd_module=none
AC_ARG_ENABLE([lcd],
AC_HELP_STRING([--enable-lcd], [enable lcd simulation (default=yes) ]),
[ENABLE_LCD="${enableval}"],
[ENABLE_LCD="yes"])
if test "x${ENABLE_LCD}" = "xyes" ; then
case $host in
*-*-mingw*|*-*-cygwin*)
lcd_module=win32
LCD_CFLAGS="-DLCD -DWIN32_LCD"
LCD_LIBS="-lgdi32 -lkernel32 -luser32"
;;
*-*-beos*|*-*-haiku*)
# TODO
;;
*-*-freebsd*)
# FIXME, we can not find suitable gtk-x11-2.0 library for LCD
;;
*)
lcd_module=auto
;;
esac
fi
if test "${lcd_module}" = "auto" ; then
lcd_module=none
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG != xno ; then
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0,
[
lcd_module=gtk
LCD_CFLAGS="-DLCD -DGTK_LCD $GTK_CFLAGS"
LCD_LIBS="$GTK_LIBS"
], [:])
fi
fi
AM_CONDITIONAL([GTK_LCD], [test "${lcd_module}" = "gtk"])
AM_CONDITIONAL([WIN32_LCD], [test "${lcd_module}" = "win32"])
AM_CONDITIONAL([LCD], [test "${lcd_module}" != "none"])
AC_SUBST(LCD_CFLAGS)
AC_SUBST(LCD_LIBS)
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lc':
AC_CHECK_LIB([c], [main])
# FIXME: Replace `main' with a function in `-liberty':
AC_CHECK_LIB([iberty], [main])
# FIXME: Replace `main' with a function in `-lintl':
AC_CHECK_LIB([intl], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-ln':
AC_CHECK_LIB([n], [main])
AC_CHECK_LIB([bfd], [bfd_openr])
AC_CHECK_LIB([socket], [socket])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h termios.h unistd.h bfd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_C_VOLATILE
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([atexit bzero getpagesize gettimeofday memmove memset munmap select setlocale socket sqrt strcasecmp strchr strdup strerror strspn strtol strtoul])
AC_OUTPUT([Makefile
arch/arm/Makefile
arch/bfin/Makefile
arch/coldfire/Makefile
arch/mips/Makefile
arch/ppc/Makefile
device/Makefile
utils/Makefile])