Hi Peter,
thanks for your patch.
Am 13.08.2011 18:23 schrieb Peter Lemenkov:
Some time ago I mentioned that I've got patches for full autotools support - here is the first patch in a patchset for your further consideration:
https://github.com/lemenkov/flashrom/commits/autotools
It was tested on RHEL 5, 6, Fedora 1x, i386, i586, i686, x86_64 and ppc (I'm using it for building Flashrom's RPM for a half of the year at least).
It's rebased on top of svn1412 and cleaned up to be a full drop-in replacement for handmade Makefile. Unfortunately I didn't test in on anything else than Linux, so I must admit that it's not in a very good shape for MinGW / BSD / DOS / Darwin users (ARM, MIPS users could be also hurt as well - that's why I didn't touch anything else in this commit except adding these two files).
I think your code looks clean. It does not work, though:
compiler@p35:flashrom-autotools> rm Makefile compiler@p35:flashrom-autotools> make make: *** Keine Targets angegeben und keine »make«-Steuerdatei gefunden. Schluss. (No targets specified, no make control file. Aborting.) compiler@p35:flashrom-autotools> autoconf --version autoconf (GNU Autoconf) 2.65 compiler@p35:flashrom-autotools> automake --version automake (GNU automake) 1.11.1 compiler@p35:flashrom-autotools> automake configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found. configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE, configure.ac: that aclocal.m4 is present in the top-level directory, configure.ac: and that aclocal.m4 was recently regenerated (using aclocal). configure.ac:5: required file `./config.guess' not found configure.ac:5: `automake --add-missing' can install `config.guess' configure.ac:5: required file `./config.sub' not found configure.ac:5: `automake --add-missing' can install `config.sub' configure.ac:170: required file `./install-sh' not found configure.ac:170: `automake --add-missing' can install `install-sh' Makefile.am:8: HAVE_SYS_UTSNAME does not appear in AM_CONDITIONAL Makefile.am:9: HAVE_UNAME does not appear in AM_CONDITIONAL Makefile.am:14: HAVE_DMIDECODE does not appear in AM_CONDITIONAL Makefile.am:21: HAVE_INTERNAL does not appear in AM_CONDITIONAL Makefile.am:29: HAVE_X86_ONLY_INTERNAL does not appear in AM_CONDITIONAL Makefile.am:41: HAVE_SERPROG does not appear in AM_CONDITIONAL Makefile.am:46: HAVE_RAYER_SPI does not appear in AM_CONDITIONAL Makefile.am:51: HAVE_BITBANG_SPI does not appear in AM_CONDITIONAL Makefile.am:56: HAVE_NIC3COM does not appear in AM_CONDITIONAL Makefile.am:61: HAVE_GFXNVIDIA does not appear in AM_CONDITIONAL Makefile.am:66: HAVE_SATASII does not appear in AM_CONDITIONAL Makefile.am:71: HAVE_ATAHPT does not appear in AM_CONDITIONAL Makefile.am:76: HAVE_FT2232_SPI does not appear in AM_CONDITIONAL Makefile.am:81: HAVE_DUMMY does not appear in AM_CONDITIONAL Makefile.am:86: HAVE_DRKAISER does not appear in AM_CONDITIONAL Makefile.am:91: HAVE_NICREALTEK does not appear in AM_CONDITIONAL Makefile.am:96: HAVE_NICNATSEMI does not appear in AM_CONDITIONAL Makefile.am:101: HAVE_NICINTEL does not appear in AM_CONDITIONAL Makefile.am:106: HAVE_NICINTEL_SPI does not appear in AM_CONDITIONAL Makefile.am:111: HAVE_GFXOGP does not appear in AM_CONDITIONAL Makefile.am:116: HAVE_BUSPIRATE_SPI does not appear in AM_CONDITIONAL Makefile.am:121: HAVE_DEDIPROG does not appear in AM_CONDITIONAL Makefile.am:126: HAVE_SATAMV does not appear in AM_CONDITIONAL Makefile.am:131: HAVE_SERIAL does not appear in AM_CONDITIONAL Makefile.am:135: HAVE_PRINT_WIKI does not appear in AM_CONDITIONAL Makefile.am:140: HAVE_PCI does not appear in AM_CONDITIONAL Makefile.am: required file `./INSTALL' not found Makefile.am: `automake --add-missing' can install `INSTALL' Makefile.am: required file `./NEWS' not found Makefile.am: required file `./AUTHORS' not found Makefile.am: required file `./ChangeLog' not found configure.ac:8: required file `config.h.in' not found Makefile.am: required file `./depcomp' not found Makefile.am: `automake --add-missing' can install `depcomp' /usr/share/automake-1.11/am/depend2.am: am__fastdepCC does not appear in AM_CONDITIONAL /usr/share/automake-1.11/am/depend2.am: The usual way to define `am__fastdepCC' is to add `AC_PROG_CC' /usr/share/automake-1.11/am/depend2.am: to `configure.ac' and run `aclocal' and `autoconf' again. /usr/share/automake-1.11/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL /usr/share/automake-1.11/am/depend2.am: The usual way to define `AMDEP' is to add one of the compiler tests /usr/share/automake-1.11/am/depend2.am: AC_PROG_CC, AC_PROG_CXX, AC_PROG_CXX, AC_PROG_OBJC, /usr/share/automake-1.11/am/depend2.am: AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC /usr/share/automake-1.11/am/depend2.am: to `configure.ac' and run `aclocal' and `autoconf' again. compiler@p35:flashrom-autotools> autoconf configure.ac:9: error: possibly undefined macro: AM_INIT_AUTOMAKE If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:223: error: possibly undefined macro: AM_CONDITIONAL
Next try: compiler@p35:flashrom-autotools> aclocal compiler@p35:/sources/tmptrees/ready/flashrom-autotools> autoconf compiler@p35:/sources/tmptrees/ready/flashrom-autotools> automake configure.ac:5: required file `./config.guess' not found configure.ac:5: `automake --add-missing' can install `config.guess' configure.ac:5: required file `./config.sub' not found configure.ac:5: `automake --add-missing' can install `config.sub' configure.ac:9: required file `./install-sh' not found configure.ac:9: `automake --add-missing' can install `install-sh' configure.ac:9: required file `./missing' not found configure.ac:9: `automake --add-missing' can install `missing' configure.ac:8: required file `config.h.in' not found Makefile.am: required file `./depcomp' not found Makefile.am: `automake --add-missing' can install `depcomp'
Next try: compiler@p35:flashrom-autotools> automake --add-missing configure.ac:5: installing `./config.guess' configure.ac:5: installing `./config.sub' configure.ac:9: installing `./install-sh' configure.ac:9: installing `./missing' configure.ac:8: required file `config.h.in' not found Makefile.am: installing `./depcomp' compiler@p35:flashrom-autotools> ./configure checking build system type... i686-suse-linux-gnu checking host system type... i686-suse-linux-gnu checking target system type... i686-suse-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking whether make sets $(MAKE)... (cached) yes checking for dmidecode... /usr/sbin/dmidecode checking DirectIO/darwinio.h usability... no checking DirectIO/darwinio.h presence... no checking for DirectIO/darwinio.h... no checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking asm/sunddi.h usability... no checking asm/sunddi.h presence... no checking for asm/sunddi.h... no checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for inttypes.h... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking machine/cpufunc.h usability... no checking machine/cpufunc.h presence... no checking for machine/cpufunc.h... no checking machine/sysarch.h usability... no checking machine/sysarch.h presence... no checking for machine/sysarch.h... no checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sys/io.h usability... yes checking sys/io.h presence... yes checking for sys/io.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/psw.h usability... no checking sys/psw.h presence... no checking for sys/psw.h... no checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/sysi86.h usability... no checking sys/sysi86.h presence... no checking for sys/sysi86.h... no checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/utsname.h usability... yes checking sys/utsname.h presence... yes checking for sys/utsname.h... yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking for unistd.h... (cached) yes checking for inline... inline checking for off_t... yes checking for size_t... yes checking size of int... 4 checking for ssize_t... yes checking for uint8_t... yes checking for uint16_t... yes checking for uint64_t... yes checking for uint32_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for getpagesize... yes checking for working mmap... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for gethostbyaddr... yes checking for gethostbyname... yes checking for getpagesize... (cached) yes checking for gettimeofday... yes checking for memmove... yes checking for memset... yes checking for munmap... yes checking for socket... yes checking for strcasecmp... yes checking for strchr... yes checking for strcspn... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for strspn... yes checking for strstr... yes checking for strtol... yes checking for strtoul... yes checking for uname... yes checking for pci_alloc in -lpci... yes checking for socket in -lsocket... no checking for usb_init in -lusb... yes checking for main in -lftdi... yes configure: creating ./config.status config.status: error: cannot find input file: `Makefile.in'
This is openSUSE 11.3 i586. autoconf and automake are installed.
Any ideas how to fix this portability problem of autotools or what I'm doing wrong? The autotools branch and fedora-1412 branch in your repository both have that problem.
Regards, Carl-Daniel