diff for configure.in

Thomas T. Thai tom at minnesota.com
Thu Jun 1 14:03:01 PDT 2000


attached is the diff for configure.in to properly include runtime library
paths for dynamic libraries. i've tested this out on NetBSD and should
work for other *BSD ELF systems.
-------------- next part --------------
--- configure.in	Thu Jun  1 15:58:24 2000
+++ configure.in.mod	Thu Jun  1 14:31:54 2000
@@ -70,7 +70,7 @@
   test -f $GD_DIR/libgd.a && GD_LIBDIR="$GD_DIR"
   if test -n "$GD_INCLUDE" -a -n "$GD_LIBDIR" ; then 
       GD_INC=-I$GD_INCLUDE
-      GD_LIB="-L$GD_LIBDIR -lgd"
+      GD_LIB="-Wl,-R$GD_LIBDIR -L$GD_LIBDIR -lgd"
   else
       AC_MSG_ERROR("Could not find gd.h or libgd.a in $GD_DIR.  Make sure gd is compiled before calling configure.")
   fi
@@ -84,7 +84,7 @@
 else
 
   dnl
-  dnl --width-gd was not given... look in system libs, and if not found
+  dnl --with-gd was not given... look in system libs, and if not found
   dnl            then use the local copy of gd 1.2
   dnl
   AC_CHECK_LIB(gd, gdImageGif, GD_DEF=-DUSE_GD_1_2,,)
@@ -100,7 +100,7 @@
       MAKE_GD_CLEAN=gd_clean
       AC_EXPAND_PATH(gd-1.2, GD_DIR)
       GD_INC=-I$GD_DIR
-      GD_LIB="-L$GD_DIR -lgd"
+      GD_LIB="-Wl,-R$GD_DIR -L$GD_DIR -lgd"
       test -f $GD_DIR/Makefile.in && GD_MAKEFILE="$GD_DIR/Makefile"
       AC_MSG_RESULT([        using GD ($GD_DEF) from $GD_DIR.])
   fi
@@ -146,7 +146,7 @@
 
   if test -n "$TIFF_INCLUDE" -a -n "$TIFF_LIBDIR" ; then 
       TIFF_INC=-I$TIFF_INCLUDE
-      TIFF_LIB="-L$TIFF_LIBDIR -ltiff"
+      TIFF_LIB="-Wl,-R$TIFF_LIBDIR -L$TIFF_LIBDIR -ltiff -lz"
   else
       AC_MSG_ERROR("Could not find tiffio.h or libtiff.a in $TIFF_DIR.")
   fi
@@ -198,7 +198,7 @@
   test -f $JPEG_DIR/libjpeg.a && JPEG_LIBDIR="$JPEG_DIR"
   if test -n "$JPEG_INCLUDE" -a -n "$JPEG_LIBDIR" ; then 
       JPEG_INC=-I$JPEG_INCLUDE
-      JPEG_LIB="-L$JPEG_LIBDIR -ljpeg"
+      JPEG_LIB="-Wl,-R$JPEG_LIBDIR -L$JPEG_LIBDIR -ljpeg"
   else
       AC_MSG_ERROR("Could not find jpeglib.h.h or libjpeg.a in $JPEG_DIR.")
   fi
@@ -277,7 +277,7 @@
   test -f $TTF_DIR/libttf.so && TTF_LIBDIR="$TTF_DIR"
   if test -n "$TTF_INCLUDE" -a -n "$TTF_LIBDIR" ; then 
       TTF_INC=-I$TTF_INCLUDE
-      TTF_LIB="-L$TTF_LIBDIR -lttf"
+      TTF_LIB="-Wl,-R$TTF_LIBDIR -L$TTF_LIBDIR -lttf"
   else
       AC_MSG_ERROR("Could not find freetype.h or libttf.so in $TTF_DIR.")
   fi
@@ -304,7 +304,7 @@
   dnl We need to link with the GDFT directory as well
   dnl
   AC_EXPAND_PATH(gdft, GDFT_DIR)
-  TTF_LIB="-L$GDFT_DIR -lgdft $TTF_LIB"
+  TTF_LIB="-Wl,-R$GDFT_DIR -L$GDFT_DIR -lgdft $TTF_LIB"
   TTF_INC="-I$GDFT_DIR $TTF_INC"
   MAKE_GDFT="gdft"
   MAKE_GDFT_CLEAN="gdft_clean"
@@ -353,7 +353,7 @@
   test -f $PROJ_DIR/libproj.a && PROJ_LIBDIR="$PROJ_DIR"
   if test -n "$PROJ_INCLUDE" -a -n "$PROJ_LIBDIR" ; then 
       PROJ_INC=-I$PROJ_INCLUDE
-      PROJ_LIB="-L$PROJ_LIBDIR -lproj"
+      PROJ_LIB="-Wl,-R$PROJ_LIBDIR -L$PROJ_LIBDIR -lproj"
   else
       AC_MSG_ERROR("Could not find projects.h or libproj.a in $PROJ_DIR.")
   fi
@@ -381,7 +381,7 @@
 
 MS_DIR="`pwd`"
 MS_INC="-I$MS_DIR"
-MS_LIB="-L$MS_DIR -lmap"
+MS_LIB="-Wl,-R$MS_DIR -L$MS_DIR -lmap"
 AC_SUBST(MS_INC, $MS_INC)
 AC_SUBST(MS_LIB, $MS_LIB)
 


More information about the MapServer-users mailing list