Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #19025: AIX fails to build #3542

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions agent/sources/client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ OBJS := $(patsubst $(SRC_DIR)/%,$(BUILD_DIR)/%,$(SRCS:.c=.o))
DESTDIR := $(BUILD_DIR)/dest
PREFIX :=

CC ?= gcc

BUILD_CPPFLAGS=$(CPPFLAGS)
# Strict flags, only compatible with modern compilers.
# Release flags come from packaging.
Expand Down
30 changes: 30 additions & 0 deletions agent/sources/client/argtable-aix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- a/src/argtable3.c 2021-03-13 15:34:14.959214228 +0100
+++ b/src/argtable3.c 2021-03-13 15:41:28.435628640 +0100
@@ -40,6 +40,9 @@
#include "argtable3.h"

#define ARG_AMALGAMATION
+#ifdef _AIX
+#define ARG_REPLACE_GETOPT 1
+#endif

/*******************************************************************************
* argtable3_private: Declares private types, constants, and interfaces
@@ -1437,7 +1440,7 @@
static const char illoptstring[] = "unknown option -- %s";
# endif

-# ifdef _WIN32
+# if defined(_WIN32) || defined(_AIX)

/*
* Windows needs warnx(). We change the definition though:
@@ -4985,7 +4988,7 @@

#ifndef ARG_AMALGAMATION
# include "argtable3_private.h"
-# if ARG_REPLACE_GETOPT == 1
+# if ARG_REPLACE_GETOPT == 1
# include "arg_getopt.h"
# else
# include <getopt.h>
5 changes: 4 additions & 1 deletion agent/sources/client/src/argtable3.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#include "argtable3.h"

#define ARG_AMALGAMATION
#ifdef _AIX
#define ARG_REPLACE_GETOPT 1
#endif

/*******************************************************************************
* argtable3_private: Declares private types, constants, and interfaces
Expand Down Expand Up @@ -1437,7 +1440,7 @@ static const char noarg[] = "option doesn't take an argument -- %.*s";
static const char illoptstring[] = "unknown option -- %s";
# endif

# ifdef _WIN32
# if defined(_WIN32) || defined(_AIX)

/*
* Windows needs warnx(). We change the definition though:
Expand Down
1 change: 0 additions & 1 deletion agent/sources/client/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-FileCopyrightText: 2021 Normation SAS

#include "cli.h"
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include "config.h"
Expand Down