How to complie lkl/linux on freebsd - linux

When I complie lkl/linux on freebsd 11.1, I got this error:
stat: illegal option -- c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle ...]
gmake[1]: *** [Makefile:984: vmlinux] Error 1
gmake: *** [Makefile:148: /root/linux-master/tools/lkl/lib/lkl.o] Error 2
gmake: Leaving directory '/root/linux-master/tools/lkl
How to solve it?

Related

fortran: Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(2))

I am a beginner of Fortran and running a model written by Fortran. When I tried to compile it, I got an error message like:
libtool: link: (cd ".libs" && rm -f "libgrib_api_f77.so" && ln -s "libgrib_api_f77.so.1.0.0" "libgrib_api_f77.so")
libtool: link: ar cru .libs/libgrib_api_f77.a grib_fortran.o grib_f77.o
libtool: link: ranlib .libs/libgrib_api_f77.a
libtool: link: ( cd ".libs" && rm -f "libgrib_api_f77.la" && ln -s "../libgrib_api_f77.la" "libgrib_api_f77.la" )
gfortran -c -o same_int_long.o same_int_long.f90
same_int_long.f90:23:18:
17 | call check_long(x2(1),x2(2),ret)
| 2
......
23 | call check_long(x4(1),x4(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(2)).
same_int_long.f90:29:18:
17 | call check_long(x2(1),x2(2),ret)
| 2
......
29 | call check_long(x8(1),x8(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(2)).
same_int_long.f90:51:17:
45 | call check_int(x2(1),x2(2),ret)
| 2
......
51 | call check_int(x4(1),x4(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(2)).
same_int_long.f90:57:17:
45 | call check_int(x2(1),x2(2),ret)
| 2
......
57 | call check_int(x8(1),x8(2),ret)
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(8)/INTEGER(2)).
make[2]: *** [Makefile:546: same_int_long.o] Error 1
make[2]: Leaving directory '/gpfs/home3/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source/fortran'
make[1]: *** [Makefile:604: all-recursive] Error 1
make[1]: Leaving directory '/gpfs/home3/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source'
make: *** [Makefile:398: /home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source-LXgfortran/include/grib_api.mod] Error 2
What I did is basically following the installation of the model:
Step1
(base) [eccei339#int3 ~]$ mkdir snellius_surfex
(base) [eccei339#int3 ~]$ cp open_surfex_v8_1_20200107.tar-2.gz snellius_surfex/
(base) [eccei339#int3 ~]$ cd snellius_surfex/
(base) [eccei339#int3 snellius_surfex]$ tar zxvf open_surfex_v8_1_20200107.tar-2.gz
…(omit the tar zxvf logging information)
Step 2: some essential env variable
(base) [eccei339#int3 snellius_surfex]$ export VER_MPI="NOMPI"
(base) [eccei339#int3 snellius_surfex]$ export OMP_NUM_THREADS=1
(base) [eccei339#int3 snellius_surfex]$ module load 2021
(base) [eccei339#int3 snellius_surfex]$ module load GCC/10.3.0
(base) [eccei339#int3 snellius_surfex]$ ls
open_SURFEX_V8_1 open_surfex_v8_1_20200107.tar-2.gz
(here I exported some necessary envi var following the instructions of installation of the software)
Step 3: configure
(base) [eccei339#int3 snellius_surfex]$ cd open_SURFEX_V8_1/src/
(base) [eccei339#int3 src]$ ls
ASSIM Makefile Rules.bullXI15.mk Rules.MCgfortran.mk SURFEX
configure Makefile.SURFEX.mk Rules.bullXI16.mk Rules.SX8.mk
FORC OFFLIN Rules.LXgfortran.mk Rules.zgfortran.mk
include Rules.AIX64.mk Rules.LXifort.mk Rules.zifort.mk
LIB Rules.bgfortran.mk Rules.LXpgi.mk scripts
(base) [eccei339#int3 src]$ ./configure
(omit the long logging info of the “configure” command)
(base) [eccei339#int3 src]$ . ../conf/profile_surfex-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0
(an essential step following the instructions of installation of the software)
Step 4: make the master
(base) [eccei339#int3 src]$ make
find: ‘/home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/dir_obj-LXgfortran-SFX-V8-1-1-NOMPI-OMP-O2-X0/MASTER’: No such file or directory
cd /home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source && LDFLAGS= FCFLAGS= CPPFLAGS="" \
./configure --disable-jpeg --prefix=/home/eccei339/snellius_surfex/open_SURFEX_V8_1/src/LIB/grib_api-1.17.0-Source-LXgfortran FC="gfortran" && \
make -j 1 clean && \
make -j 1 && \
make -j 1 install && \
make -j 1 clean
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
(omit the long logging information, and the final lines are the error message shown in the beginning of this question description.)
I searched the Internet that this could be due to the GCC 10 is more strict than older GCC (I compiled this model last year with older GCC and made it, but failed this time because our server is transferred to a new system, thus the GCC is upgraded from older version to a new version). Some information from Google said that I could add something like this:
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
But I tried it in the step 2 where I export some essential environmental variables, it still does not work. So I am wondering is there anybody who can help me? Thanks a lot!
Updates: the source code of grib_api-1.17.0-Source/fortran/same_int_long.f90 from http://distfiles.macports.org/grib_api/ is as following:
! Copyright 2005-2016 ECMWF.
!
! This software is licensed under the terms of the Apache Licence Version 2.0
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
!
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
integer function kind_of_long()
integer(2), dimension(2) :: x2 = (/1, 2/)
integer(4), dimension(2) :: x4 = (/1, 2/)
integer(8), dimension(2) :: x8 = (/1, 2/)
character(len=1) :: ret
kind_of_long=-1
call check_long(x2(1),x2(2),ret)
if (ret == 't') then
kind_of_long=2
return
endif
call check_long(x4(1),x4(2),ret)
if (ret == 't') then
kind_of_long=4
return
endif
call check_long(x8(1),x8(2),ret)
if (ret == 't') then
kind_of_long=8
return
endif
end function kind_of_long
integer function kind_of_int()
integer(2), dimension(2) :: x2 = (/1, 2/)
integer(4), dimension(2) :: x4 = (/1, 2/)
integer(8), dimension(2) :: x8 = (/1, 2/)
character(len=1) :: ret
kind_of_int=-1
call check_int(x2(1),x2(2),ret)
if (ret == 't') then
kind_of_int=2
return
endif
call check_int(x4(1),x4(2),ret)
if (ret == 't') then
kind_of_int=4
return
endif
call check_int(x8(1),x8(2),ret)
if (ret == 't') then
kind_of_int=8
return
endif
end function kind_of_int
program same_int_long
integer ki,kl
ki=kind_of_int()
kl=kind_of_long()
if (ki /= kl) then
write (*,'(i1)') 0
else
write (*,'(i1)') 1
endif
end program same_int_long
Here is the full log information of make: https://drive.google.com/file/d/14rkj2ay39Rv84QBL6UDiSdlIAfhuEt_z/view?usp=sharing
This appened to me with a MPI fortran code. The cause is a decision from gcc developpers on what should be «good interfaces» see here.
Two solutions in my case :
Tells gfortran to ignore this concerns with option -fallow-argument-mismatch.
Use modern fortran interface (use mpi instead of include mpif.h)
I chose the latter.
What you are instantiating as an INTEGER is getting its value assigned by another (variable or declaration) integer of a different "byte" memory storage size.
e.g. in other languages int is 4 bytes and long is 8 bytes. (note) Fortran also has pointers alike C/C++
https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vna5/index.html
nb: You did not show the code that has the problem , somewhere around line 29 char 18 in source file same_int_long.f90 ??

do_compile fails when building an image using the yocto-project "no such file or directory"

I tried to append a layer from git (https://github.com/sigysmund/meta-lora-net) to my Image and whenever I try to bitbake one of the recipes (the other worked), I get this error message:
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440
(see last part for full message)
I have already tried to edit the bb file.
I changed the DEPENDS to "lora-gateway pkgconfig" instead of just the name since I read on another thread, that this can produce Issues but it didn't help.
This is the bb file of the recipe:
SUMMARY = "LoRa network packet forwarder project"
SECTION = "libs/network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45"
SRC_URI = "https://github.com/Lora-net/packet_forwarder/archive/v${PV}.tar.gz"
SRC_URI[md5sum] = "a1f942e0cc7b02d604b11c8cb5f2a029"
SRC_URI[sha256sum] = "e68fadf6f1d2e5e7b601e504d5efb48b0a8f374c2c29c0476ab2fe9db68d33ae"
#old: DEPENDS += "lora-gateway"
# since new release of yocto you should add pkg-config
DEPENDS += "lora-gateway pkgconfig"
S = "${WORKDIR}/packet_forwarder-${PV}"
CFLAGS_append = "-I ${includedir}/libloragw -I ${S}/lora_pkt_fwd/inc -I ${S}/util_tx_test/inc "
do_configure_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_compile_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_install() {
install -d ${D}${bindir}
install -d ${D}${docdir}/lora-pkt-fwd/conf
install ${B}/lora_pkt_fwd/lora_pkt_fwd ${D}${bindir}
install ${B}/util_*/util_* ${D}${bindir}
install -D -m 0644 ${S}/PROTOCOL.TXT ${D}${docdir}/lora-pkt-fwd/PROTOCOL.TXT
install -D -m 0644 ${S}/lora_pkt_fwd/readme.md ${D}${docdir}/lora-pkt-fwd/readme.md
install -D -m 0644 ${S}/lora_pkt_fwd/global_conf.json ${D}${docdir}/lora-pkt-fwd/global_conf.json
install -D -m 0644 ${S}/lora_pkt_fwd/local_conf.json ${D}${docdir}/lora-pkt-fwd/local_conf.json
install -D -m 0755 ${S}/lora_pkt_fwd/update_gwid.sh ${D}${docdir}/lora-pkt-fwd
install -D -m 0644 ${S}/lora_pkt_fwd/cfg/*.json.* ${D}${docdir}/lora-pkt-fwd/conf
rm -f ${D}${bindir}/util_tx_test
rm -f ${D}${bindir}/.debug/util_tx_test
}
PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
PACKAGES = "${PN}-dbg ${PN} ${PN}-doc"
# Avoid QA Issue: No GNU_HASH in the elf binary
INSANE_SKIP_${PN} = "ldflags"
FILES_${PN}-dbg = " \
${bindir}/.debug \
"
FILES_${PN} = " \
${bindir}/* \
"
FILES_${PN}-doc = " \
${docdir} \
"
the full error is:
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_configure: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: Executing shell function do_configure
| NOTE: make clean
| ERROR: oe_runmake failed
| make clean -e -C lora_pkt_fwd
| make[1]: Entering directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| Makefile:17: /home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg: No such file or directory
| make[1]: *** No rule to make target `/home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg'. Stop.
| make[1]: Leaving directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| make: *** [clean] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_configure.23440)
ERROR: Task (/home/kilian/mlinux-4.x/layers/meta-custom/recipes-wireless/lora-pkt-fwd/lora-pkt-fwd_4.0.1.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1590 tasks of which 1580 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/kilian/mlinux-4.x/layers/meta-custom/recipes-wireless/lora-pkt-fwd/lora-pkt-fwd_4.0.1.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
I know that is has got something to do with the libloragw/library.cfg file but since that is imported and I don't know enough about these scripts, I can't find the error.
Any hint is really appreciated!
P.s I didn't include the logfiles since everything in there is already in the Log data follows part of the error. If you need it I can upload it.
Edit:
Thank you jku, appending CLEANBROKEN = "1" fixed this error.
Sadly I am getting a new one:
ERROR: lora-pkt-fwd-4.0.1-r0 do_compile: oe_runmake failed
ERROR: lora-pkt-fwd-4.0.1-r0 do_compile: Function failed: do_compile (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486)
ERROR: Logfile of failure stored in: /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 2
| ERROR: oe_runmake failed
| make all -e -C lora_pkt_fwd
| make[1]: Entering directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| Makefile:17: /home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg: No such file or directory
| make[1]: *** No rule to make target `/home/kilian/mlinux-4.x/build/tmp/sysroots/mtcdt/usr/lib/libloragw/library.cfg'. Stop.
| make[1]: Leaving directory `/home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/packet_forwarder-4.0.1/lora_pkt_fwd'
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/kilian/mlinux-4.x/build/tmp/work/arm926ejste-mlinux-linux-gnueabi/lora-pkt-fwd/4.0.1-r0/temp/log.do_compile.24486)
So there is still a problem with the libloragw/library.cfg file
I did check and there is such a file in the recipe given by the DEPENDS variable so I guess that including that and the corresponding commands don't work
CFLAGS_append = "-I ${includedir}/libloragw -I ${S}/lora_pkt_fwd/inc -I ${S}/util_tx_test/inc "
do_configure_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
do_compile_prepend() {
export LGW_PATH="${STAGING_LIBDIR}/libloragw"
}
But I still don't know what to edit so any help is precious.
| DEBUG: Executing shell function do_configure
| NOTE: make clean
| ERROR: oe_runmake failed
| make clean -e -C lora_pkt_fwd
Yocto/OpenEmbedded tries to run "make clean" during configure to ensure a reproducible build but this particular project fails to do so cleanly. You can either fix the project (patching the Makefile) or add
CLEANBROKEN = "1"
in the recipe: this way OpenEmbedded won't run make clean on configure.

error: C preprocessor "/usr/local/bin/cpp" fails sanity check

I'm trying to install freetype 2.8, unfortunately I started getting this error everytime I run the configure file I run into this issue: error: C preprocessor "/usr/local/bin/cpp" fails sanity check
I tried some solutions I found on the site but they didn't solve my problem, maybe you can.
I'll paste here the configure.log file:
`
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = ubuntu
uname -m = x86_64
uname -r = 4.10.0-38-generic
uname -s = Linux
uname -v = #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/tabi/bin
PATH: /home/tabi/.local/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin
configure:2934: $? = 0
configure:2923: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
configure:2934: $? = 0
configure:2923: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2934: $? = 1
configure:2923: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2934: $? = 1
configure:2954: checking whether the C compiler works
configure:2976: gcc conftest.c >&5
configure:2980: $? = 0
configure:3028: result: yes
configure:3031: checking for C compiler default output file name
configure:3033: result: a.out
configure:3039: checking for suffix of executables
configure:3046: gcc -o conftest conftest.c >&5
configure:3050: $? = 0
configure:3072: result:
configure:3094: checking whether we are cross compiling
configure:3102: gcc -o conftest conftest.c >&5
configure:3106: $? = 0
configure:3113: ./conftest
configure:3117: $? = 0
configure:3132: result: no
configure:3137: checking for suffix of object files
configure:3159: gcc -c conftest.c >&5
configure:3163: $? = 0
configure:3184: result: o
configure:3188: checking whether we are using the GNU C compiler
configure:3207: gcc -c conftest.c >&5
configure:3207: $? = 0
configure:3216: result: yes
configure:3225: checking whether gcc accepts -g
configure:3245: gcc -c -g conftest.c >&5
configure:3245: $? = 0
configure:3286: result: yes
configure:3303: checking for gcc option to accept ISO C89
configure:3366: gcc -c -g -O2 conftest.c >&5
configure:3366: $? = 0
configure:3379: result: none needed
configure:3404: checking how to run the C preprocessor
configure:3474: result: /usr/local/bin/cpp
configure:3494: /usr/local/bin/cpp conftest.c
./configure: line 1609: /usr/local/bin/cpp: No such file or directory
configure:3494: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "FreeType"
| #define PACKAGE_TARNAME "freetype"
| #define PACKAGE_VERSION "2.8"
| #define PACKAGE_STRING "FreeType 2.8"
| #define PACKAGE_BUGREPORT "freetype#nongnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3494: /usr/local/bin/cpp conftest.c
./configure: line 1609: /usr/local/bin/cpp: No such file or directory
configure:3494: $? = 127
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "FreeType"
| #define PACKAGE_TARNAME "freetype"
| #define PACKAGE_VERSION "2.8"
| #define PACKAGE_STRING "FreeType 2.8"
| #define PACKAGE_BUGREPORT "freetype#nongnu.org"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:3524: error: in `/home/tabi/Downloads/freetype-2.8/builds/unix':
configure:3526: error: C preprocessor "/usr/local/bin/cpp" fails sanity check
See `config.log' for more details
`

missing separator on Makefile

I am now having problems with a autotools generated Makefile, and it first looks like this. When I was trying make an error arised:
Makefile:327: *** missing separator. Stop.
Then, I tried the following change:
326,327c326
< LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b
< -static
---
> LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b -static
But, this time, I got this error:
Making all in intl
Makefile:35: *** missing separator. Stop.
make[1]: *** [Makefile:582: all-recursive] Error 1
make: *** [Makefile:489: all] Error 2
The related lines look like these:
32 skip_next=no; \
33 strip_trailopt () \
34 { \
35 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
36 }; \
And I teird a lot of things like:
34 { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \
34 { \
35 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \
33 strip_trailopt () { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \
and
35 ^Iflg=printf '%s\n' "$$flg" | sed "s/$$1.*$$//"; \$
But still got the same error.
Does anyone can give me some ieda about how to fix it?
(Note: I'm not sure if this is correct in StackOverflow vs SuperUser.)
If you edited the Makefile, it'll not be useful as it'll just re-generate out of Makefile.in, and that one in turn will be generated out of Makefile.am.
Check your Makefile.am file, and put -static in the same line as everything else; what is happening is that it does not have a continuation symbol at the end of the previous line (\), so the variable definition is not continued. And because of that it tries to parse it as a rule, which it's not.

Error while building OpenSSL for android using ndk

I am trying to build openSSL for android using ndk. I am using dockerFile concept. I have set few environment variables as per suggested in http://wiki.openssl.org/index.php/Android. Now I am getting following error:
make[2]: Entering directory `/Android/openssl/apps'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -ldl}"; LDCMD="${LDCMD:-arm-l
inux-androideabi-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO
_DLFCN -DHAVE_DLFCN_H --static -Wa,--noexecstack -march=armv7-a -mandroid -I/And
roid/android-ndk-r10c/platforms/android-19/arch-arm/usr/include -B/Android/andro
id-ndk-r10c/platforms/android-19/arch-arm/usr/lib -O3 -fomit-frame-pointer -Wall
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_AS
M -DAES_ASM -DBSAES_ASM -DGHASH_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; d
one | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/
g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:
=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd
.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o
ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o
s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.
o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o eng
ine.o ocsp.o prime.o ts.o srp.o ${LIBDEPS} )
/Android/toolchain-arm/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: unde
fined reference to 'dlopen'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: unde
fined reference to 'dlsym'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_globallookup: error: unde
fined reference to 'dlclose'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_func: error: undefin
ed reference to 'dlsym'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_func: error: undefin
ed reference to 'dlerror'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_var: error: undefine
d reference to 'dlsym'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_bind_var: error: undefine
d reference to 'dlerror'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined re
ference to 'dlopen'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined re
ference to 'dlclose'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_load: error: undefined re
ference to 'dlerror'
../libcrypto.a(dso_dlfcn.o):dso_dlfcn.c:function dlfcn_unload: error: undefined
reference to 'dlclose'
collect2: error: ld returned 1 exit status
make[2]: Leaving directory `/Android/openssl/apps'
make[2]: *** [link_app.] Error 1
make[1]: *** [openssl] Error 2
make[1]: Leaving directory `/Android/openssl/apps'
make: *** [build_apps] Error 1
INFO[0135] The command [/bin/sh -c cd openssl && ./config --static no-ssl2 no-ss
l3 no-comp no-hw no-engine && make depend && make && ls -hs . && cp l
ibssl.a /Android/output] returned a non-zero code: 2
docker#boot2docker:/home/curl_ssl$
Do you have suggestions to resolve above error? I am not able to find what is reason behind such error.
Android has openssl already. Perhaps you do not need to compile them. Try answer from this question Compiling OpenSSL on Android

Resources