Manually link two targets - makefile

I am trying to convert a (sloppy) Makefile into a CMakeLists.txt to better work with my IDE (CLion).
My Makefile is as follows:
all:
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot0.o boot/boot0/boot0.S
ld -nostdlib -m elf_i386 -N -e start -Ttext 0x7c00 -o bin/boot0.elf bin/boot0.o
objcopy -S -O binary bin/boot0.elf bin/boot0
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1.o boot/boot1/boot1.S
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1main.o boot/boot1/boot1main.c
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1lib.o boot/boot1/boot1lib.c
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/exec_kernel.o boot/boot1/exec_kernel.S
ld -nostdlib -m elf_i386 -N -e start -Ttext 0xd7000 -o bin/boot1.elf bin/boot1.o bin/boot1main.o bin/boot1lib.o bin/exec_kernel.o
objcopy -S -O binary bin/boot1.elf bin/boot1
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -D_KERN_ -Ikern -Ikern/kern -I. -m32 -O0 -c -o bin/entry.o kern/init/entry.S
ld -o kernel -nostdlib -e start -m elf_i386 -Ttext=0x00100000 bin/entry.o -b binary
dd if=/dev/zero of=project0.img bs=512 count=256
parted -s project0.img "mktable msdos mkpart primary 63s -1s set 1 boot on"
dd if=bin/boot0 of=project0.img bs=446 count=1 conv=notrunc
dd if=bin/boo1 of=project0.img bs=512 count=62 seek=1 conv=notrunc
dd if=kern/init/kernel of=project0.img bs=512 seek=63 conv=notrunc
Mostly I am using make just to run the commands.
I am running into trouble with the fact that I have three different sets of linker flags (one each for boot0, boot1, and kern.)
Should I create separate CMakeLists.txt in each subdirectory (boot0, boot1, and kern) and then have a main one that runs each in turn and then handles the dd and parted usage, is there a better way to do this, or is CMake not an appropriate tool here?

Please have short-cuts for the compiler commands first. Then write the rule to create the first target on which the second target is dependent. Then since the first target is created; now use it to create the second target.

Related

Building a Window exe using MinGW, Windows-7 in virtual machine

I'm working in Windows 7, 64 bit, running in a Virtual Box machine on a (recent-ish) Mac with Intel processor.
I have MinGW installed:
gcc -dumpmachine
>>> x86_64-w64-mingw32
I am trying to compile a Windows exe for this code (Landsat-8 routines for solar and satellite angle calculations):
gcc -I ias_lib -o l8_angle.exe -c l8_angle.c
which gives me no errors or warnings when run, and creates l8_angle.exe as expected. When opened, the exe gives:
The version of this file is not compatible with the version of Windows
you're running. Check your computer's system information to see
whether you need an x86 (32-bit) for x64 (64-bit) version of the
program, and then contact the software publisher.
Is it possible to compile this program on my setup?
If you're wondering I can run make on the Mac OS side to get a Linux executable, but I need a Windows executable for my production machine.
I was able to compile successully by echoing the gcc statements in both makefiles:
#echo $(value INCS)
which for some reasom prints the completely assembled gcc command. I then confirmed what the selected flags did and saw that they were all equally appropriate for a Windows build.
The build commands were then:
cd ias_lib
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_calculate_angles_rpc.c -o ias_angle_gen_calculate_angles_rpc.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_read_ang.c -o ias_angle_gen_read_ang.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_utilities.c -o ias_angle_gen_utilities.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_initialize.c -o ias_angle_gen_initialize.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_write_image.c -o ias_angle_gen_write_image.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_find_scas.c -o ias_angle_gen_find_scas.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_geo_convert_dms2deg.c -o ias_geo_convert_dms2deg.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_unit_vector.c -o ias_math_compute_unit_vector.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_vector_length.c -o ias_math_compute_vector_length.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_find_line_segment_intersection.c -o ias_math_find_line_segment_intersection.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_logging.c -o ias_logging.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_create_output_image_trim_lut.c -o ias_misc_create_output_image_trim_lut.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_convert_to_uppercase.c -o ias_misc_convert_to_uppercase.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_write_envi_header.c -o ias_misc_write_envi_header.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_free_tree.c -o ias_odl_free_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_get_field.c -o ias_odl_get_field.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_read_tree.c -o ias_odl_read_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_provide_help.c -o ias_parm_provide_help.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_read.c -o ias_parm_read.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_map_odl_type.c -o ias_parm_map_odl_type.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_check_ranges.c -o ias_parm_check_ranges.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_satellite_attributes.c -o ias_satellite_attributes.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c landsat8.c -o landsat8.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c lablib3.c -o lablib3.o
ar -r libl8ang.a ias_angle_gen_calculate_angles_rpc.o ias_angle_gen_read_ang.o ias_angle_gen_utilities.o ias_angle_gen_initialize.o ias_angle_gen_write_image.o ias_angle_gen_find_scas.o ias_geo_convert_dms2deg.o ias_math_compute_unit_vector.o ias_math_compute_vector_length.o ias_math_find_line_segment_intersection.o ias_logging.o ias_misc_create_output_image_trim_lut.o ias_misc_convert_to_uppercase.o ias_misc_write_envi_header.o ias_odl_free_tree.o ias_odl_get_field.o ias_odl_read_tree.o ias_parm_provide_help.o ias_parm_read.o ias_parm_map_odl_type.o ias_parm_check_ranges.o ias_satellite_attributes.o landsat8.o lablib3.o
cd ..
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o l8_angles.o l8_angles.c
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o angles_api.o angles_api.c
gcc -g -Wall -O2 -I./ias_lib/ -I./ -o l8_angles.exe ias_lib/libl8ang.a l8_angles.o angles_api.o -L./ias_lib/ -ll8ang -lm
where the only change was in the final line, l8_angles.exe rather than l8_angles. If anyone has a more straightforward way, I would love to see it.

