From c5d951846d6b803909cbd7cfeac643f5feb42911 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 30 Mar 2012 14:26:35 -0400 Subject: buildsys: use pkg-config for openssl detection Signed-off-by: Dave Reisner --- src/util/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/Makefile.am b/src/util/Makefile.am index e386d950..1465407c 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -35,6 +35,6 @@ testpkg_SOURCES = testpkg.c testpkg_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la vercmp_SOURCES = vercmp.c -vercmp_LDADD = $(top_builddir)/lib/libalpm/version.lo +vercmp_LDADD = $(top_builddir)/lib/libalpm/libalpm_la-version.lo # vim:set ts=2 sw=2 noet: -- cgit v1.2.3 From 793eff37047dbceedaf3443311bc826566685181 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 30 Mar 2012 23:26:32 -0400 Subject: buildsys: define warning CFLAGS in separate var Continue the trend of not touching the environment CFLAGS, ensuring that the user always has the final say. Signed-off-by: Dave Reisner --- src/pacman/Makefile.am | 2 +- src/util/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am index 9a92fd6b..c8ce9773 100644 --- a/src/pacman/Makefile.am +++ b/src/pacman/Makefile.am @@ -21,7 +21,7 @@ AM_CPPFLAGS = \ -imacros $(top_builddir)/config.h \ -I$(top_srcdir)/lib/libalpm -AM_CFLAGS = -pedantic -D_GNU_SOURCE +AM_CFLAGS = -pedantic -D_GNU_SOURCE $(WARNING_CFLAGS) if USE_GIT_VERSION GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty | sed s/^v//') diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 1465407c..463abf7f 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -17,7 +17,7 @@ AM_CPPFLAGS = \ -imacros $(top_builddir)/config.h \ -I$(top_srcdir)/lib/libalpm -AM_CFLAGS = -pedantic -D_GNU_SOURCE +AM_CFLAGS = -pedantic -D_GNU_SOURCE $(WARNING_CFLAGS) cleanupdelta_SOURCES = cleanupdelta.c cleanupdelta_LDADD = $(top_builddir)/lib/libalpm/.libs/libalpm.la -- cgit v1.2.3 From a8a1b093eb23450244418232c9e30c4be035fc0b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 7 Apr 2012 13:01:13 -0500 Subject: Various tweaks to support building with excessive GCC warning flags This fixes a bunch of small issues in order to enable a clean successful build with a crazy number of GCC warning flags. A lot of these changes are covered by -Wshadow, -Wformat-security, and -Wstrict-overflow=5. Signed-off-by: Dan McGee --- src/pacman/conf.c | 6 +++--- src/pacman/pacman.c | 9 +++++---- src/pacman/sync.c | 4 ++-- src/pacman/util.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 4c3d063b..2632d18f 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -202,14 +202,14 @@ static int download_with_xfercommand(const char *url, const char *localpath, cleanup: /* restore the old cwd if we have it */ if(cwdfd >= 0) { - int ret; + int close_ret; if(fchdir(cwdfd) != 0) { pm_printf(ALPM_LOG_ERROR, _("could not restore working directory (%s)\n"), strerror(errno)); } do { - ret = close(cwdfd); - } while(ret == -1 && errno == EINTR); + close_ret = close(cwdfd); + } while(close_ret == -1 && errno == EINTR); } if(ret == -1) { diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 1e6797c9..73d5be94 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -808,12 +808,13 @@ int main(int argc, char *argv[]) /* we support reading targets from stdin if a cmdline parameter is '-' */ if(!isatty(fileno(stdin)) && alpm_list_find_str(pm_targets, "-")) { - size_t current_size = PATH_MAX, i = 0; + size_t current_size = PATH_MAX; char *line = malloc(current_size); /* remove the '-' from the list */ pm_targets = alpm_list_remove_str(pm_targets, "-", NULL); + i = 0; while((line[i] = (char)fgetc(stdin)) != EOF) { if(isspace((unsigned char)line[i])) { /* avoid adding zero length arg when multiple spaces separate args */ @@ -885,13 +886,13 @@ int main(int argc, char *argv[]) #endif if(config->verbose > 0) { - alpm_list_t *i; + alpm_list_t *j; printf("Root : %s\n", alpm_option_get_root(config->handle)); printf("Conf File : %s\n", config->configfile); printf("DB Path : %s\n", alpm_option_get_dbpath(config->handle)); printf("Cache Dirs: "); - for(i = alpm_option_get_cachedirs(config->handle); i; i = alpm_list_next(i)) { - printf("%s ", (const char *)i->data); + for(j = alpm_option_get_cachedirs(config->handle); j; j = alpm_list_next(j)) { + printf("%s ", (const char *)j->data); } printf("\n"); printf("Lock File : %s\n", alpm_option_get_lockfile(config->handle)); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 5165dca1..9c17f45f 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -307,12 +307,12 @@ static int sync_cleancache(int level) static int sync_synctree(int level, alpm_list_t *syncs) { alpm_list_t *i; - int success = 0, ret; + unsigned int success = 0; for(i = syncs; i; i = alpm_list_next(i)) { alpm_db_t *db = i->data; - ret = alpm_db_update((level < 2 ? 0 : 1), db); + int ret = alpm_db_update((level < 2 ? 0 : 1), db); if(ret < 0) { pm_printf(ALPM_LOG_ERROR, _("failed to update %s (%s)\n"), alpm_db_get_name(db), alpm_strerror(alpm_errno(config->handle))); diff --git a/src/pacman/util.c b/src/pacman/util.c index f2ab163b..be8fc308 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -258,7 +258,7 @@ void indentprint(const char *str, unsigned short indent, unsigned short cols) { wchar_t *wcstr; const wchar_t *p; - int len, cidx; + size_t len, cidx; if(!str) { return; -- cgit v1.2.3