4 AM_CONFIG_HEADER(config.h)
5 AM_INIT_AUTOMAKE(eglib,0.3)
10 CFLAGS="$CFLAGS -g -O0 -D_GNU_SOURCE"
13 BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
14 if test x$GCC = xyes; then
15 GNUC_UNUSED='__attribute__((__unused__))'
16 GNUC_NORETURN='__attribute__((__noreturn__))'
17 echo target_cpu=$target_cpu
19 i*86) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
24 AC_SUBST(GNUC_NORETURN)
27 # We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono
28 # configure, because of autoconf brokeness
29 if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
30 CPPFLAGS=$CPPFLAGS_FOR_EGLIB
32 if test "x$CFLAGS_FOR_EGLIB" != "x"; then
33 CFLAGS=$CFLAGS_FOR_EGLIB
36 AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
37 AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
40 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
54 CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
66 AM_CONDITIONAL(HOST_WIN32, test x$OS = xWIN32)
67 AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
70 AC_CHECK_SIZEOF(void *)
71 AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r rewinddir)
72 AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
73 AC_SEARCH_LIBS(sqrtf, m)
74 AC_SEARCH_LIBS(dlopen, dl)
75 old_ldflags="${LDFLAGS}"
76 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
77 AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
78 if test $found_export_dynamic = no; then
79 LDFLAGS="${old_ldflags}"
82 AC_MSG_CHECKING(for varargs macros)
84 int foo (int i, int j);
85 #define bar(...) foo (1, __VA_ARGS__)
89 ],have_iso_varargs=yes,have_iso_varargs=no)
90 AC_MSG_RESULT($have_iso_varargs)
92 if test "x$have_iso_varargs" = "xyes"; then
95 AC_SUBST(G_HAVE_ISO_VARARGS)
97 AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h)
99 if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
100 GPOINTER_TO_INT="((gint)(long) (ptr))"
101 GPOINTER_TO_UINT="((guint)(long) (ptr))"
102 GINT_TO_POINTER="((gpointer)(glong) (v))"
103 GUINT_TO_POINTER="((gpointer)(gulong) (v))"
106 G_GUINT64_FORMAT='"lu"'
108 GPOINTER_TO_INT="((gint) (ptr))"
109 GPOINTER_TO_UINT="((guint) (ptr))"
110 GINT_TO_POINTER="((gpointer) (v))"
111 GUINT_TO_POINTER="((gpointer) (v))"
114 G_GUINT64_FORMAT='"llu"'
117 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
118 if test "x$PKG_CONFIG" = "xno"; then
119 AC_MSG_ERROR([You need to install pkg-config])
123 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
124 if test x$with_crosspkgdir = "x"; then
125 if test -s $PKG_CONFIG_PATH; then
126 pkg_config_path=$PKG_CONFIG_PATH
129 pkg_config_path=$with_crosspkgdir
130 PKG_CONFIG_PATH=$pkg_config_path
131 export PKG_CONFIG_PATH
136 dnl No, you can not replace the call below with a pkg.m4 macro
138 if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
143 AM_CONDITIONAL(HAVE_GLIB, $have_glib)
145 AC_SUBST(GPOINTER_TO_INT)
146 AC_SUBST(GPOINTER_TO_UINT)
147 AC_SUBST(GINT_TO_POINTER)
148 AC_SUBST(GUINT_TO_POINTER)
150 AC_SUBST(GSIZE_FORMAT)
151 AC_SUBST(G_GUINT64_FORMAT)