You are not logged in.
I have a PKGBUILD file below. When I makepkg, it failed. But I can compile manually sucess for the code source.
------------------ error message when makepkg ---------------------
dhtlib.o: In function `hashsg_init':
dhtlib.c:(.text+0x11ce): undefined reference to `SHA1_Init'
dhtlib.c:(.text+0x11e4): undefined reference to `SHA1_Update'
dhtlib.c:(.text+0x11f3): undefined reference to `SHA1_Final'
dhtrouter.o: In function `dr_generate_token':
dhtrouter.c:(.text+0x93b): undefined reference to `SHA1_Init'
dhtrouter.c:(.text+0x952): undefined reference to `SHA1_Update'
dhtrouter.c:(.text+0x969): undefined reference to `SHA1_Update'
dhtrouter.c:(.text+0x975): undefined reference to `SHA1_Final'
collect2: ld returned 1 exit status
make[2]: *** [acnchess] Error 1
make[2]: Leaving directory `/share/arch/LocalPackages/acnchess/src/acnchess-0.0.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/share/arch/LocalPackages/acnchess/src/acnchess-0.0.1/src'
make: *** [all-recursive] Error 1
------------------ PKGBUILD file ---------------------------------
pkgname=acnchess
_mainver=0.0.1
_subver=69
pkgver=${_mainver}_${_subver}
pkgrel=2
pkgdesc="another Chinese chess game coded by Alf"
arch=('i686' 'x86_64')
url="http://code.google.com/p/acnchess/"
license=('GPL2')
depends=('gtk2>=2.6.0' 'rpmextract' 'openssl')
source=("http://acnchess.googlecode.com/files/$pkgname-${_mainver}-${_subver}.src.rpm")
md5sums=('a21cd520eaab3ceeb0604704f10da869')
build() {
cd $srcdir
rpmextract.sh $pkgname-${_mainver}-${_subver}.src.rpm
bsdtar -xf $pkgname-${_mainver}.tar.gz
cd "$srcdir/$pkgname-${_mainver}"
./configure --prefix=/usr
make || return 1
make DESTDIR="$pkgdir/" install
}
any idea?
SOLUTION: add "unset LDFLAGS" into build function in PKGBUILD as bangkok_manouel said OR filter out some flag as Ranguvar wrote
export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
Last edited by tocer (2009-12-07 15:33:49)
Offline
Do you have "MAKEFLAGS=-j3" or something like that in your makepkg.conf. If so, try adding "options=('!makeflags')" to your pkgbuild.
Offline
Do you have "MAKEFLAGS=-j3" or something like that in your makepkg.conf. If so, try adding "options=('!makeflags')" to your pkgbuild.
No, the following is the part of makepkg.conf
#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="i686"
CHOST="i686-pc-linux-gnu"
#-- Exclusive: will only run on i686
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe"
LDFLAGS="-Wl,--hash-style=gnu -Wl,--as-needed"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
Offline
what if you unset LDFLAGS ?
Offline
what if you unset LDFLAGS ?
It works well, thank you very much. But, it is the default value, and I never change it. I think most of Arch user use the default value. I'll submit this package to AUR, how to patch the PKGBUILD file so that other Arch user compile it correctly?
Offline
bangkok_manouel wrote:what if you unset LDFLAGS ?
It works well, thank you very much. But, it is the default value, and I never change it. I think most of Arch user use the default value. I'll submit this package to AUR, how to patch the PKGBUILD file so that other Arch user compile it correctly?
adding
unset LDFLAGS
below
build() {
should do it...
edit: LDFLAGS not CFLAGS errrf...
Last edited by bangkok_manouel (2009-12-07 14:26:35)
Offline
bangkok_manouel:
good solution. thank you again.
Offline
More than likely it is the --as-needed flag giving problems.
I suggest you just filter out that flag rather than completely override the user's flags.
export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
export LDFLAGS="${LDFLAGS//,--as-needed}"
export LDFLAGS="${LDFLAGS//--as-needed}"
Offline
More than likely it is the --as-needed flag giving problems.
I suggest you just filter out that flag rather than completely override the user's flags.export LDFLAGS="${LDFLAGS//-Wl,--as-needed}" export LDFLAGS="${LDFLAGS//,--as-needed}" export LDFLAGS="${LDFLAGS//--as-needed}"
the first line is good, the others compiled fail.
you are right, and it is better.
Offline
No, all three lines are supposed to be used.
They strip out --as-needed in different ways that the user might have them set.
The first line takes care of how it is set in default Arch, but if you use all three lines, then even custom LDFLAGS users should be covered.
Offline
I got it. thank you
Offline