[mapserver-commits] r7771 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Jul 2 17:12:23 EDT 2008


Author: dmorissette
Date: 2008-07-02 17:12:22 -0400 (Wed, 02 Jul 2008)
New Revision: 7771

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/configure
   trunk/mapserver/configure.in
   trunk/mapserver/mapstring.c
Log:
Added support in configure script for pkg-config for fribidi2 (#2664)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-07-02 15:35:49 UTC (rev 7770)
+++ trunk/mapserver/HISTORY.TXT	2008-07-02 21:12:22 UTC (rev 7771)
@@ -12,6 +12,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Added support in configure script for pkg-config for fribidi2 (#2664)
+
 - Added more debug/tuning output to mapserv and shp2img at debug level 2 (#2673)
 
 - maptemplate.c: removed extra line feeds from mime header output. (#2672)

Modified: trunk/mapserver/configure
===================================================================
--- trunk/mapserver/configure	2008-07-02 15:35:49 UTC (rev 7770)
+++ trunk/mapserver/configure	2008-07-02 21:12:22 UTC (rev 7771)
@@ -673,6 +673,7 @@
 C_PIC
 STRINGS
 MS_VERSION
+PKG_CONFIG
 FT_BIN
 ZLIB_ENABLED
 ZLIB_INC
@@ -1387,6 +1388,7 @@
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pkg-config[=PATH]      Include pkg-config support (PATH is path to pkg-config)
   --with-freetype=DIR     GD: Specify where FreeType 2.x is installed (DIR is
                               path to freetype-config program or install dir).
   --with-zlib=DIR         GD,SVG: Specify where zlib is installed (DIR is path
@@ -1434,7 +1436,7 @@
   --with-curl-config=PATH Specify path to curl-config.
   --with-xml2-config=PATH Specify path to xml2-config.
   --with-fribidi-config[=ARG] Include FriBidi Support (ARG=yes/path to
-                          fribidi-config)
+                          fribidi-config or fribidi.pc)
   --with-fastcgi=path     Enable FastCGI, point to installed tree.
   --with-httpd            Specify path to 'httpd' executable.
   --with-warnings[=flags] Enable strict warnings (or user defined warnings)
@@ -4972,7 +4974,86 @@
 
 
 
+{ echo "$as_me:$LINENO: checking if pkg-config path is provided" >&5
+echo $ECHO_N "checking if pkg-config path is provided... $ECHO_C" >&6; }
 
+
+# Check whether --with-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+  withval=$with_pkg_config;
+fi
+
+
+if test -n "$with_pkg_config" -a "$with_pkg_config" != "no" ; then
+
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+  PKG_CONFIG=$with_pkg_config
+else
+  PKG_CONFIG="yes"
+fi
+
+if test "$PKG_CONFIG" = "yes" ; then
+
+   # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+   if test "$PKG_CONFIG" = "no" ; then
+      { echo "$as_me:$LINENO: result: couldn't find pkg-config in default path. Please specify full path to pkg-config if needed" >&5
+echo "${ECHO_T}couldn't find pkg-config in default path. Please specify full path to pkg-config if needed" >&6; }
+   fi
+
+elif test -f "$PKG_CONFIG" -a -x "$PKG_CONFIG" ; then
+     { echo "$as_me:$LINENO: result: user supplied pkg-config ($PKG_CONFIG)" >&5
+echo "${ECHO_T}user supplied pkg-config ($PKG_CONFIG)" >&6; }
+else
+     { { echo "$as_me:$LINENO: error: '$PKG_CONFIG' is not an executable.  Make sure you use --with-pkg-config=/path/to/pkg-config" >&5
+echo "$as_me: error: '$PKG_CONFIG' is not an executable.  Make sure you use --with-pkg-config=/path/to/pkg-config" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
 unset ac_cv_lib_freetype_FT_Init_FreeType
 unset ac_cv_lib_ttf_TT_Init_FreeType
 
@@ -11836,6 +11917,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
   FRIBIDI_CONFIG="no"
+
 elif test "$with_fribidi_config" = "yes" ; then
   { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
@@ -11880,6 +11962,21 @@
 fi
 
 
+  $FRIBIDI_PKG_CONFIG = "no"
+  if test "$FRIBIDI_CONFIG" = "no" -a "$PKG_CONFIG" != "no" ; then
+     { echo "$as_me:$LINENO: checking for fribidi pkg-config path" >&5
+echo $ECHO_N "checking for fribidi pkg-config path... $ECHO_C" >&6; }
+     `$PKG_CONFIG --silence-errors --libs fribidi >> /dev/null`
+     if test $? -eq 0 ; then
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        FRIBIDI_PKG_CONFIG="yes"
+        FRIBIDI_CONFIG="fribidi"
+     else
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+     fi
+  fi
 else
   FRIBIDI_CONFIG=$with_fribidi_config
 fi
@@ -11889,11 +11986,19 @@
   FRIBIDI_INC=
   FRIBIDI_LIB=
 else
-  { echo "$as_me:$LINENO: result: yes, user supplied fribidi-config" >&5
+  if test "$FRIBIDI_PKG_CONFIG" = "yes" -o ${FRIBIDI_CONFIG: -3} = ".pc" ; then
+     { echo "$as_me:$LINENO: result: yes, user supplied path to fribidi.pc" >&5
+echo "${ECHO_T}yes, user supplied path to fribidi.pc" >&6; }
+     FRIBIDI_ENABLED="-DUSE_FRIBIDI -DUSE_FRIBIDI2"
+     FRIBIDI_LIB=`$PKG_CONFIG --libs $FRIBIDI_CONFIG`
+     FRIBIDI_INC=`$PKG_CONFIG --cflags $FRIBIDI_CONFIG`
+  else
+     { echo "$as_me:$LINENO: result: yes, user supplied fribidi-config" >&5
 echo "${ECHO_T}yes, user supplied fribidi-config" >&6; }
-  FRIBIDI_ENABLED=-DUSE_FRIBIDI
-  FRIBIDI_LIB=`$FRIBIDI_CONFIG --libs`
-  FRIBIDI_INC=`$FRIBIDI_CONFIG --cflags`
+     FRIBIDI_ENABLED=-DUSE_FRIBIDI
+     FRIBIDI_LIB=`$FRIBIDI_CONFIG --libs`
+     FRIBIDI_INC=`$FRIBIDI_CONFIG --cflags`
+  fi
 fi
 
 FRIBIDI_ENABLED=$FRIBIDI_ENABLED
@@ -13688,6 +13793,7 @@
 C_PIC!$C_PIC$ac_delim
 STRINGS!$STRINGS$ac_delim
 MS_VERSION!$MS_VERSION$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
 FT_BIN!$FT_BIN$ac_delim
 ZLIB_ENABLED!$ZLIB_ENABLED$ac_delim
 ZLIB_INC!$ZLIB_INC$ac_delim
@@ -13724,7 +13830,6 @@
 THREAD_LIB!$THREAD_LIB$ac_delim
 SDE_ENABLED!$SDE_ENABLED$ac_delim
 SDE_INC!$SDE_INC$ac_delim
-SDE_LIB!$SDE_LIB$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -13766,6 +13871,7 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+SDE_LIB!$SDE_LIB$ac_delim
 GEOS_CONFIG!$GEOS_CONFIG$ac_delim
 GEOS_ENABLED!$GEOS_ENABLED$ac_delim
 GEOS_INC!$GEOS_INC$ac_delim
@@ -13842,7 +13948,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: trunk/mapserver/configure.in
===================================================================
--- trunk/mapserver/configure.in	2008-07-02 15:35:49 UTC (rev 7770)
+++ trunk/mapserver/configure.in	2008-07-02 21:12:22 UTC (rev 7771)
@@ -80,6 +80,38 @@
 AC_SUBST(MS_VERSION,    "$MS_VERSION")
 
 dnl ---------------------------------------------------------------------
+dnl Several libraries may use pkg-config.
+dnl ---------------------------------------------------------------------
+
+AC_MSG_CHECKING(if pkg-config path is provided)
+
+AC_ARG_WITH(pkg-config,
+[  --with-pkg-config[[=PATH]]      Include pkg-config support (PATH is path to pkg-config)],,)
+
+if test -n "$with_pkg_config" -a "$with_pkg_config" != "no" ; then
+
+  AC_MSG_RESULT([yes])
+
+  PKG_CONFIG=$with_pkg_config
+else
+  PKG_CONFIG="yes"
+fi
+
+if test "$PKG_CONFIG" = "yes" ; then
+
+   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+   if test "$PKG_CONFIG" = "no" ; then
+      AC_MSG_RESULT([couldn't find pkg-config in default path. Please specify full path to pkg-config if needed])
+   fi
+
+elif test -f "$PKG_CONFIG" -a -x "$PKG_CONFIG" ; then
+     AC_MSG_RESULT([user supplied pkg-config ($PKG_CONFIG)])
+else
+     AC_MSG_ERROR(['$PKG_CONFIG' is not an executable.  Make sure you use --with-pkg-config=/path/to/pkg-config])
+fi
+
+dnl ---------------------------------------------------------------------
 dnl Several libraries might be needed for GD: png, zlib, freetype,
 dnl and jpeg (processed above).  Use where GD was found as default.
 dnl ---------------------------------------------------------------------
@@ -1873,27 +1905,47 @@
 
 AC_ARG_WITH(fribidi-config,
 [  --with-fribidi-config[[=ARG]] Include FriBidi Support (ARG=yes/path to 
-                          fribidi-config)],,)
+                          fribidi-config or fribidi.pc)],,)
 
 if test "$with_fribidi_config" = "no" -o "$with_fribidi_config" = "" ; then
   AC_MSG_RESULT(no)
   FRIBIDI_CONFIG="no"
+
 elif test "$with_fribidi_config" = "yes" ; then
   AC_MSG_RESULT(yes)
   AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no)
+  $FRIBIDI_PKG_CONFIG = "no"
+  if test "$FRIBIDI_CONFIG" = "no" -a "$PKG_CONFIG" != "no" ; then 
+     AC_MSG_CHECKING(for fribidi pkg-config path)
+     `$PKG_CONFIG --silence-errors --libs fribidi >> /dev/null`
+     if test $? -eq 0 ; then
+        AC_MSG_RESULT(yes)
+        FRIBIDI_PKG_CONFIG="yes"
+        FRIBIDI_CONFIG="fribidi"
+     else
+       AC_MSG_RESULT(no)
+     fi
+  fi 
 else
   FRIBIDI_CONFIG=$with_fribidi_config
 fi
 
-if test "$FRIBIDI_CONFIG" = "no" ; then
+if test "$FRIBIDI_CONFIG" = "no" ; then 
   FRIBIDI_ENABLED=
   FRIBIDI_INC=
   FRIBIDI_LIB=
 else
-  AC_MSG_RESULT([yes, user supplied fribidi-config])
-  FRIBIDI_ENABLED=-DUSE_FRIBIDI
-  FRIBIDI_LIB=`$FRIBIDI_CONFIG --libs`
-  FRIBIDI_INC=`$FRIBIDI_CONFIG --cflags`
+  if test "$FRIBIDI_PKG_CONFIG" = "yes" -o ${FRIBIDI_CONFIG: -3} = ".pc" ; then
+     AC_MSG_RESULT([yes, user supplied path to fribidi.pc])
+     FRIBIDI_ENABLED="-DUSE_FRIBIDI -DUSE_FRIBIDI2"
+     FRIBIDI_LIB=`$PKG_CONFIG --libs $FRIBIDI_CONFIG`
+     FRIBIDI_INC=`$PKG_CONFIG --cflags $FRIBIDI_CONFIG`
+  else
+     AC_MSG_RESULT([yes, user supplied fribidi-config])
+     FRIBIDI_ENABLED=-DUSE_FRIBIDI
+     FRIBIDI_LIB=`$FRIBIDI_CONFIG --libs`
+     FRIBIDI_INC=`$FRIBIDI_CONFIG --cflags`
+  fi
 fi
 
 AC_SUBST(FRIBIDI_ENABLED,$FRIBIDI_ENABLED)

Modified: trunk/mapserver/mapstring.c
===================================================================
--- trunk/mapserver/mapstring.c	2008-07-02 15:35:49 UTC (rev 7770)
+++ trunk/mapserver/mapstring.c	2008-07-02 21:12:22 UTC (rev 7771)
@@ -35,7 +35,7 @@
 #include <ctype.h>
 
 #ifdef USE_FRIBIDI
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(USE_FRIBIDI2)
 #include "fribidi.h"
 #else
 #include <fribidi/fribidi.h>



More information about the mapserver-commits mailing list