shlomif / fortune-mod

Implementation of the Unix fortune command for displaying a random quotation, for Linux and other systems.
http://www.shlomifish.org/open-source/projects/fortune-mod/
Other
412 stars 59 forks source link

can not cross-compile #58

Closed leleliu008 closed 2 years ago

leleliu008 commented 2 years ago

I wanna cross-compile for Android. I find that strfile is ruuning when compiling, actually it can not run when compiling.

shlomif commented 2 years ago

On Mon, 13 Dec 2021 03:11:57 -0800 fpliu @.***> wrote:

I wanna cross-compile for Android. I find that strfile is ruuning when compiling, actually it can not run when compiling.

Thanks for the report! I'll try to see what I can do.

--

Shlomi Fish https://www.shlomifish.org/ Let’s talk about restores instead of backups - https://is.gd/WatQqu

What does “IDK” stand for? I don’t know. — https://www.shlomifish.org/humour.html

Please reply to list if it's a mailing list post - https://shlom.in/reply .

shlomif commented 2 years ago

hi @leleliu008 . Please try latest git master HEAD. e.g: https://github.com/shlomif/fortune-mod/commit/ee157356be6a9f0e6fe4211829a9ac04521e35cd . Thanks!

leleliu008 commented 2 years ago

hi @shlomif Thank you for your quick response.

I tried the git master HEAD, reportted following error messages:

[21/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/debian debian.dat
FAILED: datfiles/debian.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/debian.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/debian debian.dat
/bin/sh: 1: strfile: not found
[22/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/art art.dat
FAILED: datfiles/art.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/art.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/art art.dat
/bin/sh: 1: strfile: not found
[23/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/cookie cookie.dat
FAILED: datfiles/cookie.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/cookie.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/cookie cookie.dat
/bin/sh: 1: strfile: not found
[24/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/ascii-art ascii-art.dat
FAILED: datfiles/ascii-art.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/ascii-art.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/ascii-art ascii-art.dat
/bin/sh: 1: strfile: not found
[25/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && /home/linuxbrew/.linuxbrew/bin/perl -e "my (\$src, \$dest) = @ARGV; use File::Copy; copy(\$src, \$dest);" /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/cookie cookie
[26/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/computers computers.dat
FAILED: datfiles/computers.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/computers.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/computers computers.dat
/bin/sh: 1: strfile: not found
[27/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && /home/linuxbrew/.linuxbrew/bin/perl -e "my (\$src, \$dest) = @ARGV; use File::Copy; copy(\$src, \$dest);" /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/computers computers
[28/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/definitions definitions.dat
FAILED: datfiles/definitions.dat /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/definitions.dat
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles && strfile /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/definitions definitions.dat
/bin/sh: 1: strfile: not found
[29/221] cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/off && rot < /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/off/unrotated/zippy > /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/off/rotated/zippy
FAILED: datfiles/off/rotated/zippy /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/off/rotated/zippy
cd /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/off && rot < /tmp/tmp.lEP44Fzldl/fortune-mod/datfiles/off/unrotated/zippy > /tmp/tmp.lEP44Fzldl/1639434589/armeabi-v7a/datfiles/off/rotated/zippy
/bin/sh: 1: rot: not found
shlomif commented 2 years ago

@leleliu008 : hi! "strfile" and "rot" should be in the executables' path. You can get them from a native install of fortune-mod: https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them . I'll add sanity checks for them.

leleliu008 commented 2 years ago

@shlomif thank you! it works now.

shlomif commented 2 years ago

@leleliu008 : you're welcome.

leleliu008 commented 2 years ago
tree /home/fpliu/.ndk-pkg/install.d/fortune/arm64-v8a -L 4

捕获

shlomif commented 2 years ago

Fix released in v3.8.0. RESOLVED.

leleliu008 commented 2 years ago

your new release version v3.8.0 don't work for cross-compile due to commit bf93bf2 has error.

if (NOT "${_found}")

this should change to following:

if (NOT _found)

Reference: https://cmake.org/cmake/help/latest/command/if.html

if(<string>)
A quoted string always evaluates to false unless:

The string's value is one of the true constants, or

Policy CMP0054 is not set to NEW and the string's value happens to be a variable name that is affected by CMP0054's behavior.
shlomif commented 2 years ago

@leleliu008 : thanks! please try again with the git master.

leleliu008 commented 2 years ago

ok, it works again.

shlomif commented 2 years ago

On Tue, 14 Dec 2021 06:11:04 -0800 fpliu @.***> wrote:

ok, it works again.

Thanks for the update!

--

Shlomi Fish https://www.shlomifish.org/ https://shlomifishswiki.branchable.com/Self-Sufficiency/

I feel much better, now that I’ve given up hope. — Ashleigh Brilliant

Please reply to list if it's a mailing list post - https://shlom.in/reply .

shlomif commented 2 years ago

@leleliu008 hi! Please try again with release v3.10.0: https://github.com/shlomif/fortune-mod/releases/tag/fortune-mod-3.10.0 .

leleliu008 commented 2 years ago

@shlomif I have confirmed that v3.10.0 works well on both native-compile and cross-compile for Android. Many thanks for your help and efforts.

shlomif commented 2 years ago

On Wed, 15 Dec 2021 17:59:01 -0800 fpliu @.***> wrote:

@shlomif I have confirmed that v3.10.0 works well on both native-compile and cross-compile for Android. Many thanks for your help and efforts.

Thanks for the headsup, and - yw.

--

Shlomi Fish https://www.shlomifish.org/ https://www.shlomifish.org/humour/ways_to_do_it.html

“When I was your age, Emma Watson was called Sarah Bernhardt!”

“Whoa, dude! How old are you?” — https://www.shlomifish.org/humour/bits/facts/Emma-Watson/

Please reply to list if it's a mailing list post - https://shlom.in/reply .