Menu

#332 Instructions for doing usual build from source

1.29.x
closed-fixed
nobody
None
5
2022-06-26
2022-03-01
No

I tried to build mpg123 on Cygwin:

$ uname -msro
CYGWIN_NT-10.0-WOW 3.3.3(0.341/5/3) i686 Cygwin

The INSTALL says:

This way is the usual GNU 3-step procedure:

        ./configure
        make
        make install

But there is no ./configure to be found.
So I googled a bit and decided to run autoreconf.

For that I need to install autoconf, automake and libtool packages and run it:

$ autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build'.
libtoolize: copying file 'build/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:107: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:107: You should run autoupdate.
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:107: the top level

Because of the last warning I run autoupdate too:

$ autoupdate
configure.ac:107: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC

After this I found configure, ran it and it finished successfully:

$ ./configure
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
  ...
config.status: executing depfiles commands
config.status: executing libtool commands

  mpg123 1.30.0

  Install path ............ /usr/local
  CPU Optimization ........ x86
  Compiler Optimization ... 2
  Gapless Support ......... enabled
  Debugging ............... disabled
  Extreme debugging ....... disabled
  Seek table size ......... 1000
  FIFO support ............ enabled
  Buffer .................. enabled
  Network (http streams) .. enabled
  Network Sockets ......... Posix
  IPv6 (getaddrinfo) ...... enabled
  File offsets ............ default
  LFS alias symbols ....... disabled (64)
  LFS alias type .......... off_t
  Use yasm (for AVX only) . disabled

  Core libmpg123 features:
  Layer I ................. enabled
  Layer II ................ enabled
  Layer III ............... enabled
  NtoM resampling ......... enabled
  downsampled decoding .... enabled
  Feeder/buffered input ... enabled
  ID3v2 parsing ........... enabled
  String API .............. enabled
  ICY parsing/conversion .. enabled
  Error/warning messages .. enabled
  Win32 Unicode File Open.. unneeded
  Feature Report Function.. enabled
  Output formats (nofpu will disable all but 16 or 8 bit!):
  8 bit integer ........... enabled
  16 bit integer .......... enabled
  32/24 bit integer ....... enabled
  real (32 bit float) ..... enabled
  Equalizer ............... enabled
  Optimization detail:
  Integer conversion ...... quality
  IEEE 754 hackery ........ enabled
  New/old WRITE_SAMPLE .... enabled
  new Huffman scheme ...... enabled
  runtime tables .......... disabled

Note: Disabling core features is not commonly done and some combinations might
      not build/work. If you encounter such a case, help yourself (and provide
      a patch) or just poke the maintainers.

  libsyn123 special cases . enabled

  Modules ................. enabled
  Checked audio modules ... pulse alsa tinyalsa oss coreaudio sndio sun win32 win32_wasapi os2 esd jack portaudio sdl nas arts openal dummy
  Detected audio support .. oss win32 win32_wasapi dummy
  Runtime order ........... oss win32 win32_wasapi

  CPPFLAGS=' -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT -DNEWOLD_WRITE_SAMPLE '
  CFLAGS='-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math  -g -O2'
  PROG_LIBS='-lm '
       (derived from LIBS, only used for end-user binaries and modules)
  LIBDL=''
  LIBMPG123_LIBS=' '
  LIBSYN123_LIBS=''
  LIBOUT123_LIBS=' '

Next type 'make' and then 'make install'.

But make failed soon after the start:

