From cf3ac71a3cee4763c411bf1e09ede5e5160d6c97 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 1 Mar 2019 18:59:22 +0100 Subject: nxdialog: fix example --- nxdialog/bin/nxdialog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxdialog/bin/nxdialog b/nxdialog/bin/nxdialog index 0678ee4f2..bce1886e3 100755 --- a/nxdialog/bin/nxdialog +++ b/nxdialog/bin/nxdialog @@ -47,7 +47,7 @@ # # Examples: # nxdialog --dialog yesno --message "message text" --caption "message title" --parent 0 -# nxdialog --dialog yesno --message "message text" --caption "message title" --window 0x123456 --parent 0 +# nxdialog --dialog pulldown --message "message text" --caption "message title" --window 0x123456 --parent 0 from __future__ import print_function -- cgit v1.2.3 From 3af59f80675c394ff2f24c1e2dccabcb5e383fac Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Mon, 25 Mar 2019 06:42:08 +0100 Subject: nxdialog/: create (almost) empty m4 directory. Older autoconf versions - as used on SLE 11 and RHEL 6 - choke if aclocal is passed an include directory that does not exist. Instead of removing the option from the aclocal call, let's keep it and just use an empty directory for now. Maybe we'll actually use it at a later time. --- nxdialog/m4/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 nxdialog/m4/.keep diff --git a/nxdialog/m4/.keep b/nxdialog/m4/.keep new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3 From 1b6da5992dd983a8526e91cd93dd98c01a81aa5b Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 4 Apr 2019 11:18:35 +0200 Subject: nxcomp/src/Makefile.am: PTHREAD_LDFLAGS does not exist, replace with PTHREAD_LIBS. --- nxcomp/src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxcomp/src/Makefile.am b/nxcomp/src/Makefile.am index 682ddbaca..9cecae88e 100644 --- a/nxcomp/src/Makefile.am +++ b/nxcomp/src/Makefile.am @@ -139,7 +139,7 @@ AM_CPPFLAGS = \ libXcomp_la_LDFLAGS = \ -version-number @LT_COMP_VERSION@ \ -no-undefined \ - $(PTHREAD_LDFLAGS) \ + @PTHREAD_LIBS@ \ $(NULL) libXcompincludedir = $(includedir)/nx -- cgit v1.2.3 From 2efaa423bdfb8067897028854a5c56086d3843fc Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Mon, 1 Apr 2019 09:16:43 +0200 Subject: m4/: update external macros from autoconf-archive. --- m4/ax_cxx_compile_stdcxx.m4 | 45 +++++++-------------------------------------- m4/ax_pthread.m4 | 5 +++-- 2 files changed, 10 insertions(+), 40 deletions(-) diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index 5032bba80..43087b2e6 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -33,19 +33,19 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016 Krzesimir Nowak +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 11 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). -AX_REQUIRE_DEFINED([AC_MSG_WARN]) AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], @@ -61,14 +61,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then @@ -139,7 +131,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) - m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) ]) @@ -199,11 +190,13 @@ namespace cxx11 struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -587,20 +580,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ #error "This is not a C++ compiler" -#elif __cplusplus <= 201402L +#elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else -#if defined(__clang__) - #define REALLY_CLANG -#else - #if defined(__GNUC__) - #define REALLY_GCC - #endif -#endif - #include #include #include @@ -608,16 +593,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ namespace cxx17 { -#if !defined(REALLY_CLANG) namespace test_constexpr_lambdas { - // TODO: test it with clang++ from git - constexpr int foo = [](){return 42;}(); } -#endif // !defined(REALLY_CLANG) namespace test::nested_namespace::definitions { @@ -852,12 +833,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_template_argument_deduction_for_class_templates { - // TODO: test it with clang++ from git - template struct pair { @@ -876,7 +854,6 @@ namespace cxx17 } } -#endif // !defined(REALLY_CLANG) namespace test_non_type_auto_template_parameters { @@ -890,12 +867,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_structured_bindings { - // TODO: test it with clang++ from git - int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; @@ -927,14 +901,10 @@ namespace cxx17 const auto [ x3, y3 ] = f3(); } -#endif // !defined(REALLY_CLANG) -#if !defined(REALLY_CLANG) namespace test_exception_spec_type_system { - // TODO: test it with clang++ from git - struct Good {}; struct Bad {}; @@ -952,7 +922,6 @@ namespace cxx17 static_assert (std::is_same_v); } -#endif // !defined(REALLY_CLANG) namespace test_inline_variables { @@ -977,6 +946,6 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus <= 201402L +#endif // __cplusplus < 201703L ]]) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 5fbf9fe0d..4920e073b 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -82,7 +82,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 24 +#serial 25 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -438,7 +438,8 @@ if test "x$ax_pthread_ok" = "xyes"; then AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) -- cgit v1.2.3 From 95f8cf7ea0a169b47c84be29d0db3a40d1a86d86 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 4 Apr 2019 11:06:05 +0200 Subject: m4/ax_pthread.m4: implement workaround for libtool bug #13550. Find the first available pthread library and use it together with the -pthread flag if the C compiler is set to GCC. Fixes: ArcticaProject/nx-libs#756 --- m4/ax_pthread.m4 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 4920e073b..07a9cd265 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -83,6 +83,7 @@ # exception to the GPL to apply to your modified version as well. #serial 25 +#arctica-serial 1 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ @@ -334,6 +335,42 @@ for ax_pthread_try_flag in $ax_pthread_flags; do PTHREAD_LIBS="-lpthread" ;; + -pthread) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + + if test "x$GCC" = "xyes"; then + # Thanks to libtool bug #13550, we have to consider the possibility + # that -nostdlib will be used during compilation at some point. + # Try to determine the first pthread library available, + # ignoring any other variants. + for ax_pthread_try_lib_flag in $ax_pthread_flags; do + case $ax_pthread_try_lib_flag in + none|-*|pthread-config) + continue + ;; + + *) + PTHREAD_LIBS="-l$ax_pthread_try_lib_flag" + + ax_pthread_save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + + # We only need to link a trivial program with + # the current library value. + # Linking should fail if the library doesn't + # exist, otherwise we should be good to go. + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [LIBS="$ax_pthread_save_LIBS" + break], + [LIBS="$ax_pthread_save_LIBS" + PTHREAD_LIBS=""]) + ;; + esac + done + fi + ;; + -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" -- cgit v1.2.3 From d1fe6a6016efbb4f487dcac2f91194e58597ee3b Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 4 Apr 2019 11:15:22 +0200 Subject: nxproxy/{m4,configure.ac,src/Makefile.am}: drop pthread overlinking. Should be fixed by correctly building libXcomp. See: ArcticaProject/nx-libs#756 --- nxproxy/configure.ac | 11 ----------- nxproxy/m4/ax_pthread.m4 | 1 - nxproxy/src/Makefile.am | 3 --- 3 files changed, 15 deletions(-) delete mode 120000 nxproxy/m4/ax_pthread.m4 diff --git a/nxproxy/configure.ac b/nxproxy/configure.ac index 6a0a41cbb..2ca64f61e 100644 --- a/nxproxy/configure.ac +++ b/nxproxy/configure.ac @@ -28,17 +28,6 @@ NX_DEFAULT_OPTIONS NX_TARGET_USE_ELF -dnl This is a workaround for a nasty libtool bug. -dnl We actually compile libXcomp with pthread support, but libtool uses g++ ... -nostdlib ... -pthread -dnl on Linux. -nostdlib causes -pthread to be ignored. -dnl According to GCC upstream, this is not a bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -dnl GCC upstream insists that libtool needs to handle -pthread in a special way when using -nostdlib. -dnl A patch has been submitted to the libtool project: http://lists.gnu.org/archive/html/libtool-patches/2013-11/msg00015.html -dnl but never applied to the code base. Boo. -dnl We will work around this bug by using AX_PTHREAD and linking with pthread support in all consumers of -dnl libXcomp for now. -AX_PTHREAD([], AC_MSG_ERROR([no POSIX threads support detected])) - AC_CONFIG_FILES([ Makefile man/Makefile diff --git a/nxproxy/m4/ax_pthread.m4 b/nxproxy/m4/ax_pthread.m4 deleted file mode 120000 index 156af3df3..000000000 --- a/nxproxy/m4/ax_pthread.m4 +++ /dev/null @@ -1 +0,0 @@ -../../m4/ax_pthread.m4 \ No newline at end of file diff --git a/nxproxy/src/Makefile.am b/nxproxy/src/Makefile.am index fbe52cbf8..20ec7022e 100644 --- a/nxproxy/src/Makefile.am +++ b/nxproxy/src/Makefile.am @@ -9,12 +9,10 @@ nxproxy_SOURCES = \ $(NULL) nxproxy_LDADD = \ - @PTHREAD_LIBS@ \ -L$(top_srcdir)/../nxcomp/src/.libs -lXcomp \ $(NULL) nxproxy_LDFLAGS = \ - $(PTHREAD_LDFLAGS) \ $(NULL) if TARGET_ELF @@ -25,7 +23,6 @@ endif TARGET_ELF nxproxy_CFLAGS = \ $(BASE_CFLAGS) \ - $(PTHREAD_CFLAGS) \ $(NULL) AM_CPPFLAGS = \ -- cgit v1.2.3 From dd0d49c4ef08ddd0e6cb8e689f07ee84b51c2974 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 4 Apr 2019 13:07:40 +0200 Subject: debian/patches/{,series}: remove 2004_enforce-lpthread.patch. This workaround/hack should not be needed any longer. --- debian/patches/2004_enforce-lpthread.patch | 33 ------------------------------ debian/patches/series | 1 - 2 files changed, 34 deletions(-) delete mode 100644 debian/patches/2004_enforce-lpthread.patch diff --git a/debian/patches/2004_enforce-lpthread.patch b/debian/patches/2004_enforce-lpthread.patch deleted file mode 100644 index 474feb0dd..000000000 --- a/debian/patches/2004_enforce-lpthread.patch +++ /dev/null @@ -1,33 +0,0 @@ -Description: Enforce -lpthread when linking nxcomp. -Author: Mike Gabriel -Abstract: - This is a workaround for a nasty libtool bug!!! - . - We actually compile libXcomp with pthread support, but libtool uses g++ - ... -nostdlib ... -pthread on Linux. -nostdlib causes -pthread to be - ignored. - . - According to GCC upstream, this is not a bug: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 - . - GCC upstream insists that libtool needs to handle -pthread in a special - way when using -nostdlib. - . - A patch has been submitted to the libtool project: - http://lists.gnu.org/archive/html/libtool-patches/2013-11/msg00015.html - but never applied to the code base. Boo. - . - We will work around this bug by hard-coding the linking with pthread - support in libXcomp for now. - ---- a/nxcomp/src/Makefile.am -+++ b/nxcomp/src/Makefile.am -@@ -139,7 +139,7 @@ - libXcomp_la_LDFLAGS = \ - -version-number @LT_COMP_VERSION@ \ - -no-undefined \ -- $(PTHREAD_LDFLAGS) \ -+ $(PTHREAD_LDFLAGS) -lpthread \ - $(NULL) - - libXcompincludedir = $(includedir)/nx diff --git a/debian/patches/series b/debian/patches/series index 745ba5c80..e1ec9c56d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ 2001_nx-X11_install-location.debian.patch 2002_xserver-xext_set-securitypolicy-path.debian.patch 2003_nxdialog-use-python3.patch -2004_enforce-lpthread.patch -- cgit v1.2.3