]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
b2sum: port to HP-UX aCC
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 May 2019 19:42:23 +0000 (12:42 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 May 2019 19:42:58 +0000 (12:42 -0700)
Its support for the -include option is flaky.  Problem reported by
Michael Osipov (Bug#35650).  Plus, we could run into other
compilers that don’t support any option like -include.  Change the
code so that -include is not needed.  Although this causes us to
depart from the upstream version, we’re already doing that for
other reasons.
* configure.ac (USE_XLC_INCLUDE): Remove, as there’s no
guarantee a compiler will support something like -include.
* src/blake2/b2sum.c [HAVE_CONFIG_H]: Include <config.h>.
* src/local.mk (src_b2sum_CPPFLAGS): Add -DHAVE_CONFIG_H.
Do not use -include or a substitute.

configure.ac
src/blake2/b2sum.c
src/local.mk

index f97ff862eb6546186f5487dd279708f7e22d2dae..781a305e2966c5d6543956b17fe7947a1cdcc3b8 100644 (file)
@@ -508,18 +508,6 @@ CFLAGS=$ac_save_CFLAGS
 LDFLAGS=$ac_save_LDFLAGS
 ac_c_werror_flag=$cu_save_c_werror_flag
 
-# Detect when using xlc to determine whether to use -qinclude=
-AC_CACHE_CHECK([whether the system supports xlc include], [utils_cv_xlc],
-  [AC_COMPILE_IFELSE(
-     [AC_LANG_PROGRAM([[
-          #ifndef __xlc__
-            #error "not xlc"
-          #endif
-        ]])],
-     [utils_cv_xlc=yes],
-     [utils_cv_xlc=no])])
-AM_CONDITIONAL([USE_XLC_INCLUDE], [test "$utils_cv_xlc" = yes])
-
 ############################################################################
 
 dnl Autogenerated by the 'gen-lists-of-programs.sh' auxiliary script.
index 5df2046f867c712f16f68bc7c1409219923c0a49..5cb25b86a3fb714095588e129dc0d1378afdd75c 100644 (file)
    https://blake2.net.
 */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index a69d40521e055529c83ed04c06f3dd5b144d62d0..763c8a01c6ee4da5acadf0a7c952c381bb811c53 100644 (file)
@@ -399,14 +399,7 @@ src_sha384sum_SOURCES = src/md5sum.c
 src_sha384sum_CPPFLAGS = -DHASH_ALGO_SHA384=1 $(AM_CPPFLAGS)
 src_sha512sum_SOURCES = src/md5sum.c
 src_sha512sum_CPPFLAGS = -DHASH_ALGO_SHA512=1 $(AM_CPPFLAGS)
-# Include the file on the command line to avoid modifying
-# the blake2 upstream source
-if USE_XLC_INCLUDE
-src_b2sum_CPPFLAGS = -qinclude=config.h
-else
-src_b2sum_CPPFLAGS = -include config.h
-endif
-src_b2sum_CPPFLAGS += -DHASH_ALGO_BLAKE2=1 $(AM_CPPFLAGS)
+src_b2sum_CPPFLAGS = -DHASH_ALGO_BLAKE2=1 -DHAVE_CONFIG_H $(AM_CPPFLAGS)
 src_b2sum_SOURCES = src/md5sum.c \
                    src/blake2/blake2.h src/blake2/blake2-impl.h \
                    src/blake2/blake2b-ref.c \