$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/home/saukrs/src/mpg123/build/missing' aclocal-1.16 -I m4
 cd . && /bin/sh /home/saukrs/src/mpg123/build/missing automake-1.16 --gnu
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh '/home/saukrs/src/mpg123/build/missing' autoconf
configure.ac:107: warning: AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
configure.ac:110: warning: ac_ext=c
configure.ac:110: ac_cpp='$CPP $CPPFLAGS'
configure.ac:110: ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
configure.ac:110: ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
configure.ac:110: ac_compiler_gnu=$ac_cv_c_compiler_gnu
configure.ac:110: if test -n "$ac_tool_prefix"; then
configure.ac:110:   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
configure.ac:110: set dummy ${ac_tool_prefix}gcc; ac_word=$2
configure.ac:110: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
configure.ac:110: printf %s "checking for $ac_word... " >&6; }
configure.ac:110: if test ${ac_cv_prog_CC+y}
configure.ac:110: then :
configure.ac:110:   printf %s "(cached) " >&6
configure.ac:110: else $as_nop
configure.ac:110:   if test -n "$CC"; then
configure.ac:110:   ac_cv_prog_CC="$CC" # Let the user override the test.
configure.ac:110: else
configure.ac:110: as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
configure.ac:110: for as_dir in $PATH
configure.ac:110: do
configure.ac:110:   IFS=$as_save_IFS
configure.ac:110:   case $as_dir in #(((
configure.ac:110:     '' is m4_require'd but not m4_defun'd
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/programs.m4:41: _AC_CHECK_PROG is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/programs.m4:101: AC_CHECK_PROG is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/programs.m4:221: AC_CHECK_TOOL is expanded from...
/mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/c.m4:452: AC_PROG_CC is expanded from...
configure.ac:110: the top level
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --no-create --no-recursion
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for -Werror in CFLAGS (It breaks tests)... no
checking if you are up to something totally static with LDFLAGS/CFLAGS... no
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
./configure: line 5493: syntax error near unexpected token `newline'
./configure: line 5493: `    '''
make: *** [Makefile:2939: config.status] Error 2

I think of two points:

  1. Build instructions are not consistent.
  2. There is something wrong with my GNU Autotools version (on Cygwin).

Just in case:

$ autoreconf --version
autoreconf (GNU Autoconf) 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>, <https://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ automake --version
automake (GNU automake) 1.16.5
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

Discussion

  • Saulius Krasuckas

    I tried several more autoreconf switches and commands like autoconf, automake.
    Now I noticed this text in the INSTALL:

    2. Developer build
    
    This project uses GNU autotools (no specific version, but they should
    be fairly recent), also libtool. You need to have those installed, as
    it is usually the case for build environments based on the GNU toolchain.
    
    One a fresh SCM checkout, or after changing things in configure.ac,
    you need to run
    
            autoreconf -iv
    
    to prepare the configure script. Then you can build as per point 1.
    

    ... and retried it once more with additional flag -v (which I was sure shouldn't change anything):

    $ autoreconf -iv
    autoreconf-2.71: export WARNINGS=
    autoreconf-2.71: Entering directory '.'
    autoreconf-2.71: configure.ac: not using Gettext
    autoreconf-2.71: running: aclocal -I m4
    autoreconf-2.71: configure.ac: tracing
    autoreconf-2.71: configure.ac: creating directory build
    autoreconf-2.71: running: libtoolize --copy
    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build'.
    libtoolize: copying file 'build/ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
    libtoolize: copying file 'm4/libtool.m4'
    libtoolize: copying file 'm4/ltoptions.m4'
    libtoolize: copying file 'm4/ltsugar.m4'
    libtoolize: copying file 'm4/ltversion.m4'
    libtoolize: copying file 'm4/lt~obsolete.m4'
    autoreconf-2.71: configure.ac: not using Intltool
    autoreconf-2.71: configure.ac: not using Gtkdoc
    autoreconf-2.71: running: aclocal -I m4
    autoreconf-2.71: running: /usr/bin/autoconf-2.71
    configure.ac:107: warning: The macro `AC_PROG_CC_C99' is obsolete.
    configure.ac:107: You should run autoupdate.
    /mnt/share/cygpkgs/autoconf2.7/autoconf2.7.noarch/src/autoconf-2.71/lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
    configure.ac:107: the top level
    autoreconf-2.71: running: /usr/bin/autoheader-2.71
    autoreconf-2.71: running: automake --add-missing --copy --no-force
    configure.ac:105: installing 'build/compile'
    configure.ac:43: installing 'build/config.guess'
    configure.ac:43: installing 'build/config.sub'
    configure.ac:48: installing 'build/install-sh'
    configure.ac:48: installing 'build/missing'
    Makefile.am: installing 'build/depcomp'
    parallel-tests: installing 'build/test-driver'
    autoreconf-2.71: Leaving directory '.'
    

    And now after ./configure is done, make runs fine.
    There is something fishy here.

     

    Last edit: Saulius Krasuckas 2022-03-01
  • Thomas Orgis

    Thomas Orgis - 2022-03-01

    Hm. The normal build is for using a release tarball or snapshot tarball. Those have configure script generated.

    Your first failure was because of running autoupdate, right? The C99 macro I tried to get rid of, but I remember that there were side effects. I do want to state that I need a C99 compiler (well, MSVC works, too, for the libraries at least). You should ignore that warning about the old macro for now.

    So … just autoreconf -i in a fresh checkout works for you, right?

     

    Last edit: Thomas Orgis 2022-03-01
    • Saulius Krasuckas

      The normal build is for using a release tarball or snapshot tarball. Those have configure script generated.

      Thanks for pointing to this difference! My wish is that this should be expressed directly in the INSTALL. Is it patchable?

      You should ignore that warning about the old macro for now.

      I am fine with that macro and the warning. I paid attention just because the output told me so. So thank you, this is clear now.

      So … just autoreconf -i in a fresh checkout works for you, right?

      It seems so. I ran git clean -fd several times, and now I am unable to reproduce the issue. Very strange.

       

      Last edit: Saulius Krasuckas 2022-03-01
  • Thomas Orgis

    Thomas Orgis - 2022-03-01

    While I see that I have to do some cleanup of INSTALL, there is a hint right at the prerequisites list:

    ```

    • If building from direct SCM checkout, you need GNU autotools installed
      (see below).
      ```

    I can change that to 'see developer build below' …

     
    • Saulius Krasuckas

      (EDIT: Just synced the source code, hence fixing my reply)

      Thanks for adding the change. I would capitalize it as "Developer build", though.

      I would also like this to stand out of the whole list more. Maybe move it to the top of this list?

      Also "SCM checkout" phrase doesn't catch my attention in the right way. Something more specific would be appreciated, like "Daily snapshot" or "Development version".

      Thanks in advance.

       

      Last edit: Saulius Krasuckas 2022-05-18
  • Thomas Orgis

    Thomas Orgis - 2022-06-26

    I hope I got it now in the current trunk.

     
  • Thomas Orgis

    Thomas Orgis - 2022-06-26
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB