pilot-link: add patch autoconf2.71

This commit is contained in:
André Cerqueira 2022-08-11 15:02:50 +01:00 committed by Michal Vasilek
parent 25bf3e0261
commit ae5f8a6072
1 changed files with 162 additions and 0 deletions

View File

@ -0,0 +1,162 @@
From d2c7d22bdfb28144ccdea99ae8298605a619ead6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Cerqueira?= <acerqueira021@gmail.com>
Date: Thu, 11 Aug 2022 14:58:50 +0100
Subject: [PATCH 1/1] autoconf2.71
---
configure.ac | 77 +++++++++-------------------------------------------
1 file changed, 13 insertions(+), 64 deletions(-)
diff --git a/configure.ac b/configure.ac
index dc19311..727a4a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,8 +16,8 @@ dnl ******************************
dnl Limit to a specific ac version
dnl ******************************
AC_PREREQ(2.53)
-AM_CONFIG_HEADER(config.h)
-AM_CONFIG_HEADER(include/pi-md5.h)
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([include/pi-md5.h])
dnl ******************************
dnl Pilot Link Version
@@ -62,14 +62,6 @@ AC_SUBST(PISYNC_AGE)
dnl Eat -Werror so configure will run properly, if the user provided it
enable_werror=no
-save_CFLAGS="$CFLAGS"
-CFLAGS=`echo $save_CFLAGS | sed -e s/-Werror//g`
-CXXFLAGS=`echo $save_CXXFLAGS | sed -e s/-Werror//g`
-if test "x$CFLAGS" != "x$save_CFLAGS"; then
- dnl -Werror was set; treat it as implicit --enable-werror below
- enable_werror="yes"
-fi
-
dnl Check host type
AC_CANONICAL_HOST
@@ -89,14 +81,6 @@ AM_PROG_LIBTOOL
AC_PROG_YACC
-dnl ******************************
-dnl Defaults for GCC
-dnl ******************************
-if test "x$GCC" = "xyes"; then
- CFLAGS=${CFLAGS:-"-g2 -Wall"}
-fi
-
-
dnl ******************************
dnl Platform-specific things
dnl ******************************
@@ -351,7 +335,7 @@ AC_ARG_WITH(bluez,
AC_HELP_STRING([--with-bluez],
[Enable use of BlueZ]),
[use_bluez="$withval"])
-if test "$use_bluez" != "no" ; then
+AS_IF([test "$use_bluez" != "no"], [
PKG_CHECK_MODULES([BLUEZ],[bluez],[
have_bluez=yes
use_bluez=yes
@@ -367,7 +351,7 @@ if test "$use_bluez" != "no" ; then
have_bluez=no
])
])
-fi
+])
if test "$use_bluez" = "yes" ; then
AC_DEFINE([HAVE_BLUEZ],[1],[Define if we build with BlueZ])
@@ -387,20 +371,11 @@ AC_ARG_WITH(included-popt,
[with_included_popt="auto"]
)
-if test "x$enable_conduits" != "xno"; then
- if test "x$with_included_popt" != "xyes"; then
- dnl Determine if system popt is good enough
- save_LIBS="$LIBS"
- AC_CHECK_HEADER(popt.h,
- AC_CHECK_DECL(POPT_BIT_SET,
- AC_CHECK_LIB(popt, poptStrippedArgv,,
- [with_included_popt="yes"]),
- [with_included_popt="yes"],
- [#include <popt.h>]),
- [with_included_popt="yes"]
- )
- LIBS="$save_LIBS"
- fi
+AS_IF([test "x$enable_conduits" != "xno"], [
+ AS_IF([test "x$with_included_popt" != "xyes"], [
+ PKG_CHECK_MODULES([POPT], [popt])
+ POPT_INCLUDES="${POPT_CFLAGS}"
+ ])
AC_MSG_CHECKING(whether to use included popt)
if test "x$with_included_popt" = "xyes"; then
@@ -413,14 +388,13 @@ if test "x$enable_conduits" != "xno"; then
msg_popt="yes (system)"
POPT_LIBS="-lpopt"
fi
-else
+], [
with_included_popt="no"
msg_popt="none"
POPT_LIBS=
POPT_INCLUDES=
-fi
+])
AM_CONDITIONAL(INCLUDED_POPT, test "x$with_included_popt" = "xyes")
-AC_SUBST(POPT_LIBS)
AC_SUBST(POPT_INCLUDES)
@@ -667,31 +641,6 @@ if test "x$with_efence" != "xno"; then
fi
-dnl *************************************
-dnl Runtime debugging
-dnl *************************************
-set_debug=yes
-AC_ARG_ENABLE(debug,
- [ --disable-debug Shunt runtime debugging],
- [set_debug=no])
-
-if test "${enable_debug+set}" = set; then
- if test "$enable_debug" = yes; then
- CFLAGS="-g $CFLAGS"
- set_debug=yes
- fi
-fi
-
-echo -n "Runtime debugging is "
-if test "$set_debug" = "yes"; then
- echo "enabled"
- AC_DEFINE(PI_DEBUG, 1, [Define if we have debugging enabled])
-else
- echo "disabled"
- CFLAGS=`echo "$CFLAGS" | sed -e "s/-g //"`
-fi
-
-
dnl *************************************
dnl Profiling information
dnl *************************************
@@ -740,9 +689,9 @@ AC_ARG_ENABLE(compile-warnings,
if test "$GCC" = "yes" -a "$set_compile_warnings" != "no"; then
CFLAGS="$CFLAGS \
- -std=gnu99 -g -Wshadow -Wall -W -Waggregate-return -Wcast-align \
+ -std=gnu99 -Wshadow -Wall -W -Waggregate-return -Wcast-align \
-Wcast-qual -Wnested-externs -Wpointer-arith -Wundef -Winline \
- -Wbad-function-cast -pedantic -O0"
+ -Wbad-function-cast -pedantic"
fi
--
2.37.1