LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   compile 32-bit gdkglext on amd64 (https://www.linuxquestions.org/questions/linux-software-2/compile-32-bit-gdkglext-on-amd64-240414/)

spuzzzzzzz 10-08-2004 09:36 PM

compile 32-bit gdkglext on amd64
 
I'm trying to compile a 32-bit version of gtkglext on my 64-bit machine. My gcc supports multilib, but there is a really annoying step in the build process where it insists on linking in .so files from /usr/lib:
Code:

gcc -m32 -shared  .libs/gdkglversion.o .libs/gdkglinit.o .libs/gdkglquery.o
.libs/gdkglconfig.o .libs/gdkglcontext.o .libs/gdkgldrawable.o .libs/gdkglpixmap.o
.libs/gdkglwindow.o .libs/gdkglshapes.o .libs/gdkglglext.o .libs/gdkglenumtypes.o
-Wl,--whole-archive x11/.libs/libgdkglext-x11.a -Wl,--no-whole-archive  -L/usr/X11R6/lib
-L/usr/lib -L/usr/lib32 -L/usr/X11R6/lib32 /usr/lib/libGLU.so -lGL -L/usr/X11R6/lib64 -lXmu
 -lXt -lSM -lICE /usr/lib/libgdk-x11-2.0.so /usr/lib/libgdk_pixbuf-2.0.so
/usr/lib/libpangoxft-1.0.so /usr/lib/libpangox-1.0.so /usr/lib/libpango-1.0.so
/usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so -lm 
-Wl,--export-dynamic -Wl,-soname -Wl,libgdkglext-x11-1.0.so.0 -Wl,-version-script
-Wl,.libs/libgdkglext-x11-1.0.ver -o .libs/libgdkglext-x11-1.0.so.0.2.4
/usr/lib/libGLU.so: could not read symbols: Invalid operation

I want to replace /usr/lib/* with /usr/lib32/*. If I do it manually, it works; I can create .libs/libgdkglext-x11-1.0.so.0.2.4. If I try to resume the build process, though, it insists on trying to build .libs/libgdkglext-x11-1.0.so.0.2.4 again (and it fails). Why does it insist on linking these libraries at compile time instead of runtime? And I can't see where that command is coming from in the Makefile. "grep /usr/lib/libGL *" and "grep /usr/lib/libGL gdk/*" don't find anything. Help anyone?

foo_bar_foo 10-08-2004 11:56 PM

post the Makefile somewhere perhaps i can see how to fix ??
i gave up on trying to figure out why these libtool troubles crop up sometimes
and just go for hacking the makefile

spuzzzzzzz 10-09-2004 03:29 AM

Here's the Makefile.am (from the gdk subdirectory of the source tree). The Makefile is really long and ugly and this forum wouldn't let me post it (too long). If you can't find a problem in here, I can split up the Makefile over two posts if you want.
Code:

## -*- Makefile -*-
## Makefile.am for gtkglext/gdk

SUBDIRS = glext $(gdktarget)
DIST_SUBDIRS = glext x11 win32

EXTRA_DIST = \
        gdkglversion.h.in      \
        gdkglext.def            \
        gdkglext-gtk20.def

if PLATFORM_WIN32
no_undefined = -no-undefined
endif

if OS_WIN32
if MULTIHEAD_SUPPORT
gdkglext_def = gdkglext.def
else
gdkglext_def = gdkglext-gtk20.def
endif
gdkglext_win32_symbols = -export-symbols $(gdkglext_def)
endif

if MS_LIB_AVAILABLE
noinst_DATA = gdkglext-win32-@GTKGLEXT_API_VERSION@.lib

gdkglext-win32-@GTKGLEXT_API_VERSION@.lib: libgdkglext-win32-@GTKGLEXT_API_VERSION@.la $(gdkglext_def)
        lib -name:libgdkglext-win32-@GTKGLEXT_API_VERSION@-@LT_CURRENT_MINUS_AGE@.dll -def:$(gdkglext_def) -out:$@

install-ms-lib:
        $(INSTALL) gdkglext-win32-@GTKGLEXT_API_VERSION@.lib $(DESTDIR)$(libdir)
uninstall-ms-lib:
        -rm $(DESTDIR)$(libdir)/gdkglext-win32-@GTKGLEXT_API_VERSION@.lib
else
install-ms-lib:
uninstall-ms-lib:
endif

common_includes = \
        -DG_LOG_DOMAIN=\"GdkGLExt\"    \
        -DGDK_GL_COMPILATION            \
        -I$(top_srcdir)                \
        $(GTKGLEXT_DEBUG_FLAGS)        \
        $(GDKGLEXT_DEP_CFLAGS)          \
        -DG_DISABLE_DEPRECATED          \
        -DGDK_DISABLE_DEPRECATED        \
        -DGDK_PIXBUF_DISABLE_DEPRECATED

common_ldflags = \
        -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)    \
        -export-dynamic                                        \
        -rpath $(libdir)                                        \
        $(no_undefined)                                        \
        @LIBTOOL_EXPORT_OPTIONS@                                \
        $(gdkglext_win32_symbols)

common_libadd = \
        $(GDKGLEXT_DEP_LIBS)

#
# setup source file variables
#

gdkglext_public_h_sources = \
        gdkgl.h                \
        gdkgldefs.h            \
        gdkglversion.h          \
        gdkgltokens.h          \
        gdkgltypes.h            \
        gdkglinit.h            \
        gdkglquery.h            \
        gdkglconfig.h          \
        gdkglcontext.h          \
        gdkgldrawable.h        \
        gdkglpixmap.h          \
        gdkglwindow.h          \
        gdkglfont.h            \
        gdkglshapes.h          \
        gdkglglext.h

gdkglext_private_h_sources = \
        gdkglprivate.h

gdkglext_built_public_h_sources = \
        gdkglenumtypes.h

gdkglext_c_sources = \
        gdkglversion.c          \
        gdkglinit.c            \
        gdkglquery.c            \
        gdkglconfig.c          \
        gdkglcontext.c          \
        gdkgldrawable.c        \
        gdkglpixmap.c          \
        gdkglwindow.c          \
        gdkglshapes.c          \
        gdkglglext.c

gdkglext_built_c_sources = \
        gdkglenumtypes.c

gdkglext_headers = \
        $(gdkglext_public_h_sources)            \
        $(gdkglext_built_public_h_sources)      \
        gdkgldebug.h

gdkglext_sources = \
        $(gdkglext_private_h_sources)          \
        $(gdkglext_c_sources)                  \
        $(gdkglext_built_c_sources)

gdkglext_built_sources = \
        $(gdkglext_built_public_h_sources)      \
        $(gdkglext_built_c_sources)

stamp_files = \
        stamp-gdkglenumtypes-h

#
# setup GdkGLExt sources and their dependancies
#

gdkglextincludedir = $(includedir)/gtkglext-@GTKGLEXT_API_VERSION@/gdk
gdkglextinclude_HEADERS = $(gdkglext_headers)

INCLUDES = $(common_includes)

lib_LTLIBRARIES = $(gdkglext_targetlib)

EXTRA_LTLIBRARIES = \
        libgdkglext-x11-@API_MJ@.@API_MI@.la    \
        libgdkglext-win32-@API_MJ@.@API_MI@.la

libgdkglext_x11_@API_MJ@_@API_MI@_la_SOURCES = $(gdkglext_sources)
libgdkglext_x11_@API_MJ@_@API_MI@_la_LDFLAGS = $(common_ldflags)
libgdkglext_x11_@API_MJ@_@API_MI@_la_LIBADD = x11/libgdkglext-x11.la $(common_libadd)

libgdkglext_win32_@API_MJ@_@API_MI@_la_SOURCES = $(gdkglext_sources)
libgdkglext_win32_@API_MJ@_@API_MI@_la_LDFLAGS = $(common_ldflags)
libgdkglext_win32_@API_MJ@_@API_MI@_la_LIBADD = win32/libgdkglext-win32.la $(common_libadd)
libgdkglext_win32_@API_MJ@_@API_MI@_la_DEPENDENCIES = $(gdkglext_def)

BUILT_SOURCES = \
        @REBUILD@                      \
        $(gdkglext_built_sources)

DISTCLEANFILES = $(stamp_files)

MAINTAINERCLEANFILES = \
        $(gdkglext_built_sources)

# Generate built header without using automake BUILT_SOURCES
$(libgdkglext_x11_@API_MJ@_@API_MI@_la_OBJECTS) $(libgdkglext_win32_@API_MJ@_@API_MI@_la_OBJECTS): $(gdkglext_built_public_h_sources)

$(srcdir)/gdkglenumtypes.h: stamp-gdkglenumtypes-h
        @true
stamp-gdkglenumtypes-h: @REBUILD@ $(gdkglext_public_h_sources) Makefile
        ( cd $(srcdir) && glib-mkenums \
                        --fhead "#ifndef __GDK_GL_ENUM_TYPES_H__\n#define __GDK_GL_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
                        --fprod "/* enumerations from \"@filename@\" */\n" \
                        --vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
                        --ftail "G_END_DECLS\n\n#endif /* __GDK_GL_ENUM_TYPES_H__ */" \
                $(gdkglext_public_h_sources) ) >> xgen-geth \
        && (cmp -s xgen-geth $(srcdir)/gdkglenumtypes.h || cp xgen-geth $(srcdir)/gdkglenumtypes.h ) \
        && rm -f xgen-geth \
        && echo timestamp > $(@F)
$(srcdir)/gdkglenumtypes.c: @REBUILD@ $(gdkglext_public_h_sources) Makefile
        ( cd $(srcdir) && glib-mkenums \
                        --fhead "#include \"gdkgl.h\"" \
                        --fprod "\n/* enumerations from \"@filename@\" */" \
                        --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
                        --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
                        --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
                $(gdkglext_public_h_sources) ) > xgen-getc \
        && cp xgen-getc $(srcdir)/gdkglenumtypes.c  \
        && rm -f xgen-getc

#
# Rule to install gdkglext-config.h header file
#
configexecincludedir = $(libdir)/gtkglext-@GTKGLEXT_API_VERSION@/include
#configexecinclude_DATA = gdkglext-config.h

install-exec-local: gdkglext-config.h
        $(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
        file=$(DESTDIR)$(configexecincludedir)/gdkglext-config.h; \
        if test -r $$file && cmp -s gdkglext-config.h $$file; then :; \
        else $(INSTALL_DATA) gdkglext-config.h $$file; fi

gdkglext-config.h: stamp-gdkglext-config-h
        @if test -f gdkglext-config.h; then :; \
        else rm -f stamp-gdkglext-config-h; $(MAKE) stamp-gdkglext-config-h; fi

stamp-gdkglext-config-h: $(top_builddir)/config.status
        cd $(top_builddir) && $(SHELL) ./config.status gdk/gdkglext-config.h
        echo timestamp > stamp-gdkglext-config-h

DISTCLEANFILES += gdkglext-config.h stamp-gdkglext-config-h

#
# Extra rules
#

install-data-local: install-ms-lib

uninstall-local: uninstall-ms-lib



All times are GMT -5. The time now is 02:34 PM.