diff --git a/.gitignore b/.gitignore index ac840d38..6fd65cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *~ *.o +*.lo +*.la *.ce *.cce *.he @@ -31,3 +33,4 @@ libtool ltmain.sh po/aria2.pot po/remove-potcdate.sed +src/libaria2.pc diff --git a/configure.ac b/configure.ac index 1b717e06..6d2dc235 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,12 @@ LT_PREREQ([2.2.6]) AC_INIT([aria2],[1.17.0],[t-tujikawa@users.sourceforge.net],[aria2],[http://aria2.sourceforge.net/]) AC_USE_SYSTEM_EXTENSIONS LT_INIT() +dnl See versioning rule: +dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +AC_SUBST(LT_CURRENT, 0) +AC_SUBST(LT_REVISION, 0) +AC_SUBST(LT_AGE, 0) + AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -789,7 +795,8 @@ if test "x$enable_message_digest" = "xyes"; then enable_websocket=yes AC_DEFINE([ENABLE_WEBSOCKET], [1], [Define 1 if WebSocket support is enabled.]) - LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la $LIBS" + WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la" + AC_SUBST([WSLAY_LIBS]) # $(top_srcdir) for `make distcheck` CPPFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes $CPPFLAGS" fi @@ -815,6 +822,8 @@ fi AC_CONFIG_FILES([Makefile src/Makefile + src/libaria2.pc + src/includes/Makefile test/Makefile po/Makefile.in intl/Makefile diff --git a/deps/wslay/configure.ac b/deps/wslay/configure.ac index 57fc931a..91f8f29c 100644 --- a/deps/wslay/configure.ac +++ b/deps/wslay/configure.ac @@ -23,7 +23,7 @@ dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AC_PREREQ(2.61) AC_INIT([wslay], [0.1.1], [t-tujikawa@users.sourceforge.net]) LT_PREREQ([2.2.6]) -LT_INIT([disable-shared]) +LT_INIT() AC_CONFIG_AUX_DIR([.]) dnl See versioning rule: dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html diff --git a/src/Context.cc b/src/Context.cc new file mode 100644 index 00000000..ad6b1af1 --- /dev/null +++ b/src/Context.cc @@ -0,0 +1,294 @@ +/* */ +#include "Context.h" + +#include +#include + +#include +#include +#include + +#include "SharedHandle.h" +#include "LogFactory.h" +#include "Logger.h" +#include "util.h" +#include "FeatureConfig.h" +#include "MultiUrlRequestInfo.h" +#include "SimpleRandomizer.h" +#include "File.h" +#include "message.h" +#include "prefs.h" +#include "Option.h" +#include "a2algo.h" +#include "a2io.h" +#include "a2time.h" +#include "Platform.h" +#include "FileEntry.h" +#include "RequestGroup.h" +#include "ConsoleStatCalc.h" +#include "NullStatCalc.h" +#include "download_helper.h" +#include "Exception.h" +#include "ProtocolDetector.h" +#include "RecoverableException.h" +#include "SocketCore.h" +#include "DownloadContext.h" +#include "fmt.h" +#include "NullOutputFile.h" +#include "console.h" +#include "UriListParser.h" +#ifdef ENABLE_BITTORRENT +# include "bittorrent_helper.h" +#endif // ENABLE_BITTORRENT +#ifdef ENABLE_METALINK +# include "metalink_helper.h" +# include "MetalinkEntry.h" +#endif // ENABLE_METALINK +#ifdef ENABLE_MESSAGE_DIGEST +# include "message_digest_helper.h" +#endif // ENABLE_MESSAGE_DIGEST + +extern char* optarg; +extern int optind, opterr, optopt; + +namespace aria2 { + +SharedHandle getStatCalc(const SharedHandle