Index: .gitignore ================================================================== --- .gitignore +++ .gitignore @@ -11,5 +11,6 @@ config.log config.status configure DerivedData extra.mk +packages/ObjOpenSSL Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -1,3 +1,23 @@ SUBDIRS = src include buildsys.mk +include extra.mk + +install-extra: + i=packages/ObjOpenSSL; \ + ${INSTALL_STATUS}; \ + if ${INSTALL} -m 644 $$i ${DESTDIR}$$(${OBJFW_CONFIG} --packages-dir)/ObjOpenSSL; then \ + ${INSTALL_OK}; \ + else \ + ${INSTALL_FAILED}; \ + fi + +uninstall-extra: + i=packages/ObjOpenSSL; \ + if test -f ${DESTDIR}$$(${OBJFW_CONFIG} --packages-dir)/ObjOpenSSL; then \ + if rm -f ${DESTDIR}$$(${OBJFW_CONFIG} --packages-dir)/ObjOpenSSL; then \ + ${DELETE_OK}; \ + else \ + ${DELETE_FAILED}; \ + fi \ + fi Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -44,16 +44,19 @@ AC_SUBST(OBJOPENSSL_STATIC_LIB, "libobjopenssl.a") ]) AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl=PREFIX], [build with OpenSSL in the specified prefix])) -AS_IF([test x"$with_openssl" != x"no"], [ - CPPFLAGS="$CPPFLAGS -I$with_openssl/include" - LIBS="$LIBS -L$with_openssl/lib" +AS_IF([test x"$with_openssl" != x"no" -a x"$with_openssl" != x""], [ + OPENSSL_CPPFLAGS="$CPPFLAGS -I$with_openssl/include" + OPENSSL_LIBS="$LIBS -L$with_openssl/lib" + CPPFLAGS="$CPPFLAGS $OPENSSL_CPPFLAGS" + LIBS="$LIBS $OPENSSL_LIBS" ]) AC_CHECK_LIB(ssl, main, [ + OPENSSL_LIBS="$OPENSSL_LIBS -lssl -lcrypto" LIBS="$LIBS -lssl -lcrypto" ], [ AC_MSG_ERROR(You need openssl >= 1.0.2 installed!) ], [-lcrypto]) @@ -66,7 +69,10 @@ dnl We don't call AC_PROG_CPP, but only AC_PROG_OBJCPP and set CPP to OBJCPP dnl and add OBJCPPFLAGS to CPPFLAGS, thus we need to AC_SUBST these ourself. AC_SUBST(CPP) AC_SUBST(CPPFLAGS) -AC_CONFIG_FILES([buildsys.mk extra.mk]) +AC_SUBST(OPENSSL_CPPFLAGS) +AC_SUBST(OPENSSL_LIBS) + +AC_CONFIG_FILES([buildsys.mk extra.mk packages/ObjOpenSSL]) AC_OUTPUT Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,6 +1,7 @@ OBJOPENSSL_SHARED_LIB = @OBJOPENSSL_SHARED_LIB@ OBJOPENSSL_STATIC_LIB = @OBJOPENSSL_STATIC_LIB@ OBJOPENSSL_FRAMEWORK = @OBJOPENSSL_FRAMEWORK@ +OBJFW_CONFIG = @OBJFW_CONFIG@ OBJFW_FRAMEWORK_LIBS = @OBJFW_FRAMEWORK_LIBS@ OBJFW_LIBS = @OBJFW_LIBS@ ADDED packages/ObjOpenSSL.in Index: packages/ObjOpenSSL.in ================================================================== --- /dev/null +++ packages/ObjOpenSSL.in @@ -0,0 +1,3 @@ +package_version 1 +CPPFLAGS="$CPPFLAGS @OPENSSL_CPPFLAGS@" +LIBS="@OPENSSL_LIBS@ $LIBS"