2010-05-25 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 25 May 2010 15:51:01 +0000 (15:51 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 25 May 2010 15:51:01 +0000 (15:51 -0000)
* Applied patch from Burkhard Linke (blinke@cebitec.uni-bielefeld.de). Fix
building on solaris.

svn path=/trunk/mono/; revision=157869

eglib/ChangeLog
eglib/configure.ac
eglib/src/Makefile.am
eglib/test/test.c

index df7710881f21d09fc92bb57b1b190f226053be86..170b5e19409595b5e30489dd58ab8c0fbf562807 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-25  Zoltan Varga  <vargaz@gmail.com>
+
+       * Applied patch from Burkhard Linke (blinke@cebitec.uni-bielefeld.de). Fix
+       building on solaris.
+
 2010-05-21  Zoltan Varga  <vargaz@gmail.com>
 
        * src/gmisc-win32.c (g_setenv): Use the
index 45658cd50fbf5a343162002f82bbbadcb106cb53..6e10e94759e530014e82e96efd77f29a603f7e31 100644 (file)
@@ -73,9 +73,14 @@ AM_CONDITIONAL(TARGET_WIN32, test x$OS = xWIN32)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_FUNCS(strndup strlcpy getpwent_r strtok_r rewinddir vasprintf)
+AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x )
 AC_CHECK_LIB(iconv, iconv_open, LIBS="$LIBS -liconv")
 AC_CHECK_LIB(iconv, libiconv_open, LIBS="$LIBS -liconv")
 AC_SEARCH_LIBS(sqrtf, m)
+
+# nanosleep may not be part of libc, also search it in other libraries
+AC_SEARCH_LIBS(nanosleep, rt)
+
 AC_SEARCH_LIBS(dlopen, dl)
 old_ldflags="${LDFLAGS}"
 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
index 37f3d5fc24a950d7712b10c4b31181c0dd1d0ab3..1251d04c3c303fa8343ba18b1c9271f5957bdd99 100644 (file)
@@ -2,12 +2,20 @@ noinst_LTLIBRARIES = libeglib.la libeglib-static.la
 
 win_files  = \
        gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
-       gmodule-win32.c gtimer-win32.c vasprintf.c
+       gmodule-win32.c gtimer-win32.c
 
 unix_files = \
        gdate-unix.c  gdir-unix.c  gfile-unix.c  gmisc-unix.c   \
        gmodule-unix.c gtimer-unix.c
 
+# some unices and windows do not have an implementation of vasprintf
+# used by eglib, use provided implementation instead
+if NEED_VASPRINTF
+vasprintf_files = vasprintf.c
+else
+vaprinttf_files = foo.c
+endif
+
 if HOST_WIN32
 os_files = $(win_files)
 else
@@ -41,7 +49,8 @@ libeglib_la_SOURCES = \
        gutf8.c         \
        gunicode.c      \
        unicode-data.h  \
-       $(os_files)
+       $(os_files)     \
+       $(vasprintf_files)
 
 libeglib_la_CFLAGS = -Wall -D_FORTIFY_SOURCE=2
 libeglib_static_la_SOURCES=$(libeglib_la_SOURCES)
index 02a832a404bedd75a74980ef05046707c07253a3..9e23e37a8e014445ca591583666e4241c163283a 100644 (file)
 
 extern gint global_passed, global_tests;
 
+#ifndef HAVE_VASPRINTF
+  /* systen does not provide a vasprintf function, use the one
+     provided within eglib itself */
+extern int vasprintf(char **ret, const char *format, va_list ap);
+#endif
+
 static gchar *last_result = NULL;
 
 gboolean