From 2a5373ae28760f9db6f693b429b32549798c4897 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 10 Sep 2019 09:00:05 -0300 Subject: [PATCH] Adding configure option to enable/disable the installation of the static library. --- Makefile.in | 6 ++---- configure.ac | 30 +++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index d917107..4558a3a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,6 +29,7 @@ SONAME=@SONAME@ LIBNAME=libv3270 PRODUCT_NAME=@PRODUCT_NAME@ +INSTALL_PACKAGES=@INSTALL_PACKAGES@ SOURCES= \ $(wildcard src/terminal/*.c) \ @@ -274,10 +275,7 @@ $(BINRLS)/static/$(LIBNAME).a: \ #---[ Install Targets ]------------------------------------------------------------------ install: \ - install-shared \ - install-static \ - install-glade \ - install-dev + $(foreach PKG, $(INSTALL_PACKAGES), install-$(PKG)) install-shared: \ $(BINRLS)/$(SONAME) diff --git a/configure.ac b/configure.ac index 27d86de..1e18a10 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,7 @@ dnl obter mais detalhes. dnl dnl Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este dnl programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple + dnl Place, Suite 330, Boston, MA, 02111-1307, USA dnl dnl Contatos: @@ -73,6 +74,7 @@ APP_RESOURCES="" APP_LDFLAGS="" DLL_LDFLAGS="-shared -Wl,-soname,\$(@F)" STATIC_LDFLAGS="" +INSTALL_PACKAGES="shared dev glade" dnl --------------------------------------------------------------------------- dnl Check for OS specifics @@ -89,6 +91,8 @@ case "$host" in DLL_LDFLAGS="-shared -Wl,--output-def,\$(@D)/\$(LIBNAME).def" DLLEXT=".dll" + app_cv_static='yes' + app_win32_revision=$(date +%-y.%-m.%-d.%-H) AC_SUBST(WIN32_VERSION,$app_win32_revision) @@ -98,13 +102,6 @@ case "$host" in AC_CONFIG_FILES(src/terminal/windows/resources.rc) ;; - s390x-*) - CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" - app_cv_osname="linux" - LOGDIR="/var/log" - ;; - *) CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" @@ -112,6 +109,8 @@ case "$host" in LOGDIR="/var/log" DLLEXT=".so" + app_cv_static='no' + esac AC_SUBST(OSNAME,$app_cv_osname) @@ -185,6 +184,21 @@ case "$host" in esac +dnl --------------------------------------------------------------------------- +dnl Check for static library options +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static], [Enable build and install the static library])], +[ + app_cv_static="$enableval" +],[ + AC_MSG_NOTICE([Keep default selection for static library.]) +]) + +if test "$app_cv_static" == "yes"; then + INSTALL_PACKAGES="$INSTALL_PACKAGES static" +fi dnl --------------------------------------------------------------------------- dnl Check for libm (Required for spinner) @@ -337,6 +351,8 @@ dnl --------------------------------------------------------------------------- dnl Configure which files to generate. dnl --------------------------------------------------------------------------- +AC_SUBST(INSTALL_PACKAGES) + AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(sdk/libv3270.pc) AC_CONFIG_FILES(glade/v3270.xml) -- libgit2 0.21.2