Autoconf and pkg-config support for libopusurl
authorRon <ron@debian.org>
Mon, 13 May 2013 03:42:23 +0000 (13:12 +0930)
committerRon <ron@debian.org>
Mon, 13 May 2013 03:42:23 +0000 (13:12 +0930)
Makefile.am
configure.ac
opusfile-uninstalled.pc.in
opusfile.pc.in
opusurl-uninstalled.pc.in [new file with mode: 0644]
opusurl.pc.in [new file with mode: 0644]

index 1a3cb73..d10d7e3 100644 (file)
@@ -9,33 +9,48 @@ opusinclude_HEADERS = include/opusfile.h
 
 lib_LTLIBRARIES = libopusfile.la
 libopusfile_la_SOURCES = \
-       src/http.c src/info.c \
+       src/info.c \
        src/internal.c src/internal.h \
        src/opusfile.c src/stream.c
 libopusfile_la_LIBADD = $(DEPS_LIBS)
 libopusfile_la_LDFLAGS = -no-undefined \
  -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = opusfile.pc
+
 if OP_ENABLE_HTTP
+lib_LTLIBRARIES += libopusurl.la
+libopusurl_la_SOURCES = src/http.c
+libopusurl_la_LIBADD = libopusfile.la $(URL_DEPS_LIBS)
+libopusurl_la_LDFLAGS = -no-undefined \
+ -version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
+
+pkgconfig_DATA += opusurl.pc
+
+examples_opusfile_example_LDADD = libopusurl.la libopusfile.la
+examples_seeking_example_LDADD = libopusurl.la libopusfile.la
+
 if OP_WIN32
-libopusfile_la_SOURCES += src/wincerts.c
-libopusfile_la_LIBADD += -lws2_32 -lcrypt32
-endif
+libopusurl_la_SOURCES += src/wincerts.c
+libopusurl_la_LIBADD += -lws2_32 -lcrypt32
 endif
 
-noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
-
+else
 examples_opusfile_example_LDADD = libopusfile.la
 examples_seeking_example_LDADD = libopusfile.la
+endif
+
+noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
 
 debug:
        $(MAKE) CFLAGS="${CFLAGS} -O0 -ggdb -DOP_ENABLE_ASSERTIONS" all
 
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = opusfile.pc
-
 EXTRA_DIST = \
  opusfile.pc.in \
+ opusurl.pc.in \
  opusfile-uninstalled.pc.in \
+ opusurl-uninstalled.pc.in \
  doc/Doxyfile.in \
  doc/git-version.sh \
  doc/opus_logo.svg \
index 113086d..b7bf983 100644 (file)
@@ -76,13 +76,12 @@ AM_COND_IF(OP_WIN32,
 )
 
 AS_IF([test "x$enable_http" != "xno"], [
-   openssl="openssl"
    AC_DEFINE([OP_ENABLE_HTTP], [1], [Enable HTTP support])
+   PKG_CHECK_MODULES([URL_DEPS], [openssl])
 ])
 AM_CONDITIONAL(OP_ENABLE_HTTP, [test "x$enable_http" != "xno"])
-AC_SUBST(openssl)
 
-PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 opus >= 1.0.1 ${openssl}])
+PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 opus >= 1.0.1])
 
 AC_ARG_ENABLE([fixed-point],
   AS_HELP_STRING([--enable-fixed-point], [Enable fixed-point calculation]),,
@@ -132,7 +131,9 @@ AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
 AC_OUTPUT([
   Makefile
   opusfile.pc
+  opusurl.pc
   opusfile-uninstalled.pc
+  opusurl-uninstalled.pc
   doc/Doxyfile
 ])
 
index bcb06a5..f953e2d 100644 (file)
@@ -8,7 +8,7 @@ includedir=${pcfiledir}/@top_srcdir@/include
 Name: opusfile uninstalled
 Description: High-level Opus decoding library (not installed)
 Version: @VERSION@
-Requires: ogg >= 1.3 opus >= 1.0.1 @openssl@
+Requires.private: ogg >= 1.3 opus >= 1.0.1
 Conflicts:
 Libs: ${libdir}/libopusfile.la @lrintf_lib@
 Cflags: -I${includedir}
index a919138..8c315be 100644 (file)
@@ -8,7 +8,7 @@ includedir=@includedir@
 Name: opusfile
 Description: High-level Opus decoding library
 Version: @VERSION@
-Requires.private: ogg >= 1.3 opus >= 1.0.1 @openssl@
+Requires.private: ogg >= 1.3 opus >= 1.0.1
 Conflicts:
 Libs: -L${libdir} -lopusfile
 Libs.private: @lrintf_lib@
diff --git a/opusurl-uninstalled.pc.in b/opusurl-uninstalled.pc.in
new file mode 100644 (file)
index 0000000..7f76103
--- /dev/null
@@ -0,0 +1,14 @@
+# opusurl uninstalled pkg-config file
+
+prefix=
+exec_prefix=
+libdir=${pcfiledir}/.libs
+includedir=${pcfiledir}/@top_srcdir@/include
+
+Name: opusfile uninstalled
+Description: High-level Opus decoding library, HTTP support (not installed)
+Version: @VERSION@
+Requires: opusfile
+Conflicts:
+Libs: ${libdir}/libopusurl.la
+Cflags: -I${includedir}
diff --git a/opusurl.pc.in b/opusurl.pc.in
new file mode 100644 (file)
index 0000000..cc54eb3
--- /dev/null
@@ -0,0 +1,14 @@
+# opusurl installed pkg-config file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: opusurl
+Description: High-level Opus decoding library, HTTP support
+Version: @VERSION@
+Requires: opusfile
+Requires.private: openssl
+Conflicts:
+Libs: -L${libdir} -lopusurl