Skip to content

Conversation

yurivict
Copy link

CFLAGS addition is needed because the readline.h header is located under prefix, usually /usr/local.

@ccxvii
Copy link
Owner

ccxvii commented Feb 26, 2019

Then why are you setting CFLAGS += -I$(prefix)? That seems wrong. The 'prefix' is where you're building to install mujs; that has nothing to do with where we can find readline.

@yurivict
Copy link
Author

yurivict commented Feb 26, 2019

On FreeBSD all packages are installed into one location, usually with PREFIX=/usr/local. readline is also a package installed there.

@yurivict
Copy link
Author

yurivict commented Feb 27, 2019

Practically speaking, there is no need to separate readline location and mujs install prefix, because virtually all other software doesn't, and on BSD readline is a package and is installed into the package prefix, which might be different from linux. I maintain a lot of packages on FreeBSD, that's how I know.

@gardhr
Copy link
Contributor

gardhr commented Feb 28, 2019

But why would you even want to build them together like that to begin with? Doesn't make much sense at all to do that. Just compile the two libraries separately and then link the object files in the final step. Simple enough anyway.

@yurivict
Copy link
Author

But why would you even want to build them together like that to begin with

They aren't built together. They each are its own port.

@yurivict
Copy link
Author

yurivict commented Jun 7, 2019

On FreeBSD readline is available from the readline package, which is always installed into $(PREFIX), same as the mujs package.

The 'prefix' is where you're building to install mujs; that has nothing to do with where we can find readline.

It is always the same location on BSDs. According to GNU standards, $(PREFIX) is where the program is installed and general dependencies are found. Unfortunately, they didn't define a special dependency package path variable.

@yurivict
Copy link
Author

@ccxvii Could you please merge this PR? It allows FreeBSD users to use readline with MuJS, which is otherwise not found.

$prefix is both a location where the project is installed, and where to look for outside dependencies installed from packages.

$ ldd /usr/local/bin/mujs
/usr/local/bin/mujs:
	libreadline.so.8 => /usr/local/lib/libreadline.so.8 (0x8002c3000)
	libm.so.5 => /lib/libm.so.5 (0x800319000)
	libc.so.7 => /lib/libc.so.7 (0x80034a000)
	libncursesw.so.8 => /lib/libncursesw.so.8 (0x800740000)

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.

3 participants