bash-3.2$ make xlinrad64
gcc -D_FILE_OFFSET_BITS=64 xmain.c -I/usr/X11R6/include -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o xmain.om
gcc -D_FILE_OFFSET_BITS=64 ui.c -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o ui.om
In file included from ui.c:54:
./loadalsa.h:137:5: error: '__BYTE_ORDER' is not defined, evaluates to 0 [-Werror,-Wundef]
#if __BYTE_ORDER == __LITTLE_ENDIAN
^
./loadalsa.h:137:21: error: '__LITTLE_ENDIAN' is not defined, evaluates to 0 [-Werror,-Wundef]
#if __BYTE_ORDER == __LITTLE_ENDIAN
^
2 errors generated.
make: *** [ui.om] Error 1
gcc -D_FILE_OFFSET_BITS=64 lsetad.c -DALSA_LIBNAME=\"libasound.dylib\" -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o lsetad.om
lsetad.c:1405:20: error: use of undeclared identifier 'EBADFD'
if(err == -EBADFD)
gcc -D_FILE_OFFSET_BITS=64 hid.c -DUDEV_LIBNAME=\"libudev.dylib\" -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o hid.om
hid.c:857:10: fatal error: 'linux/types.h' file not found
#include <linux/types.h>
I continue to look for solution, by the way for MAC OS there is special hid.c function that does not use libusb, but IOKit and CoreFoundation
73!
Alex
Below you can find changes that have to be applied to linrad-04.07 sourc code to be
compiled under MAC OS X El Capitan, affcted files list:
loadalsa.h
lsetad.c
hidmac.c (new file)
Makefile.in
afedri.c
fcdpp.c
configure.in
1. According Leif's example:
Before the first meet of __BYTE_ORDER (at line number 136)
Insert into loadalsa.h next definitions:
#ifndef __BYTE_ORDER
#define __BYTE_ORDER 1234
#endif
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN 1234
#endif
2. In file lsetad.c insert next definitions (on line number 50):
#ifndef EBADFD
#define EBADFD EBADF
#endif
3. Copy to linrad directory hidmac.c file
4.
Edit Makefile.in
Add next text to line 46:
ifneq ($(OS),Windows_NT)
OS=$(shell uname)
endif
ifeq ($(OS), Darwin)
LIBMACOSX = -framework IOKit -framework CoreFoundation
endif
replace on line 190 text:
HID=hid.c hidapi.h
by new tet:
ifeq ($(OS), Darwin)
HID=hidmac.c hidapi.h
else
HID=hid.c hidapi.h
endif
replace on line 1966:
-lpthread @LIBRT@ -lm -ldl $(LIBMACOSX)
replace on line 2168 text:
hid.om: $(HID)
$(LCC) hid.c -DUDEV_LIBNAME=\"@LIBUDEV_64_LD@\" $(CFL64) hid.om
by the new text:
ifeq ($(OS), Darwin)
hid.om: $(HID)
$(LCC) hidmac.c $(CFL64) hid.om -Wno-unused-parameter
else
hid.om: $(HID)
$(LCC) hid.c -DUDEV_LIBNAME=\"@LIBUDEV_64_LD@\" $(CFL64) hid.om
endif
5. Edit file fcdpp.c and change every #if line before line containing the function load_udev_library()
to next text (lines: 201, 222, 245, 726):
#if OSNUM == OSNUM_LINUX && defined(__linux__)
6. Edit file afedri.c and change every #if line before line containing the function load_udev_library()
to next text (lines: 306, 440, 553):
#if OSNUM == OSNUM_LINUX && defined(__linux__)
7.
In configure.in file find text (line 630):
ST="-no_pie "
and replace it by
ST="-Wl,-no_pie"
8. Now you can try to compile Linrad
./autoconf
./configure
make xlinrad64
You can download full linrad-04.07-mac archive that ready to compile and for reference here: http://afedri-sdr.com/index.php/downloads/category/24-source-code-directory?download=232:linrad-4-07-adopted-for-mac-os-x-el-capitan
ipa=(int*)(void*)&fptr_pa;
ipa[0]=(int)FileInformation.nFileSizeLow;
ipa[1]=(int)FileInformation.nFileSizeHigh;
ipa=(int*)(void*)&fptr_pa;
fptr_pa = (uint64_t)FileInformation.nFileSizeLow | ((uint64_t)FileInformation.nFileSizeHigh) <<32;
This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
hidmac.c (new file)
Makefile.in
afedri.c
fcdpp.c
configure.in
if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
{
if(snd[RXAD].open_flag == CALLBACK_CMD_START)
{
snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
}
if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
{
return paContinue;
}
snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
return paAbort;
}
printf("rxad->%lu ",framesToProcess);fflush(stdout);
Linrad - has never came to this point.
I forgot to add that input data dump function was put in the beginning of Callback function rxadCallback(....)
fwrite(inputBuffer,4, framesToProcess, stdout);fflush(stdout);
if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
{
if(snd[RXAD].open_flag == CALLBACK_CMD_START)
{
snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
}
if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
{
return paContinue;
}
snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
return paAbort;
}
printf("rxad->%lu ",framesToProcess);fflush(stdout);
Linrad - has never came to this point.