Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-03-23 Thread Stuart Henderson
Since nobody came up with a better idea re the library version handling
(which works ok, only problem is that it's a little messy), and this is a
dependency for BIND 10, I would like to commit it as-is; it can always
be improved in-tree later if needed.

any developer OKs?

http://junkpile.org/log4cplus.tgz


On 2012/03/15 01:33, Stuart Henderson wrote:
 On 2012/03/14 10:46, Jeremy C. Reed wrote:
  On Thu, 2 Feb 2012, Stuart Henderson wrote:
  
Anyways, anyone have comments on the porting itself? (tarball in first 
message.)

   
   Yes but only minor; please start SHARED_LIBS from 0.0 rather than
   using upstream's versioning, and there's a minor whitespace nit
   in MASTER_SITES, otherwise looks good to me.
   
   With those changes I would be ok with this going in after we're
   done with lock for 5.1.
  
  Thanks.
  
  The latest tarfile is attached with the minor changes discussed on this 
  thread.
  
  Can someone please add this to the ports tree?
  
  Off list it was also suggested that consider removing the version from 
  the library name, but I didn't patch that. If anyone wants to, that is 
  fine.
 
 Sorry it's not OK as-is. Your SHARED_LIBS line and PFRAG.shared are
 incorrect for the library, the directories are not registered in
 the PLIST, and the libtool versioning is going to need to be fixed
 to be properly under control of the port
 
 $ make plist
 ===  Updating plist for log4cplus-1.0.4
 Scanning destdir
 Getting old lists
 1st pass identifying files
 Attaching annotations
 Sorting out destdir files
 WARNING: unregistered shared lib(s)
 SHARED_LIBS +=  log4cplus-1.0 0.0 # 0.0
 pkg/PLIST changed
 pkg/PFRAG.shared changed
 
 This diff relative to yours (and attached tar) improves things
 but it's still a bit awkward, there has to be a better way to
 override the library version
 
 
 diff --git a/Makefile b/Makefile
 index 617f540..f56beda 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -3,10 +3,10 @@
  COMMENT= logging API for C++
  
  DISTNAME=log4cplus-1.0.4
 -SHARED_LIBS= log4cplus 0.0
 -
  EXTRACT_SUFX=.tar.bz2
  
 +SHARED_LIBS +=  log4cplus 0.0 # 0.0
 +
  CATEGORIES=  devel
  HOMEPAGE=http://log4cplus.sourceforge.net/
  
 @@ -18,12 +18,16 @@ PERMIT_DISTFILES_FTP= Yes
  
  MASTER_SITES=${MASTER_SITE_SOURCEFORGE:=log4cplus/}
  
 -WANTLIB= m stdc++
 -
  CONFIGURE_STYLE= gnu
 -#CONFIGURE_ARGS= ${CONFIGURE_SHARED}
 +CONFIGURE_ARGS=  ${CONFIGURE_SHARED}
  CXXFLAGS+=   -fPIC
  
  USE_LIBTOOL= Yes
  
 +pre-configure:
 + echo # This file automatically generated  ${WRKSRC}/libversions
 +.for l v in ${SHARED_LIBS}
 + echo LIB$l_LTVERSION = -version-info ${v:S/./:/}  
 ${WRKSRC}/libversions
 +.endfor
 +
  .include bsd.port.mk
 diff --git a/patches/patch-src_Makefile_in b/patches/patch-src_Makefile_in
 new file mode 100644
 index 000..7d4005b
 --- /dev/null
 +++ b/patches/patch-src_Makefile_in
 @@ -0,0 +1,13 @@
 +$OpenBSD$
 +--- src/Makefile.in.orig Sun Jan 16 10:27:34 2011
  src/Makefile.in  Thu Mar 15 00:58:22 2012
 +@@ -412,7 +412,8 @@ LIB_SRC = $(SINGLE_THREADED_SRC) \
 + liblog4cplus_la_SOURCES = $(LIB_SRC)
 + 
 + #liblog4cplus_a_LIBADD = @LIBOBJS@ @ALLOCA@
 +-liblog4cplus_la_LDFLAGS = -no-undefined -version-info @LT_VERSION@ -release 
 1.0
 ++include ../libversions
 ++liblog4cplus_la_LDFLAGS = -no-undefined ${LIBlog4cplus_LTVERSION}
 + all: all-am
 + 
 + .SUFFIXES:
 diff --git a/pkg/PFRAG.shared b/pkg/PFRAG.shared
 index 174a610..e25b663 100644
 --- a/pkg/PFRAG.shared
 +++ b/pkg/PFRAG.shared
 @@ -1,2 +1,2 @@
  @comment $OpenBSD$
 -@lib lib/liblog4cplus-1.0.so.${LIBlog4cplus_VERSION}
 +@lib lib/liblog4cplus.so.${LIBlog4cplus_VERSION}
 diff --git a/pkg/PLIST b/pkg/PLIST
 index ae68a47..4c278fd 100644
 --- a/pkg/PLIST
 +++ b/pkg/PLIST
 @@ -1,6 +1,8 @@
  @comment $OpenBSD$
  %%SHARED%%
 +include/log4cplus/
  include/log4cplus/appender.h
 +include/log4cplus/config/
  include/log4cplus/config.hxx
  include/log4cplus/config/defines.hxx
  include/log4cplus/config/macosx.h
 @@ -9,6 +11,7 @@ include/log4cplus/configurator.h
  include/log4cplus/consoleappender.h
  include/log4cplus/fileappender.h
  include/log4cplus/fstreams.h
 +include/log4cplus/helpers/
  include/log4cplus/helpers/appenderattachableimpl.h
  include/log4cplus/helpers/loglog.h
  include/log4cplus/helpers/logloguser.h
 @@ -32,6 +35,7 @@ include/log4cplus/loglevel.h
  include/log4cplus/ndc.h
  include/log4cplus/nullappender.h
  include/log4cplus/socketappender.h
 +include/log4cplus/spi/
  include/log4cplus/spi/appenderattachable.h
  include/log4cplus/spi/factory.h
  include/log4cplus/spi/filter.h




Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-03-14 Thread Jeremy C. Reed
On Thu, 2 Feb 2012, Stuart Henderson wrote:

  Anyways, anyone have comments on the porting itself? (tarball in first 
  message.)
  
 
 Yes but only minor; please start SHARED_LIBS from 0.0 rather than
 using upstream's versioning, and there's a minor whitespace nit
 in MASTER_SITES, otherwise looks good to me.
 
 With those changes I would be ok with this going in after we're
 done with lock for 5.1.

Thanks.

The latest tarfile is attached with the minor changes discussed on this 
thread.

Can someone please add this to the ports tree?

Off list it was also suggested that consider removing the version from 
the library name, but I didn't patch that. If anyone wants to, that is 
fine.

Thank you,

  Jeremy C. Reed

echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \
  tr'#-~''\-.-{'


ports-devel-log4cplus.tar
Description: Binary data


Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-03-14 Thread Stuart Henderson
On 2012/03/14 10:46, Jeremy C. Reed wrote:
 On Thu, 2 Feb 2012, Stuart Henderson wrote:
 
   Anyways, anyone have comments on the porting itself? (tarball in first 
   message.)
   
  
  Yes but only minor; please start SHARED_LIBS from 0.0 rather than
  using upstream's versioning, and there's a minor whitespace nit
  in MASTER_SITES, otherwise looks good to me.
  
  With those changes I would be ok with this going in after we're
  done with lock for 5.1.
 
 Thanks.
 
 The latest tarfile is attached with the minor changes discussed on this 
 thread.
 
 Can someone please add this to the ports tree?
 
 Off list it was also suggested that consider removing the version from 
 the library name, but I didn't patch that. If anyone wants to, that is 
 fine.

Sorry it's not OK as-is. Your SHARED_LIBS line and PFRAG.shared are
incorrect for the library, the directories are not registered in
the PLIST, and the libtool versioning is going to need to be fixed
to be properly under control of the port

$ make plist
===  Updating plist for log4cplus-1.0.4
Scanning destdir
Getting old lists
1st pass identifying files
Attaching annotations
Sorting out destdir files
WARNING: unregistered shared lib(s)
SHARED_LIBS +=  log4cplus-1.0 0.0 # 0.0
pkg/PLIST changed
pkg/PFRAG.shared changed

This diff relative to yours (and attached tar) improves things
but it's still a bit awkward, there has to be a better way to
override the library version


diff --git a/Makefile b/Makefile
index 617f540..f56beda 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,10 @@
 COMMENT=   logging API for C++
 
 DISTNAME=  log4cplus-1.0.4
-SHARED_LIBS=   log4cplus 0.0
-
 EXTRACT_SUFX=  .tar.bz2
 
+SHARED_LIBS +=  log4cplus 0.0 # 0.0
+
 CATEGORIES=devel
 HOMEPAGE=  http://log4cplus.sourceforge.net/
 
@@ -18,12 +18,16 @@ PERMIT_DISTFILES_FTP=   Yes
 
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=log4cplus/}
 
