[Svxlink-devel] [PATCH] Add flags for split-builds
Brought to you by:
sm0svx
From: <red...@ge...> - 2011-06-19 02:59:16
|
From: Stuart Longland <red...@ge...> In binary-based distributions, the svxlink package is often split into separate binary builds for each component of svxlink. In Gentoo, the task is made complicated by the fact that the work tree is deleted and re-created with each package. svxlink's components typically rely on the built libraries being present in the build-tree, and as a consequence, the build system fails when you try to build the components separately in this manner. The following introduces three new flags; which are passed to make: - EXT_LIBASYNC - EXT_LIBECHOLIB - EXT_LIBLOCATIONINFO Setting any of these to 'y' will make svxlink treat that library like an external system library. --- branches/qt4/src/Makefile | 6 ++++- branches/qt4/src/create_config.sh | 4 +++ branches/qt4/src/echolib/Makefile.default | 13 +++++++++- branches/qt4/src/qtel/Makefile.default | 22 +++++++++++++++++- .../qt4/src/svxlink/dtmf_plot/Makefile.default | 11 ++++++++- .../qt4/src/svxlink/remotetrx/Makefile.default | 13 +++++++++- .../qt4/src/svxlink/siglevdetcal/Makefile.default | 13 +++++++++- branches/qt4/src/svxlink/svxlink/Makefile.default | 23 ++++++++++++++++++- branches/qt4/src/svxlink/trx/Makefile.default | 3 ++ 9 files changed, 96 insertions(+), 12 deletions(-) diff --git a/branches/qt4/src/Makefile b/branches/qt4/src/Makefile index 7736855..0c48e6e 100644 --- a/branches/qt4/src/Makefile +++ b/branches/qt4/src/Makefile @@ -116,7 +116,11 @@ ifeq ($(OS),) for dir in $${SUBDIRS}; do \ if [ -d $$dir ]; then \ $(PRINT_DIR) $(CURRENT_SUBDIR)$$dir ; \ - make CURRENT_SUBDIR="$(CURRENT_SUBDIR)$$dir/" -C $$dir $@; \ + make CURRENT_SUBDIR="$(CURRENT_SUBDIR)$$dir/" -C $$dir \ + EXT_LIBASYNC=$(EXT_LIBASYNC) \ + EXT_LIBECHOLIB=$(EXT_LIBECHOLIB) \ + EXT_LIBLOCATIONINFO=$(EXT_LIBLOCATIONINFO) \ + $@; \ ec=$$?; \ if [ $$ec -ne 0 ]; then \ exit $$ec; \ diff --git a/branches/qt4/src/create_config.sh b/branches/qt4/src/create_config.sh index 50dbfe4..16ff992 100755 --- a/branches/qt4/src/create_config.sh +++ b/branches/qt4/src/create_config.sh @@ -157,6 +157,10 @@ else exit_error fi +# Pass in build flags +output "EXT_LIBASYNC=${EXT_LIBASYNC}" +output "EXT_LIBECHOLIB=${EXT_LIBECHOLIB}" +output "EXT_LIBLOCATIONINFO=${EXT_LIBLOCATIONINFO}" exit 0 diff --git a/branches/qt4/src/echolib/Makefile.default b/branches/qt4/src/echolib/Makefile.default index 755a1ae..6c950fe 100644 --- a/branches/qt4/src/echolib/Makefile.default +++ b/branches/qt4/src/echolib/Makefile.default @@ -34,10 +34,16 @@ CPPPROGS = echolib_test EchoLinkDispatcher_demo EchoLinkDirectory_demo \ PRGSRC = EchoLinkQsoTest.cpp # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -lecholib -lasynccpp -lasyncaudio -lasynccore +PROJLIBS := -lecholib +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Libraries external to the project -LIBS = -lpopt $(SIGC_LIBS) +LIBS := -lpopt $(SIGC_LIBS) +ifeq ($(EXT_LIBASYNC),y) +LIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -173,6 +179,9 @@ RPM_NAME := # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) -I/usr/include/gsm +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/qtel/Makefile.default b/branches/qt4/src/qtel/Makefile.default index c3270f1..9ba9ba4 100644 --- a/branches/qt4/src/qtel/Makefile.default +++ b/branches/qt4/src/qtel/Makefile.default @@ -37,10 +37,22 @@ PRGSRC = MainWindow.cpp ComDialog.cpp Settings.cpp MsgHandler.cpp \ Vox.cpp # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -lecholib -lasyncqt -lasyncaudio -lasynccore +PROJLIBS := +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasyncqt -lasyncaudio -lasynccore +endif +ifneq ($(EXT_LIBECHOLIB),y) +PROJLIBS += -lecholib +endif # Libraries external to the project -LIBS = $(QT_LIBS) $(SIGC_LIBS) +LIBS := $(QT_LIBS) $(SIGC_LIBS) +ifeq ($(EXT_LIBASYNC),y) +LIBS += -lasyncqt -lasyncaudio -lasynccore +endif +ifeq ($(EXT_LIBECHOLIB),y) +LIBS += -lecholib +endif # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -217,6 +229,12 @@ include $(ROOT)/makefile.inc # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += -I/usr/include/gsm $(SIGC_INCPATH) $(QT_INCPATH) +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif +ifeq ($(EXT_LIBECHOLIB),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/svxlink/dtmf_plot/Makefile.default b/branches/qt4/src/svxlink/dtmf_plot/Makefile.default index e75b4f6..bd30ea7 100644 --- a/branches/qt4/src/svxlink/dtmf_plot/Makefile.default +++ b/branches/qt4/src/svxlink/dtmf_plot/Makefile.default @@ -34,10 +34,16 @@ CPPPROGS = $(BIN)/dtmf_plot PRGSRC = ToneDetector.cpp DtmfDecoder.cpp # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -lasyncqt -lasyncaudio +PROJLIBS := +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasyncqt -lasyncaudio +endif # Libraries external to the project LIBS = $(QT_LIBS) +ifeq ($(EXT_LIBASYNC),y) +LIBS += -lasyncqt -lasyncaudio +endif # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -215,6 +221,9 @@ RPM_NAME := # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) $(QT_INCPATH) +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/svxlink/remotetrx/Makefile.default b/branches/qt4/src/svxlink/remotetrx/Makefile.default index 3c682bb..d9fd3ae 100644 --- a/branches/qt4/src/svxlink/remotetrx/Makefile.default +++ b/branches/qt4/src/svxlink/remotetrx/Makefile.default @@ -30,10 +30,16 @@ PRGSRC = TrxHandler.cpp Uplink.cpp NetUplink.cpp RfUplink.cpp \ NetTrxAdapter.cpp # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -ltrx -lasynccpp -lasyncaudio -lasynccore +PROJLIBS := -ltrx +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Libraries external to the project -LIBS = -lpopt $(GCRYPT_LIBS) $(SIGC_LIBS) +LIBS := -lpopt $(GCRYPT_LIBS) $(SIGC_LIBS) +ifeq ($(EXT_LIBASYNC),y) +LIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -191,6 +197,9 @@ RPM_NAME := # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/svxlink/siglevdetcal/Makefile.default b/branches/qt4/src/svxlink/siglevdetcal/Makefile.default index 324cc1f..60a2ba3 100644 --- a/branches/qt4/src/svxlink/siglevdetcal/Makefile.default +++ b/branches/qt4/src/svxlink/siglevdetcal/Makefile.default @@ -29,10 +29,16 @@ CPPPROGS = $(BIN)/siglevdetcal PRGSRC = # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -ltrx -lasynccpp -lasyncaudio -lasynccore +PROJLIBS := -ltrx +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Libraries external to the project -LIBS = $(SIGC_LIBS) $(GCRYPT_LIBS) +LIBS := $(SIGC_LIBS) $(GCRYPT_LIBS) +ifeq ($(EXT_LIBASYNC),y) +LIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -190,6 +196,9 @@ RPM_NAME := # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) +ifneq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/svxlink/svxlink/Makefile.default b/branches/qt4/src/svxlink/svxlink/Makefile.default index ed12fc9..d680e1d 100644 --- a/branches/qt4/src/svxlink/svxlink/Makefile.default +++ b/branches/qt4/src/svxlink/svxlink/Makefile.default @@ -31,10 +31,26 @@ PRGSRC = MsgHandler.cpp Module.cpp Logic.cpp SimplexLogic.cpp \ CmdParser.cpp QsoRecorder.cpp # Libraries compiled in the project (in $(LIB)). -PROJLIBS = -ltrx -llocationinfo -lasynccpp -lasyncaudio -lasynccore +PROJLIBS := -ltrx +ifneq ($(EXT_LIBLOCATIONINFO),y) +PROJLIBS += -llocationinfo +endif +ifneq ($(EXT_LIBASYNC),y) +PROJLIBS += -lasynccpp -lasyncaudio -lasynccore +endif + +# Libraries from the project that were compiled and installed earlier +MY_LIBS := +ifeq ($(EXT_LIBLOCATIONINFO),y) +MY_LIBS += -llocationinfo +endif +ifeq ($(EXT_LIBASYNC),y) +MY_LIBS += -lasynccpp -lasyncaudio -lasynccore +endif # Libraries external to the project -LIBS = -ldl -lpopt -lgsm $(TCL_LIBS) $(GCRYPT_LIBS) $(SIGC_LIBS) +LIBS = -ldl -lpopt -lgsm $(TCL_LIBS) $(GCRYPT_LIBS) $(SIGC_LIBS) \ + $(MY_LIBS) # Specify Qt header files here that you want to run the # Qt Meta Object Compiler on (for programs). @@ -192,6 +208,9 @@ RPM_NAME := svxlink # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) -I/usr/include/gsm -I/usr/include/tcl8.4 +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. diff --git a/branches/qt4/src/svxlink/trx/Makefile.default b/branches/qt4/src/svxlink/trx/Makefile.default index 8a0438d..f316f07 100644 --- a/branches/qt4/src/svxlink/trx/Makefile.default +++ b/branches/qt4/src/svxlink/trx/Makefile.default @@ -197,6 +197,9 @@ RPM_NAME := # Paths to includefile-directories. All directories must be preceeded # by the "-I" switch. INCPATH += $(SIGC_INCPATH) +ifeq ($(EXT_LIBASYNC),y) +INCPATH += -I/usr/include/svxlink +endif # Paths to library-directories. All directories must be preceeded # by the "-L" switch. -- 1.7.3.4 |