summaryrefslogtreecommitdiff
path: root/fix-libtool-from-moving-options-after-libs
blob: 1f4d5adebf32224ff12cad51865ba98101e1c0d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/sh
# Copyright 2011-2023, Mageia
# Modified 2024, Funda Wang <fundawang@yeah.net>
# Licensed under GPL-2.0-or-later

CONFIGURE_TOP="${1:-.}"
if [ -e $CONFIGURE_TOP/configure ] && grep -q -F '$deplibs $compiler_flags' $CONFIGURE_TOP/configure; then
  echo "Fixing libtool inside configure to pass -Wl,xxx options earliest"

  sed -i \
   -e 's,$libobjs $deplibs $compiler_flags,$compiler_flags $libobjs $deplibs,' \
   -e 's,$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags,$compiler_flags $predep_objects $libobjs $deplibs $postdep_objects,' \
   $CONFIGURE_TOP/configure
fi