8000 More portable use of sed(1) at configure-time by dressupgeekout · Pull Request #113 · aranym/aranym · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

More portable use of sed(1) at configure-time #113

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dressupgeekout
Copy link

Some of the sed operations that happen in the configure script rely on GNU extensions, which are not enabled by default on some platforms.

E.g. on NetBSD we see junk like this, because \b is a GNU-only parameter:

checking for isnan... yes
checking for isinf... yes
checking for finite... yes
checking for isnormal... no
checking for signbit... no
sed: 1: "s/-g\b//g
": RE error: trailing backslash (\)
sed: 1: "s/-g\b//g
": RE error: trailing backslash (\)
checking for sdl-config... /usr/pkg/bin/sdl-config
checking for SDL - version >= 1.2.12... yes
checking for jpeglib.h... no

My change allows me to run a command like SED=/usr/pkg/bin/gsed ./configure [...], which alleviates the issue.

Or maybe it'd be better to find something that has the same effect as GNU sed's \b but is more portable.

@dressupgeekout
Copy link
Author

Oof, yeah, the CI doesn't like this at all.

checking for isnan... yes
checking for isinf... yes
checking for finite... yes
checking for isnormal... no
checking for signbit... no
./configure: line 13890: -e: command not found
./configure: line 13893: -e: command not found
./configure: line 13909: -e: command not found
./configure: line 13913: -e: command not found
checking for sdl-config... no
checking for SDL - version >= 1.2.12... no
*** The sdl-config script installed by SDL could not be found
*** If SDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL_CONFIG environment variable to the
*** full path to sdl-config.
configure: error: *** neither SDL nor SDL2 found! ***

configure.ac Outdated
if test "$ac_test_CFLAGS" != set; then
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
CFLAGS=`echo $CFLAGS | ${SED} -e 's/-g\b//g'`

Choose a reason for hiding this comment

The reason 8000 will be displayed to describe this comment to others. Learn more.

Hi,

This don't seem to work under osx.
Why not simply use
sed "s/-g$//g" | sed "s/-g //g"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a much more practical solution.

@dressupgeekout dressupgeekout changed the title Allow overriding path to sed(1) at configure-time More portable use of sed(1) at configure-time Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0