-WANTLIB=   m stdc++
-
 CONFIGURE_STYLE=   gnu
-#CONFIGURE_ARGS=   ${CONFIGURE_SHARED}
+CONFIGURE_ARGS=${CONFIGURE_SHARED}
 CXXFLAGS+= -fPIC
 
 USE_LIBTOOL=   Yes
 
+pre-configure:
+   echo # This file automatically generated  ${WRKSRC}/libversions
+.for l v in ${SHARED_LIBS}
+   echo LIB$l_LTVERSION = -version-info ${v:S/./:/}  
${WRKSRC}/libversions
+.endfor
+
 .include bsd.port.mk
diff --git a/patches/patch-src_Makefile_in b/patches/patch-src_Makefile_in
new file mode 100644
index 000..7d4005b
--- /dev/null
+++ b/patches/patch-src_Makefile_in
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- src/Makefile.in.orig   Sun Jan 16 10:27:34 2011
 src/Makefile.inThu Mar 15 00:58:22 2012
+@@ -412,7 +412,8 @@ LIB_SRC = $(SINGLE_THREADED_SRC) \
+ liblog4cplus_la_SOURCES = $(LIB_SRC)
+ 
+ #liblog4cplus_a_LIBADD = @LIBOBJS@ @ALLOCA@
+-liblog4cplus_la_LDFLAGS = -no-undefined -version-info @LT_VERSION@ -release 
1.0
++include ../libversions
++liblog4cplus_la_LDFLAGS = -no-undefined ${LIBlog4cplus_LTVERSION}
+ all: all-am
+ 
+ .SUFFIXES:
diff --git a/pkg/PFRAG.shared b/pkg/PFRAG.shared
index 174a610..e25b663 100644
--- a/pkg/PFRAG.shared
+++ b/pkg/PFRAG.shared
@@ -1,2 +1,2 @@
 @comment $OpenBSD$
