diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-26 14:54:06 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-26 14:59:11 +0200 |
commit | c532b58b892ae2c9696306e11fe44491740b736d (patch) | |
tree | 0241fa5ee86584ca30267bdd435aa94d0ccb7772 | |
parent | 0cfd2d8ec76692ec4567d07eb89a256c267a1527 (diff) | |
download | aports-cache-master.tar.bz2 aports-cache-master.tar.xz |
fixes build on linux
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | main.c | 5 |
2 files changed, 15 insertions, 2 deletions
@@ -3,7 +3,17 @@ CC ?= gcc LD ?= gcc CFLAGS ?= -Werror -Wall -g -DDEBUG -LDFLAGS ?= +LDFLAGS ?= + +ifeq ($(shell uname),Darwin) +HAVE_PROGRAM_INVOCATION_NAME= +else +HAVE_PROGRAM_INVOCATION_NAME=1 +endif + +ifeq ($(HAVE_PROGRAM_INVOCATION_NAME),1) +CFLAGS += -DHAVE_PROGRAM_INVOCATION_NAME +endif aports-cache-objs := aports-cache.o @@ -11,7 +11,9 @@ #include "aports-cache.h" +#ifndef HAVE_PROGRAM_INVOCATION_NAME static char *program_invocation_name; +#endif static void usage(int exitcode) { @@ -45,8 +47,9 @@ int main(int argc, char *argv[]) int dirfd, rc; char *shell_argv[] = {"/bin/sh", NULL}; +#ifndef HAVE_PROGRAM_INVOCATION_NAME program_invocation_name = argv[0]; - +#endif while ((c = getopt_long(argc, argv, "fs:v", opts, &i)) != -1) { switch(c) { |