pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problems with 2006Q3



On Thursday 02 November 2006 09:53, Hrvoje Habjanić wrote:
[snip]
>
> Few patches follow.
>

1. wrapper-sink-osf1.patch 
Ld on Tru64 doesn't know what to do with "-h <soname>" flag, but it 
understands "-soname" flag. This patch "fix"es this.

2. wrapper-buildcmd.patch
This one is my favorite. In short, Tru64 doent't have strict policy to 
put "imported" libraries in /usr/local or something similar. They all end up 
in default places. This include libraries like libjpeg and libz. Of course, 
those installed in default location are some quite old versions, custom made, 
needed for normal os operation (gui administration tools). Of course, ld 
linker first searches default places, and then if it doesn't found library, 
it searches for it in directories listed in "-L" flags.
So, i needed a way to modify linker search order to succesufuly compile netpbm 
package. For Tru 64 ld, to disable default search path, one must include "-L" 
empty option on command line. Of course, wrapper libraries doesn't allow 
this - then concatenate anything that comes after "-L"<space>. Instead of 
complicating with regular expressions, i introduced new flag "-no-std-libs", 
which bypasses sink wrappers (and others). This, probably, can be done 
better, but it works for me - all that needs to be done is to put this flag 
in LDFLAGS directive in mk.conf.

3. mk.conf settings
Following needs to be "added" to mk.conf file:
CC=                             gcc
CFLAGS+=                        -D__arch64__
CXX=                            g++
CXXFLAGS+=                      -D__arch64__
# custom header to remove default libs
LDFLAGS+=                       -no-std-libs

"-D__arch64__" is needed because of broken headers on Tru64 - by default they 
include int64 but not uint64. If you add this flag, then uint64 gets included 
too.

4. unzip package
Authors recently made some changes to crc32.c file, and they broke building of 
unzipsfx. The problem is that make is first compiling crc32.c for unzip 
command with USE_ZLIB flag enabled, and later it reuses it form unzipsfx. But 
that's wrong, because crc32 for unzipsfx must not have USE_ZLIB defined, 
because unzipsfx doesn't use zlib!! So you get unresolved references ...
Patch fixes this ...

5. png package
Again, authors assume too much. My os doesn't have gnu malloc. :-) But this is 
requirement for this package, as can be seen in configure.ac. Unfortunately, 
authors doesn't provide replacement, so you end up with unresolved 
rpl_malloc. Quick fix was to remove this requirement, but more permanent 
solution would be to rpl_malloc be defined somewhere within libpng. I did 
quick-and-dirty fix. :-)

6. netpbm-misc.patch
This one is big. In short, Tru64 has probably broken snadards.h. Instead of 
fixing system include file (which could broke a lot of things), i added few 
#ifdefs in netpbm source files.

NOTE: i did update from cvs on 26.10.2006.

H.
--- mk/wrapper/cmd-sink-osf1-cc.orig    Sun Oct 29 01:47:48 2006
+++ mk/wrapper/cmd-sink-osf1-cc Mon Oct 30 13:21:31 2006
@@ -34,6 +34,11 @@
                esac
                $debug_log $wrapperlog "    (cmd-sink-osf1-cc) drop: $dir 
[adding to osf1runpath]"
                ;;
+       -Wl,-h*)
+               arg="-Wl,-soname"${arg#"-Wl,-h"}
+               $debug_log $wrapperlog "    (cmd-sink-osf1-cc) pop: $arg"
+               . $buildcmd
+               ;;
        *)
                . $buildcmd
                ;;
--- mk/wrapper/cmd-sink-osf1-ld.orig    Sat Oct 28 19:24:31 2006
+++ mk/wrapper/cmd-sink-osf1-ld Sun Oct 29 20:36:08 2006
@@ -33,6 +33,11 @@
                esac
                $debug_log $wrapperlog "    (cmd-sink-osf1-ld) drop: $dir 
[adding to osf1runpath]"
                ;;
+       -Wl,-h,*)
+               arg="-Wl,-soname"${arg#"-Wl,-h"}
+               $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg"
+               . $buildcmd
+               ;;
        -pthread)
                arg="-lpthread"
                $debug_log $wrapperlog "    (cmd-sink-osf1-ld) pop: $arg"
--- mk/wrapper/buildcmd.orig    Mon Oct 30 14:10:57 2006
+++ mk/wrapper/buildcmd Mon Oct 30 21:12:17 2006
@@ -40,6 +40,9 @@
 ######################################################################
 "")
        ;;
+-no-std-libs)
+       libs="-L -L/usr/shlib $libs"
+       ;;
 ######################################################################
 # Reduce command length by not appending options that we've already
 # seen.  We also ensure that all of the -l options come after the -L
