I build httrack on Cygwin, but it is always "checking for iconv in -liconv... no" and compile error.
collect2: error: ld returned 1 exit status
./.libs/libhttrack.a(htscharset.o): In function `hts_convertStringCharset':
/home/myname/httrack/src/htscharset.c:441: undefined reference to `libiconv_open'
/home/myname/httrack/src/htscharset.c:460: undefined reference to `libiconv'
/home/myname/httrack/src/htscharset.c:491: undefined reference to `libiconv_close
I have install libiconv1.1.4 in /usr/local/libiconv, but it's still error.
nm /lib/libiconv.a | grep iconv
iconv.o:
00000000 D __libiconv_version
00015960 T _iconv_canonicalize
00015120 T _libiconv
00015180 T _libiconv_close
00014d00 T _libiconv_open
000151a0 T _libiconv_open_into
00015690 T _libiconvctl
00015810 T _libiconvlist
U _libiconv_relocate
000000d0 T _libiconv_relocate
00000000 T _libiconv_set_relocation_prefix
iconv-exports.o:
00000000 D __imp___libiconv_version
U __libiconv_version
libiconv.res.o:
The code in configure for iconv check:
### Check for iconv
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5
$as_echo_n "checking for iconv in -liconv... " >&6; }
if ${ac_cv_lib_iconv_iconv+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv $LIBS"
httrack requires several patches to build and operate correctly on Cygwin. The libiconv patch fixes the iconv configure test to work on Cygwin (and other platforms which use GNU libiconv).
Related
Prior to the Monterey update, I had a fairly stable method of running x86 versions of Python (3.8, and 3.10) on my M1 Mac by adapting these instructions (basically, arch -x86_64 brew to install x86 versions of Python dependencies and using arch -x86_64 pyenv to install Python).
Since Monterey, whenever I try to install a different version of Python 3.8+ (e.g. 3.9.11), I get this error:
BUILD FAILED (OS X 12.3 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/q6/w2pgnv455zx_swdp919_zsww0000gn/T/python-build.20220324065050.66757
Results logged to /var/folders/q6/w2pgnv455zx_swdp919_zsww0000gn/T/python-build.20220324065050.66757.log
Last 10 log lines:
"_libintl_textdomain", referenced from:
_PyIntl_textdomain in libpython3.9.a(_localemodule.o)
_PyIntl_textdomain in libpython3.9.a(_localemodule.o)
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
clang: clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1
make: *** Waiting for unfinished jobs....
make: *** [python.exe] Error 1
I am struggling to find anything significant in the corresponding config.log (top lines included):
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by python configure 3.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/Users/joshualee/.pyenv/versions/3.9.11_x86 --libdir=/Users/joshualee/.pyenv/versions/3.9.11_x86/lib --with-openssl=/opt/homebrew/opt/openssl#1.1
## --------- ##
## Platform. ##
## --------- ##
hostname = Macbook-Pro-2.local
uname -m = x86_64
uname -r = 21.4.0
uname -s = Darwin
uname -v = Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000
Kernel configured for up to 10 processors.
10 processors are physically available.
10 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7 8 9
Primary memory available: 16.00 gigabytes
Default processor set: 515 tasks, 2684 threads, 10 processors
Load average: 2.49, Mach factor: 7.50
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /opt/homebrew/Cellar/pyenv/2.2.5/libexec
PATH: /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/bin
PATH: /Users/joshualee/.pyenv/shims
PATH: /opt/homebrew/bin
PATH: /opt/homebrew/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Users/joshualee/.local/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2860: checking build system type
configure:2874: result: x86_64-apple-darwin21.4.0
configure:2894: checking host system type
configure:2907: result: x86_64-apple-darwin21.4.0
configure:2937: checking for python3.9
configure:2967: result: no
configure:2937: checking for python3
configure:2953: found /Users/joshualee/.pyenv/shims/python3
configure:2964: result: python3
configure:3058: checking for --enable-universalsdk
configure:3105: result: no
configure:3129: checking for --with-universal-archs
configure:3144: result: no
configure:3300: checking MACHDEP
configure:3351: result: "darwin"
configure:3645: checking for gcc
configure:3672: result: clang
configure:3901: checking for C compiler version
configure:3910: clang --version >&5
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:3921: $? = 0
configure:3910: clang -v >&5
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:3921: $? = 0
configure:3910: clang -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3921: $? = 1
configure:3910: clang -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:3921: $? = 1
configure:3941: checking whether the C compiler works
configure:3963: clang -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib -L/usr/local/opt/openssl#3/lib -L/usr/local/opt/xz/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib conftest.c >&5
ld: warning: directory not found for option '-L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib'
configure:3967: $? = 0
configure:4015: result: yes
configure:4018: checking for C compiler default output file name
configure:4020: result: a.out
configure:4026: checking for suffix of executables
configure:4033: clang -o conftest -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib -L/usr/local/opt/openssl#3/lib -L/usr/local/opt/xz/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib conftest.c >&5
ld: warning: directory not found for option '-L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib'
configure:4037: $? = 0
configure:4059: result:
configure:4081: checking whether we are cross compiling
configure:4089: clang -o conftest -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib -L/usr/local/opt/openssl#3/lib -L/usr/local/opt/xz/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib conftest.c >&5
ld: warning: directory not found for option '-L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib'
configure:4093: $? = 0
configure:4100: ./conftest
configure:4104: $? = 0
configure:4119: result: no
configure:4124: checking for suffix of object files
configure:4146: clang -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c >&5
configure:4150: $? = 0
configure:4171: result: o
configure:4175: checking whether we are using the GNU C compiler
configure:4194: clang -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c >&5
configure:4194: $? = 0
configure:4203: result: yes
configure:4212: checking whether clang accepts -g
configure:4232: clang -c -g -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c >&5
configure:4232: $? = 0
configure:4273: result: yes
configure:4290: checking for clang option to accept ISO C89
configure:4353: clang -c -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c >&5
configure:4353: $? = 0
configure:4366: result: none needed
configure:4391: checking how to run the C preprocessor
configure:4422: clang -E -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c
configure:4422: $? = 0
configure:4436: clang -E -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c
conftest.c:8:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
configure:4436: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:4461: result: clang -E
configure:4481: clang -E -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c
configure:4481: $? = 0
configure:4495: clang -E -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include conftest.c
conftest.c:8:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
configure:4495: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:4523: checking for grep that handles long lines and -e
configure:4581: result: /usr/bin/grep
configure:4586: checking for a sed that does not truncate output
configure:4650: result: /usr/bin/sed
configure:4658: checking for --with-cxx-main=<compiler>
configure:4684: result: no
configure:4933: checking for clang++
configure:4966: result: no
configure:5202:
By default, distutils will build C++ extension modules with "clang++".
If this is not intended, then set CXX on the configure command line.
configure:5211: checking for the platform triplet based on compiler characteristics
configure:5361: result: darwin
configure:5369: checking for multiarch
configure:5381: result:
configure:5398: checking for -Wl,--no-as-needed
configure:5414: clang -o conftest -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl#3/include -I/usr/local/opt/xz/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/readline/include -I/Users/joshualee/.pyenv/versions/3.9.11_x86/include -I/opt/homebrew/include -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib -L/usr/local/opt/openssl#3/lib -L/usr/local/opt/xz/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -Wl,--no-as-needed conftest.c >&5
ld: warning: directory not found for option '-L/Users/joshualee/.pyenv/versions/3.9.11_x86/lib'
ld: unknown option: --no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:5414: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define _GNU_SOURCE 1
| #define _NETBSD_SOURCE 1
| #define __BSD_VISIBLE 1
| #define _DARWIN_C_SOURCE 1
| #define _PYTHONFRAMEWORK ""
| /* end confdefs.h. */
Things I have tried:
re-installing xcode command line tools
re-installing with brew (and arch brew -x86_64) pyenv pre-requisites: openssl, readling, sqlite3 etc.
different CFLAGS and LDFLAGS (I can't remember which but largely, pointing to x86 folders for openssl, zlib, readline, etc.)
I am still fairly new to using M1 Macs so any guidance would be much appreciated.
The solution was to
install gettext library with arch -x86_64 /usr/local/bin/brew install gettext
add path to gettext to pyenv CFLAGS and LDFLAGS in your .zshrc file. (Usually it's at ~/.zshrc)
export LDFLAGS="-L/usr/local/opt/gettext/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include"
restart terminal
I am try to compress the JPEG file and installed ImageMagick on Linux machine. PFB.
Below is the convert command looks like.
Any idea to fix it?
Below are logs :
No package 'pango' found
configure:32506: result:
configure:32565: result: -------------------------------------------------------------
configure:32569: checking for PNG
configure:32576: $PKG_CONFIG --exists --print-errors "libpng >= 1.0.0"
configure:32579: $? = 0
configure:32593: $PKG_CONFIG --exists --print-errors "libpng >= 1.0.0"
configure:32596: $? = 0
configure:32634: result: yes
configure:32638: result:
configure:32682: result: -------------------------------------------------------------
configure:32686: checking for RAW_R
configure:32693: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:32696: $? = 1
configure:32710: $PKG_CONFIG --exists --print-errors "libraw_r >= 0.14.8"
Package libraw_r was not found in the pkg-config search path.
Perhaps you should add the directory containing `libraw_r.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libraw_r' found
configure:32713: $? = 1
configure:32727: result: no
No package 'libraw_r' found
configure:32755: result:
configure:33003: result: -------------------------------------------------------------
configure:33005: checking for TIFF
configure:33007: result:
configure:33011: checking tiff.h usability
configure:33011: gcc -std=gnu99 -std=gnu99 -c -I/usr/include/libpng15 -fopenmp -g -O2 -Wall -mtune=corei7 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 conftest.c >&5
conftest.c:260:18: fatal error: tiff.h: No such file or directory
#include <tiff.h>
^
compilation terminated.
configure:33011: $? = 1
configure: failed program was:
Compile it in.
./configure -with-png=yes \
--with-jpeg=yes \
--with-jp2=yes \
--with-freetype=yes
From
http://www.imagemagick.org/discourse-server/viewtopic.php?t=22086.
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
I am a new user of Linux and am trying to attempt Pintos Project #02 - User Programs. I've only installed Pintos and I was trying to build the examples by "make" and I get this error:
7fcdfb62f000-7fcdfb631000 rw-p 00000000 00:00 0
7fcdfb631000-7fcdfb632000 r--p 00022000 08:07 4619 /lib/x86_64-linux-gnu/ld-2.17.so
7fcdfb632000-7fcdfb634000 rw-p 00023000 08:07 4619 /lib/x86_64-linux-gnu/ld-2.17.so
7fffa164a000-7fffa166b000 rw-p 00000000 00:00 0 [stack]
7fffa16ed000-7fffa16ef000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
../Makefile.userprog:42: recipe for target 'libc.a' failed
make: *** [libc.a] Aborted (core dumped)
make: *** Deleting file 'libc.a'
Can anyone please explain what is going on?
Here is Makefile.userprog for reference:
# -*- makefile -*-
$(PROGS): CPPFLAGS += -I$(SRCDIR)/lib/user -I.
# Linker flags.
$(PROGS): LDFLAGS += -nostdlib -static -Wl,-T,$(LDSCRIPT)
$(PROGS): LDSCRIPT = $(SRCDIR)/lib/user/user.lds
# Library code shared between kernel and user programs.
lib_SRC = lib/debug.c # Debug code.
lib_SRC += lib/random.c # Pseudo-random numbers.
lib_SRC += lib/stdio.c # I/O library.
lib_SRC += lib/stdlib.c # Utility functions.
lib_SRC += lib/string.c # String functions.
lib_SRC += lib/arithmetic.c # 64-bit arithmetic for GCC.
lib_SRC += lib/ustar.c # Unix standard tar format utilities.
exm_SRC += example/halt.c # changes done
# User level only library code.
lib/user_SRC = lib/user/debug.c # Debug helpers.
lib/user_SRC += lib/user/syscall.c # System calls.
lib/user_SRC += lib/user/console.c # Console code.
LIB_OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(lib_SRC) $(lib/user_SRC)))
LIB_DEP = $(patsubst %.o,%.d,$(LIB_OBJ))
LIB = lib/user/entry.o libc.a
PROGS_SRC = $(foreach prog,$(PROGS),$($(prog)_SRC))
PROGS_OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(PROGS_SRC)))
PROGS_DEP = $(patsubst %.o,%.d,$(PROGS_OBJ))
all: $(PROGS)
define TEMPLATE
$(1)_OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$($(1)_SRC)))
$(1): $$($(1)_OBJ) $$(LIB) $$(LDSCRIPT)
$$(CC) $$(LDFLAGS) $$($(1)_OBJ) $$(LIB) -o $$#
endef
$(foreach prog,$(PROGS),$(eval $(call TEMPLATE,$(prog))))
libc.a: $(LIB_OBJ)
rm -f $# # LINE 42
ar r $# $^
ranlib $#
clean::
rm -f $(PROGS) $(PROGS_OBJ) $(PROGS_DEP)
rm -f $(LIB_DEP) $(LIB_OBJ) lib/user/entry.[do] libc.a
.PHONY: all clean
-include $(LIB_DEP) $(PROGS_DEP)
You might have messed up your makefile by copypasting it from somewhere. The whitespace in front of commands to be executed NEEDS to be one or more tabs, you can't use blanks.
I'm having trouble compiling wmii v3.9.2 on Fedora 15; Here's the interesting part (things break down at the linking stage):
% bmake -de
MAKE all libbio/
MAKE all libfmt/
MAKE all libregexp/
MAKE all libutf/
MAKE all libixp/
MAKE all doc/
MAKE all man/
MAKE all cmd/
MAKE all cmd/wmii/
MAKE all cmd/menu/
LD cmd/wmii9menu.out
/usr/bin/ld: wmii/xext.o: undefined reference to symbol 'XRenderFindVisualFormat'
/usr/bin/ld: note: 'XRenderFindVisualFormat' is defined in DSO /usr/lib64/libXrender.so.1 so try adding it to the linker command line
/usr/lib64/libXrender.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
*** Failed target: wmii9menu.out
*** Failed command: ../util/link "cc" "$(pkg-config --libs 2>/dev/null) -g -L../lib -L/usr/lib64 ../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a ../lib/libutf.a -L../lib -L/usr/lib64 ../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a ../lib/libutf.a" wmii9menu.out wmii9menu.o clientutil.o wmii/x11.o wmii/xext.o wmii/geom.o wmii/map.o util.o ../lib/libixp.a $(pkg-config --libs xft xrandr xinerama) -lXext
*** Error code 1
Stop.
bmake: stopped in /srv/redhat/BUILD/wmii+ixp-3.9.2/cmd
*** Failed target: dall
*** Failed command: dirs="libbio libfmt libregexp libutf libixp doc man cmd libwmii_hack rc alternative_wmiircs"; set -e; targ=dall; targ=${targ#d}; for i in $dirs; do export WMII_HGVERSION=""; export BASE=$i/; if [ ! -d $i ]; then echo Skipping nonexistent directory: $i 1>&2; else echo MAKE $targ $BASE; (cd $i && bmake $targ) || exit ; fi; done
*** Error code 1
Stop.
bmake: stopped in /srv/redhat/BUILD/wmii+ixp-3.9.2
Finally, in config.mk, I have the following settings:
...
INCLUDES = -I. -I$(ROOT)/include -I$(INCLUDE) -I/usr/include
LIBS = -L$(ROOT)/lib -L/usr/lib64
...
LDFLAGS += -g $(LIBS)
SOLDFLAGS += $(LDFLAGS)
SHARED = -shared -Wl,-soname=$(SONAME)
STATIC = -static
...
With a little more manual resolution, the statement generating the error is essentially as follows:
gcc \
-o wmii9menu.out\
-L../lib -L/usr/lib $(pkg-config --libs xft xrandr xinerama xext)\
../lib/libregexp9.a ../lib/libbio.a ../lib/libfmt.a\
../lib/libutf.a ../lib/libixp.a\
wmii9menu.o clientutil.o util.o\
wmii/x11.o wmii/xext.o wmii/geom.o wmii/map.o
Here, the pkg-config resolves to the following, which by itself is perfectly correct:
-lXft -lXrandr -lXinerama -lXext
And the solution is as follows:
--- wmii+ixp-3.9.2/config.mk 2011-06-03 14:03:22.950163074 +1000
+++ wmii+ixp-3.9.2/config.mk 2011-06-03 14:03:16.086129011 +1000
## -32 +32 ##
-X11PACKAGES = xft
+X11PACKAGES = xft xext xrandr xrender xinerama