Commit f87a16d31a39de805828686a18f3eb164a6d657b
Committed by
GitHub
Exists in
master
and in
3 other branches
Merge pull request #4 from andrebreves/develop
Patching library to allow build on apple darwin
Showing
3 changed files
with
28 additions
and
7 deletions
Show diff stats
configure.ac
| @@ -104,6 +104,20 @@ case "$host" in | @@ -104,6 +104,20 @@ case "$host" in | ||
| 104 | 104 | ||
| 105 | ;; | 105 | ;; |
| 106 | 106 | ||
| 107 | + *-apple-darwin*) | ||
| 108 | + CFLAGS="$CFLAGS -pthread -DCONFDIR=\$(confdir) -DDATADIR=\$(datadir) -DLOCALEDIR=\$(localedir)" | ||
| 109 | + LDFLAGS="$LDFLAGS -pthread" | ||
| 110 | + app_cv_osname="linux" | ||
| 111 | + LOGDIR="/var/log" | ||
| 112 | + DLLEXT=".so" | ||
| 113 | + DLL_LDFLAGS="-shared -Wl,-install_name,\$(@F)" | ||
| 114 | + | ||
| 115 | + INSTALL_PACKAGES="linux-lib ${INSTALL_PACKAGES}" | ||
| 116 | + | ||
| 117 | + app_cv_static='yes' | ||
| 118 | + | ||
| 119 | + ;; | ||
| 120 | + | ||
| 107 | *) | 121 | *) |
| 108 | CFLAGS="$CFLAGS -pthread -DCONFDIR=\$(confdir) -DDATADIR=\$(datadir) -DLOCALEDIR=\$(localedir)" | 122 | CFLAGS="$CFLAGS -pthread -DCONFDIR=\$(confdir) -DDATADIR=\$(datadir) -DLOCALEDIR=\$(localedir)" |
| 109 | LDFLAGS="$LDFLAGS -pthread" | 123 | LDFLAGS="$LDFLAGS -pthread" |
| @@ -217,6 +231,10 @@ AC_CHECK_HEADER(libintl.h, [ | @@ -217,6 +231,10 @@ AC_CHECK_HEADER(libintl.h, [ | ||
| 217 | INTL_LIBS="-lintl" | 231 | INTL_LIBS="-lintl" |
| 218 | ;; | 232 | ;; |
| 219 | 233 | ||
| 234 | + *-apple-darwin*) | ||
| 235 | + INTL_LIBS="-lintl" | ||
| 236 | + ;; | ||
| 237 | + | ||
| 220 | *) | 238 | *) |
| 221 | INTL_LIBS="" | 239 | INTL_LIBS="" |
| 222 | 240 | ||
| @@ -277,7 +295,7 @@ rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl | @@ -277,7 +295,7 @@ rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl | ||
| 277 | ])# GLIB_CHECK_COMPILE_WARNINGS | 295 | ])# GLIB_CHECK_COMPILE_WARNINGS |
| 278 | 296 | ||
| 279 | AC_MSG_CHECKING(for GNUC visibility attribute) | 297 | AC_MSG_CHECKING(for GNUC visibility attribute) |
| 280 | -GLIB_CHECK_COMPILE_WARNINGS([ | 298 | +GLIB_CHECK_COMPILE_WARNINGS([AC_LANG_SOURCE([[ |
| 281 | void | 299 | void |
| 282 | __attribute__ ((visibility ("hidden"))) | 300 | __attribute__ ((visibility ("hidden"))) |
| 283 | f_hidden (void) | 301 | f_hidden (void) |
| @@ -306,7 +324,7 @@ int main (int argc, char **argv) | @@ -306,7 +324,7 @@ int main (int argc, char **argv) | ||
| 306 | f_default(); | 324 | f_default(); |
| 307 | return 0; | 325 | return 0; |
| 308 | } | 326 | } |
| 309 | -],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no) | 327 | +]])],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no) |
| 310 | AC_MSG_RESULT($g_have_gnuc_visibility) | 328 | AC_MSG_RESULT($g_have_gnuc_visibility) |
| 311 | if test x$g_have_gnuc_visibility = xyes; then | 329 | if test x$g_have_gnuc_visibility = xyes; then |
| 312 | AC_DEFINE(HAVE_GNUC_VISIBILITY, 1, [supports GCC visibility attributes]) | 330 | AC_DEFINE(HAVE_GNUC_VISIBILITY, 1, [supports GCC visibility attributes]) |
| @@ -510,7 +528,7 @@ dnl Check for headers | @@ -510,7 +528,7 @@ dnl Check for headers | ||
| 510 | dnl --------------------------------------------------------------------------- | 528 | dnl --------------------------------------------------------------------------- |
| 511 | 529 | ||
| 512 | AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H,,[do we have malloc.h?])) | 530 | AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H,,[do we have malloc.h?])) |
| 513 | -AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG,,[do we have malloc.h?])) | 531 | +AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG,,[do we have syslog.h?])) |
| 514 | 532 | ||
| 515 | AC_CHECK_FUNCS(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO) ) | 533 | AC_CHECK_FUNCS(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO) ) |
| 516 | AC_CHECK_FUNC(vasprintf, AC_DEFINE(HAVE_VASPRINTF) ) | 534 | AC_CHECK_FUNC(vasprintf, AC_DEFINE(HAVE_VASPRINTF) ) |
src/core/host.c
| @@ -37,7 +37,10 @@ | @@ -37,7 +37,10 @@ | ||
| 37 | 37 | ||
| 38 | #pragma GCC diagnostic ignored "-Wsign-compare" | 38 | #pragma GCC diagnostic ignored "-Wsign-compare" |
| 39 | 39 | ||
| 40 | -#include <malloc.h> | 40 | +#ifdef HAVE_MALLOC_H |
| 41 | + #include <malloc.h> | ||
| 42 | +#endif // HAVE_MALLOC_H | ||
| 43 | + | ||
| 41 | #include <internals.h> | 44 | #include <internals.h> |
| 42 | #include "resources.h" | 45 | #include "resources.h" |
| 43 | 46 |
src/core/iocalls.c
| @@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
| 93 | static void (*set_poll_state)(H3270 *session, void *id, int enabled) | 93 | static void (*set_poll_state)(H3270 *session, void *id, int enabled) |
| 94 | = internal_set_poll_state; | 94 | = internal_set_poll_state; |
| 95 | 95 | ||
| 96 | - static int (*wait)(H3270 *session, int seconds) | 96 | + static int (*wait_callback)(H3270 *session, int seconds) |
| 97 | = internal_wait; | 97 | = internal_wait; |
| 98 | 98 | ||
| 99 | static int (*event_dispatcher)(H3270 *session,int wait) | 99 | static int (*event_dispatcher)(H3270 *session,int wait) |
| @@ -454,7 +454,7 @@ LIB3270_EXPORT int lib3270_register_io_controller(const LIB3270_IO_CONTROLLER *c | @@ -454,7 +454,7 @@ LIB3270_EXPORT int lib3270_register_io_controller(const LIB3270_IO_CONTROLLER *c | ||
| 454 | lib3270_register_fd_handlers(cbk->add_poll,cbk->remove_poll); | 454 | lib3270_register_fd_handlers(cbk->add_poll,cbk->remove_poll); |
| 455 | 455 | ||
| 456 | if(cbk->Wait) | 456 | if(cbk->Wait) |
| 457 | - wait = cbk->Wait; | 457 | + wait_callback = cbk->Wait; |
| 458 | 458 | ||
| 459 | if(cbk->event_dispatcher) | 459 | if(cbk->event_dispatcher) |
| 460 | event_dispatcher = cbk->event_dispatcher; | 460 | event_dispatcher = cbk->event_dispatcher; |
| @@ -480,7 +480,7 @@ LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block) | @@ -480,7 +480,7 @@ LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block) | ||
| 480 | 480 | ||
| 481 | LIB3270_EXPORT int lib3270_wait(H3270 *hSession, int seconds) | 481 | LIB3270_EXPORT int lib3270_wait(H3270 *hSession, int seconds) |
| 482 | { | 482 | { |
| 483 | - wait(hSession,seconds); | 483 | + wait_callback(hSession,seconds); |
| 484 | return 0; | 484 | return 0; |
| 485 | } | 485 | } |
| 486 | 486 |