-@lib lib/liblog4cplus-1.0.so.${LIBlog4cplus_VERSION}
+@lib lib/liblog4cplus.so.${LIBlog4cplus_VERSION}
diff --git a/pkg/PLIST b/pkg/PLIST
index ae68a47..4c278fd 100644
--- a/pkg/PLIST
+++ b/pkg/PLIST
@@ -1,6 +1,8 @@
 @comment $OpenBSD$
 %%SHARED%%
+include/log4cplus/
 include/log4cplus/appender.h
+include/log4cplus/config/
 include/log4cplus/config.hxx
 include/log4cplus/config/defines.hxx
 include/log4cplus/config/macosx.h
@@ -9,6 +11,7 @@ include/log4cplus/configurator.h
 include/log4cplus/consoleappender.h
 include/log4cplus/fileappender.h
 include/log4cplus/fstreams.h
+include/log4cplus/helpers/
 include/log4cplus/helpers/appenderattachableimpl.h
 include/log4cplus/helpers/loglog.h
 include/log4cplus/helpers/logloguser.h
@@ -32,6 +35,7 @@ include/log4cplus/loglevel.h
 include/log4cplus/ndc.h
 include/log4cplus/nullappender.h
 include/log4cplus/socketappender.h
+include/log4cplus/spi/
 include/log4cplus/spi/appenderattachable.h
 include/log4cplus/spi/factory.h
 include/log4cplus/spi/filter.h


