diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e372375..4dd92bf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ jobs: build: strategy: matrix: - os: [windows-2022, macos-12, ubuntu-22.04] + os: [windows-2022, macos-15, ubuntu-22.04] addrsize: ["64"] continue-on-error: false runs-on: ${{ matrix.os }} @@ -20,10 +20,10 @@ jobs: - name: Setup Apt Packages if: ${{ runner.os == 'Linux' }} shell: bash - run: | + run: | sudo apt-get update sudo apt-get -y install autoconf automake autopoint gettext - - uses: secondlife/action-autobuild@v4 + - uses: secondlife/action-autobuild@v5 with: addrsize: ${{ matrix.addrsize }} release: diff --git a/apr-util/build/apu-conf.m4 b/apr-util/build/apu-conf.m4 index 127d75f..c7391c4 100644 --- a/apr-util/build/apu-conf.m4 +++ b/apr-util/build/apu-conf.m4 @@ -142,17 +142,16 @@ AC_ARG_WITH([expat], # Add given path to standard search paths if appropriate: if test "$withval" != "/usr"; then APR_ADDTO(LDFLAGS, [-L$withval/lib]) - APR_ADDTO(CPPFLAGS, [-I$withval/include]) - APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include]) + APR_ADDTO(CPPFLAGS, [-I$withval/include/expat]) + APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/expat]) APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) fi + + APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, + [expat.h], [-lexpat]) fi ]) -if test $apu_try_external_expat = 1; then - APU_SYSTEM_EXPAT -fi - APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) APR_ADDTO(APRUTIL_LIBS, [$apu_expat_libs]) diff --git a/apr/configure.in b/apr/configure.in index 6e2ebdd..b0457e2 100644 --- a/apr/configure.in +++ b/apr/configure.in @@ -9,6 +9,7 @@ AC_PREREQ(2.59) AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) +AC_CONFIG_MACRO_DIR(build) dnl dnl Include our own M4 macros along with those for libtool diff --git a/autobuild.xml b/autobuild.xml index d329059..5c4a7a5 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -156,7 +156,6 @@ manifest lib/release/*.a - lib/release/*.dylib name darwin diff --git a/build-cmd.sh b/build-cmd.sh index 337c32c..b7e1823 100755 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -144,26 +144,51 @@ case "$AUTOBUILD_PLATFORM" in opts="-arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE" plainopts="$(remove_cxxstd $opts)" - export CFLAGS="$plainopts" - export CXXFLAGS="$opts" - export LDFLAGS="$plainopts" export MAKEFLAGS="-j${AUTOBUILD_CPU_COUNT:-2}" export MACOSX_DEPLOYMENT_TARGET="$LL_BUILD_DARWIN_DEPLOY_TARGET" - pushd "$TOP_DIR/apr" - autoreconf -fvi - ./configure --prefix="$PREFIX" - make - make install - popd + for arch in x86_64 arm64 ; do + ARCH_ARGS="-arch $arch" + opts="${TARGET_OPTS:-$ARCH_ARGS $LL_BUILD_RELEASE}" + cc_opts="$(remove_cxxstd $opts)" + ld_opts="$ARCH_ARGS" + + pushd "$TOP_DIR/apr" + autoreconf -fvi + + mkdir -p "build_$arch" + pushd "build_$arch" + CFLAGS="$cc_opts" CXXFLAGS="$opts" LDFLAGS="$ld_opts" \ + ../configure --prefix="$PREFIX" --disable-shared --enable-static --host=$arch-apple-darwin + make + make install + popd + popd + + pushd "$TOP_DIR/apr-util" + autoreconf -fvi + + lipo $STAGING_DIR/packages/lib/release/libexpat.a -thin $arch -output $STAGING_DIR/packages/lib/libexpat.a + + mkdir -p "build_$arch" + pushd "build_$arch" + CFLAGS="$cc_opts" CXXFLAGS="$opts" LDFLAGS="$ld_opts" \ + ../configure --prefix="$PREFIX" --with-apr="$PREFIX" --with-expat="$STAGING_DIR/packages" --disable-shared --enable-static --host=$arch-apple-darwin + make + make install + popd + + rm $STAGING_DIR/packages/lib/libexpat.a + popd + + mkdir -p "$PREFIX/lib/release/$arch" + mv "$PREFIX"/lib/*.* "$PREFIX/lib/release/$arch" + done - pushd "$TOP_DIR/apr-util" - autoreconf -fvi - ./configure --prefix="$PREFIX" --with-apr="$PREFIX" --with-expat="$PREFIX" - make - make install - popd + # Create universal library + lipo -create -output "$STAGING_DIR/lib/release/libapr-1.a" "$STAGING_DIR/lib/release/x86_64/libapr-1.a" "$STAGING_DIR/lib/release/arm64/libapr-1.a" + lipo -create -output "$STAGING_DIR/lib/release/libaprutil-1.a" "$STAGING_DIR/lib/release/x86_64/libaprutil-1.a" "$STAGING_DIR/lib/release/arm64/libaprutil-1.a" # To conform with autobuild install-package conventions, we want to move # the libraries presently in "$PREFIX/lib" to "$PREFIX/lib/release". @@ -184,26 +209,26 @@ case "$AUTOBUILD_PLATFORM" in # directly, they want to manipulate only libapr[util]-1.0.dylib. Fix # things while relocating. - mkdir -p "$PREFIX/lib/release" || echo "reusing $PREFIX/lib/release" - for libname in libapr libaprutil - do # First just move the static library, that part is easy - mv "$PREFIX/lib/$libname-1.a" "$PREFIX/lib/release/" - # Ensure that lib/release/$libname-1.0.dylib is a real file, not a symlink - cp "$PREFIX/lib/$libname-1.0.dylib" "$PREFIX/lib/release" - # Make sure it's stamped with the -id we need in our app bundle. - # As of 2012-02-07, with APR 1.4.5, this function has been observed to - # fail on TeamCity builds. Does the failure matter? Hopefully not... - pushd "$PREFIX/lib/release" - fix_dylib_id "$libname-1.0.dylib" || \ - echo "fix_dylib_id $libname-1.0.dylib failed, proceeding" - popd - # Recreate the $libname-1.dylib symlink, because the one in lib/ is - # pointing to (e.g.) libapr-1.0.4.5.dylib -- no good - ln -svf "$libname-1.0.dylib" "$PREFIX/lib/release/$libname-1.dylib" - # Clean up whatever's left in $PREFIX/lib for this $libname (e.g. - # libapr-1.0.4.5.dylib) - rm "$PREFIX/lib/$libname-"*.dylib || echo "moved all $libname-*.dylib" - done + # mkdir -p "$PREFIX/lib/release" || echo "reusing $PREFIX/lib/release" + # for libname in libapr libaprutil + # do # First just move the static library, that part is easy + # mv "$PREFIX/lib/$libname-1.a" "$PREFIX/lib/release/" + # # Ensure that lib/release/$libname-1.0.dylib is a real file, not a symlink + # cp "$PREFIX/lib/$libname-1.0.dylib" "$PREFIX/lib/release" + # # Make sure it's stamped with the -id we need in our app bundle. + # # As of 2012-02-07, with APR 1.4.5, this function has been observed to + # # fail on TeamCity builds. Does the failure matter? Hopefully not... + # pushd "$PREFIX/lib/release" + # fix_dylib_id "$libname-1.0.dylib" || \ + # echo "fix_dylib_id $libname-1.0.dylib failed, proceeding" + # popd + # # Recreate the $libname-1.dylib symlink, because the one in lib/ is + # # pointing to (e.g.) libapr-1.0.4.5.dylib -- no good + # ln -svf "$libname-1.0.dylib" "$PREFIX/lib/release/$libname-1.dylib" + # # Clean up whatever's left in $PREFIX/lib for this $libname (e.g. + # # libapr-1.0.4.5.dylib) + # rm "$PREFIX/lib/$libname-"*.dylib || echo "moved all $libname-*.dylib" + # done # When we linked apr-util against apr (above), it grabbed the -id baked # into libapr-1.0.dylib as of that moment. A libaprutil-1.0.dylib built @@ -226,14 +251,14 @@ case "$AUTOBUILD_PLATFORM" in # to the canonical relative Resources path. NOW: feed all those -change # switches into an install_name_tool command operating on that same # .dylib. - lib="$PREFIX/lib/release/libaprutil-1.0.dylib" - install_name_tool \ - $(otool -L "$lib" | tail -n +3 | \ - grep "$PREFIX/lib" | awk '{ print $1 }' | \ - (while read f; \ - do echo -change "$f" "@executable_path/../Resources/$(basename "$f")"; \ - done) ) \ - "$lib" + # lib="$PREFIX/lib/release/libaprutil-1.0.dylib" + # install_name_tool \ + # $(otool -L "$lib" | tail -n +3 | \ + # grep "$PREFIX/lib" | awk '{ print $1 }' | \ + # (while read f; \ + # do echo -change "$f" "@executable_path/../Resources/$(basename "$f")"; \ + # done) ) \ + # "$lib" ;; # ****************************************************************************