File: configure.ac

package info (click to toggle)
libemu 0.2.0+git20120122-1.2
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 3,360 kB
  • ctags: 1,872
  • sloc: ansic: 43,547; makefile: 211; python: 14
file content (258 lines) | stat: -rw-r--r-- 7,839 bytes parent folder | download
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# -*- mode: m4; -*-
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# $Id$

AC_PREREQ(2.59)
AC_INIT([libemu], [0.2.0], [nepenthesdev@gmail.com])
AM_INIT_AUTOMAKE([libemu], [0.2.0])
AC_REVISION([$Id$])

AC_PREFIX_DEFAULT(/opt/libemu)
AC_CONFIG_SRCDIR([include/emu/emu.h])
AM_CONFIG_HEADER([config.h])
# AM_MAINTAINER_MODE

AC_CANONICAL_HOST
AC_C_CONST
AC_C_BIGENDIAN

dnl Check for some target-specific stuff
case "$host" in
*-*-linux*|*-*-gnu*)
  #CPPFLAGS="$CPPFLAGS -D _GNU_SOURCE -I/usr/local/include"
  CPPFLAGS="$CPPFLAGS -D _GNU_SOURCE"
  #LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-rpath,/usr/local/lib"
  ;;
*-*-freebsd*)
  #CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/src/contrib/file/"
  #LDFLAGS="$LDFLAGS -L/usr/local/lib -Wl,-rpath,/usr/local/lib"
  ;;
*-*-darwin*)
  CPPFLAGS="$CPPFLAGS -I/opt/local/include"
  LDFLAGS="$LDFLAGS -L/opt/local/lib"
  if test "$GCC" = "yes"; then
          CFLAGS="$CFLAGS -no-cpp-precomp"
  fi
  ;;
esac

# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL

AC_CHECK_HEADERS([stdint.h stdlib.h string.h strings.h unistd.h])

dnl   We ought not to have to worry about getopt.h, getopt{,1}.c,
dnl   since they can always be unconditionally compiled and linked.  See
dnl   http://mail.gnu.org/archive/html/autoconf/2000-12/msg00049.html
dnl   and surrounding thread for discussion.  However that doesn't
dnl   appear to work in fact, and the function in getopt_long.c has
dnl   different magic to avoid getting horribly tangled up.
AC_CHECK_FUNCS(getopt)
AC_CHECK_DECLS([getopt,getsubopt,getopt_long,setenv,putenv])
AC_REPLACE_FUNCS(getopt_long getsubopt)

dnl   getopt_long.c uses (and provides a replacement for)
dnl   this glibc utility function
AC_CHECK_FUNCS(__strchrnul)


# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_UID_T
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL


AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([strndup inet_ntoa  memmove memset strdup strerror])

# library soname
# check http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91
libemu_current=2
libemu_revision=0
libemu_age=0
libemu_soname=$libemu_current:$libemu_revision:$libemu_age
AC_SUBST(libemu_soname)

AM_PROG_CC_C_O

dnl **************************************************
dnl * large filesystem Support                       *
dnl **************************************************

AC_MSG_CHECKING(for Large File System support)
AC_ARG_ENABLE(lfs,
 AC_HELP_STRING([--enable-lfs],[Turn on Large File System (default)]),
 [case "$host" in
 *-*-linux*)
 case "${enableval}" in
    yes) CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES" ;;
     no) ;;
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-lfs) ;;
   esac
   ;;
 esac],[
 CPPFLAGS="${CPPFLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES"
 enable_lfs=yes]
 ,enable_lfs=no,)
AC_MSG_RESULT($enableval)


dnl **************************************************
dnl * debug code & debug messages                    *
dnl **************************************************

AC_MSG_CHECKING(whether debug code generation should be enabled)
AC_ARG_ENABLE([debug],
		[AS_HELP_STRING(--enable-debug, enable debug code generation [[default=yes]])],
		[enable_debug=${enableval}], [enable_debug="yes"])
if test x"$enable_debug" = "xyes"; then
	AC_DEFINE([DEBUG], 1, [enable debug code generation])
fi
AC_MSG_RESULT($enable_debug)



#dnl **************************************************
#dnl * interactive hooks                              *
#dnl **************************************************
#
#AC_MSG_CHECKING(if hooks should be interactive)
#AC_ARG_ENABLE([interactive-hooks],
#		[AS_HELP_STRING(--enable-interactive-hooks, enable interactive hooks (dangerous!)[[default=no]])],
#		[enable_interactive_hooks=${enableval}], [enable_interactive_hooks="yes"])
#if test x"$enable_interactive_hooks" = "xyes"; then
#	AC_DEFINE([HAVE_INTERACTIVE_HOOKS], 1, [enable interactive hooks])
#fi
#AC_MSG_RESULT($enable_interactive_hooks)


