diff --git a/Makefile.in b/Makefile.in index 8d4125a..bb59250 100644 --- a/Makefile.in +++ b/Makefile.in @@ -67,8 +67,8 @@ CXX=@CXX@ CC=@CC@ LD=@CXX@ -LIBS=-lpw3270cpp @LIBS@ @LIBICONV@ -CFLAGS=@CFLAGS@ @PYTHON_CFLAGS@ +LIBS=-lpw3270cpp @LIBS@ @LIBICONV@ @DBUS_LIBS@ +CFLAGS=@CFLAGS@ @PYTHON_CFLAGS@ @DBUS_CFLAGS@ LDFLAGS=@LDFLAGS@ #---[ Rules ]---------------------------------------------------------------------------- @@ -142,7 +142,7 @@ $(BINDBG)/$(LIBNAME): \ run: \ $(BINDBG)/$(LIBNAME) - php -d extension=$(BINDBG)/$(LIBNAME) testprograms/version.php + PYTHONPATH=$(BINDBG) python ./testprograms/sample.py cleanDebug: \ clean diff --git a/configure.ac b/configure.ac index 4951e6b..c856ce3 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,14 @@ AC_SUBST(PYTHON_LIBS) AC_SUBST(PYTHON_CFLAGS) dnl --------------------------------------------------------------------------- +dnl Check for D-Bus +dnl --------------------------------------------------------------------------- + +PKG_CHECK_MODULES( [DBUS], [dbus-1], AC_DEFINE(HAVE_DBUS), AC_MSG_NOTICE([ No DBUS support.]) ) +AC_SUBST(DBUS_LIBS) +AC_SUBST(DBUS_CFLAGS) + +dnl --------------------------------------------------------------------------- dnl Check for integer types & library functions dnl --------------------------------------------------------------------------- @@ -222,19 +230,19 @@ fi dnl --------------------------------------------------------------------------- dnl Check for compiler visibility flag dnl --------------------------------------------------------------------------- -AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden) -AC_CACHE_VAL(app_cv_fvisibility_ok, -[ac_save_cc="$CC" -CC="$CC -fvisibility=hidden" -AC_TRY_RUN([int main() { return 0; }], - app_cv_fvisibility_ok=yes, - app_cv_fvisibility_ok=no, - app_cv_fvisibility_ok=no) -CC="$ac_save_cc"]) -AC_MSG_RESULT($app_cv_fvisibility_ok) -if test $app_cv_fvisibility_ok = yes; then - CFLAGS="$CFLAGS -fvisibility=hidden" -fi +dnl AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden) +dnl AC_CACHE_VAL(app_cv_fvisibility_ok, +dnl [ac_save_cc="$CC" +dnl CC="$CC -fvisibility=hidden" +dnl AC_TRY_RUN([int main() { return 0; }], +dnl app_cv_fvisibility_ok=yes, +dnl app_cv_fvisibility_ok=no, +dnl app_cv_fvisibility_ok=no) +dnl CC="$ac_save_cc"]) +dnl AC_MSG_RESULT($app_cv_fvisibility_ok) +dnl if test $app_cv_fvisibility_ok = yes; then +dnl CFLAGS="$CFLAGS -fvisibility=hidden" +dnl fi dnl --------------------------------------------------------------------------- dnl Check for pic diff --git a/src/private.h b/src/private.h index d7deb39..02bc790 100644 --- a/src/private.h +++ b/src/private.h @@ -43,6 +43,30 @@ #include #include + #if defined(_WIN32) + + #include + + #define DLL_PRIVATE extern + #define DLL_PUBLIC extern __declspec (dllexport) + + #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) + + #define DLL_PRIVATE __hidden extern + #define DLL_PUBLIC extern + + #elif defined (HAVE_GNUC_VISIBILITY) + + #define DLL_PRIVATE __attribute__((visibility("hidden"))) extern + #define DLL_PUBLIC __attribute__((visibility("default"))) extern + + #else + + #error Unable to set visibility attribute + + #endif + + using namespace std; typedef struct { @@ -57,34 +81,34 @@ extern "C" { - PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds); - int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds); - void terminal_dealloc(pw3270_TerminalObject * self); + DLL_PRIVATE PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + DLL_PRIVATE int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds); + DLL_PRIVATE void terminal_dealloc(pw3270_TerminalObject * self); - PyObject * terminal_get_version(PyObject *self, PyObject *args); - PyObject * terminal_get_revision(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_get_version(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_get_revision(PyObject *self, PyObject *args); - PyObject * terminal_is_connected(PyObject *self, PyObject *args); - PyObject * terminal_is_ready(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_is_connected(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_is_ready(PyObject *self, PyObject *args); - PyObject * terminal_connect(PyObject *self, PyObject *args); - PyObject * terminal_disconnect(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_connect(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_disconnect(PyObject *self, PyObject *args); - PyObject * terminal_get_string_at(PyObject *self, PyObject *args); - PyObject * terminal_get_contents(PyObject *self); - PyObject * terminal_set_string_at(PyObject *self, PyObject *args); - PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_get_string_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_get_contents(PyObject *self); + DLL_PRIVATE PyObject * terminal_set_string_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args); - PyObject * terminal_pfkey(PyObject *self, PyObject *args); - PyObject * terminal_pakey(PyObject *self, PyObject *args); - PyObject * terminal_enter(PyObject *self, PyObject *args); - PyObject * terminal_action(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_pfkey(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_pakey(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_enter(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_action(PyObject *self, PyObject *args); - PyObject * terminal_is_protected_at(PyObject *self, PyObject *args); - PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_is_protected_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args); - PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args); - PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args); + DLL_PRIVATE PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args); } -- libgit2 0.21.2