source: packages/net/samba36/patches/110-multicall.patch @ 30511

Last change on this file since 30511 was 30511, checked in by nbd, 5 years ago

samba36: fix some linking issues

File size: 4.1 KB
  • source3/Makefile.in

    a b LDAP_LIBS=@LDAP_LIBS@ 
    7373NSCD_LIBS=@NSCD_LIBS@ 
    7474UUID_LIBS=@UUID_LIBS@ 
    7575LIBWBCLIENT=@LIBWBCLIENT_STATIC@ @LIBWBCLIENT_SHARED@ 
    76 LIBWBCLIENT_LIBS=@LIBWBCLIENT_LIBS@ 
     76LIBWBCLIENT_LIBS=@LIBWBCLIENT_STATIC@ 
    7777PTHREAD_LDFLAGS=@PTHREAD_LDFLAGS@ 
    7878PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ 
    7979DNSSD_LIBS=@DNSSD_LIBS@ 
    8080AVAHI_LIBS=@AVAHI_LIBS@ 
    8181POPT_LIBS=@POPTLIBS@ 
    8282LIBTALLOC=@LIBTALLOC_STATIC@ @LIBTALLOC_SHARED@ 
    83 LIBTALLOC_LIBS=@LIBTALLOC_LIBS@ 
     83LIBTALLOC_LIBS=@LIBTALLOC_STATIC@ 
    8484LIBREPLACE_LIBS=@LIBREPLACE_LIBS@ 
    8585LIBTDB=@LIBTDB_STATIC@ @LIBTDB_SHARED@ 
    86 LIBTDB_LIBS=@LIBTDB_LIBS@ 
     86LIBTDB_LIBS=@LIBTDB_STATIC@ 
    8787TDB_DEPS=@TDB_DEPS@ 
    8888LIBNETAPI=@LIBNETAPI_STATIC@ @LIBNETAPI_SHARED@ 
    89 LIBNETAPI_LIBS=@LIBNETAPI_LIBS@ 
     89LIBNETAPI_LIBS=@LIBNETAPI_STATIC@ 
    9090LIBSMBCLIENT_LIBS=@LIBSMBCLIENT_LIBS@ 
    9191LIBSMBSHAREMODES_LIBS=@LIBSMBSHAREMODES_LIBS@ 
    9292 
    PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_P 
    214214 
    215215# Note that all executable programs now provide for an optional executable suffix. 
    216216 
    217 SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ 
     217SBIN_PROGS = bin/samba_multicall@EXEEXT@ bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ 
    218218 
    219219BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ 
    220220        bin/testparm@EXEEXT@ bin/smbstatus@EXEEXT@ bin/smbget@EXEEXT@ \ 
    bin/.dummy: 
    17741774          dir=bin $(MAKEDIR); fi 
    17751775        @: >> $@ || : > $@ # what a fancy emoticon! 
    17761776 
     1777smbd/server_multicall.o: smbd/server.c smbd/server.o 
     1778        @echo Compiling $<.c 
     1779        @$(COMPILE_CC_PATH) -Dmain=smbd_main && exit 0;\ 
     1780                echo "The following command failed:" 1>&2;\ 
     1781                echo "$(COMPILE_CC_PATH)" 1>&2;\ 
     1782                $(COMPILE_CC_PATH) >/dev/null 2>&1 
     1783 
     1784nmbd/nmbd_multicall.o: nmbd/nmbd.c nmbd/nmbd.o 
     1785        @echo Compiling $<.c 
     1786        @$(COMPILE_CC_PATH) -Dmain=nmbd_main && exit 0;\ 
     1787                echo "The following command failed:" 1>&2;\ 
     1788                echo "$(COMPILE_CC_PATH)" 1>&2;\ 
     1789                $(COMPILE_CC_PATH) >/dev/null 2>&1 
     1790 
     1791utils/smbpasswd_multicall.o: utils/smbpasswd.c utils/smbpasswd.o 
     1792        @echo Compiling $<.c 
     1793        @$(COMPILE_CC_PATH) -Dmain=smbpasswd_main && exit 0;\ 
     1794                echo "The following command failed:" 1>&2;\ 
     1795                echo "$(COMPILE_CC_PATH)" 1>&2;\ 
     1796                $(COMPILE_CC_PATH) >/dev/null 2>&1 
     1797 
     1798SMBD_MULTI_O = $(patsubst smbd/server.o,smbd/server_multicall.o,$(SMBD_OBJ)) 
     1799NMBD_MULTI_O = $(patsubst nmbd/nmbd.o,nmbd/nmbd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(NMBD_OBJ))) 
     1800SMBPASSWD_MULTI_O = $(patsubst utils/smbpasswd.o,utils/smbpasswd_multicall.o,$(filter-out $(LIB_DUMMY_OBJ),$(SMBPASSWD_OBJ))) 
     1801MULTI_O = multi.o 
     1802 
     1803MULTICALL_O = $(sort $(SMBD_MULTI_O) $(NMBD_MULTI_O) $(SMBPASSWD_MULTI_O) $(MULTI_O)) 
     1804 
     1805bin/samba_multicall@EXEEXT@: $(BINARY_PREREQS) $(MULTICALL_O) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ 
     1806        @echo Linking $@ 
     1807        @$(CC) -o $@ $(MULTICALL_O) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ 
     1808                $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ 
     1809                $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \ 
     1810                $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \ 
     1811                $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) 
     1812 
    17771813bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ 
    17781814        @echo Linking $@ 
    17791815        @$(CC) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ 
  • new file source3/multi.c

    - +  
     1#include <stdio.h> 
     2#include <string.h> 
     3 
     4extern int smbd_main(int argc, char **argv); 
     5extern int nmbd_main(int argc, char **argv); 
     6extern int smbpasswd_main(int argc, char **argv); 
     7 
     8static struct { 
     9        const char *name; 
     10        int (*func)(int argc, char **argv); 
     11} multicall[] = { 
     12        { "smbd", smbd_main }, 
     13        { "nmbd", nmbd_main }, 
     14        { "smbpasswd", smbpasswd_main }, 
     15}; 
     16 
     17#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) 
     18 
     19int main(int argc, char **argv) 
     20{ 
     21        int i; 
     22 
     23        for (i = 0; i < ARRAY_SIZE(multicall); i++) { 
     24                if (strstr(argv[0], multicall[i].name)) 
     25                        return multicall[i].func(argc, argv); 
     26        } 
     27 
     28        fprintf(stderr, "Invalid multicall command, available commands:"); 
     29        for (i = 0; i < ARRAY_SIZE(multicall); i++) 
     30                fprintf(stderr, " %s", multicall[i].name); 
     31 
     32        fprintf(stderr, "\n"); 
     33 
     34        return 1; 
     35} 
Note: See TracBrowser for help on using the repository browser.