You are not logged in.

#1 2011-10-07 16:48:45

Verge
Member
Registered: 2008-12-01
Posts: 8

[SOLVED] Makepkg makes qmake or make act weird and causes trouble

I am trying to build an Arch package from a Qt app. The app is split into some libraries that are compiled with the main application. Installation instruction for the whole app are defined in src.pro (see the hierarchy below), which are then written into the Makefiles that are generated on-the-fly during the build process. When I run 'qmake && make && make install' manually, everything goes fine. But when I try to build the package using a PKGBUILD, for some reason the Makefile generated based on the src.pro is missing installation instruction for the libraries (lib1, lib2, etc.).

I don't really have any idea of what is the problem. I tried to study the output of the make process and it seems like that when running makepkg, qmake first runs on each subdirectory to generate the Makefiles and only then begins the actual build process. Manually running make first builds one directory, then the second one and so on and only generates a Makefile when entering a directory. Since the libraries marked for installation do not exist in the beginning of the build process, they are not put into the Makefile at all, I think.

My first idea for a solution was to move the installation instructions into the libraries' own .pro files but that didn't seem to change anything. The build() process in the makepkg only runs qmake, make and make install - what I also do manually.

The directory structure of the project is like this:

project/
    project.pro
    src/
        src.pro
        lib1/
            lib1.pro
        lib2/
            lib2.pro

Last edited by Verge (2011-10-07 19:07:33)

Offline

#2 2011-10-07 17:16:12

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Makepkg makes qmake or make act weird and causes trouble

The difference would be the CFLAGS, CXXFLAGS, and LDFLAGS that makepkg pulls in from /etc/makepkg.conf. It's likely exposing a problem in your own Makefiles.

Offline

#3 2011-10-07 18:53:56

Verge
Member
Registered: 2008-12-01
Posts: 8

Re: [SOLVED] Makepkg makes qmake or make act weird and causes trouble

I tracked the problem to be in MAKEFLAGS and especially with -j. If there are anymore concurrent jobs than one, it will first generate Makefiles and only then begin compilation. I guess I just have to write my own build script to build the libs first and then the main app, or force -j1 somehow.

Last edited by Verge (2011-10-07 18:54:12)

Offline

#4 2011-10-07 18:59:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Makepkg makes qmake or make act weird and causes trouble

options=(!makeflags)

Offline

#5 2011-10-07 19:07:01

Verge
Member
Registered: 2008-12-01
Posts: 8

Re: [SOLVED] Makepkg makes qmake or make act weird and causes trouble

After many hours I finally came up with a solution that was too easy... I only needed an "install.pri" file in which I added two lines:

target.path = /path/
INSTALLS += target

Next I just included that file into each lib's .pro file and now the makepkg process works. "target" is somewhat a magical variable for qmake.

I consider this solved.

Last edited by Verge (2011-10-07 19:08:22)

Offline

Board footer

Powered by FluxBB