"undefined reference to `wildexp'" when compiling in mingw

keldzh <[email protected]> Sat, 9 Aug 2014 23:52:23 +0400
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <CAJyg2-zJfbS8OUN_xR3N8=Jf1kbmuqCfifc4tDvOBErwa1tT8A@mail.gmail.com>
Hello
I tried to install indent-2.2.10 from source on my computer with MS Windows
8 system with MinGW32 the usual way:
./configure --prefix=/mingw
make
make install
But I got the error:
gcc  -g -O2   -o indent.exe indent.o args.o backup.o comments.o lexi.o
parse.o globs.o code_io.o output.o utils.o /mingw/lib/libintl.a
-L/mingw/lib /mingw/lib/libiconv.a /mingw/lib/libintl.a -L/mingw/lib
/mingw/lib/libiconv.a
indent.o: In function `main':
c:\Users\keldz_000\Documents\Coding\indent-2.2.10\src/indent.c:3303:
undefined reference to `wildexp'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [indent.exe] Error 1
I didn't see another option how to install this progrum under MinGW32 with
Makefile in the folder miscel. And I made some changes to the files
configure.ac and src/Makefile.am, which helped me to compile and install
this program.
I think this is a more correct way to install program than additional
Makefles. Therefore I attach to this letter patch-file with my changes.

Anton Kovalyov <[email protected]>

_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent
indent-2.2.10_mingw32.patch (application/octet-stream, 1.7 KB)
diff -cr indent-2.2.10//configure.ac Coding/indent-2.2.10//configure.ac
*** indent-2.2.10//configure.ac	Tue Mar 11 22:50:42 2008
--- Coding/indent-2.2.10//configure.ac	Sat Aug  9 23:18:30 2014
***************
*** 37,42 ****
--- 37,49 ----
  AM_GNU_GETTEXT
  AM_GNU_GETTEXT_VERSION(0.11.5)
  
+ dnl Check for compiling under mingw
+ case $host in
+ 	*mingw32*) WILDEXP='wildexp.$(OBJEXT)' ;;
+ 	*) WILDEXP='' ;;
+ esac
+ AC_SUBST([WILDEXP])
+ 
  AH_TEMPLATE(HAVE_LC_MESSAGES)
  AH_TEMPLATE(ENABLE_NLS)
  AH_TEMPLATE(HAVE_GETTEXT)
diff -cr indent-2.2.10//src/Makefile.am Coding/indent-2.2.10//src/Makefile.am
*** indent-2.2.10//src/Makefile.am	Tue Mar 11 22:50:42 2008
--- Coding/indent-2.2.10//src/Makefile.am	Sat Aug  9 23:14:12 2014
***************
*** 2,10 ****
  
  bin_PROGRAMS = indent
  indent_SOURCES = indent.c args.c backup.c comments.c lexi.c parse.c globs.c code_io.c output.c utils.c
  noinst_HEADERS = indent.h args.h backup.h comments.h lexi.h parse.h globs.h code_io.h output.h utils.h sys.h libgettext.h
! indent_LDADD =  $(INTLLIBS)
! EXTRA_DIST = @[email protected] @[email protected] wildexp.c gperf.c gperf-cc.c \
  	     @[email protected] \
  	     config.h.vc++ \
  	     config.h.vms
--- 2,12 ----
  
  bin_PROGRAMS = indent
  indent_SOURCES = indent.c args.c backup.c comments.c lexi.c parse.c globs.c code_io.c output.c utils.c
+ EXTRA_indent_SOURCES = wildexp.c
  noinst_HEADERS = indent.h args.h backup.h comments.h lexi.h parse.h globs.h code_io.h output.h utils.h sys.h libgettext.h
! indent_LDADD =  $(INTLLIBS) $(WILDEXP)
! indent_DEPENDENCIES = $(WILDEXP)
! EXTRA_DIST = @[email protected] @[email protected] gperf.c gperf-cc.c \
  	     @[email protected] \
  	     config.h.vc++ \
  	     config.h.vms