Ticket #8937: 001-cross_compile.patch

File 001-cross_compile.patch, 4.9 KB (added by sebastian@…, 7 years ago)

001-cross_compile.patch

  • mDNSResponder-214.3.2

    diff -u --recursive mDNSResponder-214.3.2.orig/Clients/Makefile mDNSResponder-214.3.2/Clients/Makefile
    old new  
    6464 
    6565# On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable 
    6666# If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library 
    67 ifneq "$(wildcard /usr/lib/libSystem.dylib)" "" 
    68 TARGETS = build/dns-sd build/dns-sd64 
    69 LIBS = 
    70 else 
     67 
     68###### 
     69# Disabled check as we build FOR openwrt and if we build ON Mac OS X  
     70# the build otherwise will fail, as it'll be missing the lib dns_sd  
     71###### 
     72#ifneq "$(wildcard /usr/lib/libSystem.dylib)" "" 
     73 
     74#TARGETS = build/dns-sd build/dns-sd64 
     75#LIBS = 
     76#else 
    7177TARGETS = build/dns-sd 
    7278LIBS = -L../mDNSPosix/build/prod/ -ldns_sd 
    73 endif 
     79#endif 
    7480 
    7581all: $(TARGETS) 
    7682 
     
    8187        mkdir build 
    8288 
    8389build/dns-sd: build dns-sd.c ClientCommon.c 
    84         cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ 
     90        $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ 
    8591 
    8692build/dns-sd64: build dns-sd.c ClientCommon.c 
    87         cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 
     93        $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64 
    8894 
    8995# Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we 
    9096# don't, because we don't want or need a 'fat' version of dns-sd, because it will 
  • mDNSResponder-214.3.2

    diff -u --recursive mDNSResponder-214.3.2.orig/mDNSPosix/Makefile mDNSResponder-214.3.2/mDNSPosix/Makefile
    old new  
    316316SHAREDDIR ?= ../mDNSShared 
    317317JDK = /usr/jdk 
    318318 
    319 CC = @cc 
     319CC = @gcc 
    320320BISON = @bison 
    321321FLEX = @flex 
    322 LD = ld -shared 
     322LD = @ld 
     323SOOPTS = -shared 
    323324CP = cp 
    324325RM = rm 
    325326LN = ln -s -f 
     
    344345CFLAGS_DEBUG = -Os -DMDNS_DEBUGMSGS=0  
    345346OBJDIR ?= objects/prod 
    346347BUILDDIR ?= build/prod 
    347 STRIP = strip -S  
     348STRIP = @strip -S  
    348349endif 
    349350 
    350351# Configure per-OS peculiarities 
     
    353354CFLAGS_OS = -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN -DNOT_HAVE_SOCKLEN_T -DNOT_HAVE_IF_NAMETOINDEX \ 
    354355         -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME -DTARGET_OS_SOLARIS 
    355356CC = gcc 
    356 LD = gcc -shared 
     357LD = gcc 
    357358LINKOPTS = -lsocket -lnsl -lresolv 
    358359JAVACFLAGS_OS += -I$(JDK)/include/solaris 
    359360ifneq ($(DEBUG),1) 
     
    404405CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \ 
    405406        -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 #-Wunreachable-code 
    406407CC = @gcc-4.0 
    407 LD = $(CC) -dynamiclib 
     408LD = $(CC) 
     409SOOPTS = -dynamiclib 
    408410LINKOPTS = -lSystem 
    409411LDSUFFIX = dylib 
    410412JDK = /System/Library/Frameworks/JavaVM.framework/Home 
     
    426428NSSLINKNAME := $(NSSLIBNAME).so.2 
    427429NSSINSTPATH := /lib 
    428430 
    429 # If not otherwise defined, we install into /usr/lib and /usr/include 
     431# If not otherwise defined, we install into /usr/lib, /usr/include and /etc 
    430432# and our startup script is called mdns (e.g. /etc/init.d/mdns) 
     433ETCBASE?=/etc 
    431434INSTBASE?=/usr 
    432435STARTUPSCRIPTNAME?=mdns 
    433436 
     
    511514CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o 
    512515 
    513516$(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS) 
    514         @$(LD) $(LINKOPTS) -o $@ $+ 
     517        @$(LD) $(SOOPTS) $(LINKOPTS) -o $@ $+ 
    515518        @$(STRIP) $@ 
    516519 
    517520Clients: setup libdns_sd ../Clients/build/dns-sd 
     
    546549InstalledClients: $(INSTBASE)/bin/dns-sd 
    547550        @echo $+ " installed" 
    548551 
    549 InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) /etc/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 
     552InstalledNSS: $(NSSINSTPATH)/$(NSSLINKNAME) $(ETCBASE)/nss_mdns.conf $(MANPATH)/man5/nss_mdns.conf.5 $(MANPATH)/man8/libnss_mdns.8 
    550553        @echo $+ " installed" 
    551554 
    552555# Note: If daemon already installed, we make sure it's stopped before overwriting it 
     
    601604 
    602605$(NSSINSTPATH)/$(NSSLINKNAME): $(NSSINSTPATH)/$(NSSLIBFILE) 
    603606        $(LN) $< $@ 
     607ifdef LDCONFIG 
    604608        ldconfig 
     609endif 
    605610 
    606611$(NSSINSTPATH)/$(NSSLIBFILE): $(BUILDDIR)/$(NSSLIBFILE) 
    607612        $(CP) $< $@ 
    608613        chmod 444 $@ 
    609614 
    610 /etc/nss_mdns.conf: nss_mdns.conf 
     615$(ETCBASE)/nss_mdns.conf: nss_mdns.conf 
    611616        $(CP) $< $@ 
    612617        chmod 444 $@ 
    613618        # Check the nsswitch.conf file. 
    614619        # If 'mdns' does not already appear on the "hosts:" line, then add it right before 'dns' 
    615         cp -f /etc/nsswitch.conf /etc/nsswitch.conf.pre-mdns 
    616         sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' /etc/nsswitch.conf.pre-mdns > /etc/nsswitch.conf 
     620        -[ -f $(ETCBASE)/nsswitch.conf ] && cp -f $(ETCBASE)/nsswitch.conf $(ETCBASE)/nsswitch.conf.pre-mdns 
     621        -[ -f $(ETCBASE)/nsswitch.conf ] && sed -e '/mdns/!s/^\(hosts:.*\)dns\(.*\)/\1mdns dns\2/' $(ETCBASE)/nsswitch.conf.pre-mdns > $(ETCBASE)/nsswitch.conf 
    617622 
    618623############################################################################# 
    619624