diff options
Diffstat (limited to 'net/megacmd/files/patch-sdk_configure.ac')
-rw-r--r-- | net/megacmd/files/patch-sdk_configure.ac | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/net/megacmd/files/patch-sdk_configure.ac b/net/megacmd/files/patch-sdk_configure.ac new file mode 100644 index 000000000000..9328d1669b1f --- /dev/null +++ b/net/megacmd/files/patch-sdk_configure.ac @@ -0,0 +1,140 @@ +--- sdk/configure.ac.orig 2024-05-17 14:19:43 UTC ++++ sdk/configure.ac +@@ -208,6 +208,8 @@ LINUX=no + DARWIN=no + ANDROID=no + LINUX=no ++DRAGONFLY=no ++NETBSD=no + AC_MSG_CHECKING([platform options]) + case $host in + *-*-cygwin*) +@@ -238,6 +240,12 @@ case $host in + *-linux*) + LINUX=yes + ;; ++ *-dragonfly*) ++ DRAGONFLY=yes ++ ;; ++ *-netbsd*) ++ NETBSD=yes ++ ;; + *) + LIBS_EXTRA="" + ;; +@@ -247,6 +255,8 @@ AM_CONDITIONAL([LINUX], [test "${LINUX}" = "yes"]) + AM_CONDITIONAL([DARWIN], [test "${DARWIN}" = "yes"]) + AM_CONDITIONAL([ANDROID], [test "${ANDROID}" = "yes"]) + AM_CONDITIONAL([LINUX], [test "${LINUX}" = "yes"]) ++AM_CONDITIONAL([DRAGONFLY], [test "${DRAGONFLY}" = "yes"]) ++AM_CONDITIONAL([NETBSD], [test "${NETBSD}" = "yes"]) + + AC_SUBST(LIBS_EXTRA) + +@@ -1369,6 +1379,7 @@ cares=false + # + openssl=false + cares=false ++rt=undef + if test "x$WIN32" = "xno" ; then + + AC_ARG_WITH([poll], +@@ -1381,12 +1392,71 @@ if test "x$WIN32" = "xno" ; then + LDFLAGS="-pthread $LDFLAGS" + fi + +- # librt #TODO: allow --with-rt=... +- AC_CHECK_LIB([rt], [aio_write], [ +- SAVE_LDFLAGS="-lrt $SAVE_LDFLAGS" +- LDFLAGS="-lrt $LDFLAGS" +- AC_DEFINE(HAVE_AIO_RT, [1], [Define to indicate AIO presence in librt]) +- ], ++ # librt ++ AC_MSG_CHECKING(for rt) ++ AC_ARG_WITH([rt], ++ AS_HELP_STRING(--with-rt=PATH, base of Real-time Library installation), ++ [ ++ case $with_rt in ++ no) ++ AC_MSG_RESULT([no]) ++ ++ rt=false ++ ;; ++ yes) ++ AC_CHECK_HEADERS([aio.h], [], ++ AC_MSG_ERROR([aio.h header not found or not usable]) ++ ) ++ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], ++ AC_MSG_ERROR([Could not find rt library!]) ++ ) ++ ++ AC_SUBST(LIBRT_LIBS) ++ rt=true ++ ;; ++ *) ++ # determine if library is installed ++ if test -d "$with_rt/lib"; then ++ LDFLAGS="-L$with_rt/lib $LDFLAGS" ++ CXXFLAGS="-I$with_rt/include $CXXFLAGS" ++ ++ AC_CHECK_HEADERS([aio.h], [ ++ LIBRT_LDFLAGS="-L$with_rt/lib" ++ LIBRT_CXXFLAGS="-I$with_rt/include"], ++ AC_MSG_ERROR([aio.h header not found or not usable]) ++ ) ++ ++ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], ++ AC_MSG_ERROR([Could not find rt library!]) ++ ) ++ else ++ AC_MSG_ERROR([Could not find rt library in "$with_rt/lib"!]) ++ fi ++ ++ AC_SUBST(LIBRT_LDFLAGS) ++ AC_SUBST(LIBRT_CXXFLAGS) ++ AC_SUBST(LIBRT_LIBS) ++ rt=true ++ ++ #restore ++ LDFLAGS=$SAVE_LDFLAGS ++ CXXFLAGS=$SAVE_CXXFLAGS ++ ;; ++ esac ++ ], ++ [ ++ AC_MSG_RESULT([--with-rt not specified]) ++ ++ AC_CHECK_HEADERS([aio.h], [], ++ AC_MSG_ERROR([aio.h header not found or not usable]) ++ ) ++ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], ++ AC_MSG_NOTICE([Could not find librt]) ++ ) ++ ++ AC_SUBST(LIBRT_LIBS) ++ rt=true ++ ] + ) + + # OpenSSL +@@ -1617,6 +1687,12 @@ fi + fi + + # define on all platforms ++AM_CONDITIONAL(HAVE_RT, test x$rt = xtrue) ++if test "x$rt" = "xtrue" ; then ++ AC_DEFINE(HAVE_AIO_RT, [1], [Define to indicate AIO presence in librt]) ++fi ++ ++# define on all platforms + AM_CONDITIONAL(HAVE_OPENSSL, test x$openssl = xtrue) + if test "x$openssl" = "xtrue" ; then + AC_DEFINE(USE_OPENSSL, [1], [Define to use OpenSSL]) +@@ -2308,6 +2384,7 @@ AC_MSG_NOTICE([Configured to build Mega SDK: + PCRE: $PCRE_CXXFLAGS $PCRE_LDFLAGS $PCRE_LIBS + LIBUV: $LIBUV_CXXFLAGS $LIBUV_LDFLAGS $LIBUV_LIBS + LIBRAW: $LIBRAW_CXXFLAGS $LIBRAW_LDFLAGS $LIBRAW_LIBS ++ LIBRT: $LIBRT_CXXFLAGS $LIBRT_LDFLAGS $LIBRT_LIBS + LIBMEDIAINFO: $LIBMEDIAINFO_CXXFLAGS $LIBMEDIAINFO_LDFLAGS $LIBMEDIAINFO_LIBS + FFMPEG: $FFMPEG_CXXFLAGS $FFMPEG_LDFLAGS $FFMPEG_LIBS + |