glib-2.49.4 static build step in windows XP

时间:2021-06-14 13:13:26
export LIBFFI_CFLAGS=" -I/usr/local/lib/libffi-3.2.1/include " \
export LIBFFI_LIBS=" -lffi " \
export ZLIB_CFLAGS=-I/usr/local/include \
export ZLIB_LIBS=-lz \
export CFLAGS=" -I/usr/local/include -O2 -Wall -march=i686 -mms-bitfields -mthreads " \
export CPPFLAGS=" -I/usr/local/include " \
export LDFLAGS=" -L/usr/local/lib " \
export LIBS=' -lpsapi -lws2_32 -lmswsock -lpthread ' ./configure \
--prefix=/usr/local \
--enable-static \
--disable-shared \
--disable-debug \
--disable-gtk-doc \
--with-pcre=internal \
--enable-silent-rules __declspec(dllexport) fix to --> __attribute__((visibility ("default")))
__stdcall _export fix to --> __attribute__((visibility ("default")))
define PNG_IMPEXP __declspec(dllimport) fix to --> define PNG_IMPEXP
__attribute__((visibility ("hidden"))) fix to --> __attribute__((visibility ("default")))
delete all DllMain function config.h
-------------------------------------------
/* #define _GLIB_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern */
#define _GLIB_EXTERN __attribute__((visibility("default"))) ... glib/gmessages.c
-------------------------------------------
#include <sys/types.h>
//#include <sys/socket.h>
//#include <sys/un.h> -------------------------------------------
glib_genmarshal
glib-compile-resources
-------------------------------------------
tests\gobject\Makefile
-------------------------------------------
# glib_genmarshal = $(top_builddir)/gobject/glib-genmarshal
glib_genmarshal = echo gio\tests\Makefile
-------------------------------------------
#glib_compile_resources = $(top_builddir)/gio/glib-compile-resources
glib_compile_resources = echo fix source gio/gtype.h add
-------------------------------------------
void gobj_init(void); gio/gtype.c add
-------------------------------------------
void gobj_init(void)
{
gobject_init ();
} -------------------------------------------
fix tools source
-------------------------------------------
gio/glib-compile-resources.c
gio/glib-compile-schemas.c
gio/gio-querymodules.c
gio/gsettings-tool.c
gio/gresource-tool.c
gio/gdbus-tool.c
gio/gio-tool.c
-------------------------------------------
#include "glib-init.h"
#include "../gobject/gobject.h"
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
-------------------------------------------
gio/gdbusaddress.c
-------------------------------------------
//res = CreateProcessW (rundll_path, args,
// 0, 0, FALSE,
// NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW | DETACHED_PROCESS,
// 0, NULL /* TODO: Should be root */,
// &si, &pi);
hThread=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)g_win32_run_session_bus, NULL,0,&ThreadID);
if(hThread)
{
g_print ("g_win32_run_session_bus thread run.\n");
address = read_shm (DBUS_DAEMON_ADDRESS_INFO);
}
else
{
g_print ("g_win32_run_session_bus thread create false.\n");
}
-------------------------------------------
gobject/glib-genmarshal.c <-- Makefile add $(top_builddir)/gobject/libgobject-2.0.la
gobject/gobject-query.c
-------------------------------------------
#include "glib/glib-init.h"
#include "gobject.h"
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
------------------------------------------- -------------------------------------------
tests\gobject\performance.c
tests\gobject\performance-threaded.c
-------------------------------------------
#include "glib.h"
#include <glib-object.h>
main()
...
g_clock_win32_init ();
g_thread_win32_init ();
glib_init ();
gobj_init ();
...
-------------------------------------------
make && make install