Adds a check for the minimum mainline GCC version for FORTIFY_SOURCE
support and enables -D_FORTIFY_SOURCE=2 by default when building with
--enable-debug.
Signed-off-by: Allan McRae <allan@archlinux.org>
Unfortunately this patch is hard to split up into smaller chunks. Our build
system and the associated automake/autoconf/libtool macros has been left
untouched for a while, and could use a refresher.
* Upgrade ltmain.sh to the latest version
* Move away from a huge acinclude.m4 directory to using individual files in
the m4/ subdirectory, suggested by upstream automake documentation
* Update all macros to their latest available version
* Adjust Makefile.am and autogen.sh to accommodate m4/ subdirectory
Signed-off-by: Dan McGee <dan@archlinux.org>
I don't know what I tested in commit 3e7b90ff69, but it definitely wasn't
working as advertised. Fix the checks in the source code itself to match the
right define (HAVE_LIBFETCH), as well as make sure the configure check
defaults to looking for the library but not bailing if it could not be
found.
Signed-off-by: Dan McGee <dan@archlinux.org>
Model it after the new OpenSSL check, and have it be a bit more useful. If
you do not explicitly pass a command line option, it will be linked if
available but will not error out if it is missing. Also bump the version to
that where connection caching was introduced as we use these new features in
the codebase.
Signed-off-by: Dan McGee <dan@archlinux.org>
I've noticed my Atom-powered laptop is dog-slow when doing integrity checks
on packages, and it turns out our MD5 implementation isn't near as good as
that provided by OpenSSL. Using their routines instead provided anywhere
from a 1.4x up to a 1.8x performance benefit over our built-in MD5 function.
This does not remove the MD5 code from our codebase, but it does enable
linking against OpenSSL to get their much faster implementation if it is
available on whatever platform you are using. At configure-time, we will
default to using it if it is available, but this can be easily changed by
using the `--with-openssl` or `--without-openssl` arguments to configure.
Signed-off-by: Dan McGee <dan@archlinux.org>
With commit 5dffef78, the repo database always has a symlink
of the form reponame.db. Use that filename and let libarchive
determine the compression type.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Attempt to find "du" from coreutils in the standard paths and if
not revert to the version in the users PATH. Using the full path
prevents issues such as FS#19932, where a different and incompatible
version of du is put earlier in the users path.
Signed-off-by: Allan McRae <allan@archlinux.org>
This is a partial revert of commit d44e5099. By making disabling docs the
default, it presents all sorts of problems- namely anyone who builds from a
tarball and isn't careful enough to include '--enable-doc' will get an
install without any manpages at all. Remember that make includes both
'build' and 'install' steps.
The warning introduced by the commit is kept, so we do not lose all its
benefits, but I am not happy to see regressions introduced in packaging and
installing of this piece of software.
Signed-off-by: Dan McGee <dan@archlinux.org>
Move the test suite to test/pacman in order to make a logical
location for a future makepkg test suite.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This is a complaint that has been reported many many times. By default, docs
are enabled and there is no check for asciidoc, so anyone building from git
will see their build fail.
We cannot do a strict check for asciidoc because released source tarballs
have man pages already built, and it should be possible to install them
without having asciidoc.
This patch attempts to improve the situation in two ways :
1) disable doc by default
2) print a warning if docs are enabled but asciidoc is not installed
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Don't explicitly add things to the list that might not need to be there, and
get the fallback list of libraries correct.
Signed-off-by: Dan McGee <dan@archlinux.org>
This patch fixes 2 issues I encountered when cross-compiling pacman.
First is the test for libfetch which requires explicit linking to all
libraries libfetch depends on.
The other problem results from the AC_CHECK_PROGS test for git. This
test will stop configure with an error when cross-compiling.
The fix moves the call to AC_CHECK_PROG so that is only called of
--enable-git is actually set.
Signed-off-by: Matthias Lanzinger <mlaenz@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
The newly added variables STRIP_BINARIES, STRIP_SHARED and STRIP_STATIC,
that are set in makepkg.conf, specify the strip options used on binaries
and shared and static libraries.
In addition, files are now stripped more aggressively by default.
Implements FS#13592 the way it was suggested by Allan in the comments.
Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
If the package we were adding was a symlink, we stuck the symlink size in
the database rather than the size of the file it referred to. Whoops!
Signed-off-by: Dan McGee <dan@archlinux.org>
Commit 6f97842 started using libfetch's conditional GET. This requires
libfetch to be version 2.21 or greater.
Change configure.ac to check for the existence of the last_modified field in
the url struct, which was introduced with libfetch 2.21.
Signed-off-by: Henning Garus <henning.garus@gmail.com>
[Xav : moved AC_CHECK_MEMBER outside of AC_CHECK_LIB]
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
after commit 8feccaed78, -g was no longer added with
--enable-debug.
So if CFLAGS was set (if unset, it defaults to -g -O2) and didn't contain
-g, we ended with no debug symbols..
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
1) Do not attempt to strip compressed binaries
Original-work-by: Marc - A. Dahlhaus <mad@wol.de>
2) Add "\" in "GPL\'ed" so quote mark does not break source code highlighting
3) Add local to docdir paths in makepkg.conf for consistency
4) Use full path to sed in MacOSX in case users have GNU sed earlier in
path
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Do a sed replacement in-place is not very portable. On Mac OSX and
BSDs, the syntax is "sed -i ''" where as with GNU sed the command is
"sed -i''" or just "sed -i". This patch detects which command should
be used during configure.
Credit to Kevin Barry who researched this issue and provided a patch
to work around this using temporary backup files.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Change configure.ac to use the full path of stat when on darwin/mac.
This is needed for situations when a user installs the GNU/coreutils
and places it in their path before /usr/bin, but the SIZECMD is
already configured for Darwin's version of stat.
Signed-off-by: Kevin Barry <barryk gmail com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Aaron said to consider libdownload a dead project so libdownload support was
removed to more easily fix libfetch one (otherwise many ifdef needed).
There was no direct replacement for ferror to detect an error while
downloading. So instead, I added a check at the end to see if the file was
fully downloaded, which is just a small chunk of code taken from here:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/net/libfetch/files/fetch.c?only_with_tag=MAIN
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Commit 4b183bf9 moved makepkg.conf sourcing to after the parsing
of options, breaking the -p option and --help output. The solution
is to move BUILDSCRIPT out of makepkg.conf. This patch moves the
definition BUILDSCRIPT back to makepkg itself and adds configure
option to allow easy changing of this value during build time.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
I mess this up more often than not, and maybe this will do the trick. Remove
the --enable-asciidoc option as it has been superseded by the --disable-doc
option in usefulness. If you want to skip building docs, you skip building
all docs which is much easier when it comes to ensuring the make 'dist' and
'distcheck' targets will always build the manpages and always build the most
up to date manpages.
Developers shouldn't be affected in their normal builds, nor should end
users of the source tarball.
Signed-off-by: Dan McGee <dan@archlinux.org>
Added a Makefile.am for the pactest/tests dir. This is a blatant ripoff
of scripts/Makefile.am, which replaces predefined expressions in
NAME.py.in pactests with configure variables.
This can be used to write pactests which consider compile time options.
Signed-off-by: Henning Garus <henning.garus@gmail.com>
[Dan: autotools are tough, make a few adjustments for correctness]
Signed-off-by: Dan McGee <dan@archlinux.org>
Commit 149839c539 introduced a small behavior regression as a drawback
for a better portability. repo-add now includes the approximate size (to the
nearest KB) rather than an exact size due to the switching of the du command
to a more portable form. Instead of sacrificing the exact size, use
configure to help us determine a valid command to acquire our filesize and
place it in the sync database.
Signed-off-by: Dan McGee <dan@archlinux.org>
This presents plenty of problems on OSes besides Linux, and even on Linux
when the libtool file for libarchive isn't present. The static build isn't
all that useful anyway as missing something such as glibc will still leave
you unable to run the pacman.static binary. Remove it from the formal build
process.
Signed-off-by: Dan McGee <dan@archlinux.org>
Add a new configure flag, --enable-git-version, that allows the output of
'git describe' to be used in the version string associated with this
package. This could aid in debugging for users that are using a development
version of pacman and we should be able to figure out which cut of code they
are using.
Sample output:
$ pacman --version
Pacman v3.1.4-190-g4cfa-dirty - libalpm v2.3.1
$ makepkg --version
makepkg (pacman) 3.1.4-190-g5861-dirty
Signed-off-by: Dan McGee <dan@archlinux.org>
This should remove the need for any additional patching to run on platforms
that have libfetch available but not libdownload. It isn't the prettiest,
but we have kept our libdownload impact down to just a few files, so it can
be easily done.
Signed-off-by: Dan McGee <dan@archlinux.org>
Darwin's binary format does support symbols with differing visibilities, but
it does not support the protected or internal visibilities- only hidden. For
Darwin only, we should fall back to this visibility to prevent warnings from
the compiler and because it is close enough for our library purposes.
See http://gcc.gnu.org/viewcvs/*checkout*/trunk/gcc/config/darwin.c, search
for the "darwin_assemble_visibility" function for more details.
Also add pacman.static.exe to gitignore.
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove a few functions and things that were unnecessary, update the help
line calls to the current function name, and make the small change to
pacman.c for the signal handler return type that is defined in config.h.
Signed-off-by: Dan McGee <dan@archlinux.org>
We use this function once in our codebase, but fortunately the workaround is
relatively easy. swprintf() is not available on Cygwin so the compile failed
there, but we can do a series of mbstowcs() calls that produce the same end
result as the swprintf() call.
Signed-off-by: Dan McGee <dan@archlinux.org>
Add a new --disable-internal-download flag to configure allowing the
internal download code to be skipped. This will be helpful on platforms that
currently don't support either libdownload or libfetch (such as Cygwin) and
for just compiling a lighter weight pacman binary.
This was made really easy by our recent refactoring of the download code
into separate internal and external functions, as well as some error code
cleanup.
Signed-off-by: Dan McGee <dan@archlinux.org>
Also fix a broken contrib/ Makefile, found with make distcheck. I also let
the little translation linebreak update slip in here as it was small enough
not to be a big deal, and this should just prevent it from happening again
later anyway.
Signed-off-by: Dan McGee <dan@archlinux.org>
Commit 012f793978 was a bit misguided in its
thinking, and resulted in a package built without asciidoc enabled not
installing the manpages to the system on a 'make install' operation. Fix
this behavior by making manpages required in a normal build, and in order to
disable their existence, the '--disable-doc' option must be used.
Hopefully this solves manpage issues for both developers and package
builders while allowing as much flexibility as possible.
Signed-off-by: Dan McGee <dan@archlinux.org>
abs has always been an Arch Linux specific tool, and although it is used
primarily by pacman and makepkg, it should not be included with a distro-
agnostic tarball. In addition, maintenance of the script would be better
outside of pacman and would allow for more frequent updates.
This also facilitates our move away from a cvsup/csup dependent tool for
syncing PKGBUILDs.
Signed-off-by: Dan McGee <dan@archlinux.org>
Because building of pacman.static fails on some platforms, we should make
it optional. It is enabled by default but can be disabled with the use of
the --disable-pacman-static flag.
Signed-off-by: Dan McGee <dan@archlinux.org>
Hopefully these new autoconf macros, with a little magic, will allow us to
compile with any compiler and still choose the options we have available
to us.
Tested locally with gcc 4.2.2 and gcc 3.4.6; the latter doesn't support two
of the items we previously had hardcoded in our CFLAGS.
Signed-off-by: Dan McGee <dan@archlinux.org>
Do a little cleanup of our configure script. Highlights:
* Remove macros deemed unnecessary to call [1]
* Change check for compiler to look for one that is C99 capable-
this automatically adds the -std=gnu99 flag
[1] Noted in the autoconf NEWS file, notably entries for 2.59d
Signed-off-by: Dan McGee <dan@archlinux.org>
Use an autoconf macro to find us a python executable, preferring python2.5
if we can find it. From there, fall back to python2.4 and then python.
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove the need for two variables for the architecture-specific switches
(things like "-march=i686") by combining it into one variable. Also allow
configure to proceed with only a warning if we don't have presets for the
detected architecture- it is kind of stupid to restrict ourselves like we
had been.
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove the commented desc_localized stuff, we can find it later in version
control. Also remove some unnecessary includes of the stat header and
use -fstack-protector-all which is a bit more broad.
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove versioncmp.c by moving all functions to locations that make sense.
Move replacement functions (for building without glibc) into util.c where
they belong, and do proper checks for them instead of using __sun__, etc.
Signed-off-by: Dan McGee <dan@archlinux.org>
This defines _FILE_OFFSET_BITS == 64, which makes stat calls transparently
use stat64, etc. This allows us to support large files, such as packages
over 1 GB in size. libarchive was already correctly compiled with this macro.
Signed-off-by: Dan McGee <dan@archlinux.org>
Include manpages when we ship a package tarball, and allow them to be
generated by the end user if they want by using the --enable-asciidoc option
to ./configure. This will allow us to maintain manpages in an easier to modify
format while still keeping the make dependencies to a minimum.
Signed-off-by: Dan McGee <dan@archlinux.org>
Move the translations from src/pacman/po to just po/ so we can include the
scripts gettext translations in the same message catalog as that of the
pacman frontend. The libalpm message catalog, for now, will remain a separate
existence.
Signed-off-by: Dan McGee <dan@archlinux.org>
I previously introduced some patches to make just about every path in
pacman/libalpm configurable; doing this with the lockfile seemed a bit too
far and we really should just place the lockfile where it belongs- with the
DB that needs locking.
More details in this thread:
http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html
Signed-off-by: Dan McGee <dan@archlinux.org>
* Add vim modeline to Makefile.am and configure.ac
* Fix white space in Makefile.am and configure.ac
* Add contrib/wget-xdelta.sh to EXTRA_DIST in Makefile.am
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove any use of the former path variables defined by the Makefiles or
config.h. These are now runtime configurable only with pacman.conf (or by
using flags on the command line).
Signed-off-by: Dan McGee <dan@archlinux.org>
* configure.ac: Add AC_SUBST() for ROOTDIR, PKGEXT, DBEXT so
they get exported to Makefiles.
* {makepkg,pacman}.conf.in: Remove extra / from paths.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
This change allows us to use all autoconf specified paths, most notably
$(localstatedir). It is quite a change and touches a lot of files, as
all references to the DB and cache were done with the ROOTDIR as a prefix.
* add --lock command-line option to pacman to specify the location of the
lockfile (this can now be specified at configure time by setting the
$localstatedir path).
* Rip quite a few settings out of configure.ac as they are now picked by
setting the paths during configure or make.
* Fix bug with /tmp fallback for sync downloads not working correctly
(related to root location, now the system tmp dir is used).
* Simplified the parameters to some libalpm functions, and added get/set
for the new lockfile option.
* Renamed several of the DEFS to names without the PM_ prefix.
Signed-off-by: Dan McGee <dan@archlinux.org>
Fix up everything in the etc/ directory so it is built at make-time and
not configure-time. This reduces configure generated files to just the
makefiles, which is the correct way to do things. This also allows a switch
from @@REPO@@ to the more sane @REPO@ in mirrorlist.in, and kills the
two-part generation of the mirror files.
Signed-off-by: Dan McGee <dan@archlinux.org>
This should finally get the path replacement in our scripts right. This
is the way the autoconf package itself does it and should not need much
further tweaking.
Threw in a few trailing whitespace corrections from the scripts as well.
Signed-off-by: Dan McGee <dan@archlinux.org>
Using the autoscan tool, ensure we are doing the checks we should be doing
in configure.ac. There is still more work to do, but this is a start at
cleaning up the file a bit to make it much easier to change in the future.
Signed-off-by: Dan McGee <dan@archlinux.org>
By setting up a few more AC_SUBST macros in configure.ac, we can fill in
paths in the scripts on the fly instead of having them in multiple places.
Other small fixes:
* Fix an oops on my last commit where I had some lines stil commented.
* Fix makepkg bug where the generated package name using PKGEXT had two
periods (..).
Signed-off-by: Dan McGee <dan@archlinux.org>
Added the autoconf option std-options to the scripts/ directory, which
checks to ensure all programs have both --help and --version options. A
few things needed cleaning up to get this working. To test these types
of options, use the 'make distcheck' target.
Signed-off-by: Dan McGee <dan@archlinux.org>
Add gettext support to makepkg. Still to do- figure out for sure what
textdomain the translations should go in (perhaps share with pacman?), and
ensure this doesn't break anything.
Signed-off-by: Dan McGee <dan@archlinux.org>
Several important paths, file locations, and extensions were #define-d in the
source code instead of being configurable. This moves all of these to
the configure script where they can be picked upon running ./configure. We
may later want to make some of these even more visible and move them to
pacman.conf.
Signed-off-by: Dan McGee <dan@archlinux.org>
CFLAGS are used at build time, not configure time. We don't need to get the
CFLAGS from the environment during configure.
Signed-off-by: Dan McGee <dan@archlinux.org>
Giovanni Scafora <linuxmania@gmail.com>
* added '-fstack-protector' flag to debug compile, to catch any buffer
overflows we may have in stack variables.
* Updated all of the language files, as the POT file was updated. NOTE FOR
TRANSLATORS, try to base your next contribution off of these, notice how
some msgids and messages have been wrapped to the next line- it makes it
easier to read anyway.
* More Makefile.am/configure.ac updates. 'make dist' and 'make distclean' now
work properly, with only one caveat- the automatic testing in distclean
doesn't do so hot as it is compiled with a default configure, which includes
the fakeroot-proof code (which does not cooperate with pactest).
* Added a Makefile.am for the pactest directory.
and not always MARCH). Also changes makepkg.conf.in to not have commented -mcpu
lines (due to the above), but to have a comment about the differences in -march
and -mcpu
* Added libdownload check in configure.ac
* Added generation for mirrorlists in pacman.d
NOTE: autoconf sucks for things like this, so gen-mirrorlist is required
Dan McGee <dpmcgee@gmail.com>:
* mirrorlist.in file
Roman Kyrylych <roman.kyrylych@gmail.com>:
* ukrainian mirror
Jürgen Hötzel <juergen@hoetzel.info>:
* conditional build for pacman.static
* libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a
typesafe _get_what_we_want(p) scheme [not 100% complete yet]
* some const correctness changes
* removal of PM_* types in alpm.h in favor of the pm*_t types used throughout
libalpm