en Linux

Script para compilar en Linux

sudo -s

gedit bld.sh

Copiamos y pegamos lo siguienteĀ :

#!/bin/sh

if [ -z “$HB_PREF” ]; then export HB_PREF=hb; fi
if [ -z “$HB_ARCHITECTURE” ]; then export HB_ARCHITECTURE=w32; fi
if [ -z “$HB_GPM_MOUSE” ]; then export HB_GPM_MOUSE=no; fi
if [ -z “$HB_COMPILER” ]; then export HB_COMPILER=mingw32; fi
if [ -z “$HB_GT_LIB” ]; then export HB_GT_LIB=gtwin; fi
if [ -z “$HB_BIN_INSTALL” ]; then export HB_BIN_INSTALL=/harbour/bin/; fi
if [ -z “$HB_LIB_INSTALL” ]; then export HB_LIB_INSTALL=/harbour/lib/; fi
if [ -z “$HB_INC_INSTALL” ]; then export HB_INC_INSTALL=/harbour/include/; fi

LIBFILES=”-Wl,–start-group “

LIBFILES=”$LIBFILES -lhbdebug -lhbvm -lhbrtl -lhbrdd -lhbrtl -lhbvm

-lhbmacro -lhbpp -lhblang -lhbcpage -lhbcommon -lrddntx -lrddcdx

-lrddfpt -lhbsix -lhbhsx “

if [ $HB_COMPILER = mingw32 ]; then
LIBFILES=”$LIBFILES -lgtwin -lgtgui “
fi

if [ $HB_GT_LIB = gtcrs ]; then
LIBFILES=”$LIBFILES -lgtcrs -lncurses “
fi

if [ $HB_GT_LIB = gtsln ]; then
LIBFILES=”$LIBFILES -lgtsln -lslang “
fi

LIBFILES=”$LIBFILES -Wl,–end-group “

if [ $HB_COMPILER = mingw32 ]; then
CFLAGS=”-W -Wall -O2 -mms-bitfields -mwindows -mno-cygwin “
LIBFILES=”$LIBFILES -lm -luser32 -lwinspool -lole32 -loleaut32

-luuid -lgdi32 -lcomctl32 -lcomdlg32 -lodbc32 -lwininet -lwsock32″
else
CFLAGS=”-W -Wall -O2″
fi

$HB_BIN_INSTALL/harbour -b -a -m -n -w -I$HB_INC_INSTALL $1

gcc $1.c -o $1 $CFLAGS -L$HB_LIB_INSTALL

-I$HB_INC_INSTALL $LIBFILES `pkg-config –cflags gtk+-2.0`

`pkg-config –libs gtk+-2.0 libglade-2.0`

rm -f $1.c
rm -f $1.o

./$1

Guardamos como bld.sh

en consola escribimos

chmod +x bld.sh

para compilar nuestro ejemplo

./bld.sh hola