Commits

Ondřej Surý committed 2a9096a

Make the pkg-config support simpler

Comments (0)

Files changed (1)

 case $with_fontconfig in
 no) ;;
 yes|"")
-  PKG_CHECK_MODULES([LIBFONTCONFIG], fontconfig, [with_fontconfig=yes], [:])
+  PKG_CHECK_MODULES([LIBFONTCONFIG], fontconfig, [with_fontconfig=yes],
+  [
+    if test "$with_fontconfig" = yes; then
+      AC_MSG_ERROR([fontconfig support requested, but not found])
+    fi
+    with_fontconfig=no
+  ])
   ;;
-esac
-
-if test "$with_fontconfig" != no; then
+*)
   save_LIBS="$LIBS"
   save_CPPFLAGS="$CPPFLAGS"
 
   if test -d "$with_fontconfig"; then
     LIBFONTCONFIG_CFLAGS="-I$with_fontconfig/include"
-    LIBFONTCONFIG_LIBS="-L$with_fontconfig/lib -lfontconfig"
+    LIBFONTCONFIG_LIBS="-L$with_fontconfig/lib"
   fi
 
   CPPFLAGS="$CPPFLAGS $LIBFONTCONFIG_CFLAGS"
 
   AC_CHECK_LIB(fontconfig, FcInit,
     [
+      LIBFONTCONFIG_LIBS="$LIBFONTCONFIG_LIBS -lfontconfig"
       with_fontconfig=yes
     ],[
       if test "$with_fontconfig" != ""; then
 
   CPPFLAGS="$save_CPPFLAGS"
   LIBS="$save_LIBS"
-fi
+  ;;
+esac
 
 if test "$with_fontconfig" != no; then
   CPPFLAGS="$CPPFLAGS $LIBFONTCONFIG_CFLAGS"
-  LIBS="$LIBS $LIBFONTCONFIG_LIBS"
+  LIBS="$LIBS $LIBFONTCONFIG_LIBS -lfontconfig"
   FEATURES="GD_FONTCONFIG $FEATURES"
   AC_DEFINE(HAVE_LIBFONTCONFIG, 1, [ Define if you have the fontconfig library. ])
 fi
 case $with_xpm in
 no) ;;
 yes|"")
-  PKG_CHECK_MODULES([LIBXPM], xpm, [with_xpm=yes], [:])
+  PKG_CHECK_MODULES([LIBXPM], xpm, [with_xpm=yes],
+  [
+    if test "$with_xpm" = yes; then
+      AC_MSG_ERROR([Xpm support requested, but not found])
+    fi
+    with_xpm=no
+  ])
   ;;
-esac
-
-if test "$with_xpm" != no; then
+*)
   save_LIBS="$LIBS"
   save_CPPFLAGS="$CPPFLAGS"
 
 
   CPPFLAGS="$save_CPPFLAGS"
   LIBS="$save_LIBS"
-fi
+  ;;
+esac
 
 if test "$with_xpm" != no; then
   CPPFLAGS="$CPPFLAGS $LIBXPM_CFLAGS"
 case $with_vpx in
 no) ;;
 yes|"")
-  PKG_CHECK_MODULES([LIBVPX], vpx, [with_vpx=yes], [:])
+  PKG_CHECK_MODULES([LIBVPX], vpx, [with_vpx=yes],
+  [
+    if test "$with_vpx" = yes; then
+      AC_MSG_ERROR([VPX support requested, but not found])
+    fi
+    with_vpx=no
+  ])
   ;;
-esac
-
-if test "$with_vpx" != no; then
+*)
   save_LIBS="$LIBS"
   save_CPPFLAGS="$CPPFLAGS"
 
 
   CPPFLAGS="$save_CPPFLAGS"
   LIBS="$save_LIBS"
-fi
+  ;;
+esac
 
 if test "$with_vpx" != no; then
   CPPFLAGS="$CPPFLAGS $LIBVPX_CFLAGS"
 case $with_tiff in
 no) ;;
 yes|"")
-  PKG_CHECK_MODULES([LIBTIFF], libtiff-4, [with_tiff=yes], [:])
+  PKG_CHECK_MODULES([LIBTIFF], libtiff-4, [with_tiff=yes],
+  [
+    if test "$with_tiff" = yes; then
+      AC_MSG_ERROR([TIFF support requested, but not found])
+    fi
+    with_tiff=no
+  ])
   ;;
-esac
-
-if test "$with_tiff" != no; then
+*)
   save_CPPFLAGS="$CPPFLAGS"
   save_LIBS="$LIBS"
 
   if test -d "$with_tiff"; then
     LIBTIFF_CFLAGS="-I$with_tiff/include"
-    LIBTIFF_LIBS="-L$with_tiff/lib -ltiff"
+    LIBTIFF_LIBS="-L$with_tiff/lib"
   fi
 
   CPPFLAGS="$CPPFLAGS $LIBTIFF_CFLAGS"
 
   AC_CHECK_LIB(tiff,TIFFClientOpen,
     [
+      LIBTIFF_LIBS="$LIBTIFF_LIBS -ltiff"
       with_tiff=yes
     ],[
       if test "$with_tiff" != ""; then
 
   CPPFLAGS="$save_CPPFLAGS"
   LIBS="$save_LIBS"
-fi
+  ;;
+esac
 
 if test "$with_tiff" != no; then
   CPPFLAGS="$CPPFLAGS $LIBTIFF_CFLAGS"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.