How to create makefile for compiling multiple programs

I have some problems with creating makefile. I have tried to compile some files from terminal and found right options for gcc to do this.
But I have some troubles with creating one makefile to do all this tasks.
Here are my commands that work.
gcc -c pstree.c -DHAVE_CONFIG_H -I.
gcc -o hello pstree.o -L/usr/lib/ -ltinfo
gcc -c fuser.c -DHAVE_CONFIG_H -I.
gcc -c -o libsignals.a signals.c
gcc -o hello fuser.o -L/usr/lib/ -L. -lsignals
gcc -c -o libsignals.a signals.c
gcc -o hello killall.o -L/usr/lib/ -L. -lsignals
gcc -c killall.c -DHAVE_CONFIG_H -I.
How can I make a Makefile for executing these commands?
killall: hello\ fuser.o
gcc -c -o libsignals.a signals.c
gcc -o hello killall.o -L/usr/lib/ -L. -lsignals
gcc -c killall.c -DHAVE_CONFIG_H -I.
fuser: hello\ pstree.o
gcc -c fuser.c -DHAVE_CONFIG_H -I.
gcc -c -o libsignals.a signals.c
gcc -o hello\ fuser.o -L/usr/lib/ -L. -lsignals
pstree:
gcc -c pstree.c -DHAVE_CONFIG_H -I.
gcc -o hello\ pstree.o -L/usr/lib/ -ltinfo
clean:
rm -rf *.o
I wrote very very dirty you can define cc variable such as:
CC = gcc
CFLAGS = -g -Wall -I.
LIBS = -L/usr/lib/ -lsignals
and so on.....
Mine is very dirty ....
NOTE: Before each line of intending you have to use TAB, not space.
usage :
make clean
make killall

User of autotools-generated tarball gets error message: aclocal-1.13: command not found

