enzo1982 / mp4v2

Reviving the MP4v2 project...
https://mp4v2.org
Other
135 stars 50 forks source link

missing configure script #4

Closed bergert closed 2 years ago

bergert commented 2 years ago

The configure script is missing, as such cannot build on macOS:

1) mkdir build 2) cd build 3) ../configure --libdir=build/_libs --enable-static --disable-shared MP4V2_USE_STATIC_LIB=yes

I use mp4tags for one of my private projects, tag parsing needed fixing. For my workflow, I need to build with static libs - so there are no dependencies - can import a single binary (and no need to install mp4v2 library: macOS security!). Keep in mind, macOS requires all binaries (including dylib) to be code-signed. Installer for shared lib also complicates version updates.

galad87 commented 2 years ago

It's not missing, you need to run autoreconf -fiv to generate it.

enzo1982 commented 2 years ago

@galad87 is right here. Release packages will have pre-generated scripts, but if you're using the git source, you are supposed to generate them yourself using autoreconf.

If you're using Homebrew, you can install the necessary tools with: brew install autoconf automake libtool

Then just issue autoreconf -fiv in the mp4v2 source folder and after that, call ./configure as you normally would.

Alternatively, you can build using CMake:

cmake . -DBUILD_SHARED=OFF
make

There was as missing space in the CMakeLists.txt preventing static builds. It's fixed now so the above commands should work after a git pull.

bergert commented 2 years ago

thanks it is good to see the project is updated! I forgot autoconf/have it installed already. It creates the configure script, but there is an error: the m4 directory is not found?

$ autoreconf -fiv autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force aclocal: warning: couldn't open directory 'm4': No such file or directory autoreconf: configure.ac: tracing autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/local/bin/autoconf --force autoreconf: running: /usr/local/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:33: installing 'autoaux/config.guess' configure.ac:33: installing 'autoaux/config.sub' configure.ac:24: installing 'autoaux/install-sh' configure.ac:24: installing 'autoaux/missing' GNUmakefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined GNUmakefile.am:1: The usual way to define 'LIBTOOL' is to add 'LT_INIT' GNUmakefile.am:1: to 'configure.ac' and run 'aclocal' and 'autoconf' again. GNUmakefile.am:1: If 'LT_INIT' is in 'configure.ac', make sure GNUmakefile.am:1: its definition is in aclocal's search path. GNUmakefile.am: installing 'autoaux/depcomp' autoreconf: automake failed with exit status: 1

and libtool is installed; and in the path: $ libtool -V Apple Inc. version cctools-921.0.1 (cannot understand what the problem is)

and ../configure --libdir=build/_libs --enable-static --disable-shared MP4V2_USE_STATIC_LIB=yes configure: WARNING: unrecognized options: --enable-static, --disable-shared configure: error: expected an absolute directory name for --libdir: build/_libs (the problem is that ".libs" is a hidden folder, and therefore I use "_libs")

enzo1982 commented 2 years ago

The m4 directory warning is normal, the directory will be created by autoreconf.

LT_INIT is certainly defined in configure.ac, but the libtool you invoked is Apple's libtool. It's not the version used by Autoconf. That one can be invoked as glibtool when installed via Homebrew. I have these:

$ autoconf --version
autoconf (GNU Autoconf) 2.71

$ automake --version
automake (GNU automake) 1.16.5

$ glibtool --version
glibtool (GNU libtool) 2.4.6

Maybe you have outdated Autotools or do not have GNU libtool installed?

The --libdir option specifies the path where libraries will be installed (default is /usr/local/lib), not the local path for output binaries.

If you want to access the .libs folder with Finder, just type open .libs or rename the folder from the command line after building.

enzo1982 commented 2 years ago

Closing this issue.

I just release MP4v2 v2.1.0 and added a tarball that includes the configure script.