4 AM_CONFIG_HEADER(config.h)
5 AM_INIT_AUTOMAKE(eglib,0.3)
10 CFLAGS='-g -O0 -D_GNU_SOURCE'
14 BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
15 if test x$GCC = xyes; then
16 GNUC_UNUSED='__attribute__((__unused__))'
17 GNUC_NORETURN='__attribute__((__noreturn__))'
18 echo target_cpu=$target_cpu
20 i*86) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
25 AC_SUBST(GNUC_NORETURN)
28 AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
29 AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
33 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
47 CFLAGS="$CLAFGS -U_FORTIFY_SOURCE"
54 AM_CONDITIONAL(PLATFORM_WIN32, test x$OS = xWIN32)
57 AC_CHECK_SIZEOF(void *)
58 AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r rewinddir)
59 AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
60 old_ldflags="${LDFLAGS}"
61 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
62 AC_TRY_LINK(, [int i;], found_export_dynamic=yes, found_export_dynamic=no)
63 if test $found_export_dynamic = no; then
64 LDFLAGS="${old_ldflags}"
67 AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h)
69 if test $ac_cv_sizeof_void_p != $ac_cv_sizeof_int; then
70 GPOINTER_TO_INT="((gint)(long) (ptr))"
71 GPOINTER_TO_UINT="((guint)(long) (ptr))"
72 GINT_TO_POINTER="((gpointer)(glong) (v))"
73 GUINT_TO_POINTER="((gpointer)(gulong) (v))"
76 G_GUINT64_FORMAT='"lu"'
78 GPOINTER_TO_INT="((gint) (ptr))"
79 GPOINTER_TO_UINT="((guint) (ptr))"
80 GINT_TO_POINTER="((gpointer) (v))"
81 GUINT_TO_POINTER="((gpointer) (v))"
84 G_GUINT64_FORMAT='"llu"'
87 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
88 if test "x$PKG_CONFIG" = "xno"; then
89 AC_MSG_ERROR([You need to install pkg-config])
93 AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
94 if test x$with_crosspkgdir = "x"; then
95 if test -s $PKG_CONFIG_PATH; then
96 pkg_config_path=$PKG_CONFIG_PATH
99 pkg_config_path=$with_crosspkgdir
100 PKG_CONFIG_PATH=$pkg_config_path
101 export PKG_CONFIG_PATH
106 dnl No, you can not replace the call below with a pkg.m4 macro
108 if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
113 AM_CONDITIONAL(HAVE_GLIB, $have_glib)
115 AC_SUBST(GPOINTER_TO_INT)
116 AC_SUBST(GPOINTER_TO_UINT)
117 AC_SUBST(GINT_TO_POINTER)
118 AC_SUBST(GUINT_TO_POINTER)
120 AC_SUBST(GSIZE_FORMAT)
121 AC_SUBST(G_GUINT64_FORMAT)