You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-embedded/gputils/files/gputils-1.5.0-respect-flags...

124 lines
4.5 KiB

https://sourceforge.net/p/gputils/code/1288
https://bugs.gentoo.org/722648
--- a/configure.ac
+++ b/configure.ac
@@ -160,29 +160,41 @@
AC_CHECK_FUNCS(strndup, , [IBERTYOBJS="$IBERTYOBJS strndup.o"])
AC_CHECK_FUNCS(strverscmp, , [IBERTYOBJS="$IBERTYOBJS strverscmp.o"])
-AM_CFLAGS=
+VERSION_MAJOR=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $1}'`
+VERSION_MINOR=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $2}'`
+VERSION_MICRO=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $3}'`
+
+AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MAJOR, $VERSION_MAJOR, [gputils major version number])
+AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MINOR, $VERSION_MINOR, [gputils minor version number])
+AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MICRO, $VERSION_MICRO, [gputils micro version number])
+AC_DEFINE_UNQUOTED(GPUTILS_VERSION_STR, "$PACKAGE_VERSION", [gputils version string])
+
+AM_GPUTILS_SVN_VERSION="\$(shell \$(top_srcdir)/get_cl_revision.sh \$(top_srcdir)/ChangeLog)"
+AM_PACKAGE_SVN_VERSION=`./get_cl_revision.sh ChangeLog`
+
+AM_CFLAGS="-DGPUTILS_SVN_VERSION=\$(AM_GPUTILS_SVN_VERSION)"
AM_LDFLAGS=
# Options for the system on which the package will run.
case "${host}" in
*cygwin* )
if test "x$GCC" = "xyes"; then
- AM_CFLAGS="-Wall -pedantic"
+ AM_CFLAGS="$AM_CFLAGS -Wall -pedantic"
AM_LDFLAGS="-Wl,-warn-common -Wl,-warn-once"
fi
;;
*darwin* )
if test "x$CC" = "xclang"; then
- AM_CFLAGS="-Wall -pedantic -Wformat -Wtautological-compare -Wimplicit-function-declaration -Wformat-security"
+ AM_CFLAGS="$AM_CFLAGS -Wall -pedantic -Wformat -Wtautological-compare -Wimplicit-function-declaration -Wformat-security"
fi
;;
*linux* )
if test "x$CC" = "xclang"; then
- AM_CFLAGS="-Wall -pedantic -Wformat -Wtautological-compare -Wimplicit-function-declaration -Wformat-security"
+ AM_CFLAGS="$AM_CFLAGS -Wall -pedantic -Wformat -Wtautological-compare -Wimplicit-function-declaration -Wformat-security"
AM_LDFLAGS="-Wl,-warn-common -Wl,-warn-once"
else
if test "x$GCC" = "xyes"; then
- AM_CFLAGS="-Wall -pedantic -Wformat -Wimplicit-function-declaration -Wformat-security"
+ AM_CFLAGS="$AM_CFLAGS -Wall -pedantic -Wformat -Wimplicit-function-declaration -Wformat-security"
AM_LDFLAGS="-Wl,-warn-common -Wl,-warn-once"
fi
fi
@@ -192,33 +204,20 @@
*-pc-os2_emx | *-pc-os2-emx )
EXEEXT=".exe"
if test "x$GCC" = "xyes"; then
- AM_CFLAGS="-Zcrtdll"
+ AM_CFLAGS="$AM_CFLAGS -Zcrtdll"
fi
;;
*sun* )
# sunos cc needs the -xCC flag for // comments
if test "x$GCC" != "xyes"; then
- AM_CFLAGS="-xCC"
+ AM_CFLAGS="$AM_CFLAGS -xCC"
fi
;;
esac
-
-VERSION_MAJOR=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $1}'`
-VERSION_MINOR=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $2}'`
-VERSION_MICRO=`echo $PACKAGE_VERSION | $AWK 'BEGIN {FS="."} {print $3}'`
-
-AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MAJOR, $VERSION_MAJOR, [gputils major version number])
-AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MINOR, $VERSION_MINOR, [gputils minor version number])
-AC_DEFINE_UNQUOTED(GPUTILS_VERSION_MICRO, $VERSION_MICRO, [gputils micro version number])
-AC_DEFINE_UNQUOTED(GPUTILS_VERSION_STR, "$PACKAGE_VERSION", [gputils version string])
-
-AM_GPUTILS_SVN_VERSION="\$(shell \$(top_srcdir)/get_cl_revision.sh \$(top_srcdir)/ChangeLog)"
-AM_PACKAGE_SVN_VERSION=`./get_cl_revision.sh ChangeLog`
-CFLAGS="-DGPUTILS_SVN_VERSION=\$(AM_GPUTILS_SVN_VERSION)"
# Host filesystem options.
case "${host}" in
- *mingw* | *-pc-os2_emx | *-pc-os2-emx | *djgpp*)
+ *mingw* | *-pc-os2_emx | *-pc-os2-emx | *djgpp* )
AC_DEFINE(HAVE_DOS_BASED_FILE_SYSTEM, 1,
[Define if your host uses a DOS based file system.])
;;
@@ -231,15 +230,13 @@
fi
if test x$enable_gdb_debuginfo = xyes; then
- CFLAGS="$CFLAGS -ggdb"
+ AM_CFLAGS="$AM_CFLAGS -ggdb"
fi
if test x$enable_gputils_path = xyes; then
AC_DEFINE(USE_DEFAULT_PATHS, 1,
[Define if you want to add default search paths.])
fi
-
-LDFLAGS=
# Substitute configuration variables.
AC_SUBST(ENABLE_HTML_DOC)
@@ -248,8 +245,6 @@
AC_SUBST(AM_PACKAGE_SVN_VERSION)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
-AC_SUBST(CFLAGS)
-AC_SUBST(LDFLAGS)
AC_SUBST(GPUTILS_HEADER_PATH)
AC_SUBST(GPUTILS_LKR_PATH)
AC_SUBST(GPUTILS_LIB_PATH)
@@ -301,6 +296,7 @@
Source directory: $srcdir
Installation prefix: $prefix
C compiler: $CC $AM_CFLAGS $CFLAGS
+ C linker: $CC $AM_LDFLAGS
Location of MPLAB-X: $DEFAULT_MPLABX_PATH
])