LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-11-2010, 04:29 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Rep: Reputation: 18
sms server tools cross compiling


hello
I wanted to cross compile sms server tools(http://smstools3.kekekasvi.com/)
for arm-linux with arm-linux-gcc compiler but I can not this is all information that I have from it's error:
Quote:
[root@localhost smstools3]# ls
doc examples install.sh LICENSE Makefile package.sh README scripts src uninstall.sh
Quote:
[root@localhost smstools3]# cat Makefile
# Makefile

# If you change destination of executables, remember to change
# startup script (init.d/sms3) too.
#BINDIR=/usr/local/bin
BINDIR=/mnt/sd/Utility/sms/ ///I changed here for cross compilation
VERSION=$(shell grep package_version src/version.h | cut -f2)

compile:
cd src && $(MAKE) -$(MAKEFLAGS)

install: compile
./install.sh $(BINDIR)

uninstall:
./uninstall.sh $(BINDIR)

clean:
cd src && $(MAKE) -$(MAKEFLAGS) clean

package: compile clean
./package.sh
Quote:
[root@localhost smstools3]# ls src/
alarm.c blacklist.h charset.c extras.h locking.h Makefile modeminit.h smsd.c stats.c whitelist.c
alarm.h cfgfile.c charset.h extras.o logging.c Makefile~ pdu.c smsd_cfg.c stats.h whitelist.h
blacklist.c cfgfile.h extras.c locking.c logging.h modeminit.c pdu.h smsd_cfg.h version.h
Quote:
[root@localhost smstools3]# cat src/Makefile
# In case of windows, use os_cygwin=yes setting in the configuration file (smsd.conf).
CC=arm-linux-gcc ///I added this line here for cross compilation
# Select your setup size:
CFLAGS = -D NUMBER_OF_MODEMS=64

# Uncomment for Solaris
# CFLAGS += -D SOLARIS
# This might be also needed for Solaris:
# CC=gcc

# Comment this out, to enable statistics
CFLAGS += -D NOSTATS

# Uncomment this to force smsd to run in terminal mode
#CFLAGS += -D TERMINAL

# Uncomment to add debug info
# CFLAGS += -ggdb -O0

# The following option is only used by developers
# CFLAGS += -D DEBUGMSG

CFLAGS += -Wall

# The following enables logfile size more than 2GB
CFLAGS += -D_FILE_OFFSET_BITS=64

all: smsd

smsd: smsd.c extras.o locking.o cfgfile.o logging.o alarm.o smsd_cfg.o charset.o stats.o blacklist.o whitelist.o modeminit.o pdu.o
ifneq (,$(findstring NOSTATS,$(CFLAGS)))
$(CC) $(CFLAGS) -o $@ $^
else
$(CC) `mm-config --cflags` $(CFLAGS) -o $@ $^ `mm-config --ldflags --libs`
endif

clean:
rm -f *.o smsd *.exe *~
Quote:
[root@localhost smstools3]# make
cd src && make -
make[1]: Entering directory `/root/Download/Gateway/smstools3-3.1.6/smstools3/src'
arm-linux-gcc -D NUMBER_OF_MODEMS=64 -D NOSTATS -Wall -D_FILE_OFFSET_BITS=64 -c -o locking.o locking.c
locking.c: In function `lockfile':
locking.c:27: error: `PATH_MAX' undeclared (first use in this function)
locking.c:27: error: (Each undeclared identifier is reported only once
locking.c:27: error: for each function it appears in.)
locking.c:27: warning: unused variable `lockfilename'
locking.c: In function `islocked':
locking.c:55: error: `PATH_MAX' undeclared (first use in this function)
locking.c:55: warning: unused variable `lockfilename'
locking.c: In function `unlockfile':
locking.c:72: error: `PATH_MAX' undeclared (first use in this function)
locking.c:72: warning: unused variable `lockfilename'
make[1]: *** [locking.o] Error 1
make[1]: Leaving directory `/root/Download/Gateway/smstools3-3.1.6/smstools3/src'
make: *** [compile] Error 2
what should I do for this? how can I fix it?
thanks for any help.
 
Old 04-11-2010, 07:48 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by golden_boy615 View Post
what should I do for this? how can I fix it?
You'll find a lot of errors like this, you've just got to go through them one at a time - it helps a lot if you know a little C.

In this case, PATH_MAX is defined when you include limits.h, so you want to edit locking.c and add the following line somewhere near the top (i.e. next to the other #include statements that should be there):

Code:
#include <limits.h>
John G

Last edited by JohnGraham; 04-11-2010 at 08:01 AM.
 
1 members found this post helpful.
Old 04-12-2010, 05:00 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
you probably have a dependency or library missing.
or wrong version of blah.
look at the website and check everything.
if an install script fails editing it will 99% never work.
it's somewhere else.
 
1 members found this post helpful.
Old 04-13-2010, 12:02 AM   #4
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 445

Original Poster
Rep: Reputation: 18
I found it thanks and it works.
 
  


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
sms server tools cross compiling golden_boy615 Programming 1 03-28-2010 12:09 PM
Cross-compiling v/s cross-building kushalkoolwal Programming 3 05-13-2009 05:49 AM
trying to use sms tools cannot start! Nzo Linux - Newbie 1 09-14-2008 06:11 PM
New to LQ with Cross Platform tools RufusG LinuxQuestions.org Member Intro 1 08-27-2008 02:30 AM
Compiling Server Cluster Tools for RH wimnat Linux - Software 1 11-29-2005 09:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:26 PM.

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