I am distributing a tarball with installation scripts generated by autoconf version 2.69. Works fine on many different machines. Now a user, working on a fresh Arch Linux system, reports that configure executes properly, but make immediately terminates with the following error message:
/home/user/project/build-aux/missing: line 81: aclocal-1.13: command not found
WARNING: 'aclocal-1.13' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
There is no acinclude.m4 in the project directory. The user assures that he has not modified aclocal.m4, configure.ac, files in m4/, or anything else in the project.
The error message makes no sense for me: as I understand, aclocal is executed when I run autoreconf -if; it generates a file aclocal.m4 that is part of the tarball I distribute; there is no reason why a user's make command should request aclocal.
The user further reports that he can solve the problem for himself by running aclocal. However, that is not a clean solution: packagers are not supposed to request their users to have autotools installed, right?
For completeness, I attach the full configure.ac: is there anything wrong?
################################################################################
## FRIDA: fast reliable interactive data analysis ##
## configure.ac: used by 'autoreconf -i' to prepare for 'configure' ##
## (C) Joachim Wuttke, Sebastian Busch 2008- ##
## http://apps.jcns.fz-juelich.de/frida ##
################################################################################
################################################################################
## Generic initialization ##
################################################################################
AC_INIT([frida],[post-2.1.8c],[j.wuttke#fz-juelich.de])
# ^^^^^ delete "post-" for public releases
# project name must be "frida"; this determines the installation directories
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign]) # don't insert GNU blala files
################################################################################
## Select compiler and preprocessors ##
################################################################################
AC_PROG_CXX
AC_LANG(C++)
AX_CXX_COMPILE_STDCXX_11 # provided in directory m4
AC_SUBST(AM_CXXFLAGS,"-g -pedantic -Wall -Wno-sign-compare -Wno-unused-result -Werror")
# for valgrind --leak-check=full frida, use -O0 -fno-inline
# source files that use -D settings must #include "../config.h"
AC_CONFIG_HEADERS([config.h]) # also needed to prevent endless -D option lists
AC_PROG_LEX # LEX,LEXLIB = "flex","-lfl" or "lex","-ll"
if test "$LEX" = :; then
AC_MSG_ERROR([Cannot find lex. Aborting.])
fi
AC_PROG_YACC # YACC = "bison -y" or "byacc" or "yacc"
if test "$YACC" = "yacc"; then
AC_MSG_ERROR([Cannot find yacc. Aborting.])
fi
## I put this one here only because qmake does: Make sure off_t is 64-bit in *nix, taken from http://www.google.com/search?q=cache:wlNJ8Qe4dBgJ:www.sfr-fresh.com/unix/privat/libfb-v0.18.4b-src.zip:a/src/rtlib/configure.ac+configure.ac+file+offset+bits&hl=de&ct=clnk&cd=5&gl=de&client=firefox-a
AC_DEFINE([_FILE_OFFSET_BITS],64,[File offset bits])
################################################################################
## Check for headers, defs needed at compile time ##
################################################################################
# Consistency check: is source code present?
AC_CONFIG_SRCDIR([src/frida2.cpp])
AC_CONFIG_SRCDIR([man/frida.pod])
# Checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_HEADER_STDBOOL
AC_HEADER_STDC
# Checks for standard includes
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_MKTIME
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([gettimeofday],,AC_MSG_ERROR([Cannot find gettimeofday.]))
AC_CHECK_FUNCS([memset], ,AC_MSG_ERROR([Cannot find memset.]))
AC_CHECK_FUNCS([mkfifo], ,AC_MSG_ERROR([Cannot find mkfifo.]))
AC_CHECK_FUNCS([strchr], ,AC_MSG_ERROR([Cannot find strchr.]))
AC_CHECK_HEADERS([fcntl.h], ,AC_MSG_ERROR([Cannot find fcntl.h.]))
AC_CHECK_HEADERS([math.h], ,AC_MSG_ERROR([Cannot find math.h.]))
# The following headers are needed for code produced by lexx and yacc
AC_CHECK_HEADERS([inttypes.h], ,AC_MSG_ERROR([Cannot find inttypes.h.]))
AC_CHECK_HEADERS([libintl.h], ,AC_MSG_ERROR([Cannot find libintl.h.]))
AC_CHECK_HEADERS([malloc.h], ,AC_MSG_ERROR([Cannot find malloc.h.]))
AC_CHECK_HEADERS([unistd.h], ,AC_MSG_ERROR([Cannot find unistd.h.]))
AC_CHECK_HEADERS([stddef.h], ,AC_MSG_ERROR([Cannot find stddef.h.]))
# Non-standard includes
AC_CHECK_HEADERS([gsl/gsl_rng.h gsl/gsl_randist.h gsl/gsl_math.h \
gsl/gsl_errno.h gsl/gsl_integration.h gsl/gsl_roots.h \
gsl/gsl_sf.h gsl/gsl_sf_debye.h],,
AC_MSG_ERROR([Cannot find required gsl headers.]))
# C includes of our own
AC_CHECK_HEADERS([kww.h],, AC_MSG_ERROR([Cannot find kww.h.]))
AC_CHECK_HEADERS([cerf.h],, AC_MSG_ERROR([Cannot find cerf.h.]))
# C++ includes of our own
AC_TRY_CPP([#include<boost/format.hpp>],,
AC_MSG_ERROR([Cannot find boost/format.hpp.]))
AC_TRY_CPP([#include<boost/shared_ptr.hpp>],,
AC_MSG_ERROR([Cannot find boost/shared_ptr.hpp.]))
AC_TRY_CPP([#include<trivia/file_ops.hpp>],,
AC_MSG_ERROR([Cannot find trivia/file_ops.hpp.]))
AC_TRY_CPP([#include<readplus/readln.hpp>],,
AC_MSG_ERROR([Cannot find readplus/readln.hpp.]))
AC_TRY_CPP([#include<yamlfreeze/yaml.hpp>],,
AC_MSG_ERROR([Cannot find yamlfreeze/yaml.hpp.]))
################################################################################
## Check for libraries, needed at link time ##
################################################################################
# From standard packages
AC_SEARCH_LIBS([cos], [m],, [AC_MSG_ERROR(libm not found or corrupted)])
AC_SEARCH_LIBS([cblas_dgemm], [gslcblas],,
[AC_MSG_ERROR(libgslcblas not found or out of sync)])
AC_SEARCH_LIBS([gsl_blas_dgemm], [gsl],,
[AC_MSG_ERROR(libgsl not found or out of sync)])
AC_SEARCH_LIBS([fftw_plan_r2r_1d], [fftw3],,
[AC_MSG_ERROR(libfftw not found or out of sync)])
AC_SEARCH_LIBS([rl_completion_matches], [readline],,
[AC_MSG_ERROR(libreadline not found or corrupted)])
# From our own C packages
AC_CHECK_LIB([lmfit], [lmmin], ,
[AC_MSG_ERROR(liblmfit not found or out of sync)])
AC_CHECK_LIB([kww], [kwwp], ,
[AC_MSG_ERROR(libkww not found or out of sync)])
AC_CHECK_LIB([cerf], [voigt], ,
[AC_MSG_ERROR(libcerf not found or out of sync)])
# From our own C++ packages (why checking for main? how else?)
AC_CHECK_LIB([trivia], [main], ,
[AC_MSG_ERROR(libtrivia not found or out of sync)])
AC_CHECK_LIB([readplus], [main],,
[AC_MSG_ERROR(library readplus not found)])
AC_CHECK_LIB([yamlfreeze], [main],,
[AC_MSG_ERROR(library yamlfreeze not found)])
################################################################################
## Check for facilities needed at run time ##
################################################################################
AC_CHECK_PROGS([GNUPLOT], [gnuplot], [:])
if test "$GNUPLOT" = :; then
AC_MSG_ERROR([Cannot find gnuplot. Aborting.])
fi
################################################################################
## make Makefiles ##
################################################################################
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile share/Makefile])
AC_OUTPUT
Could the problem be due to the presence of files that do not belong in a tarball? Here the contents of the tgz archive, except for the source files themselves:
frida2.1.8c/aclocal.m4
frida2.1.8c/build-aux/
frida2.1.8c/build-aux/depcomp
frida2.1.8c/build-aux/ylwrap
frida2.1.8c/build-aux/ltmain.sh
frida2.1.8c/build-aux/missing
frida2.1.8c/build-aux/install-sh
frida2.1.8c/build-aux/config.guess
frida2.1.8c/build-aux/config.sub
frida2.1.8c/CHANGELOG
frida2.1.8c/config.h.in
frida2.1.8c/configure
frida2.1.8c/configure.ac
frida2.1.8c/COPYING
frida2.1.8c/INSTALL
frida2.1.8c/m4/
frida2.1.8c/m4/libtool.m4
frida2.1.8c/m4/m4_ax_boost_regex.m4
frida2.1.8c/m4/ltversion.m4
frida2.1.8c/m4/ltoptions.m4
frida2.1.8c/m4/lt~obsolete.m4
frida2.1.8c/m4/m4_ax_boost_base.m4
frida2.1.8c/m4/ax_cxx_compile_stdcxx_11.m4
frida2.1.8c/m4/ltsugar.m4
frida2.1.8c/Makefile.am
frida2.1.8c/Makefile.in
frida2.1.8c/man/
...
frida2.1.8c/share/
...
frida2.1.8c/src/
...
frida2.1.8c/test/
...
Ok, so I had this exact problem too, it was driving me nuts. The issue seems to be that I was doing an svn export of the source code to make my src tarball.
Now that is fine, but correct me if I am wrong, but I think svn only commits files that have been modified, not touched. This means that when you come to check out the files using an svn export the files can be chronologically in the wrong order, even though files like:
configure.ac aclocal.m4 configure Makefile.am Makefile.in
Have all been touched recently, svn's date stamps wont be updated; so when you come to release the source package, the dates are in the wrong order and the configure stage will fail (not too obviously).
After doing svn export, remember always to touch these files before the src is bundled into a tar.gz using the commands:
svn export <repo address>
cd <repo name>
touch configure.ac aclocal.m4 configure Makefile.am Makefile.in
Otherwise, the user will be forced to either touch the files themselves:
touch configure.ac aclocal.m4 configure Makefile.am Makefile.in
./configure
make
or run:
autoreconf
./configure
automake
make
which will retouch these files, instead of just:
./configure
make
Which is much easier for the end user.
make -d gave a clue:
Considering target file `aclocal.m4'.
Pruning file `m4/ax_cxx_compile_stdcxx_11.m4'.
Pruning file `configure.ac'.
Finished prerequisites of target file `aclocal.m4'.
Prerequisite `m4/ax_cxx_compile_stdcxx_11.m4' is older than target `aclocal.m4'.
Prerequisite `configure.ac' is newer than target `aclocal.m4'.
Must remake target `aclocal.m4'.
Somehow the timestamps got confused, which activated the "rebuild rules". Since this happens again and again, I finally opted for
AM_MAINTAINER_MODE([disable])
in configure.ac. I read that the author of this macro got convinced it was a bad idea, but for me it seems to work fine. Clear separation of tasks: The maintainer has to run autoreconf whenever configure.ac or a Makefile.am has changed. The end user should neither need nor be induced to regenerate configure.
Running
autoreconf -vfi
in the directory where the configure file is located (in my case: /source/evtest/evtest-1.31/) worked for me for a missing aclocal-1.13 due to a too new version (aclocal-1.14).
To resolve, run aclocal, then automake in the top level directory before calling make. This will rebuild the makefiles using the installed version of autotools.
Before the actual build, do
touch aclocal.mk
This will not help in all cases for building software but it sure helps in Jenkins jobs and Rpm build scripts.
Background: in the last autoreconf run the tool has discovered that an add-on macro was updated, so it copied ax_cxx_compile_stdcxx_11.m4 from /usr/share/aclocal/ to ./m4. It did also rebuild the ./aclocal.m4 however that did not introduce a real change. So on the next commit only the ./m4/xxmacro.m4 macro is being sent to the central repository, and on the next versioncontrol-update in a different location you end up with a newer (updated) .m4/xxmacro.m4 than ./aclocal.m4 (not updated). This may even get packaged into a tarball. As Joachim Wuttke has pointed out above, the differences in timestamps triggers the rebuild. And you can avoid the different timestamps by touching aclocal.m4 which defeats the bad assumptions from automake.
I had to recompile exact version to fix the problem. I it was ruining my custom nginx compilation. You can see the fix here
or here's the script itself. 1.5 exactly was very important for OpenSSL and Lua compilation
#!/bin/bash
# run as root only
if [[ $EUID -ne 0 ]] ; then
echo -e "\e[1;39m[ \e[31mError\e[39m ] need root access to run this script\e[0;39m"
exit 1
fi
function install_automake() {
[ $# -eq 0 ] && { run_error "Usage: install_automake <version>"; exit; }
local VERSION=${1}
wget ftp://ftp.gnu.org/gnu/automake/automake-${VERSION}.tar.gz &> /dev/null
if [ -f "automake-${VERSION}.tar.gz" ]; then
tar -xzf automake-${VERSION}.tar.gz
cd automake-${VERSION}/
./configure
make && make install
echo -e "\e[1;39m[ \e[1;32mOK\e[39m ] automake-${VERSION} installed\e[0;39m"
else
echo -e "\e[1;39m[ \e[31mError\e[39m ] cannot fetch file from ftp://ftp.gnu.org/gnu/automake/ \e[0;39m"
exit 1
fi
}
install_automake 1.15
I was facing the same issue
WARNING: 'aclocal-1.14' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
For me this issue was due to same source file I was using same source file to install on another server.
Once I have deleted the old one and extracted the tar file once again on another server the issue got resolved.
I was able to install the Htop command from command line.
PFB for your refrence....
[root#client samba_share]# ls
htop-2.0.2 htop-2.0.2.tar.gz
[root#client samba_share]# rm htop-2.0.2
rm: cannot remove `htop-2.0.2': Is a directory
[root#client samba_share]# rm -rf htop-2.0.2
[root#client samba_share]# ls
htop-2.0.2.tar.gz
[root#client samba_share]# tar -xvf htop-2.0.2.tar.gz
[root#client samba_share]# cd htop-2.0.2
[root#client htop-2.0.2]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-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 whether make supports nested variables... yes
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 whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o fil`enter code here`e.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library `paths` into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ceil in -lm... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking whether closedir returns void... no
checking return type of signal handlers... void
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for memmove... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strdup... yes
checking whether gcc -std=c99 option works... yes
checking if compiler supports -Wextra... yes
checking for addnwstr in -lncursesw... yes
checking ncursesw/curses.h usability... yes
checking ncursesw/curses.h presence... yes
checking for ncursesw/curses.h... yes
checking for usable sched_setaffinity... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating htop.1
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[root#client htop-2.0.2]# make
make all-am
make[1]: Entering directory `/root/samba_share/htop-2.0.2'
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-AvailableMetersPanel.o -MD -MP -MF .deps/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo './'`AvailableMetersPanel.c
mv -f .deps/htop-AvailableMetersPanel.Tpo .deps/htop-AvailableMetersPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-CategoriesPanel.o -MD -MP -MF .deps/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo './'`CategoriesPanel.c
mv -f .deps/htop-CategoriesPanel.Tpo .deps/htop-CategoriesPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-CheckItem.o -MD -MP -MF .deps/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo './'`CheckItem.c
mv -f .deps/htop-CheckItem.Tpo .deps/htop-CheckItem.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ClockMeter.o -MD -MP -MF .deps/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo './'`ClockMeter.c
mv -f .deps/htop-ClockMeter.Tpo .deps/htop-ClockMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ColorsPanel.o -MD -MP -MF .deps/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo './'`ColorsPanel.c
mv -f .deps/htop-ColorsPanel.Tpo .deps/htop-ColorsPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ColumnsPanel.o -MD -MP -MF .deps/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo './'`ColumnsPanel.c
mv -f .deps/htop-ColumnsPanel.Tpo .deps/htop-ColumnsPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-CPUMeter.o -MD -MP -MF .deps/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo './'`CPUMeter.c
mv -f .deps/htop-CPUMeter.Tpo .deps/htop-CPUMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-CRT.o -MD -MP -MF .deps/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo './'`CRT.c
mv -f .deps/htop-CRT.Tpo .deps/htop-CRT.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-MainPanel.o -MD -MP -MF .deps/htop-MainPanel.Tpo -c -o htop-MainPanel.o `test -f 'MainPanel.c' || echo './'`MainPanel.c
mv -f .deps/htop-MainPanel.Tpo .deps/htop-MainPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-DisplayOptionsPanel.o -MD -MP -MF .deps/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo './'`DisplayOptionsPanel.c
mv -f .deps/htop-DisplayOptionsPanel.Tpo .deps/htop-DisplayOptionsPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-FunctionBar.o -MD -MP -MF .deps/htop-FunctionBar.Tpo -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo './'`FunctionBar.c
mv -f .deps/htop-FunctionBar.Tpo .deps/htop-FunctionBar.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Hashtable.o -MD -MP -MF .deps/htop-Hashtable.Tpo -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo './'`Hashtable.c
mv -f .deps/htop-Hashtable.Tpo .deps/htop-Hashtable.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Header.o -MD -MP -MF .deps/htop-Header.Tpo -c -o htop-Header.o `test -f 'Header.c' || echo './'`Header.c
mv -f .deps/htop-Header.Tpo .deps/htop-Header.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-htop.o -MD -MP -MF .deps/htop-htop.Tpo -c -o htop-htop.o `test -f 'htop.c' || echo './'`htop.c
mv -f .deps/htop-htop.Tpo .deps/htop-htop.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ListItem.o -MD -MP -MF .deps/htop-ListItem.Tpo -c -o htop-ListItem.o `test -f 'ListItem.c' || echo './'`ListItem.c
mv -f .deps/htop-ListItem.Tpo .deps/htop-ListItem.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-LoadAverageMeter.o -MD -MP -MF .deps/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo './'`LoadAverageMeter.c
mv -f .deps/htop-LoadAverageMeter.Tpo .deps/htop-LoadAverageMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-MemoryMeter.o -MD -MP -MF .deps/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo './'`MemoryMeter.c
mv -f .deps/htop-MemoryMeter.Tpo .deps/htop-MemoryMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Meter.o -MD -MP -MF .deps/htop-Meter.Tpo -c -o htop-Meter.o `test -f 'Meter.c' || echo './'`Meter.c
mv -f .deps/htop-Meter.Tpo .deps/htop-Meter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-MetersPanel.o -MD -MP -MF .deps/htop-MetersPanel.Tpo -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo './'`MetersPanel.c
mv -f .deps/htop-MetersPanel.Tpo .deps/htop-MetersPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Object.o -MD -MP -MF .deps/htop-Object.Tpo -c -o htop-Object.o `test -f 'Object.c' || echo './'`Object.c
mv -f .deps/htop-Object.Tpo .deps/htop-Object.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Panel.o -MD -MP -MF .deps/htop-Panel.Tpo -c -o htop-Panel.o `test -f 'Panel.c' || echo './'`Panel.c
mv -f .deps/htop-Panel.Tpo .deps/htop-Panel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-BatteryMeter.o -MD -MP -MF .deps/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo './'`BatteryMeter.c
mv -f .deps/htop-BatteryMeter.Tpo .deps/htop-BatteryMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Process.o -MD -MP -MF .deps/htop-Process.Tpo -c -o htop-Process.o `test -f 'Process.c' || echo './'`Process.c
mv -f .deps/htop-Process.Tpo .deps/htop-Process.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ProcessList.o -MD -MP -MF .deps/htop-ProcessList.Tpo -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo './'`ProcessList.c
mv -f .deps/htop-ProcessList.Tpo .deps/htop-ProcessList.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-RichString.o -MD -MP -MF .deps/htop-RichString.Tpo -c -o htop-RichString.o `test -f 'RichString.c' || echo './'`RichString.c
mv -f .deps/htop-RichString.Tpo .deps/htop-RichString.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-ScreenManager.o -MD -MP -MF .deps/htop-ScreenManager.Tpo -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo './'`ScreenManager.c
mv -f .deps/htop-ScreenManager.Tpo .deps/htop-ScreenManager.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Settings.o -MD -MP -MF .deps/htop-Settings.Tpo -c -o htop-Settings.o `test -f 'Settings.c' || echo './'`Settings.c
mv -f .deps/htop-Settings.Tpo .deps/htop-Settings.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-SignalsPanel.o -MD -MP -MF .deps/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo './'`SignalsPanel.c
mv -f .deps/htop-SignalsPanel.Tpo .deps/htop-SignalsPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-StringUtils.o -MD -MP -MF .deps/htop-StringUtils.Tpo -c -o htop-StringUtils.o `test -f 'StringUtils.c' || echo './'`StringUtils.c
mv -f .deps/htop-StringUtils.Tpo .deps/htop-StringUtils.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-SwapMeter.o -MD -MP -MF .deps/htop-SwapMeter.Tpo -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo './'`SwapMeter.c
mv -f .deps/htop-SwapMeter.Tpo .deps/htop-SwapMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-TasksMeter.o -MD -MP -MF .deps/htop-TasksMeter.Tpo -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo './'`TasksMeter.c
mv -f .deps/htop-TasksMeter.Tpo .deps/htop-TasksMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-UptimeMeter.o -MD -MP -MF .deps/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo './'`UptimeMeter.c
mv -f .deps/htop-UptimeMeter.Tpo .deps/htop-UptimeMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-TraceScreen.o -MD -MP -MF .deps/htop-TraceScreen.Tpo -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo './'`TraceScreen.c
mv -f .deps/htop-TraceScreen.Tpo .deps/htop-TraceScreen.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-UsersTable.o -MD -MP -MF .deps/htop-UsersTable.Tpo -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo './'`UsersTable.c
mv -f .deps/htop-UsersTable.Tpo .deps/htop-UsersTable.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Vector.o -MD -MP -MF .deps/htop-Vector.Tpo -c -o htop-Vector.o `test -f 'Vector.c' || echo './'`Vector.c
mv -f .deps/htop-Vector.Tpo .deps/htop-Vector.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-AvailableColumnsPanel.o -MD -MP -MF .deps/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo './'`AvailableColumnsPanel.c
mv -f .deps/htop-AvailableColumnsPanel.Tpo .deps/htop-AvailableColumnsPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-AffinityPanel.o -MD -MP -MF .deps/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo './'`AffinityPanel.c
mv -f .deps/htop-AffinityPanel.Tpo .deps/htop-AffinityPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-HostnameMeter.o -MD -MP -MF .deps/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo './'`HostnameMeter.c
mv -f .deps/htop-HostnameMeter.Tpo .deps/htop-HostnameMeter.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-OpenFilesScreen.o -MD -MP -MF .deps/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo './'`OpenFilesScreen.c
mv -f .deps/htop-OpenFilesScreen.Tpo .deps/htop-OpenFilesScreen.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Affinity.o -MD -MP -MF .deps/htop-Affinity.Tpo -c -o htop-Affinity.o `test -f 'Affinity.c' || echo './'`Affinity.c
mv -f .deps/htop-Affinity.Tpo .deps/htop-Affinity.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-IncSet.o -MD -MP -MF .deps/htop-IncSet.Tpo -c -o htop-IncSet.o `test -f 'IncSet.c' || echo './'`IncSet.c
mv -f .deps/htop-IncSet.Tpo .deps/htop-IncSet.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-Action.o -MD -MP -MF .deps/htop-Action.Tpo -c -o htop-Action.o `test -f 'Action.c' || echo './'`Action.c
mv -f .deps/htop-Action.Tpo .deps/htop-Action.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-EnvScreen.o -MD -MP -MF .deps/htop-EnvScreen.Tpo -c -o htop-EnvScreen.o `test -f 'EnvScreen.c' || echo './'`EnvScreen.c
mv -f .deps/htop-EnvScreen.Tpo .deps/htop-EnvScreen.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-InfoScreen.o -MD -MP -MF .deps/htop-InfoScreen.Tpo -c -o htop-InfoScreen.o `test -f 'InfoScreen.c' || echo './'`InfoScreen.c
mv -f .deps/htop-InfoScreen.Tpo .deps/htop-InfoScreen.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT htop-XAlloc.o -MD -MP -MF .deps/htop-XAlloc.Tpo -c -o htop-XAlloc.o `test -f 'XAlloc.c' || echo './'`XAlloc.c
mv -f .deps/htop-XAlloc.Tpo .deps/htop-XAlloc.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-Platform.o -MD -MP -MF linux/.deps/htop-Platform.Tpo -c -o linux/htop-Platform.o `test -f 'linux/Platform.c' || echo './'`linux/Platform.c
mv -f linux/.deps/htop-Platform.Tpo linux/.deps/htop-Platform.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-IOPriorityPanel.o -MD -MP -MF linux/.deps/htop-IOPriorityPanel.Tpo -c -o linux/htop-IOPriorityPanel.o `test -f 'linux/IOPriorityPanel.c' || echo './'`linux/IOPriorityPanel.c
mv -f linux/.deps/htop-IOPriorityPanel.Tpo linux/.deps/htop-IOPriorityPanel.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-IOPriority.o -MD -MP -MF linux/.deps/htop-IOPriority.Tpo -c -o linux/htop-IOPriority.o `test -f 'linux/IOPriority.c' || echo './'`linux/IOPriority.c
mv -f linux/.deps/htop-IOPriority.Tpo linux/.deps/htop-IOPriority.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-LinuxProcess.o -MD -MP -MF linux/.deps/htop-LinuxProcess.Tpo -c -o linux/htop-LinuxProcess.o `test -f 'linux/LinuxProcess.c' || echo './'`linux/LinuxProcess.c
mv -f linux/.deps/htop-LinuxProcess.Tpo linux/.deps/htop-LinuxProcess.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-LinuxProcessList.o -MD -MP -MF linux/.deps/htop-LinuxProcessList.Tpo -c -o linux/htop-LinuxProcessList.o `test -f 'linux/LinuxProcessList.c' || echo './'`linux/LinuxProcessList.c
mv -f linux/.deps/htop-LinuxProcessList.Tpo linux/.deps/htop-LinuxProcessList.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-LinuxCRT.o -MD -MP -MF linux/.deps/htop-LinuxCRT.Tpo -c -o linux/htop-LinuxCRT.o `test -f 'linux/LinuxCRT.c' || echo './'`linux/LinuxCRT.c
mv -f linux/.deps/htop-LinuxCRT.Tpo linux/.deps/htop-LinuxCRT.Po
gcc -DHAVE_CONFIG_H -I. -DNDEBUG -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -MT linux/htop-Battery.o -MD -MP -MF linux/.deps/htop-Battery.Tpo -c -o linux/htop-Battery.o `test -f 'linux/Battery.c' || echo './'`linux/Battery.c
mv -f linux/.deps/htop-Battery.Tpo linux/.deps/htop-Battery.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I"./linux" -rdynamic -g -O2 -o htop htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-MainPanel.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-SignalsPanel.o htop-StringUtils.o htop-SwapMeter.o htop-TasksMeter.o htop-UptimeMeter.o htop-TraceScreen.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IncSet.o htop-Action.o htop-EnvScreen.o htop-InfoScreen.o htop-XAlloc.o linux/htop-Platform.o linux/htop-IOPriorityPanel.o linux/htop-IOPriority.o linux/htop-LinuxProcess.o linux/htop-LinuxProcessList.o linux/htop-LinuxCRT.o linux/htop-Battery.o -lncursesw -lm
libtool: link: gcc -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -I./linux -rdynamic -g -O2 -o htop htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-MainPanel.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-SignalsPanel.o htop-StringUtils.o htop-SwapMeter.o htop-TasksMeter.o htop-UptimeMeter.o htop-TraceScreen.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IncSet.o htop-Action.o htop-EnvScreen.o htop-InfoScreen.o htop-XAlloc.o linux/htop-Platform.o linux/htop-IOPriorityPanel.o linux/htop-IOPriority.o linux/htop-LinuxProcess.o linux/htop-LinuxProcessList.o linux/htop-LinuxCRT.o linux/htop-Battery.o -lncursesw -lm
make[1]: Leaving directory `/root/samba_share/htop-2.0.2'
[root#client htop-2.0.2]# make install
make install-am
make[1]: Entering directory `/root/samba_share/htop-2.0.2'
make[2]: Entering directory `/root/samba_share/htop-2.0.2'
/bin/mkdir -p '/usr/local/bin'
/bin/sh ./libtool --mode=install /usr/bin/install -c htop '/usr/local/bin'
libtool: install: /usr/bin/install -c htop /usr/local/bin/htop
/bin/mkdir -p '/usr/local/share/applications'
/usr/bin/install -c -m 644 htop.desktop '/usr/local/share/applications'
/bin/mkdir -p '/usr/local/share/man/man1'
/usr/bin/install -c -m 644 htop.1 '/usr/local/share/man/man1'
/bin/mkdir -p '/usr/local/share/pixmaps'
/usr/bin/install -c -m 644 htop.png '/usr/local/share/pixmaps'
make[2]: Leaving directory `/root/samba_share/htop-2.0.2'
make[1]: Leaving directory `/root/samba_share/htop-2.0.2'
[root#client htop-2.0.2]# htop

Why aren't debugging symbols being added to my output file?

I am trying to compile a project to run on an ARM board that I have. To use the debugger, I have to put debugging symbols in the resulting .elf file.
I configured everything and ran my makefile, which produced the following results:
arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi-s -g -gdwarf-2 -Wa,-amhls=src/crt.lst src/crt.S -o src/crt.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=src/main.lst -MD -MP -MF .dep/main.o.d -I . -I./inc src/main.c -o src/main.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=library/md5.lst -MD -MP -MF .dep/md5.o.d -I . -I./inc library/md5.c -o library/md5.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=library/bignum.lst -MD -MP -MF .dep/bignum.o.d -I . -I./inc library/bignum.c -o library/bignum.o
arm-elf-gcc ./src/crt.o ./src/main.o ./library/md5.o ./library/bignum.o -mcpu=arm7tdmi-s -g -nostartfiles -T./prj/LPC2138_flash.ld -Wl,-Map=testFLASH.map,--cref,--no-warn-mismatch -nostdlib -L. -Wl,-static -ffunction-sections -Wl,--gc-sections -Wl,-s -fdata-sections -lc -lg -lnosys -o testFLASH.elf
I have put in the -g flags, but when I try to find debugging symbols, I get only :
C:\Users\stkerr\Code\EclipseWorkspace\LibraryWork>objdump -g testFLASH.elf
testFLASH.elf: file format elf32-little
This is further confirmed when I try to open the .elf file in my debugger, I get an error about the file not having debugging symbols.
Can anyone point to an error in my arm-elf-gcc calls or a flag that I am missing?
After poking around a little more in the documentation, the -Wl,-s is the problem.
It strips all symbols from the resulting executable, including the debugging information.

Programming in Lua on OS X?

What can I use to program Lua script on Mac OS X? I'm looking for something that I can use to compile/interpret Lua script on OS X.
My preferred way:
brew install lua
Thanks, Max!
And if you need to know how to install Homebrew, see Link and:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
The Lua source easily compiles with no changes on the mac. It will build lua (the interpreter which can act on a source script, a pre-compiled script or interactively) and luac which can be used to pre-compile source scripts.
From the lua.org website: http://luabinaries.luaforge.net/download.html. The ones you want are the darwin binaries (they say Mac OS X in the description).
My favorite way (from the shell):
sudo port install lua
I LOVE macports!
Here is my terminal session from compiling and installing Lua from source, basically following these directions. I already had Apple's Developer Tools installed, and /usr/local/bin was already in my PATH, so I was able to skip some of the more time-consuming and/or tedious steps in the directions.
$ cd ~/Downloads
$ tar -xf lua-5.1.4.tar
$ cd lua-5.1.4
$ make macosx
cd src && make macosx
make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lapi.o lapi.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lcode.o lcode.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldebug.o ldebug.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldo.o ldo.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldump.o ldump.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lfunc.o lfunc.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lgc.o lgc.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o llex.o llex.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lmem.o lmem.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lobject.o lobject.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lparser.o lparser.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstate.o lstate.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstring.o lstring.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltable.o ltable.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltm.o ltm.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lundump.o lundump.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lvm.o lvm.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lzio.o lzio.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lauxlib.o lauxlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldblib.o ldblib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o liolib.o liolib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lmathlib.o lmathlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o loslib.o loslib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltablib.o ltablib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o loadlib.o loadlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lua.o lua.c
gcc -o lua lua.o liblua.a -lm -lreadline
gcc -O2 -Wall -DLUA_USE_LINUX -c -o luac.o luac.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o print.o print.c
gcc -o luac luac.o print.o liblua.a -lm -lreadline
$ make test
src/lua test/hello.lua
Hello world, from Lua 5.1!
$ sudo make install INSTALL_TOP=/usr/local
Password:
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.1 /usr/local/lib/lua/5.1
cd src && install -p -m 0755 lua luac /usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /usr/local/include
cd src && install -p -m 0644 liblua.a /usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1
$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print "Hi"
Hi
> = 2 + 3
5
> ^c
$ cd test
$ lua factorial.lua
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
7! = 5040
8! = 40320
9! = 362880
10! = 3628800
11! = 39916800
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 1307674368000
16! = 20922789888000
If you don't want to compile your own Lua binaries, you can try ZeroBrane Studio Lua IDE, which comes packaged as a .dmg file for OSX. It's an IDE that allows you to edit and debug your Lua scripts. If you are just starting with Lua, it also includes 50+ examples and demo scripts, as well as integrated instructions on running them, so you won't be facing an empty screen not knowing where to start.
I just recently found Rudix—a maintained collection of precompiled Unix software for Mac.
While I'm sure you've already figured out a way of installing Lua, I came across your question by Googling the same thing. For anyone that's interested, here's the link to a recent Lua 5.1.4 dmg.

Resources