VirtualBox

Changeset 1767 in kBuild for trunk


Ignore:
Timestamp:
Sep 8, 2008 12:05:35 AM (16 years ago)
Author:
bird
Message:

qt4: export stuff for recursive make files, better guess work, and unit-qt4-show-vars for debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/units/qt4.kmk

    r1761 r1767  
    5151
    5252# SDK Specific Properties
     53#       PATH_SDK_QT4           - The general Qt4 root directory.
     54#       PATH_SDK_QT4_INC       - The include directory.
     55#       PATH_SDK_QT4_LIB.amd64 - The lib directory for AMD64.
     56#       PATH_SDK_QT4_LIB.x86   - The lib directory for X86.
     57#       PATH_SDK_QT4_LIB       - The lib directory for KBUILD_TARGET.
    5358ifndef PATH_SDK_QT4
    5459 PATH_SDK_QT4 := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
     
    6065   else ifeq ($(KBUILD_TARGET),win)
    6166    # No idea here yet...
     67   else ifeq ($(KBUILD_TARGET),ose)
     68    # No port...
    6269   else
    6370    # The Unices. Includes and esp. libs are tricky, so override the PATH_SDK_QT4_LIB* stuff if it doesn't work.
    64     PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard /usr/bin/qt3to4 /usr/local/bin/qt3to4 /usr/qt/4/bin/qt3to4 /usr/share/qt4/bin/qt3to4)))
     71    # Try find the general root of thing by looking for the qt3to4 program, if not found, then look for rcc.
     72    PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard \
     73        /usr/bin/qt3to4 \
     74        /usr/local/bin/qt3to4 \
     75        /usr/qt/4/bin/qt3to4 \
     76        /usr/share/qt4/bin/qt3to4 \
     77        )))
     78    ifeq ($(PATH_SDK_QT4),)
     79     PATH_SDK_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard \
     80        /usr/bin/rcc \
     81        /usr/local/bin/rcc \
     82        /usr/qt/4/bin/rcc \
     83        /usr/share/qt4/bin/rcc \
     84        )))
     85    endif
    6586    ifneq ($(PATH_SDK_QT4),)
     87     export PATH_SDK_QT4
     88     
     89     # Locate the include files.
    6690     ifeq ($(PATH_SDK_QT4_INC),)
    67       PATH_SDK_QT4_INC := $(patsubst %/QtCore/qglobal.h,%,$(firstword $(wildcard $(PATH_SDK_QT4)/include/QtCore/qglobal.h $(PATH_SDK_QT4)/include/qt4/QtCore/qglobal.h /usr/include/qt4/QtCore/qtglobal.h)))
     91      PATH_SDK_QT4_INC := $(patsubst %/QtCore/qglobal.h,%,$(firstword $(wildcard \
     92        $(PATH_SDK_QT4)/include/QtCore/qglobal.h \
     93        $(PATH_SDK_QT4)/include/qt4/QtCore/qglobal.h \
     94        /usr/include/qt4/QtCore/qtglobal.h \
     95        /usr/local/include/qt4/QtCore/qtglobal.h \
     96        )))
    6897     endif
     98
     99     # Now for the libraries (mostly for helping out finding the KBUILD_TARGET libs).
    69100     ifeq ($(PATH_SDK_QT4_LIB.x86),)
    70101      PATH_SDK_QT4_LIB.x86   := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \
     
    78109        $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
    79110        )))
     111      ifneq ($(PATH_SDK_QT4_LIB.x86),)
     112       export PATH_SDK_QT4_LIB.x86
     113      endif
    80114     endif
    81115     ifeq ($(PATH_SDK_QT4_LIB.amd64),)
     
    93127        $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
    94128        )))
     129      ifneq ($(PATH_SDK_QT4_LIB.amd64),)
     130       export PATH_SDK_QT4_LIB.amd64
     131      endif
    95132     endif
     133
     134     # And finally, the library path for KBUILD_TARGET.
    96135     ifeq ($(PATH_SDK_QT4_LIB),)
    97136      PATH_SDK_QT4_LIB := $(PATH_SDK_QT4_LIB.$(KBUILD_TARGET))
    98137      ifeq ($(PATH_SDK_QT4_LIB),)
    99138       PATH_SDK_QT4_LIB := $(patsubst %/libQtCore$(SUFF_DLL),%,$(firstword $(wildcard \
    100         $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \
    101         $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
    102         /usr/lib/libQtCore$(SUFF_DLL) \
    103         /usr/lib/qt4/libQtCore$(SUFF_DLL) \
    104         /usr/local/lib/libQtCore$(SUFF_DLL) \
    105         /usr/local/lib/qt4/libQtCore$(SUFF_DLL) \
    106         )))
     139        $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \
     140        $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \
     141        /usr/lib/libQtCore$(SUFF_DLL) \
     142        /usr/lib/qt4/libQtCore$(SUFF_DLL) \
     143        /usr/local/lib/libQtCore$(SUFF_DLL) \
     144        /usr/local/lib/qt4/libQtCore$(SUFF_DLL) \
     145        )))
     146      endif
     147      ifneq ($(PATH_SDK_QT4_LIB),)
     148       export PATH_SDK_QT4_LIB
    107149      endif
    108150     endif
     151
    109152    endif
    110153   endif # Unices
     
    149192
    150193# Tool Specific Properties
    151 ifndef PATH_TOOL_QT4
    152  PATH_TOOL_QT4 := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_BLD)/qt/v4*)))
    153  ifeq ($(PATH_TOOL_QT4),)
    154   PATH_TOOL_QT4 := $(patsubst %/bin/qt3to4,%,$(firstword $(wildcard /usr/lib/qt4/bin/qt3to4 /usr/qt/4/bin/qt3to4 /usr/share/qt4/bin/qt3to4 /usr/local/bin/qt3to4 /usr/bin/qt3to4)))
     194#       PATH_TOOL_QT4     - Obsolete.
     195#       PATH_TOOL_QT4_BIN - The
     196#       TOOL_QT4_BIN_SUFF -
     197if !defined(PATH_TOOL_QT4_BIN) && defined(PATH_TOOL_QT4)
     198 PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4)/bin
     199endif
     200ifndef PATH_TOOL_QT4_BIN
     201 PATH_TOOL_QT4_BIN := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_BLD)/qt/v4*/bin)))
     202 ifeq ($(PATH_TOOL_QT4_BIN),)
     203  ifdef TOOL_QT4_BIN_SUFF
     204   TOOL_QT4_BIN_SUFF := $(TOOL_QT4_BIN_SUFF)
     205  endif
     206  # Try looking for qt3to4 first, then try moc-qt4/moc.
     207  PATH_TOOL_QT4_BIN := $(patsubst %/qt3to4,%,$(firstword $(wildcard \
     208        /usr/lib/qt4/bin/qt3to4 \
     209        /usr/qt/4/bin/qt3to4 \
     210        /usr/share/qt4/bin/qt3to4 \
     211        /usr/local/bin/qt3to4 \
     212        /usr/bin/qt3to4\
     213        )))
     214  ifeq ($(PATH_TOOL_QT4_BIN),)
     215   ifeq ($(TOOL_QT4_BIN_SUFF),)
     216    PATH_TOOL_QT4_BIN := $(patsubst %/moc-qt4,%,$(firstword $(wildcard \
     217        /usr/lib/qt4/bin/moc-qt4 \
     218        /usr/qt/4/bin/moc-qt4 \
     219        /usr/share/qt4/bin/moc-qt4 \
     220        /usr/local/bin/moc-qt4 \
     221        /usr/bin/moc-qt4 \
     222        )))
     223   endif
     224   ifneq ($(PATH_TOOL_QT4_BIN),)
     225    export TOOL_QT4_BIN_SUFF := -qt4
     226   else
     227    PATH_TOOL_QT4_BIN := $(patsubst %/moc$(TOOL_QT4_BIN_SUFF),%,$(firstword $(wildcard \
     228         /usr/lib/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \
     229         /usr/qt/4/bin/moc$(TOOL_QT4_BIN_SUFF) \
     230         /usr/share/qt4/bin/moc$(TOOL_QT4_BIN_SUFF) \
     231         /usr/local/bin/moc$(TOOL_QT4_BIN_SUFF) \
     232         /usr/bin/moc$(TOOL_QT4_BIN_SUFF) \
     233         )))
     234   endif
     235  endif
    155236 endif
    156237 # If not found, we'll enter the 'pathless' mode.
    157238else
    158239 # Resolve any fancy stuff once and for all.
    159  PATH_TOOL_QT4 := $(PATH_TOOL_QT4)
     240 PATH_TOOL_QT4_BIN := $(PATH_TOOL_QT4_BIN)
    160241endif
    161242ifneq ($(PATH_TOOL_QT4),)
    162  PATH_TOOL_QT4_BIN  ?= $(PATH_TOOL_QT4)/bin
    163  TOOL_QT4_MOC       ?= $(PATH_TOOL_QT4_BIN)/moc$(HOST_SUFF_EXE)
    164  TOOL_QT4_UIC       ?= $(PATH_TOOL_QT4_BIN)/uic$(HOST_SUFF_EXE)
    165  TOOL_QT4_RCC       ?= $(PATH_TOOL_QT4_BIN)/rcc$(HOST_SUFF_EXE)
    166  TOOL_QT4_LRC       ?= $(PATH_TOOL_QT4_BIN)/lrelease$(HOST_SUFF_EXE)
    167  TOOL_QT4_LUPDATE   ?= $(PATH_TOOL_QT4_BIN)/lupdate$(HOST_SUFF_EXE)
     243 TOOL_QT4_MOC       ?= $(PATH_TOOL_QT4_BIN)/moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     244 TOOL_QT4_UIC       ?= $(PATH_TOOL_QT4_BIN)/uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     245 TOOL_QT4_RCC       ?= $(PATH_TOOL_QT4_BIN)/rcc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     246 TOOL_QT4_LRC       ?= $(PATH_TOOL_QT4_BIN)/lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     247 TOOL_QT4_LUPDATE   ?= $(PATH_TOOL_QT4_BIN)/lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
    168248else
    169249 # Pathless, relies on the environment.
    170  TOOL_QT4_MOC       ?= moc$(HOST_SUFF_EXE)
    171  TOOL_QT4_UIC       ?= uic$(HOST_SUFF_EXE)
    172  TOOL_QT4_RCC       ?= rcc$(HOST_SUFF_EXE)
    173  TOOL_QT4_LRC       ?= lrelease$(HOST_SUFF_EXE)
    174  TOOL_QT4_LUPDATE   ?= lupdate$(HOST_SUFF_EXE)
     250 TOOL_QT4_MOC       ?= moc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     251 TOOL_QT4_UIC       ?= uic$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     252 TOOL_QT4_RCC       ?= rcc$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     253 TOOL_QT4_LRC       ?= lrelease$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
     254 TOOL_QT4_LUPDATE   ?= lupdate$(TOOL_QT4_BIN_SUFF)$(HOST_SUFF_EXE)
    175255endif
    176256
     
    906986endef # def_unit_qt4_target_pre
    907987
     988
     989#
     990# Rule for debugging.
     991#
     992unit-qt4-show-vars:
     993        @$(ECHO) 'The Qt4 SDK variables:'
     994        @$(ECHO) '  PATH_SDK_QT4           = "$(PATH_SDK_QT4)"'
     995        @$(ECHO) '  PATH_SDK_QT4_INC       = "$(PATH_SDK_QT4_INC)"'
     996        @$(ECHO) '  PATH_SDK_QT4_LIB       = "$(PATH_SDK_QT4_LIB)"'
     997        @$(ECHO) '  PATH_SDK_QT4_LIB.amd64 = "$(PATH_SDK_QT4_LIB.amd64)"'
     998        @$(ECHO) '  PATH_SDK_QT4_LIB.x86   = "$(PATH_SDK_QT4_LIB.x86)"'
     999        @$(ECHO) 'The Qt4 TOOL variables:'
     1000        @$(ECHO) '  PATH_TOOL_QT4_BIN      = "$(PATH_TOOL_QT4_BIN)"'
     1001        @$(ECHO) '  TOOL_QT4_BIN_SUFF      = "$(TOOL_QT4_BIN_SUFF)"'
     1002        @$(ECHO) '  TOOL_QT4_MOC           = "$(TOOL_QT4_MOC)"'
     1003        @$(ECHO) '  TOOL_QT4_UIC           = "$(TOOL_QT4_UIC)"'
     1004        @$(ECHO) '  TOOL_QT4_RCC           = "$(TOOL_QT4_RCC)"'
     1005        @$(ECHO) '  TOOL_QT4_LRC           = "$(TOOL_QT4_LRC)"'
     1006        @$(ECHO) '  TOOL_QT4_LUPDATE       = "$(TOOL_QT4_LUPDATE)"'
     1007       
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette