Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile: "make install" puts libraries into wrong path #316

Open
mariob92 opened this issue Aug 18, 2021 · 1 comment
Open

Cross compile: "make install" puts libraries into wrong path #316

mariob92 opened this issue Aug 18, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@mariob92
Copy link

I want to cross compile GLEW on Ubuntu for mingw-w64.

make install SYSTEM=linux-mingw64 installs the library files into the wrong path:

mario@ubuntu:~/glew$ sudo make install SYSTEM=linux-mingw64
install -d -m 0755 "/usr/local/include/GL"
install -m 0644 include/GL/wglew.h "/usr/local/include/GL/"
install -m 0644 include/GL/glew.h "/usr/local/include/GL/"
install -m 0644 include/GL/glxew.h "/usr/local/include/GL/"
install -m 0644 include/GL/eglew.h "/usr/local/include/GL/"
sed \
        -e "s|@prefix@|/usr/local|g" \
        -e "s|@libdir@|/usr/local/lib|g" \
        -e "s|@exec_prefix@|/usr/local/bin|g" \
        -e "s|@includedir@|/usr/local/include/GL|g" \
        -e "s|@version@|2.2.0|g" \
        -e "s|@cflags@||g" \
        -e "s|@libname@|glew32|g" \
        -e "s|@libgl@|-L/usr/x86_64-w64-mingw32/lib -lopengl32 -lgdi32 -luser32 -lkernel32|g" \
        -e "s|@requireslib@|glu|g" \
        < glew.pc.in > glew.pc
install -d -m 0755 "/usr/local/lib"
install -m 0644 lib/glew32.dll "/usr/local/lib/"
install -m 0644 lib/libglew32.a         "/usr/local/lib/"
install -d -m 0755 "/usr/local/lib/pkgconfig"
install -d -m 0755 "/usr/local/lib/pkgconfig"
install -m 0644 glew.pc "/usr/local/lib/pkgconfig/"

The files are installed into /usr/local/, however, they should be installed in something like /usr/local/x86_64-w64-mingw32/ (for win64) and /usr/local/i686-w64-mingw32/ (for win32).

This is an issue if I want to compile GLEW for different architectures (e.g. win32 and win64).

I'm not really an expert into Makefiles, but in the Makefile the following to lines hardcode the destination path, but they should be definied like /usr/local/$(HOST), where HOST is defined in the config/Makefile.*-files to the appropriate host.

 43 GLEW_PREFIX ?= /usr/local
 44 GLEW_DEST ?= /usr/local
@nigels-com
Copy link
Owner

nigels-com commented Aug 18, 2021

Thanks for the detailed report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants