From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QwYCY-0002uo-N1 for garchives@archives.gentoo.org; Thu, 25 Aug 2011 11:34:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AAA0C21C0AF; Thu, 25 Aug 2011 11:34:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4C51921C0AF for ; Thu, 25 Aug 2011 11:34:19 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7A30B1B4021 for ; Thu, 25 Aug 2011 11:34:18 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2279) id 4218C2004C; Thu, 25 Aug 2011 11:34:16 +0000 (UTC) From: "Michal Gorny (mgorny)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, mgorny@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-arch/zpaq/files: zpaq-3-autotools.patch zpaq-2-autotools.patch 0001-Add-autotools-files.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: zpaq-3-autotools.patch zpaq-2-autotools.patch 0001-Add-autotools-files.patch X-VCS-Directories: app-arch/zpaq/files X-VCS-Committer: mgorny X-VCS-Committer-Name: Michal Gorny Content-Type: text/plain; charset=utf8 Message-Id: <20110825113416.4218C2004C@flycatcher.gentoo.org> Date: Thu, 25 Aug 2011 11:34:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 3f372066a26b974261e2332e5546b4c7 mgorny 11/08/25 11:34:16 Added: zpaq-3-autotools.patch zpaq-2-autotools.patch Removed: 0001-Add-autotools-files.patch Log: Version bump. Add USE=3Ddebug. Adjust lib deps. Remove pointless lib ch= eck from generated autotools. =20 (Portage version: 2.2.0_alpha51_p9/cvs/Linux x86_64) Revision Changes Path 1.1 app-arch/zpaq/files/zpaq-3-autotools.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/zpaq/file= s/zpaq-3-autotools.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/zpaq/file= s/zpaq-3-autotools.patch?rev=3D1.1&content-type=3Dtext/plain Index: zpaq-3-autotools.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >From cb14b21eb30e3c78eb475aabab97a89d3d428d91 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Micha=3DC5=3D82=3D20G=3DC3=3DB3rny?=3D Date: Tue, 4 Jan 2011 21:04:53 +0100 Subject: [PATCH] Add autotools files. --- Makefile.am | 28 ++++++ configure.ac | 38 +++++++++ m4/ax_pthread.m4 | 246 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 3 files changed, 312 insertions(+), 0 deletions(-) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 m4/ax_pthread.m4 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d005d5e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +bin_PROGRAMS =3D zpaq +bin_SCRIPTS =3D zpaqopt +lib_LIBRARIES =3D libzpaqstub.a + +ACLOCAL_AMFLAGS =3D -I m4 + +if HAVE_POD2MAN +man1_MANS =3D zpaq.1 + +zpaq.1: zpaq.1.pod + $(POD2MAN) $< > $@ +endif + +libzpaqstub_a_SOURCES =3D zpaq.cpp +libzpaqstub_a_CPPFLAGS =3D -DOPT + +zpaq_SOURCES =3D zpaq.cpp divsufsort.c divsufsort.h +zpaq_CFLAGS =3D $(OPENMP_CXXFLAGS) +zpaq_CXXFLAGS =3D $(OPENMP_CXXFLAGS) $(PTHREAD_CFLAGS) +zpaq_LDADD =3D -lzpaq $(PTHREAD_LIBS) + +zpaqopt: + echo "$(CXX) $(CXXFLAGS) $$1.cpp $(LDFLAGS) @RUNTIME_LDFLAGS@ -o $$1.ex= e $(LIBS) -lzpaqstub" > $@ + +.PHONY: zpaqopt + +MOSTLYCLEANFILES =3D zpaq.1 zpaqopt +EXTRA_DIST =3D zpaq.1.pod diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..b7ad2b7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,38 @@ +AC_PREREQ([2.60]) +AC_INIT([zpaq], [na]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([1.6 foreign no-dependencies]) + +AC_LANG([C++]) +AC_PROG_CC +AC_PROG_CXX +AC_PROG_RANLIB +AC_OPENMP +ACX_PTHREAD + +runtime_LDFLAGS=3D'-Wl,--strip-all' +AC_MSG_CHECKING([whether the linker supports $runtime_LDFLAGS]) +save_LDFLAGS=3D$LDFLAGS +LDFLAGS=3D"$LDFLAGS $runtime_LDFLAGS" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [])], + [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) +runtime_LDFLAGS=3D]) +LDFLAGS=3D$save_LDFLAGS +AC_SUBST([RUNTIME_LDFLAGS], [$runtime_LDFLAGS]) + +AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man]) +AM_CONDITIONAL([HAVE_POD2MAN], [test x"$POD2MAN" !=3D x""]) +AS_IF([test "x$POD2MAN" =3D x], [ + AC_MSG_WARN([Unable to find pod2man, manpage will not be generated]) +]) + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [Enable debug])]) +AS_IF([test x"$enable_debug" !=3D x"yes"], [ + AC_DEFINE([NDEBUG], [1], [Set this to disable debug]) +]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 new file mode 100644 index 0000000..3d0806d --- /dev/null +++ b/m4/ax_pthread.m4 @@ -0,0 +1,246 @@ +# note: dropped PTHREAD_CC, joinable and stuff + +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. = It +# sets the PTHREAD_LIBS output variable to the threads library and lin= ker +# flags, and the PTHREAD_CFLAGS output variable to any special C compi= ler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (Th= is +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these fl= ags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS=3D"$PTHREAD_LIBS $LIBS" +# CFLAGS=3D"$CFLAGS $PTHREAD_CFLAGS" +# CC=3D"$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constan= t +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and th= e +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads libr= ary +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if= it +# is not found. If ACTION-IF-FOUND is not specified, the default actio= n +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or = if +# you have any other suggestions or comments. This macro was based on = work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with hel= p +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted b= y +# Alejandro Forero Cuervo to the autoconf macro repository. We are als= o +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify= it +# under the terms of the GNU General Public License as published by th= e +# Free Software Foundation, either version 3 of the License, or (at yo= ur +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gen= eral +# Public License for more details. +# +# You should have received a copy of the GNU General Public License al= ong +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright ow= ner +# gives unlimited permission to copy, distribute and modify the config= ure +# scripts that are the output of Autoconf when processing the Macro. Y= ou +# need not follow the terms of the GNU General Public License when usi= ng +# or distributing such scripts, even though portions of the text of th= e +# Macro appear in them. The GNU General Public License (GPL) does gove= rn +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autocon= f +# Macro released by the Autoconf Archive. When you make and distribute= a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 16 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=3Dno + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" !=3D x; then + save_CFLAGS=3D"$CFLAGS" + CFLAGS=3D"$CFLAGS $PTHREAD_CFLAGS" + save_LIBS=3D"$LIBS" + LIBS=3D"$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=3D$PTHREAD_LIBS with C= FLAGS=3D$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=3Dyes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" =3D xno; then + PTHREAD_LIBS=3D"" + PTHREAD_CFLAGS=3D"" + fi + LIBS=3D"$save_LIBS" + CFLAGS=3D"$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-con= fig" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags=3D"pthreads none -Kthread -kthread lthread -pthread -pt= hreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able= ) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbe= d + # (non-functional) versions of the pthreads routines, so link-ba= sed + # tests will erroneously succeed. (We need to link with -pthrea= ds/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or r= ather + # a function called by this macro, so we could check for that, b= ut + # who knows whether they'll stub that too in a future libc.) So= , + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags=3D"-pthreads pthread -mt -pthread $ax_pthread_f= lags" + ;; + + *-darwin*) + ax_pthread_flags=3D"-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" =3D xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags= ]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS=3D"$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no= ) + if test x"$ax_pthread_config" =3D xno; then continue; fi + PTHREAD_CFLAGS=3D"`pthread-config --cflags`" + PTHREAD_LIBS=3D"`pthread-config --ldflags` `pthread-conf= ig --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS=3D"-l$flag" + ;; + esac + + save_LIBS=3D"$LIBS" + save_CFLAGS=3D"$CFLAGS" + LIBS=3D"$PTHREAD_LIBS $LIBS" + CFLAGS=3D"$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_in= it + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc s= tub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a =3D 0; } + static void *start_routine(void *a) { return a; = }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=3Dyes], + []) + + LIBS=3D"$save_LIBS" + CFLAGS=3D"$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" =3D xyes; then + break; + fi + + PTHREAD_LIBS=3D"" + PTHREAD_CFLAGS=3D"" +done +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" =3D xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX = threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=3Dno + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD --=20 1.7.6.1 1.1 app-arch/zpaq/files/zpaq-2-autotools.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/zpaq/file= s/zpaq-2-autotools.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-arch/zpaq/file= s/zpaq-2-autotools.patch?rev=3D1.1&content-type=3Dtext/plain Index: zpaq-2-autotools.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >From 0c5836166c1d856eb7f20b9cfc3b6f646b1bf587 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Micha=3DC5=3D82=3D20G=3DC3=3DB3rny?=3D Date: Tue, 4 Jan 2011 21:04:53 +0100 Subject: [PATCH] Add autotools files. --- Makefile.am | 18 ++++++++++++++++++ configure.ac | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 Makefile.am create mode 100644 configure.ac diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..51275c3 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,18 @@ +bin_PROGRAMS =3D zpaq +lib_LIBRARIES =3D libzpaqstub.a + +if HAVE_POD2MAN +man1_MANS =3D zpaq.1 + +zpaq.1: zpaq.1.pod + $(POD2MAN) $< > $@ +endif + +libzpaqstub_a_SOURCES =3D zpaq.cpp + +zpaq_SOURCES =3D zpaq.cpp libzpaq.h +zpaq_CPPFLAGS =3D $(AM_CPPFLAGS) -DOPT=3D'"$(CXX) $(CXXFLAGS) zpaqopt.cp= p $(LDFLAGS) @RUNTIME_LDFLAGS@ -o zpaqopt.exe $(LIBS) -lzpaqstub"' +zpaq_LDADD =3D -lzpaq + +MOSTLYCLEANFILES =3D zpaq.1 +EXTRA_DIST =3D zpaq.1.pod diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..24dddc6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,35 @@ +AC_PREREQ([2.60]) +AC_INIT([zpaq], [na]) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([1.6 foreign no-dependencies]) + +AC_LANG([C++]) +AC_PROG_CXX +AC_PROG_RANLIB + +runtime_LDFLAGS=3D'-Wl,--strip-all' +AC_MSG_CHECKING([whether the linker supports $runtime_LDFLAGS]) +save_LDFLAGS=3D$LDFLAGS +LDFLAGS=3D"$LDFLAGS $runtime_LDFLAGS" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [])], + [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) +runtime_LDFLAGS=3D]) +LDFLAGS=3D$save_LDFLAGS +AC_SUBST([RUNTIME_LDFLAGS], [$runtime_LDFLAGS]) + +AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man]) +AM_CONDITIONAL([HAVE_POD2MAN], [test x"$POD2MAN" !=3D x""]) +AS_IF([test "x$POD2MAN" =3D x], [ + AC_MSG_WARN([Unable to find pod2man, manpage will not be generated]) +]) + +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [Enable debug])]) +AS_IF([test x"$enable_debug" !=3D x"yes"], [ + AC_DEFINE([NDEBUG], [1], [Set this to disable debug]) +]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT --=20 1.7.6.1