Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 1482238

Browse files
committed
fix: resolve automake version mismatch issues in builds
- Add `touchAutomakeFiles` utility function to prevent automake regeneration - Implement the function for speex build process - Simplify macOS dependency installation by removing automake symlinks This change addresses issues with automake version mismatches where macOS has a newer automake version (1.18) than what was used to configure speex (1.16).
1 parent 4cb0994 commit 1482238

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

.github/workflows/ffmpeg.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ jobs:
5151

5252
- name: Install macOS dependencies
5353
if: matrix.os == 'darwin'
54-
run: |
55-
brew update
56-
brew install yasm autoconf ragel meson nasm automake libtool
57-
# Create compatibility symlinks for older automake version references
58-
ln -sf $(which aclocal) /usr/local/bin/aclocal-1.16
59-
ln -sf $(which automake) /usr/local/bin/automake-1.16
54+
run: brew update && brew install yasm autoconf ragel meson nasm automake libtool
6055

6156
- name: Create build directory
6257
run: mkdir -p build

internal/builder/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ func buildSpeex() {
398398
run("[speex configure]", cmd)
399399
}
400400

401+
// Prevent automake regeneration (macOS has automake 1.18 but speex was configured with 1.16)
402+
touchAutomakeFiles(srcPath)
403+
401404
{
402405
log.Println("Running make")
403406

internal/builder/utils.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,3 +450,40 @@ func modify(path string, mod func([]byte) []byte) {
450450
log.Panicln(err)
451451
}
452452
}
453+
454+
// touchAutomakeFiles updates timestamps on automake-generated files to prevent
455+
// Make from trying to regenerate them. This works around automake version mismatches
456+
// where the tarball was configured with a different automake version than installed.
457+
func touchAutomakeFiles(srcPath string) {
458+
now := time.Now()
459+
460+
// Touch all automake-generated files to be newer than their sources
461+
// This prevents Make from invoking automake to regenerate them
462+
files := []string{
463+
"aclocal.m4",
464+
"Makefile.in",
465+
"config.h.in",
466+
"configure",
467+
}
468+
469+
for _, file := range files {
470+
fullPath := filepath.Join(srcPath, file)
471+
if _, err := os.Stat(fullPath); err == nil {
472+
// File exists, update its timestamp
473+
if err := os.Chtimes(fullPath, now, now); err != nil {
474+
log.Printf("Warning: failed to touch %s: %v", file, err)
475+
}
476+
}
477+
}
478+
479+
// Also touch any Makefile.in files in subdirectories
480+
filepath.Walk(srcPath, func(path string, info os.FileInfo, err error) error {
481+
if err != nil {
482+
return err
483+
}
484+
if !info.IsDir() && info.Name() == "Makefile.in" {
485+
os.Chtimes(path, now, now)
486+
}
487+
return nil
488+
})
489+
}

0 commit comments

Comments
 (0)