dnl **************************************************
dnl * python bindings                                *
dnl **************************************************

AC_ARG_ENABLE([python-bindings],
		[  --enable-python-bindings    Compile bindings for Python],
		[enable_python="$enableval"],[enable_python="no"])

AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], [test x$enable_python = xyes])

dnl **************************************************
dnl * libcargos                                      *
dnl **************************************************


AC_SUBST([LIB_CARGOS])
AC_SUBST([LIB_CARGOS_LIBDIR])
AC_SUBST([LIB_CARGOS_INCDIR])


enable_cargos="yes"

AC_ARG_ENABLE(cargos, [  --enable-cargos      enable support for libcargos],
			[enable_cargos="$enableval"],[enable_cargos="yes"])

AC_ARG_WITH(cargos-include,
			[  --with-cargos-include=DIR  libcargos include dir],
				      [cargos_inc="$withval"],[cargos_inc=no])
AC_ARG_WITH(cargos-lib,
			[  --with-cargos-lib=DIR  libcargos library dir],
			[cargos_lib="$withval"],[cargos_lib=no])


if test x$enable_cargos = "xyes" ; then
	OLD_CPPFLAGS=${CPPFLAGS};
	OLD_LDFLAGS=${LDFLAGS}
	if test x$cargos_inc != "xno"; then
		CPPFLAGS="${CPPFLAGS} -I${cargos_inc}"
	fi
	
	AC_CHECK_HEADER(cargos-lib.h,[enable_cargos=yes],[enable_cargos=no])
	
	if test x$enable_cargos = "xyes" ; then
		if test x$cargos_lib != "xno"; then
			LDFLAGS="${LDFLAGS}  -L${cargos_lib}"
		fi
	
		AC_CHECK_LIB([cargos],[cargos_lib_create],enable_cargos="yes", enable_cargos="no")
	
		if test x$enable_cargos = "xyes" ; then
			LIB_CARGOS="-lcargos"
			LIB_CARGOS_LIBDIR="-L$cargos_lib"
			LIB_CARGOS_INCDIR="-I$cargos_inc"
			AC_DEFINE([HAVE_LIBCARGOS], [1], [Define to 1 to compile with cargos support])
		fi
	fi
	CPPFLAGS=${OLD_CPPFLAGS}
	LDFLAGS=${OLD_LDFLAGS}
fi


AC_DEFUN([AC_DEFINE_DIR], [
  prefix_NONE=
  exec_prefix_NONE=
  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}.  Thus we have to use `eval' twice.
  eval ac_define_dir="\"[$]$2\""
  eval ac_define_dir="\"$ac_define_dir\""
  AC_SUBST($1, "$ac_define_dir")
  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
  test "$prefix_NONE" && prefix=NONE
  test "$exec_prefix_NONE" && exec_prefix=NONE
])

AC_DEFINE_DIR(PREFIX, prefix, [default working directory])
AC_DEFINE_DIR(LOCALESTATEDIR, localstatedir, [where to put logs etc])
AC_DEFINE_DIR(LIBDIR, libdir, [where to look for plugins])
AC_DEFINE_DIR(SYSCONFDIR, [sysconfdir], [System configuration dir])
AC_DEFINE_DIR(DATADIR, [datadir], [The directory for installing idiosyncratic read-only architecture-independent data.])
AC_DEFINE_DIR(DATAROOTDIR, [datarootdir], [The root of the directory tree for read-only architecture-independent data files.])

emu_data_dir=$datadir/emu

AC_SUBST(emu_data_dir)

CFLAGS="${CFLAGS} -Wstrict-prototypes"

AC_CONFIG_FILES([Makefile
		src/Makefile
		src/functions/Makefile
		include/Makefile
		include/emu/Makefile
		include/emu/environment/Makefile
		include/emu/environment/win32/Makefile
		include/emu/environment/linux/Makefile
		testsuite/Makefile
		doc/Makefile
		libemu.pc
		bindings/Makefile
		bindings/python/Makefile
		bindings/python/setup.py
		tools/Makefile
		tools/sctest/Makefile])

                 
AC_OUTPUT

echo
echo "*** libemu configuration ***"
echo ""
echo "debug                              : $enable_debug"
echo ""
echo "bindings"
echo " - python                          : $enable_python"
echo ""
echo "support"
echo " - cargos                          : $enable_cargos"