log4cplus.tgz
Description: application/tar-gz


Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-02-02 Thread Jeremy C. Reed
On Thu, 2 Feb 2012, Stuart Henderson wrote:

 Did you try recompiling with -fPIC?

I should have mentioned that the build logs (provided via URLs in 
previous message) already showed they did. And the build of the other 
software using this library also already did.  I am trying to understand 
how ports compiled/linked it different versus not using ports.



Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-02-02 Thread Kirill Bychkov
Hi.
  /usr/bin/ld: /usr/local/lib/liblog4cplus.a(configurator.o): relocation
 R_X86_64_32 can not be used when making a shared object; recompile with
 -fPIC
 /usr/local/lib/liblog4cplus.a: could not read symbols: Bad value

I have the same error when compiling TORCS on amd64. Adding -fPIC to TORCS
port doesn't help, but adding CFLAGS+=-fPIC to devel/plib solves this problem.
So... may be some of depends are missing -fPIC?



Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-02-02 Thread Stuart Henderson
On 2012/02/02 11:38, Jeremy C. Reed wrote:
 On Thu, 2 Feb 2012, Stuart Henderson wrote:
 
  Did you try recompiling with -fPIC?
 
 I should have mentioned that the build logs (provided via URLs in 
 previous message) already showed they did. And the build of the other 
 software using this library also already did.  I am trying to understand 
 how ports compiled/linked it different versus not using ports.

Hmm. Try USE_LIBTOOL=gnu and see if there's a change.



Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-02-02 Thread Jeremy C. Reed
On Thu, 2 Feb 2012, Stuart Henderson wrote:

 Hmm. Try USE_LIBTOOL=gnu and see if there's a change.

No change.

On Thu, 2 Feb 2012, Kirill Bychkov wrote:
 I have the same error when compiling TORCS on amd64. Adding -fPIC to 
 TORCS port doesn't help, but adding CFLAGS+=-fPIC to devel/plib solves 
 this problem. So... may be some of depends are missing -fPIC?

I added to my port's makefile:
CXXFLAGS+=  -fPIC

And that fixed the build of the other software using it.

Thanks for the hint. I still don't know yet what ports did to make the 
change.

Anyways, anyone have comments on the porting itself? (tarball in first 
message.)



Re: new port: log4cplus and relocation R_X86_64_32 issue

2012-02-02 Thread Stuart Henderson
On 2012/02/02 13:24, Jeremy C. Reed wrote:
 On Thu, 2 Feb 2012, Stuart Henderson wrote:
 
  Hmm. Try USE_LIBTOOL=gnu and see if there's a change.
 
 No change.
 
 On Thu, 2 Feb 2012, Kirill Bychkov wrote:
  I have the same error when compiling TORCS on amd64. Adding -fPIC to 
  TORCS port doesn't help, but adding CFLAGS+=-fPIC to devel/plib solves 
  this problem. So... may be some of depends are missing -fPIC?
 
 I added to my port's makefile:
 CXXFLAGS+=  -fPIC
 
 And that fixed the build of the other software using it.
 
 Thanks for the hint. I still don't know yet what ports did to make the 
 change.
 
 Anyways, anyone have comments on the porting itself? (tarball in first 
 message.)
 

Yes but only minor; please start SHARED_LIBS from 0.0 rather than
using upstream's versioning, and there's a minor whitespace nit
in MASTER_SITES, otherwise looks good to me.

With those changes I would be ok with this going in after we're
done with lock for 5.1.