Attempt to fix building of universal exe
[openjpeg.git] / configure.ac
index 4ee8e8469e29be675ad9533f1cfc910ff7290e88..cef24a518d6cf7f17a7e19408b899db357fe9634 100644 (file)
@@ -26,7 +26,7 @@ AC_CONFIG_HEADERS([opj_config.h])
 AC_CANONICAL_SYSTEM
 AC_CANONICAL_HOST
 
-AM_INIT_AUTOMAKE(1.11 foreign dist-bzip2)
+AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 MAJOR_NR=OPJ_MAJOR
@@ -116,10 +116,6 @@ AC_ARG_ENABLE([jpwl],
 AC_MSG_CHECKING([whether to build the JPWL library])
 AC_MSG_RESULT([${want_jpwl}])
 
-if test "x${want_jpwl}" = "xyes" ; then
-   AC_DEFINE(USE_JPWL, [1], [define to 1 if you use jpwl])
-fi
-
 AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
 
 # JPIP
@@ -355,6 +351,21 @@ if test "x${want_jpip}" = "xyes" ; then
 
 fi
 
+# libcurl
+
+if test "x${want_jpip}" = "xyes" ; then
+
+   PKG_CHECK_MODULES([LIBCURL], [libcurl],
+      [have_libcurl="yes"],
+      [have_libcurl="no"])
+
+   if ! test "x${have_libcurl}" = "xyes" ; then
+      AC_MSG_WARN([libcurl library not found. OpenJPIP will not be compiled.])
+      want_jpip="no"
+   fi
+
+fi
+
 if test "x${want_jpip}" = "xyes" ; then
    AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
 fi
@@ -375,6 +386,7 @@ AC_HEADER_DIRENT
 
 ### Checks for compiler characteristics
 
+AM_PROG_CC_C_O
 AC_C_BIGENDIAN
 
 #OPJ_COMPILER_FLAG([-Wall])
@@ -396,6 +408,13 @@ fi
 
 ### Checks for library functions
 
+
+### Post configuration
+
+AM_CONDITIONAL([BUILD_SHARED], [test "x${enable_shared}" = "xyes"])
+AM_CONDITIONAL([BUILD_STATIC], [test "x${enable_static}" = "xyes"])
+
+
 AC_CONFIG_FILES([
 Makefile
 libopenjpeg1.pc
@@ -407,11 +426,7 @@ applications/codec/Makefile
 applications/mj2/Makefile
 applications/jpip/Makefile
 applications/jpip/libopenjpip/Makefile
-applications/jpip/opj_server/Makefile
-applications/jpip/opj_client/Makefile
-applications/jpip/opj_client/opj_dec_server/Makefile
-applications/jpip/tools/Makefile
-applications/jpip/tools/indexer/Makefile
+applications/jpip/util/Makefile
 doc/Makefile
 ])