--- configure.ac.orig   Sun Oct 29 18:30:25 2006
+++ configure.ac        Sun Oct 29 18:30:44 2006
@@ -52,7 +52,7 @@
 AC_STRUCT_TM
 
 # Checks for library functions.
-AC_FUNC_MALLOC
+#AC_FUNC_MALLOC
 AC_FUNC_STRTOD
 AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
 AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
--- configure.orig      Sun Oct 29 18:37:05 2006
+++ configure   Sun Oct 29 18:37:52 2006
@@ -19451,84 +19451,6 @@
 
 done
 
-echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_malloc_0_nonnull=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#if STDC_HEADERS || HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-
-int
-main ()
-{
-exit (malloc (0) ? 0 : 1);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_malloc_0_nonnull=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_malloc_0_nonnull=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext 
conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6
-if test $ac_cv_func_malloc_0_nonnull = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 1
-_ACEOF
-
-else
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC 0
-_ACEOF
-
-   case $LIBOBJS in
-    "malloc.$ac_objext"   | \
-  *" malloc.$ac_objext"   | \
-    "malloc.$ac_objext "* | \
-  *" malloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;;
-esac
-
-
-cat >>confdefs.h <<\_ACEOF
-#define malloc rpl_malloc
-_ACEOF
-
-fi
 
 
 
--- converter/other/jpeg2000/pamtojpeg2k.c.orig Tue Oct 31 09:41:12 2006
+++ converter/other/jpeg2000/pamtojpeg2k.c      Tue Oct 31 10:53:02 2006
@@ -9,7 +9,11 @@
 *****************************************************************************/
 
 #define _BSD_SOURCE 1    /* Make sure strdup() is in string.h */
+#ifdef __osf__
+#define _OSF_SOURCE
+#else
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
+#endif /* __osf__ */
 #include <string.h>
 
 #include "pam.h"
--- converter/other/jpeg2000/jpeg2ktopam.c.orig Tue Oct 31 09:41:56 2006
+++ converter/other/jpeg2000/jpeg2ktopam.c      Tue Oct 31 10:52:39 2006
@@ -9,7 +9,11 @@
 *****************************************************************************/
 
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
+#ifdef __osf__
+#define _OSF_SOURCE
+#else
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
+#endif /* __osf__ */
 #include <string.h>
 
 #include "pam.h"
--- converter/other/cameratopam/camera.c.orig   Tue Oct 31 09:49:45 2006
+++ converter/other/cameratopam/camera.c        Tue Oct 31 10:55:38 2006
@@ -1,7 +1,11 @@
 #define _BSD_SOURCE
     /* Make sure strcasecmp is in string.h */
+#ifdef __osf__
+#define _OSF_SOURCE
+#else
 #define _XOPEN_SOURCE
     /* Make sure putenv is in stdlib.h */
+#endif /* __osf__ */
 #define __EXTENSIONS__
 
 #include <stdlib.h>
--- converter/other/cameratopam/cameratopam.c.orig      Tue Oct 31 09:55:51 2006
+++ converter/other/cameratopam/cameratopam.c   Tue Oct 31 10:55:17 2006
@@ -18,7 +18,11 @@
 */
 #include <time.h>
 
+#ifdef __osf__
+#define _OSF_SOURCE
+#else
 #define _XOPEN_SOURCE  /* Make sure unistd.h contains swab() */
+#endif /* __osf__ */
 
 #include <ctype.h>
 #include <unistd.h>
--- unix/Makefile.orig  Mon Oct 30 22:45:35 2006
+++ unix/Makefile       Mon Oct 30 22:48:02 2006
@@ -87,7 +87,7 @@
 OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
 LOBJS = $(OBJS)
 OBJSDLL = $(OBJS:.o=.pic.o) api.pic.o
-OBJX = unzipsfx$O $(CRC32)$O crctab_$O crypt_$O extract_$O fileio_$O \
+OBJX = unzipsfx$O crc32_$O crctab_$O crypt_$O extract_$O fileio_$O \
        globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$O
 LOBJX = $(OBJX)
 OBJF = funzip$O $(CRC32)$O cryptf$O globalsf$O inflatef$O ttyiof$O
@@ -306,6 +306,11 @@
        -$(CP) unzip.c unzipsfx.c
        $(CC) -c $(CF) -DSFX unzipsfx.c
        $(RM) unzipsfx.c
+
+crc32_$O:      crc32.c $(UNZIP_H) zip.h                        # unzipsfx only
+       -$(CP) crc32.c crc32_.c
+       $(CC) -c $(CF) -DSFX crc32_.c
+       $(RM) crc32_.c
 
 crctab_$O:     crctab.c $(UNZIP_H) zip.h
        -$(CP) crctab.c crctab_.c


Home | Main Index | Thread Index | Old Index