AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2001.12.04 12:26 "Fix for MacOS 10.1", by Karin Kosina

Hi,

  I have just tried to build libtiff (up-to-date from CVS) on MacOS

10.1, and found that DSO support doesn't work. I am attaching a patch that fixes those problems. Sorry if this is off topic, but I was not able to find the address to send patches to.

JFYI: The problem I encountered is due to the linker-update from 10.0.x to 10.1. The "-twolevel_namespace" option (which enables two-pass linking, and is on by default in 10.1) requires the "-undefined error" switch. Besides, you were using "gcc" for the configure test, which is not default on OS X (the compiler there is basically a gcc version, but is called "cc"). This should also work on MacOS 10.0.x, of course.

On a related note, there should be three variables for the DSO extension -- something like @DSOSUF_FULL_VERSION@ in addition to @DSOSUF_VERSION@ and @DSOSUF@. At the moment, you are using @DSOSUF_VERSION@ to get libtiff.3.5.7.so (or libtiff.3.5.7.dylib in the darwin case), and @DSOSUF@ for libtiff.3.so -- and then, at "make install", you create a symlink named libtiff.so. This is not correct on some platforms (at least MacOS X, since here this should read libtiff.dylib).

Anyway, it doesn't hurt to have that additional symlink ;) -- but I've changed the @DSOSUF@ variable to be ".dylib", not "3.dylib" for now since some other program's configure scripts expect to find libtiff.dylib.

Please let me know if you accept the patch; we are requiring libtiff in our texturing library, and would have to distribute the correct configure/Makefile.in files for MacOS X ourselves otherwise.

Best regards,
#!/kyrah

--

Karin "kyrah" Kosina  (gpg - public key 0x1FE281EB)     http://kyrah.net

Coin3D (by Systems In Motion) http://www.coin3d.org

+-----------------------------------><---------------------------------+ In the beginning was the word, and the word was content-type: text/plain

Index: configure
===================================================================
RCS file: /cvsroot/osrs/libtiff/configure,v
retrieving revision 1.20
diff -u -u -r1.20 configure

--- configure   2001/11/15 17:21:05     1.20
+++ configure   2001/12/04 11:59:15

@@ -1194,11 +1194,11 @@
        esac
        ;;
     *-darwin*)
- DSOSUF=${DIST_MAJOR}.dylib
+ DSOSUF=dylib
         DSOSUF_VERSION=${DIST_MAJOR}.${DIST_MINOR}.${DIST_POINT}.dylib
         LIBCOPTS='-fno-common'
- DSOLD=gcc
- DSOOPTS='-dynamiclib -undefined suppress'
+ DSOLD="${CCOMPILER} ${ENVOPTS}"
+ DSOOPTS='-dynamiclib -undefined error'
         DSO=DARWIN
         ;;
     *-linux*)
Index: libtiff/Makefile.in

=================================================================== RCS file: /cvsroot/osrs/libtiff/libtiff/Makefile.in,v retrieving revision 1.16

diff -u -u -r1.16 Makefile.in
--- libtiff/Makefile.in 2001/09/09 15:56:04 1.16
+++ libtiff/Makefile.in 2001/12/04 11:59:16
@@ -211,7 +211,7 @@
        fi
        touch $@
 DARWINdso: ${OBJS}
- ${CC} -dynamiclib -undefined suppress \
+ ${CC} -dynamiclib -undefined error \
          -install_name libtiff.@DSOSUF@ \
          -o libtiff.@DSOSUF_VERSION@ ${OBJS} \
          @LIBJPEG@ @LIBGZ@ @MACHDEPLIBS@