LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-10-2007, 09:17 PM   #1
rbautch
LQ Newbie
 
Registered: Jun 2006
Posts: 13

Rep: Reputation: 0
Static awk or gawk binary


I spent a few hours trying to compile a static gawk binary in Red Hat Enterprise (on vmware), before throwing in the towel. Is there someplace I can download a precompiled static binary? Or does anyone have a static copy of awk or gawk? Thanks in advance.

Last edited by rbautch; 06-11-2007 at 10:37 PM.
 
Old 06-11-2007, 12:08 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I'm hoping someone can give you what you want, but in the meantime:

What happened to your attempt to compile a static gawk binary?

The best way to answer that is this:
  1. Run program script.
  2. It will present you with a shell prompt, as usual. Do your best to build the static gawk.
  3. When you have gotten as far as you can, use the exit shell command to get out of script.
  4. Post the entire content of file typescript to this thread.

Then maybe we can see why it failed.
 
Old 06-11-2007, 02:42 PM   #3
rbautch
LQ Newbie
 
Registered: Jun 2006
Posts: 13

Original Poster
Rep: Reputation: 0
I've attached the output of configure and make. Did a little troubleshooting, but anything beyond basic compiling is over my head. Thanks for the help.

edit: I can't post an attachment, so here's the full output.

Code:
# ./configure
loading cache ./config.cache
checking for non-GNU ld... (cached) /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... (cached) gawk
checking whether make sets ${MAKE}... (cached) yes
checking for bison... (cached) bison -y
checking whether ln -s works... (cached) no
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for style of include used by make... GNU
checking dependency style of gcc... (cached) gcc
checking how to run the C preprocessor... (cached) gcc -E
checking for ranlib... (cached) ranlib
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... (cached) yes
checking for special development options... no
checking for AIX... no
checking for strerror in -lcposix... (cached) no
checking for minix/config.h... (cached) no
checking for special C compiler options needed for large files... (cached) no
checking for _FILE_OFFSET_BITS value needed for large files... (cached) 64
checking for _LARGE_FILES value needed for large files... (cached) no
checking for AIX compilation hacks... (cached) no
checking for Linux/Alpha compilation hacks... (cached) no
checking for gcc option to accept ANSI C... (cached) none needed
checking for function prototypes... yes
checking for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking for shared library run path origin... (cached) done
checking host system type... i686-pc-linux-gnu
checking for working const... (cached) yes
checking for inline... (cached) inline
checking for off_t... (cached) yes
checking for size_t... (cached) yes
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... (cached) no
checking whether we are using the GNU C Library 2.1 or newer... (cached) yes
checking for iconv... (cached) yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for msgmerge... (cached) /usr/bin/msgmerge
checking for argz.h... (cached) yes
checking for limits.h... (cached) yes
checking for locale.h... (cached) yes
checking for nl_types.h... (cached) yes
checking for malloc.h... (cached) yes
checking for stddef.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for feof_unlocked... (cached) yes
checking for fgets_unlocked... (cached) yes
checking for getc_unlocked... (cached) yes
checking for getcwd... (cached) yes
checking for getegid... (cached) yes
checking for geteuid... (cached) yes
checking for getgid... (cached) yes
checking for getuid... (cached) yes
checking for mempcpy... (cached) yes
checking for munmap... (cached) yes
checking for putenv... (cached) yes
checking for setenv... (cached) yes
checking for setlocale... (cached) yes
checking for stpcpy... (cached) yes
checking for strcasecmp... (cached) yes
checking for strdup... (cached) yes
checking for strtoul... (cached) yes
checking for tsearch... (cached) yes
checking for __argz_count... (cached) yes
checking for __argz_stringify... (cached) yes
checking for __argz_next... (cached) yes
checking for iconv declaration... (cached) 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... (cached) yes
checking for LC_MESSAGES... (cached) yes
checking for bison... (cached) bison
checking version of bison... 1.875, ok
checking whether NLS is requested... yes
checking whether included gettext is requested... no
checking for GNU gettext in libc... (cached) yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking for fcntl.h... (cached) yes
checking for limits.h... (cached) yes
checking for locale.h... (cached) yes
checking for libintl.h... (cached) yes
checking for mcheck.h... (cached) yes
checking for netdb.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for signum.h... (cached) no
checking for stdarg.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for unistd.h... (cached) yes
checking for wchar.h... (cached) yes
checking for wctype.h... (cached) yes
checking for memory.h... (cached) yes
checking for pid_t... (cached) yes
checking return type of signal handlers... (cached) void
checking for size_t... (cached) yes
checking for uid_t in sys/types.h... (cached) yes
checking type of array argument to getgroups... (cached) gid_t
checking for unistd.h... (cached) yes
checking for ssize_t... (cached) yes
checking for vprintf... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtod... (cached) yes
checking for strtod with C89 semantics... (cached) no
checking for sys/time.h... (cached) yes
checking for unistd.h... (cached) yes
checking for alarm... (cached) yes
checking for working mktime... (cached) yes
checking for fmod in -lm... (cached) yes
checking for getgroups... (cached) yes
checking for memset... (cached) yes
checking for memcpy... (cached) yes
checking for memcmp... (cached) yes
checking for fmod... (cached) yes
checking for setlocale... (cached) yes
checking for strchr... (cached) yes
checking for strerror... (cached) yes
checking for strftime... (cached) yes
checking for strncasecmp... (cached) yes
checking for strtod... (cached) yes
checking for system... (cached) yes
checking for tzset... (cached) yes
checking for mbrlen... (cached) yes
checking for mbrtowc... (cached) yes
checking for dlfcn.h... (cached) yes
checking for dlopen in -ldl... (cached) yes
checking whether getpgrp takes no argument... (cached) yes
checking for gethostbyname... (cached) yes
checking for connect... (cached) yes
checking where to find the socket library calls... the standard library
checking for st_blksize in struct stat... (cached) yes
checking whether time.h and sys/time.h may both be included... (cached) yes
checking whether struct tm is in sys/time.h or time.h... (cached) time.h
checking for tm_zone in struct tm... (cached) yes
checking whether char is unsigned... (cached) no
checking for working const... (cached) yes
checking for inline... (cached) inline
checking for preprocessor stringizing operator... (cached) yes
creating ./config.status
creating Makefile
creating awklib/Makefile
creating doc/Makefile
creating intl/Makefile
creating po/Makefile.in
creating test/Makefile
creating config.h
config.h is unchanged
creating po/POTFILES
creating po/Makefile
Code:
# make CC="gcc -static"
make 'CFLAGS=-g -O2' 'LDFLAGS=-rdynamic' all-recursive
make[1]: Entering directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1'
Making all in intl
make[2]: Entering directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1/intl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1/intl'
Making all in .
make[2]: Entering directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1'
source='array.c' object='array.o' libtool=no \
depfile='.deps/array.Po' tmpdepfile='.deps/array.TPo' \
depmode=gcc /bin/sh ./depcomp \
gcc -static -DDEFPATH="\".:/usr/local/share/awk\"" -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"/usr/local/share/locale\"" -I. -I. -I. -I./intl    -g -O2 -c `test -f array.c || echo './'`array.c
In file included from awk.h:68,
                 from array.c:40:
/usr/lib/gcc/i386-redhat-linux/3.4.4/include/varargs.h:4:2: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/i386-redhat-linux/3.4.4/include/varargs.h:5:2: #error "Revise your code to use <stdarg.h>."
In file included from awk.h:152,
                 from array.c:40:
protos.h:125: error: syntax error before "sprintf"
protos.h:125: warning: data definition has no type or storage class
In file included from array.c:40:
awk.h:198: error: syntax error before "lose"
awk.h:209: error: syntax error before "extern"
In file included from array.c:40:
awk.h:946: error: syntax error before "catchsig"
awk.h:946: warning: data definition has no type or storage class
make[2]: *** [array.o] Error 1
make[2]: Leaving directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/hgfs/russ shared vmware folder/awk/gawk-3.1.1'
make: *** [all] Error 2

Last edited by rbautch; 06-12-2007 at 06:30 PM.
 
Old 06-12-2007, 08:28 AM   #4
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I'm really puzzled by why it blew up as it did. And the following suggestion is pure guesswork.

Instead of:

Code:
make CC="gg -static"
try:

Code:
make LDFLAGS="-static"
or:

Code:
make LDFLAGS="-rstatic"

Last edited by wjevans_7d1@yahoo.co; 06-12-2007 at 08:36 AM.
 
Old 06-12-2007, 09:26 PM   #5
rbautch
LQ Newbie
 
Registered: Jun 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Smile

Turned out to be an issue with vmware that caused the problems compiling. I was in a "shared" directory that is used to transfer files between operating systems, and gawk didn't like that. When I moved it to /usr/local it compiled fine. Thanks anyway for the helpful suggestions.
 
Old 06-14-2011, 01:41 AM   #6
ianll
LQ Newbie
 
Registered: Jan 2011
Posts: 18

Rep: Reputation: 2
I'm having a similar problem. I'm not using VMWare though.

When I do make LDFLAGS="-static", I get the following output:
Code:
make 'CFLAGS=-g -O2' 'LDFLAGS=-static' all-recursive
make[1]: Entering directory `/home/ian/devel/gawk-3.1.8'
Making all in .
make[2]: Entering directory `/home/ian/devel/gawk-3.1.8'
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/u
sr/local/share/locale"' -I.     -g -O2 -MT array.o -MD -MP -MF .deps/array.Tpo -
c -o array.o array.c
mv -f .deps/array.Tpo .deps/array.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/u
sr/local/share/locale"' -I.     -g -O2 -MT awkgram.o -MD -MP -MF .deps/awkgram.T
po -c -o awkgram.o awkgram.c
mv -f .deps/awkgram.Tpo .deps/awkgram.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/u
sr/local/share/locale"' -I.     -g -O2 -MT builtin.o -MD -MP -MF .deps/builtin.T
po -c -o builtin.o builtin.c
mv -f .deps/builtin.Tpo .deps/builtin.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/u
sr/local/share/locale"' -I.     -g -O2 -MT dfa.o -MD -MP -MF .deps/dfa.Tpo -c -o
 dfa.o dfa.c
mv -f .deps/dfa.Tpo .deps/dfa.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/u
sr/local/share/locale"' -I.     -g -O2 -MT ext.o -MD -MP -MF .deps/ext.Tpo -c -o
 ext.o ext.c
mv -f .deps/ext.Tpo .deps/ext.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT field.o -MD -MP -MF .deps/field.Tpo -c -o field.o field.c
mv -f .deps/field.Tpo .deps/field.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT floatcomp.o -MD -MP -MF .deps/floatcomp.Tpo -c -o floatcomp.o floatcomp.c
mv -f .deps/floatcomp.Tpo .deps/floatcomp.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT gawkmisc.o -MD -MP -MF .deps/gawkmisc.Tpo -c -o gawkmisc.o gawkmisc.c
mv -f .deps/gawkmisc.Tpo .deps/gawkmisc.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT getopt.o -MD -MP -MF .deps/getopt.Tpo -c -o getopt.o getopt.c
mv -f .deps/getopt.Tpo .deps/getopt.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT getopt1.o -MD -MP -MF .deps/getopt1.Tpo -c -o getopt1.o getopt1.c
mv -f .deps/getopt1.Tpo .deps/getopt1.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT io.o -MD -MP -MF .deps/io.Tpo -c -o io.o io.c
mv -f .deps/io.Tpo .deps/io.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
mv -f .deps/main.Tpo .deps/main.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT msg.o -MD -MP -MF .deps/msg.Tpo -c -o msg.o msg.c
mv -f .deps/msg.Tpo .deps/msg.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT node.o -MD -MP -MF .deps/node.Tpo -c -o node.o node.c
mv -f .deps/node.Tpo .deps/node.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT random.o -MD -MP -MF .deps/random.Tpo -c -o random.o random.c
mv -f .deps/random.Tpo .deps/random.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT re.o -MD -MP -MF .deps/re.Tpo -c -o re.o re.c
mv -f .deps/re.Tpo .deps/re.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT regex.o -MD -MP -MF .deps/regex.Tpo -c -o regex.o regex.c
mv -f .deps/regex.Tpo .deps/regex.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT replace.o -MD -MP -MF .deps/replace.Tpo -c -o replace.o replace.c
mv -f .deps/replace.Tpo .deps/replace.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT version.o -MD -MP -MF .deps/version.Tpo -c -o version.o version.c
mv -f .deps/version.Tpo .deps/version.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT eval.o -MD -MP -MF .deps/eval.Tpo -c -o eval.o eval.c
mv -f .deps/eval.Tpo .deps/eval.Po
gcc -DDEFPATH='".:/usr/local/share/awk"' -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"' -I.     -g -O2 -MT profile.o -MD -MP -MF .deps/profile.Tpo -c -o profile.o profile.c
mv -f .deps/profile.Tpo .deps/profile.Po
gcc  -g -O2  -static -o gawk array.o awkgram.o builtin.o dfa.o ext.o field.o floatcomp.o gawkmisc.o getopt.o getopt1.o io.o main.o msg.o node.o random.o re.o regex.o replace.o version.o eval.o profile.o    -ldl -lm -lm 
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[2]: *** [gawk] Error 1
make[2]: Leaving directory `/home/ian/devel/gawk-3.1.8'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ian/devel/gawk-3.1.8'
make: *** [all] Error 2
Any help with this would be great!

ianll
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Get started coding with GAWK and AWK LXer Syndicated Linux News 0 09-26-2006 02:54 PM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 09:19 AM
Binary -- static or dynamic ? swiadek Linux - General 2 02-11-2006 04:25 PM
Deleting a line with gawk/awk caps_phisto Linux - General 4 11-06-2004 02:31 PM
awk/gawk handling of "delete" ? realos Programming 1 06-26-2003 09:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration