+ config/detfun.mk
+ config/detect.mk
* config/global.mk
+ Added generic external component detection function.
+ Added central detection for optional external components
used by Harbour core. These are: openssl, gpm, slang, curses, x11
Easy to extend with new ones.
The detection code will run once per make session and
results can be used in all our make files by checking HB_HAS_*
variable. If it's empty we cannot use the component, if
it's not we can. In this case it contains dir where headers
were located. It's possible that it's a list of paths.
Users can control these components by using HB_INC_* variable
the following way: if it's left empty, Harbour make system
will automatically look into default locations, this usually
works on *nix systems. If set to a path (or a list of paths),
this list will be checked. Finally to explicitly disable a
component, user can set the variable to 'no'.
Following legacy control variables are yet understood, but
the will be removed in the near future:
HB_WITHOUT_GTCRS=yes is the same as HB_INC_CURSES=no
HB_WITHOUT_SLANG=yes is the same as HB_INC_SLANG=no
HB_WITHOUT_GTXWC=yes is the same as HB_INC_X11=no
Notice that these settings aren't meant to allow user control
of actual Harbour components (like gtxwc). If we need something
like this, we can do it, but it wasn't the subject of this change.
HB_GPM_MOUSE var is still set for compatibility with internals.
NOTE: I've left verbose output on to see what's happening, this will
tuned after testing.
; TODO: Remove reliance on legacy settings in our own codebase.
; TODO: Start using HB_HAS_* values for dynamic lib syslib list assembly
and in GT Makefiles.
* contrib/hbtip/hbtipssl/Makefile
* contrib/hbtip/Makefile
* contrib/hbssl/Makefile
* HB_HAS_OPENSSL works a little differently now, not empty
means 'yes', empty means 'no'.
147 lines
3.4 KiB
Makefile
147 lines
3.4 KiB
Makefile
#
|
|
# $Id$
|
|
#
|
|
|
|
# ---------------------------------------------------------------
|
|
# Copyright 2009 Viktor Szakats (harbour.01 syenar.hu)
|
|
# See COPYING for licensing terms.
|
|
#
|
|
# This make file will detect optional external components
|
|
# used in Harbour core code.
|
|
# ---------------------------------------------------------------
|
|
|
|
# NOTE:
|
|
# INPUT:
|
|
# HB_INC_* variable with following possible contents:
|
|
# (empty) - Will enable external component if found on default locations
|
|
# no - Will disable external component
|
|
# <dirlist> - Will specify locations to check for the external component
|
|
# OUTPUT:
|
|
# HB_HAS_* variable with following possible contents:
|
|
# (empty) - We can't use this component
|
|
# <dirlist> - Component headers were found at these locations
|
|
# config/conf.mk if found, will
|
|
|
|
ifeq ($(DETECT_MK_),)
|
|
export DETECT_MK_ := yes
|
|
|
|
# Reset everything to default
|
|
export HB_HAS_OPENSSL :=
|
|
export HB_HAS_GPM :=
|
|
export HB_HAS_SLANG :=
|
|
export HB_HAS_CURSES :=
|
|
export HB_HAS_X11 :=
|
|
|
|
# Allow detection by external (generated) config file
|
|
|
|
-include $(TOP)$(ROOT)config/conf.mk
|
|
|
|
# Exclude Harbour-wide features prohibiting commercial use
|
|
|
|
ifeq ($(HB_COMMERCE),yes)
|
|
export HB_INC_GPM := no
|
|
export HB_INC_SLANG := no
|
|
endif
|
|
|
|
# Compatibility inputs (deprecated)
|
|
|
|
ifeq ($(HB_WITHOUT_GTCRS),yes)
|
|
export HB_INC_CURSES := no
|
|
endif
|
|
ifeq ($(HB_WITHOUT_SLANG),yes)
|
|
export HB_INC_SLANG := no
|
|
endif
|
|
ifeq ($(HB_WITHOUT_GTXWC),yes)
|
|
export HB_INC_X11 := no
|
|
endif
|
|
|
|
# Detect OpenSSL
|
|
|
|
_DET_DSP_NAME := OpenSSL
|
|
_DET_VAR_INC_ := HB_INC_OPENSSL
|
|
_DET_VAR_HAS_ := HB_HAS_OPENSSL
|
|
_DET_UNS_PLAT := dos
|
|
_DET_UNS_COMP := watcom
|
|
_DET_INC_DEFP := /usr/include /usr/local/ssl/include
|
|
_DET_INC_HEAD := /openssl/ssl.h
|
|
|
|
include $(TOP)$(ROOT)config/detfun.mk
|
|
|
|
# Detect GPM mouse
|
|
|
|
_DET_DSP_NAME := GPM
|
|
_DET_VAR_INC_ := HB_INC_GPM
|
|
_DET_VAR_HAS_ := HB_HAS_GPM
|
|
_DET_UNS_PLAT := linux
|
|
_DET_UNS_COMP :=
|
|
_DET_INC_DEFP := /usr/include /usr/local/include
|
|
_DET_INC_HEAD := /gpm.h
|
|
|
|
include $(TOP)$(ROOT)config/detfun.mk
|
|
|
|
# Detect slang
|
|
|
|
_DET_DSP_NAME := slang
|
|
_DET_VAR_INC_ := HB_INC_SLANG
|
|
_DET_VAR_HAS_ := HB_HAS_SLANG
|
|
_DET_UNS_PLAT :=
|
|
_DET_UNS_COMP :=
|
|
_DET_INC_DEFP :=
|
|
_DET_INC_HEAD := /slang.h
|
|
|
|
ifeq ($(HB_LOCAL_SLN),yes)
|
|
_DET_INC_DEFP += /usr/local/include /usr/local/include/slang
|
|
else
|
|
_DET_INC_DEFP += /usr/include /usr/include/slang
|
|
_DET_INC_DEFP += /usr/usr/local/include /usr/local/include/slang
|
|
_DET_INC_DEFP += /sw/include /sw/include/slang
|
|
_DET_INC_DEFP += /opt/local/include /opt/local/include/slang
|
|
endif
|
|
|
|
include $(TOP)$(ROOT)config/detfun.mk
|
|
|
|
# Detect curses
|
|
|
|
_DET_DSP_NAME := curses
|
|
_DET_VAR_INC_ := HB_INC_CURSES
|
|
_DET_VAR_HAS_ := HB_HAS_CURSES
|
|
_DET_UNS_PLAT := os2
|
|
_DET_UNS_COMP :=
|
|
_DET_INC_DEFP :=
|
|
_DET_INC_HEAD := /curses.h
|
|
|
|
ifeq ($(HB_NCURSES_194),yes)
|
|
_DET_INC_DEFP += /usr/include/ncur194
|
|
else
|
|
_DET_INC_DEFP += /usr/include /usr/local/include /sw/include /opt/local/include
|
|
endif
|
|
ifeq ($(HB_COMPILER),djgpp)
|
|
_DET_INC_DEFP += $(foreach d, $(subst $(PTHSEP), ,$(PATH)), $(d)/../include)
|
|
endif
|
|
|
|
include $(TOP)$(ROOT)config/detfun.mk
|
|
|
|
# Detect X11
|
|
|
|
_DET_DSP_NAME := X11
|
|
_DET_VAR_INC_ := HB_INC_X11
|
|
_DET_VAR_HAS_ := HB_HAS_X11
|
|
_DET_UNS_PLAT :=
|
|
_DET_UNS_COMP :=
|
|
_DET_INC_DEFP := /usr/include
|
|
_DET_INC_HEAD := /X11/Xlib.h
|
|
|
|
include $(TOP)$(ROOT)config/detfun.mk
|
|
|
|
# Finished
|
|
|
|
# Compatibility outputs (deprecated)
|
|
|
|
ifeq ($(HB_HAS_GPM),)
|
|
HB_GPM_MOUSE := no
|
|
else
|
|
HB_GPM_MOUSE := yes
|
|
endif
|
|
|
|
endif # DETECT_MK_
|