Asterisk 1.6.1.5 won't build on Mac OSX 10.6

With Xcode updated to the latest version 3.2, the build attempt terminates in errors related to 64 bit support. The hardware is an intel mac mini running Snow Leopard, version 10.6. Any pointers appreciated.

A previous Asterisk version (1.6.1.0) successfully built using OSX 10.5.x continues to run fine on a system upgraded to OSX 10.6.

Here’s the result of the failed build:

stevedemy@Miniserver-2 ~ $ cd asterisk-1.6.1.5
stevedemy@Miniserver-2 asterisk-1.6.1.5 $ sudo bash …/asterisk-build.sh
Password:
checking build system type… i386-apple-darwin10.0.0
checking host system type… i386-apple-darwin10.0.0
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
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 how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/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 for uname… /usr/bin/uname
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking how to run the C preprocessor… gcc -E
checking how to run the C++ preprocessor… g++ -E
checking for a sed that does not truncate output… /usr/bin/sed
checking for egrep… grep -E
checking for ld used by gcc… /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) is GNU ld… no
checking for gawk… no
checking for mawk… no
checking for nawk… no
checking for awk… awk
checking for a BSD-compatible install… /usr/bin/install -c
checking whether ln -s works… yes
checking for ranlib… ranlib
checking for GNU make… make
checking for strip… /usr/bin/strip
checking for ar… /usr/bin/ar
checking for grep… (cached) /usr/bin/grep
checking for find… /usr/bin/find
checking for compress… /usr/bin/compress
checking for basename… /usr/bin/basename
checking for id… /usr/bin/id
checking for dirname… /usr/bin/dirname
checking for sh… /bin/sh
checking for ln… /bin/ln
checking for dot… :
checking for wget… /usr/bin/curl -O
checking for rubber… :
checking for kpsewhich… :
checking for soxmix… no
checking for md5… md5
checking for the pthreads library -lpthreads… no
checking whether pthreads work without any flags… yes
checking for joinable pthread attribute… PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads… -D_THREAD_SAFE
checking for working alloca.h… yes
checking for alloca… 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 sys/wait.h that is POSIX.1 compatible… yes
checking arpa/inet.h usability… yes
checking arpa/inet.h presence… yes
checking for arpa/inet.h… yes
checking fcntl.h usability… yes
checking fcntl.h presence… yes
checking for fcntl.h… yes
checking for inttypes.h… (cached) yes
checking libintl.h usability… no
checking libintl.h presence… no
checking for libintl.h… no
checking limits.h usability… yes
checking limits.h presence… yes
checking for limits.h… yes
checking locale.h usability… yes
checking locale.h presence… yes
checking for locale.h… yes
checking malloc.h usability… no
checking malloc.h presence… no
checking for malloc.h… no
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking netinet/in.h usability… yes
checking netinet/in.h presence… yes
checking for netinet/in.h… yes
checking stddef.h usability… yes
checking stddef.h presence… yes
checking for stddef.h… yes
checking for stdint.h… (cached) yes
checking for stdlib.h… (cached) yes
checking for string.h… (cached) yes
checking for strings.h… (cached) yes
checking sys/file.h usability… yes
checking sys/file.h presence… yes
checking for sys/file.h… yes
checking sys/ioctl.h usability… yes
checking sys/ioctl.h presence… yes
checking for sys/ioctl.h… yes
checking sys/param.h usability… yes
checking sys/param.h presence… yes
checking for sys/param.h… yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking syslog.h usability… yes
checking syslog.h presence… yes
checking for syslog.h… yes
checking termios.h usability… yes
checking termios.h presence… yes
checking for termios.h… yes
checking for unistd.h… (cached) yes
checking utime.h usability… yes
checking utime.h presence… yes
checking for utime.h… yes
checking arpa/nameser.h usability… yes
checking arpa/nameser.h presence… yes
checking for arpa/nameser.h… yes
checking sys/io.h usability… no
checking sys/io.h presence… no
checking for sys/io.h… no
checking winsock.h usability… no
checking winsock.h presence… no
checking for winsock.h… no
checking winsock2.h usability… no
checking winsock2.h presence… no
checking for winsock2.h… no
checking sys/poll.h usability… yes
checking sys/poll.h presence… yes
checking for sys/poll.h… yes
checking for special C compiler options needed for large files… no
checking for _FILE_OFFSET_BITS value needed for large files… no
checking for stdbool.h that conforms to C99… yes
checking for _Bool… yes
checking for an ANSI C-conforming const… yes
checking for uid_t in sys/types.h… yes
checking for inline… inline
checking for mode_t… yes
checking for off_t… yes
checking for pid_t… yes
checking for size_t… yes
checking for struct stat.st_blksize… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether struct tm is in sys/time.h or time.h… time.h
checking for working volatile… yes
checking for ptrdiff_t… yes
checking for unistd.h… (cached) yes
checking for working chown… yes
checking whether closedir returns void… no
checking for error_at_line… no
checking vfork.h usability… no
checking vfork.h presence… no
checking for vfork.h… no
checking for fork… yes
checking for vfork… yes
checking for working fork… yes
checking for working vfork… (cached) yes
checking for _LARGEFILE_SOURCE value needed for large files… no
checking whether gcc needs -traditional… no
checking for working memcmp… yes
checking for stdlib.h… (cached) yes
checking for unistd.h… (cached) yes
checking for getpagesize… yes
checking for working mmap… yes
checking sys/select.h usability… yes
checking sys/select.h presence… yes
checking for sys/select.h… yes
checking for sys/socket.h… (cached) yes
checking types of arguments for select… int,fd_set *,struct timeval *
checking return type of signal handlers… void
checking whether lstat dereferences a symlink specified with a trailing slash… no
checking whether stat accepts an empty string… no
checking for working strcoll… yes
checking for strftime… yes
checking for working strnlen… no
checking for working strtod… yes
checking for utime.h… (cached) yes
checking whether utime accepts a null argument… yes
checking for vprintf… yes
checking for _doprnt… no
checking for asprintf… yes
checking for atexit… yes
checking for dup2… yes
checking for eaccess… no
checking for endpwent… yes
checking for euidaccess… no
checking for ftruncate… yes
checking for getcwd… yes
checking for gethostbyname… yes
checking for gethostname… yes
checking for getloadavg… yes
checking for gettimeofday… yes
checking for ioperm… no
checking for inet_ntoa… yes
checking for isascii… yes
checking for localtime_r… yes
checking for memchr… yes
checking for memmove… yes
checking for memset… yes
checking for mkdir… yes
checking for munmap… yes
checking for putenv… yes
checking for re_comp… no
checking for regcomp… yes
checking for select… yes
checking for setenv… yes
checking for socket… yes
checking for strcasecmp… yes
checking for strcasestr… yes
checking for strchr… yes
checking for strcspn… yes
checking for strdup… yes
checking for strerror… yes
checking for strlcat… yes
checking for strlcpy… yes
checking for strncasecmp… yes
checking for strndup… no
checking for strnlen… no
checking for strrchr… yes
checking for strsep… yes
checking for strspn… yes
checking for strstr… yes
checking for strtol… yes
checking for strtoq… yes
checking for unsetenv… yes
checking for utime… yes
checking for vasprintf… yes
checking for glob… yes
checking for timersub in time.h… yes
checking for sys/poll.h… (cached) yes
checking for funopen… yes
checking for fopencookie… no
checking for inet_aton… yes
checking for IP_PKTINFO… no
checking for library containing gethostbyname_r… no
checking for gethostbyname_r with 6 arguments… no
checking for gethostbyname_r with 5 arguments… no
checking byteswap.h usability… no
checking byteswap.h presence… no
checking for byteswap.h… no
checking for __swap16 variant of <sys/endian.h> byteswapping macros… no
checking for bswap16 variant of <sys/endian.h> byteswapping macros… no
checking for /dev/urandom… yes
checking for PTHREAD_RWLOCK_INITIALIZER in pthread.h… yes
checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h… no
checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h… no
checking for pthread_rwlock_timedwrlock() in pthread.h… no
checking for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in pthread.h… no
checking for compiler atomic operations… yes
checking for compiler ‘attribute pure’ support… yes
checking for compiler ‘attribute malloc’ support… yes
checking for compiler ‘attribute const’ support… yes
checking for compiler ‘attribute unused’ support… yes
checking for compiler ‘attribute always_inline’ support… yes
checking for compiler ‘attribute deprecated’ support… yes
checking for compiler ‘attribute sentinel’ support… yes
checking for compiler ‘attribute warn_unused_result’ support… yes
checking for compiler ‘attribute weak’ support… yes
checking for -ffunction-sections support… yes
checking for --gc-sections support… no
checking for -Wdeclaration-after-statement support… yes
checking for _FORTIFY_SOURCE support… yes
checking for -fno-strict-overflow… yes
checking for -Wshadow… yes
checking for sysinfo… no
checking for library containing res_9_ninit… -lresolv
checking for res_ninit… yes
checking for library containing res_9_ndestroy… none required
checking for res_ndestroy… yes
checking for GLOB_NOMAGIC in glob.h… yes
checking for GLOB_BRACE in glob.h… yes
checking for IP_MTU_DISCOVER in netinet/in.h… no
checking libkern/OSAtomic.h usability… yes
checking libkern/OSAtomic.h presence… yes
checking for libkern/OSAtomic.h… yes
checking size of int… 4
checking for snd_spcm_init in -lasound… no
checking for initscr in -lcurses… yes
checking curses.h usability… yes
checking curses.h presence… yes
checking for curses.h… yes
checking for DAHDI_CODE in dahdi/user.h… no
checking for exp2l in -lm… yes
checking for log2l in -lm… yes
checking for exp10l in -lm… no
checking for log10l in -lm… yes
checking for sinl in -lm… yes
checking for cosl in -lm… yes
checking for tanl in -lm… yes
checking for asinl in -lm… yes
checking for acosl in -lm… yes
checking for atanl in -lm… yes
checking for atan2l in -lm… yes
checking for powl in -lm… yes
checking for sqrtl in -lm… yes
checking for rintl in -lm… yes
checking for expl in -lm… yes
checking for logl in -lm… yes
checking for remainderl in -lm… yes
checking for fmodl in -lm… yes
checking for roundl in -lm… yes
checking for truncl in -lm… yes
checking for strtold in -lc… yes
checking for stdlib.h… (cached) yes
checking for floorl in -lm… yes
checking for ceill in -lm… yes
checking for exp2 in -lm… yes
checking for log2 in -lm… yes
checking for exp10 in -lm… no
checking for log10 in -lm… yes
checking for sin in -lm… yes
checking for cos in -lm… yes
checking for tan in -lm… yes
checking for asin in -lm… yes
checking for acos in -lm… yes
checking for atan in -lm… yes
checking for atan2 in -lm… yes
checking for pow in -lm… yes
checking for sqrt in -lm… yes
checking for rint in -lm… yes
checking for exp in -lm… yes
checking for log in -lm… yes
checking for remainder in -lm… yes
checking for fmod in -lm… yes
checking for round in -lm… yes
checking for trunc in -lm… yes
checking for strtod in -lc… yes
checking for stdlib.h… (cached) yes
checking for floor in -lm… yes
checking for ceil in -lm… yes
checking for getifaddrs() support… yes
checking for gsm_create in -lgsm… no
checking for iconv_open in -liconv… yes
checking iconv.h usability… yes
checking iconv.h presence… yes
checking for iconv.h… yes
checking for iks_start_sasl in -liksemel… no
checking for UW IMAP Toolkit c-client library… no
checking for system c-client library… no
checking for jack_activate in -ljack… no
checking for lt_dlinit in -lltdl… yes
checking ltdl.h usability… yes
checking ltdl.h presence… yes
checking for ltdl.h… yes
checking for ldap_initialize in -lldap… yes
checking ldap.h usability… yes
checking ldap.h presence… yes
checking for ldap.h… yes
checking for mISDN_open in -lmISDN… no
checking for nbs_connect in -lnbs… no
checking for initscr in -lncurses… yes
checking for curses.h… (cached) yes
checking for net-snmp-config… net-snmp-config
checking for newtBell in -lnewt… no
checking for SQLConnect in -lodbc… yes
checking sql.h usability… yes
checking sql.h presence… yes
checking for sql.h… yes
checking for ogg_sync_init in -logg… no
checking for backtrace in -lexecinfo… no
checking for backtrace in -lc… yes
checking execinfo.h usability… yes
checking execinfo.h presence… yes
checking for execinfo.h… yes
checking linux/soundcard.h usability… no
checking linux/soundcard.h presence… no
checking for linux/soundcard.h… no
checking sys/soundcard.h usability… no
checking sys/soundcard.h presence… no
checking for sys/soundcard.h… no
checking for oss_ioctl_mixer in -lossaudio… no
checking for pg_config… no
checking for poptStrerror in -lpopt… no
checking for Pa_GetDeviceCount in -lportaudio… no
checking for pri_new_bri in -lpri… no
checking for pri_set_inbanddisconnect in -lpri… no
checking for resample_open in -lresample… no
checking for minimum version of SpanDSP… no
checking for ss7_pollflags in -lss7… no
checking /Users/stevedemy/pwlib/include/ptlib.h usability… no
checking /Users/stevedemy/pwlib/include/ptlib.h presence… no
checking for /Users/stevedemy/pwlib/include/ptlib.h… no
checking /usr/local/include/ptlib.h usability… no
checking /usr/local/include/ptlib.h presence… no
checking for /usr/local/include/ptlib.h… no
checking /usr/include/ptlib.h usability… no
checking /usr/include/ptlib.h presence… no
checking for /usr/include/ptlib.h… no
checking for luaL_newstate in -llua5.1… no
checking for luaL_register in -llua… no
checking for rc_read_config in -lradiusclient-ng… no
checking for saClmInitialize in -lSaClm… no
checking for speex_encode in -lspeex… no
checking for speex_preprocess_ctl in -lspeex… no
checking for speex_preprocess_ctl in -lspeexdsp… no
checking for sqlite_exec in -lsqlite… no
checking for sqlite3_open in -lsqlite3… yes
checking sqlite3.h usability… yes
checking sqlite3.h presence… yes
checking for sqlite3.h… yes
checking for AES_encrypt in -lcrypto… yes
checking openssl/aes.h usability… yes
checking openssl/aes.h presence… yes
checking for openssl/aes.h… yes
checking for ssl2_connect in -lssl… yes
checking openssl/ssl.h usability… yes
checking openssl/ssl.h presence… yes
checking for openssl/ssl.h… yes
checking osp/osp.h usability… no
checking osp/osp.h presence… no
checking for osp/osp.h… no
checking for gmime-config… no
checking for malloc in -lhoard… no
checking for dbinit in -lsybdb… no
checking for tgetent in -ltermcap… yes
checking for tgetent in -ltinfo… no
checking for tone_zone_find_by_num in -ltonezone… no
checking for tone_zone_find in -ltonezone… no
checking for usb_init in -lusb… no
checking for vorbis_info_init in -lvorbis… no
checking for vpb_open in -lvpb… no
checking for compress in -lz… yes
checking zlib.h usability… yes
checking zlib.h presence… yes
checking for zlib.h… yes
checking h323.h usability… no
checking h323.h presence… no
checking for h323.h… no
checking linux/compiler.h usability… no
checking linux/compiler.h presence… no
checking for linux/compiler.h… no
checking for linux/ixjuser.h… no
checking for sdl-config… no
checking for IMG_Load in -lSDL_image… no
checking for sws_getContext in -lavcodec… no
checking linux/videodev.h usability… no
checking linux/videodev.h presence… no
checking for linux/videodev.h… no
checking for XOpenDisplay in -lX11… no
checking for XOpenDisplay in -lX11… (cached) no
checking for /sbin/launchd… yes
checking for gtk-config… no
checking for pkg-config… no
checking for curl-config… /usr/bin/curl-config
checking for curl_version() in curl/curl.h… yes
checking for mandatory modules: … ok
configure: creating ./config.status
config.status: creating build_tools/menuselect-deps
config.status: creating makeopts
config.status: creating channels/h323/Makefile
config.status: creating include/asterisk/autoconfig.h
config.status: include/asterisk/autoconfig.h is unchanged

           .$$$$$$$$$$$$$$$=..      
        .$7$7..          .7$$7:.    
      .$$:.                 ,$7.7   
    .$7.     7$$$$           .$$77  
 ..$$.       $$$$$            .$$$7 
..7$   .?.   $$$$$   .?.       7$$$.

$.$. .$$$7. $$$$7 .7$$$. .$$$.
.777. .$$$$$$77$$$77$$$$$7. $$$,
$$$~ .7$$$$$$$$$$$$$7. .$$$.
.$$7 .7$$$$$$$7: ?$$$.
$$$ ?7$$$$$$$$$$I .$$$7
$$$ .7$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$7$$$$$$$$$$$$ .$$$.
$$$ $$$ 7$$$7 .$$$ .$$$.
$$$$ $$$$7 .$$$.
7$$$7 7$$$$ 7$$$
$$$$$ $$$
$$$$7. $$ ™
$$$$$$$. .7$$$$$$ $$
$$$$$$$$$$$$7$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$.

configure: Package configured for:
configure: OS type : darwin10.0.0
configure: Host CPU : i386
configure: build-cpu:vendor:os: i386 : apple : darwin10.0.0 :
configure: host-cpu:vendor:os: i386 : apple : darwin10.0.0 :
CC=“cc” CXX=“g++” LD="" AR="" RANLIB="" CFLAGS="" make -C menuselect CONFIGURE_SILENT="–silent" makeopts
make[1]: `makeopts’ is up to date.
menuselect/menuselect --check-deps menuselect.makeopts
Generating embedded module rules …
[CC] src/add.c -> src/add.o
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
make[2]: *** [src/add.o] Error 1
make[1]: *** [gsm/lib/libgsm.a] Error 2
make: *** [codecs] Error 2

Same issue here. I would be glad to attempt any troubleshooting steps.

Mac OS X 10.6 with Xcode 3.2 running on Intel/Mac Pro.

After running make with -d option, this is the tail of the output:


...
     Trying implicit prerequisite `src/table.c.c'.
     Looking for a rule with intermediate file `src/table.c.c'.
      Avoiding implicit rule recursion.
      Avoiding implicit rule recursion.
      Avoiding implicit rule recursion.
    Trying pattern rule with stem `table.c'.
    Rejecting impossible implicit prerequisite `src/table.c.c'.
   No implicit rule found for `src/table.c'.
 Considering target file `src/add.o'.
  File `src/add.o' does not exist.
  Considering target file `src/add.c'.
   Finished prerequisites of target file `src/add.c'.
  No need to remake target `src/add.c'.
  Finished prerequisites of target file `src/add.o'.
 Must remake target `src/add.o'.
Putting child 0x100115020 (src/add.o) PID 29335 on the chain.
Live child 0x100115020 (src/add.o) PID 29335 
   [CC] src/add.c -> src/add.o
Reaping winning child 0x100115020 PID 29335 
Live child 0x100115020 (src/add.o) PID 29336 
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
Reaping losing child 0x100115020 PID 29336 
make[2]: *** [src/add.o] Error 1
Removing child 0x100115020 PID 29336 from chain.
Reaping losing child 0x1001193c0 PID 29333 
make[1]: *** [gsm/lib/libgsm.a] Error 2
Removing child 0x1001193c0 PID 29333 from chain.
Reaping losing child 0x1001538b0 PID 29257 
make: *** [codecs] Error 2
Removing child 0x1001538b0 PID 29257 from chain.

Is it possible we have to be booted into 64 bit kernel for this to work?

Startup using k-6-4 keyboard sequence? Unfortunately, I can’t try this right now, but will when I get a chance.

Well, the really bad news is: I have a Mac Pro with 32 bit EFI, which means I can’t boot native 64 bit without a hack.

osnews.com/story/22009/Snow_ … by_Default

However, it seems like you can cross-compile to x86-64. I tried Apple’s instructions for trying to change gcc to use gcc 4.0, but it doesn’t seem to have worked.

developer.apple.com/mac/library/ … -TPXREF101

I’m not a make or gcc expert, but I’ll see if I can keep making some progress. If anyone can offer guidance, that would be great.

For what it’s worth; I actually paid attention to the ./configure output this time and noticed it clearly identified my machine as i386.

configure: Package configured for: 
configure: OS type  : darwin10.0.0
configure: Host CPU : i386
configure: build-cpu:vendor:os: i386 : apple : darwin10.0.0 :
configure: host-cpu:vendor:os: i386 : apple : darwin10.0.0 :

I’ll continue looking to see if I can figure out forcing the cross-compile. But shouldn’t it just build the x86-32 binaries?

I also noticed that if you fire up Xcode it identifies the architecture of my Mac Pro as i386 only, but a newer iMac I use allows me to select the PPC/x86-64, and i386 architectures from the pull-down menu.

Still digging …

This from an attempted build of 1.6.1.6 (same thing happens):

checking build system type… i386-apple-darwin10.0.0
checking host system type… i386-apple-darwin10.0.0

[…]

configure: Package configured for:
configure: OS type : darwin10.0.0
configure: Host CPU : i386
configure: build-cpu:vendor:os: i386 : apple : darwin10.0.0 :
configure: host-cpu:vendor:os: i386 : apple : darwin10.0.0 :

[CC] codec_gsm.c -> codec_gsm.o
[CC] src/add.c -> src/add.o
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
src/add.c:1: error: CPU you selected does not support x86-64 instruction set
make[2]: *** [src/add.o] Error 1
make[1]: *** [gsm/lib/libgsm.a] Error 2
make: *** [codecs] Error 2

on a Core Duo (not a Core 2 Duo mac which can boot true 64-bit)…

[AR] hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o hash/ndbm.o btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o btree/bt_overflow.o btree/bt_page.o btree/bt_put.o btree/bt_search.o btree/bt_seq.o btree/bt_split.o btree/bt_utils.o db/db.o mpool/mpool.o recno/rec_close.o recno/rec_delete.o recno/rec_get.o recno/rec_open.o recno/rec_put.o recno/rec_search.o recno/rec_seq.o recno/rec_utils.o -> libdb1.a ranlib: file: libdb1.a(bt_debug.o) has no symbols ranlib: file: libdb1.a(bt_debug.o) has no symbols [LD] abstract_jb.o acl.o aescrypt.o aeskey.o aestab.o alaw.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o audiohook.o autoservice.o callerid.o cdr.o channel.o chanvars.o cli.o config.o cryptostub.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o file.o fixedjitterbuf.o frame.o fskmodem.o global_datastores.o http.o image.o indications.o io.o jitterbuf.o loader.o logger.o manager.o md5.o netsock.o pbx.o plc.o poll.o privacy.o rtp.o say.o sched.o sha1.o slinfactory.o srv.o stdtime/localtime.o strcompat.o tdd.o term.o threadstorage.o translate.o udptl.o ulaw.o utils.o editline/libedit.a db1-ast/libdb1.a -> asterisk Undefined symbols: "___sync_fetch_and_add_4", referenced from: _ao2_ref in astobj2.o ___ao2_link in astobj2.o ___ao2_link in astobj2.o _ao2_callback in astobj2.o _ao2_callback in astobj2.o _ast_channel_alloc in channel.o _ast_channel_alloc in channel.o _ast_cli_command in cli.o _ast_dial_append in dial.o ___ast_module_user_add in loader.o _ast_module_unref in loader.o _ast_module_ref in loader.o ___ast_module_user_hangup_all in loader.o ___ast_module_user_remove in loader.o _accept_thread in manager.o _generic_http_callback in manager.o _generic_http_callback in manager.o _ast_atomic_fetchadd_int in utils.o "___sync_sub_and_fetch_4", referenced from: _free_session in manager.o _process_events in manager.o _action_waitevent in manager.o _ast_atomic_dec_and_test in utils.o ld: symbol(s) not found collect2: ld returned 1 exit status make[1]: *** [asterisk] Error 1 make: *** [main] Error 2

use:
./configure --host=x86_64-darwin
make

it should build correctly now. continue with the install.

also, I had sudo’d as root to run the install, don’t know if that mattered.

Worked like a charm!

ok, so the make works, but the install seems odd.

when i run the “make install”, it completes successfully, but I can’t find asterisk to start it. it’s not in /usr/bin /usr/sbin /usr/local/… it seems it didn’t actually install everything.

i can’t even find it with locate (which was running before the asterisk build).

all it seemed to install was the /var/log/asterisk

what was even weirder was that at one point it was failing because it couldn’t create /usr/bin, because it already existed as a 600MB file!?!?! any reason that should already exist, or was that from a failed previous installation? once i did “mv usr/bin /usr/bin.org” the installation would complete (created the /usr/bin directory), but as I said above, it didn’t seem to actually install it.

no problems installing either. My configure command was:

nice ./configure --host=x86_64-darwin --prefix=/usr/local WGET=/usr/bin/curl\ -O 2>&1 | tee configure.log

ok, so now i’m installed. now when i go to /usr/local/sbin and run ./asterisk, I get:

unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)

and, no, it doesn’t exist.

any suggestions? or are my install locations off…
do I need to add some symbolic links to handle darwin’s paths vs linux’s paths?

When I’ve used this on linux, I’ve had to be root or else sudo the app. I’d bet $1 that’s your problem.

ok so here’s where I am now…

I’ve only run asterisk from pre-configured distros before, so this is kind of new to me (the install and config process).

robert-justices-macbook-pro:sbin robjdj$ ./asterisk
Unable to open pid file ‘/var/run/asterisk.pid’: Permission denied
Mac OS X detected. Use ‘/sbin/launchd -d’ to launch with the nofork option.
Unable to bind socket to /var/run/asterisk.ctl: Permission denied
Logger Warning: Unable to open log file ‘/var/log/asterisk/messages’: Permission denied
[Sep 12 12:27:43] ERROR[1371]: logger.c:1030 init_logger: Unable to create event log: Permission denied
robert-justices-macbook-pro:sbin robjdj$ sudo ./asterisk
Password:
Mac OS X detected. Use ‘/sbin/launchd -d’ to launch with the nofork option.
[Sep 12 12:28:15] NOTICE[1374]: loader.c:1042 load_modules: 1 modules will be loaded.
[Sep 12 12:28:15] NOTICE[1374]: cdr.c:1474 do_reload: CDR simple logging enabled.
[Sep 12 12:28:15] NOTICE[1374]: loader.c:1042 load_modules: 158 modules will be loaded.
[Sep 12 12:28:16] WARNING[1374]: loader.c:385 load_dynamic_module: Error loading module ‘res_config_odbc.so’: dlopen(/usr/local/lib/asterisk/modules/res_config_odbc.so, 5): Symbol not found: _ast_odbc_clear_cache
Referenced from: /usr/local/lib/asterisk/modules/res_config_odbc.so
Expected in: flat namespace
in /usr/local/lib/asterisk/modules/res_config_odbc.so
[Sep 12 12:28:16] NOTICE[1374]: res_smdi.c:1360 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Sep 12 12:28:16] NOTICE[1374]: res_odbc.c:955 load_module: res_odbc loaded.
[Sep 12 12:28:16] WARNING[1374]: res_config_ldap.c:1393 parse_config: No directory user found, anonymous binding as default.
[Sep 12 12:28:16] ERROR[1374]: res_config_ldap.c:1418 parse_config: No directory URL or host found.
[Sep 12 12:28:16] NOTICE[1374]: res_config_ldap.c:1311 load_module: Cannot load LDAP RealTime driver.
[Sep 12 12:28:16] NOTICE[1374]: config.c:1953 ast_config_engine_register: Registered Config Engine odbc
[Sep 12 12:28:16] NOTICE[1374]: config.c:1953 ast_config_engine_register: Registered Config Engine curl
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:122 pbx_load_module: Starting AEL load process.
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:135 pbx_load_module: AEL load process: parsed config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:138 pbx_load_module: AEL load process: checked config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:141 pbx_load_module: AEL load process: compiled config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:146 pbx_load_module: AEL load process: merged config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Sep 12 12:28:17] NOTICE[1374]: pbx_ael.c:149 pbx_load_module: AEL load process: verified config file name ‘/usr/local/etc/asterisk/extensions.ael’.
[Sep 12 12:28:17] WARNING[1374]: translate.c:654 __ast_register_translator: plc_samples 160 format f
[Sep 12 12:28:17] WARNING[1374]: chan_unistim.c:5495 reload_config: Your OS does not support IP_PKTINFO, you must set public_ip.
[Sep 12 12:28:17] WARNING[1374]: utils.c:1534 __ast_string_field_init: trying to reset empty pool
[Sep 12 12:28:17] WARNING[1374]: utils.c:1534 __ast_string_field_init: trying to reset empty pool
[Sep 12 12:28:17] WARNING[1374]: utils.c:1534 __ast_string_field_init: trying to reset empty pool

^Crobert-justices-macbook-pro:sbin robjdj$ sudo ./asterisk -rvvvvg
Asterisk 1.6.1.6, Copyright © 1999 - 2009 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

== Parsing ‘/usr/local/etc/asterisk/asterisk.conf’: == Found
== Parsing ‘/usr/local/etc/asterisk/extconfig.conf’: == Found
Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
robert-justices-macbook-pro:sbin robjdj$ ls
aelparse asterisk autosupport hashtest muted refcounter stereorize
astcanary astgenkey conf2ael hashtest2 rasterisk safe_asterisk streamplayer

should I be running something other that ./asterisk first?
I thought running ./asterisk -rvvvvg connected to the console, so really, something has to be running in the background for it to connect to. when I do a ps -a, I don’t see any asterisk processes running.
thanks…

Installing Asterisk 1.6.x on Mac OS X

  1. Get apple’s Xcode developer tools which installs gcc and other necessities.
    developer.apple.com/technology/xcode.html

  2. Login as root
    sudo su -
    (provide credentials for the admin user you use, not root)

  3. Download wget from gnu. You’ll need it if you configured some options in the make menuconfig later, and it’s good stuff anyway.
    ftp.gnu.org/gnu/wget/

  4. Untar and install it.
    tar -zxvf wget-1.11.4.tgz
    cd wget-1.11.4
    ./configure
    make
    make install

  5. Download your favorite open source PBX version 1.6.x.

  6. Untar, and change directories.
    tar -zxvf asterisk-1.6..tgz
    cd asterisk-1.6.

  7. ./configure --host=x86_64-darwin

  8. Select build options with “make menuconfig”

  9. make

  10. make install

This should get anyone going. If you think you broken somewhere in the middle with your own method, try starting from scratch with this.

robjdj, Sorry I sidetracked on the last post.

I think the issue you posted was due to the fact that asterisk really wasn’t running yet. You have to start a daemon first, and then you can have a session to connect to with the R or r option (the r’s just connect to running session).

I can’t figure out how to correctly get asterisk started with launchctl using a /System/Library/LaunchDaemon/ plist file.

Here are some old instructions:
voip-info.org/wiki/view/Buil … +on+MacOSX
… look for the old lauchd section, which was for OS X Tiger using asterisk 1.4.x I think.

If you don’t want to run asterisk as a proper Mac OS X daemon, but just want to get it going, try: “asterisk -cf”

That will give you a cli running in the foreground. Obviously you could then connect with another terminal using “asterisk -vvvvvvvvr” or whatever remote connection you want.

Anyone else a launchctl guru?

All is well with my Asterisk 1.6.1.6 running on Mac OSX 10.6.1. Thanks very much to those of you in the community more experienced than I, who found and communicated the solution here.

I can make Asterisk 1.6.1.6 on OS X 10.6.1 but it does not work for Asterisk 1.6.2.0-rc2. I follow these steps:
sudo su -
make menuconfig
./configure --host=x86_64-darwin
make

This works with 1.6.1.6 but fails as follows for 1.6.2.0-rc2:
[LD] chan_agent.o -> chan_agent.so
ld: symbol dyld_stub_binding_helper not defined (usually in crt1.o/dylib1.o/bundle1.o)
collect2: ld returned 1 exit status
make[1]: *** [chan_agent.so] Error 1
make: *** [channels] Error 2

Do I need to do anything different for 1.6.2.0-rc2 or could this be a bug with this release candidate? Thank you.

I use this launchd.plist file for asterisk. Rename it to /Library/LaunchDaemons/local.asterisk.plist and it needs to be owned by root with no write permissions for others.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>local.asterisk</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/sbin/asterisk</string>
		<string>-f</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/tmp/asterisk.out</string>
	<key>StandardOutPath</key>
	<string>/tmp/asterisk.out</string>
</dict>
</plist>

You may need to change the path of asterisk if you have installed it elsewhere. The StandardErrorPath and StandardOutPath settings may be unnecessary but were required with an early 1.4 and don’t hurt.

Load the plist with

sudo launchctl load -w /Library/LaunchDaemons/local.asterisk.plist

This will run asterisk (RunAtLoad is true), right away and after a reboot. Run an unload -w to stop asterisk and disable launching after a boot.

Read the launchd.plist manual page for more information.

I have installed successfully, but every time I run it I get a Bus Error.
I am running it on a Mac Mini Snow Leopard Server.