Bug 1126607, part 4: Simplify the LDAP build system further, r=glandium.

Two major changes are present in this bug:
1. The LDAP libraries names are no longer different between Windows and all
other platforms, with the DLLs changing on Windows to match the scheme.
2. We no longer build the static libraries that we don't appear to use (libutil
and libiutil).

SeaMonkey's packaging changes get to be pushed against a CLOSED TREE.

--HG--
extra : amend_source : 284da615cf1bdafc2dfe73273002412503c61746
This commit is contained in:
Joshua Cranmer 2015-04-19 22:20:50 -05:00
Родитель c5bff1cf36
Коммит a7aca4966d
18 изменённых файлов: 24 добавлений и 328 удалений

Просмотреть файл

@ -1,103 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Public interface for libiutil the innosoft migration library
*
*/
#ifdef _WINDOWS
#include "ldap.h"
#define LDAP_MUTEX_T HANDLE
int
pthread_mutex_init( LDAP_MUTEX_T *mp, void *attr)
{
if ( (*mp = CreateMutex(NULL, FALSE, NULL)) == NULL )
return( 1 );
else
return( 0 );
}
static void *
pthread_mutex_alloc( void )
{
LDAP_MUTEX_T *mutexp;
if ( (mutexp = malloc( sizeof(LDAP_MUTEX_T) )) != NULL ) {
pthread_mutex_init( mutexp, NULL );
}
return( mutexp );
}
int
pthread_mutex_destroy( LDAP_MUTEX_T *mp )
{
if ( !(CloseHandle(*mp)) )
return( 1 );
else
return( 0 );
}
static void
pthread_mutex_free( void *mutexp )
{
pthread_mutex_destroy( (LDAP_MUTEX_T *) mutexp );
free( mutexp );
}
int
pthread_mutex_lock( LDAP_MUTEX_T *mp )
{
if ( (WaitForSingleObject(*mp, INFINITE) != WAIT_OBJECT_0) )
return( 1 );
else
return( 0 );
}
int
pthread_mutex_unlock( LDAP_MUTEX_T *mp )
{
if ( !(ReleaseMutex(*mp)) )
return( 1 );
else
return( 0 );
}
#endif /* WINDOWS */

Просмотреть файл

@ -1,20 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include('/ldap/ldap-sdk.mozbuild')
Library(get_ldap_name('iutil'))
SOURCES += [
'iutil-lock.c'
]
DEFINES['USE_WAITPID'] = True
DEFINES['NEEDPROTOS'] = True
LOCAL_INCLUDES += [
'/ldap/c-sdk/include'
]

Просмотреть файл

@ -5,7 +5,7 @@
include('/ldap/ldap-sdk.mozbuild')
Library(get_ldap_name('lber'))
Library('lber60')
SOURCES += [
'bprint.c',

Просмотреть файл

@ -35,7 +35,7 @@
;
; ***** END LICENSE BLOCK *****
LIBRARY NSLDAP32V60
LIBRARY LDAP60
DESCRIPTION 'Lightweight Directory Access Protocol Client API for 32-bit Windows'
VERSION 6.0
HEAPSIZE 4096

Просмотреть файл

@ -5,7 +5,7 @@
include('/ldap/ldap-sdk.mozbuild')
SharedLibrary(get_ldap_name('ldap'))
SharedLibrary('ldap60')
SOURCES += [
'abandon.c',
@ -85,4 +85,4 @@ LOCAL_INCLUDES += [
'/ldap/c-sdk/include'
]
USE_LIBS += [get_ldap_name('lber')]
USE_LIBS += ['lber60']

Просмотреть файл

@ -35,7 +35,7 @@
;
; ***** END LICENSE BLOCK *****
LIBRARY NSLDIF32V60
LIBRARY LDIF60
DESCRIPTION 'Lightweight Directory Access Protocol LDIF Client API for 32-bit Windows'
VERSION 6.0
HEAPSIZE 4096

Просмотреть файл

@ -5,7 +5,7 @@
include('/ldap/ldap-sdk.mozbuild')
SharedLibrary(get_ldap_name('ldif'))
SharedLibrary('ldif60')
SOURCES += [
'line64.c'

Просмотреть файл

@ -35,7 +35,7 @@
;
; ***** END LICENSE BLOCK *****
LIBRARY NSLDAPPR32V60
LIBRARY PRLDAP60
DESCRIPTION 'LDAP to NSPR glue library for 32-bit Windows'
VERSION 6.0
HEAPSIZE 4096

Просмотреть файл

@ -5,7 +5,7 @@
include('/ldap/ldap-sdk.mozbuild')
SharedLibrary('nsldappr32v60' if CONFIG['OS_ARCH'] == 'WINNT' else 'prldap60')
SharedLibrary('prldap60')
SOURCES += [
'ldappr-dns.c',
@ -26,6 +26,6 @@ LOCAL_INCLUDES += [
]
USE_LIBS += [
get_ldap_name('ldap'),
'ldap60',
'nspr'
]

Просмотреть файл

@ -1,146 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifdef _WINDOWS
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)getopt.c 4.12 (Berkeley) 6/1/90";
#endif /* LIBC_SCCS and not lint */
#include <windows.h>
#include <stdio.h>
#include <string.h>
#define index strchr
#define rindex strrchr
/*
* get option letter from argument vector
*/
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
optopt; /* character checked for validity */
char *optarg; /* argument associated with option */
#define BADCH (int)'?'
#define EMSG ""
int getopt(int nargc, char *const *nargv, const char *ostr)
{
static char *place = EMSG; /* option letter processing */
register char *oli; /* option letter list index */
char *p;
if (!*place) { /* update scanning pointer */
if (optind >= nargc || *(place = nargv[optind]) != '-') {
place = EMSG;
return(EOF);
}
if (place[1] && *++place == '-') { /* found "--" */
++optind;
place = EMSG;
return(EOF);
}
} /* option letter okay? */
if ((optopt = (int)*place++) == (int)':' ||
!(oli = index(ostr, optopt))) {
/*
* if the user didn't specify '-' as an option,
* assume it means EOF.
*/
if (optopt == (int)'-')
return(EOF);
if (!*place)
++optind;
if (opterr) {
if (!(p = rindex(*nargv, '/')))
p = *nargv;
else
++p;
(void)fprintf(stderr, "%s: illegal option -- %c\n",
p, optopt);
}
return(BADCH);
}
if (*++oli != ':') { /* don't need argument */
optarg = NULL;
if (!*place)
++optind;
}
else { /* need an argument */
if (*place) /* no white space */
optarg = place;
else if (nargc <= ++optind) { /* no arg */
place = EMSG;
if (!(p = rindex(*nargv, '/')))
p = *nargv;
else
++p;
if (opterr)
(void)fprintf(stderr,
"%s: option requires an argument -- %c\n",
p, optopt);
return(BADCH);
}
else /* white space */
optarg = nargv[optind];
place = EMSG;
++optind;
}
return(optopt); /* dump back option letter */
}
#endif

Просмотреть файл

@ -1,16 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include('/ldap/ldap-sdk.mozbuild')
Library(get_ldap_name('util'))
SOURCES += [
'getopt.c',
]
LOCAL_INCLUDES += [
'/ldap/c-sdk/include'
]

Просмотреть файл

@ -6,11 +6,6 @@
DIRS += [
'liblber',
'libldif',
'libiutil',
'libldap',
'libprldap'
]
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['libutil']

Просмотреть файл

@ -23,8 +23,3 @@ DEFINES['NS_DOMESTIC'] = True
if CONFIG['MOZ_DEBUG']:
DEFINES['LDAP_DEBUG'] = True
if CONFIG['OS_ARCH'] == 'WINNT':
get_ldap_name = lambda simple: 'ns%s32v60' % simple
else:
get_ldap_name = lambda simple: '%s60' % simple

Просмотреть файл

@ -9,15 +9,8 @@ DIRS += [
'c-sdk/libraries'
]
if CONFIG['OS_ARCH'] == 'WINNT':
USE_LIBS += [
'nsldap32v60',
'nsldappr32v60',
'nsldif32v60',
]
else:
USE_LIBS += [
'ldap60',
'ldif60',
'prldap60',
]
USE_LIBS += [
'ldap60',
'ldif60',
'prldap60',
]

Просмотреть файл

@ -323,15 +323,9 @@
@RESPATH@/components/nsAbLDAPAutoCompleteSearch.js
@RESPATH@/components/nsLDAPProtocolHandler.js
@RESPATH@/components/ldapComponents.manifest
#ifdef XP_WIN32
@BINPATH@/nsldap32v60@DLL_SUFFIX@
@BINPATH@/nsldappr32v60@DLL_SUFFIX@
@BINPATH@/nsldif32v60@DLL_SUFFIX@
#else
@BINPATH@/@DLL_PREFIX@ldap60@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@ldif60@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@prldap60@DLL_SUFFIX@
#endif
; download progress for jsdownloads
@RESPATH@/components/DownloadsStartup.js

Просмотреть файл

@ -377,6 +377,11 @@ uninstall/uninstall.exe
@DIR_MACOS@@DLL_PREFIX@ldap50@DLL_SUFFIX@
@DIR_MACOS@nsldappr32v50.dll
@DIR_MACOS@@DLL_PREFIX@prldap50@DLL_SUFFIX@
#ifdef XP_WIN
nsldap32v60.dll
nsldappr32v60.dll
nsldif32v60.dll
#endif
@DIR_MACOS@redo-prebinding.sh
@DIR_MACOS@regxpcom.exe
#ifdef XP_WIN

Просмотреть файл

@ -720,15 +720,9 @@ bin/libfreebl_32int64_3.so
; LDAP components need to be in the browser for AutoConfig
@RESPATH@/components/mozldap.xpt
@RESPATH@/components/nsLDAPProtocolHandler.js
#ifdef XP_WIN32
@BINPATH@/nsldap32v60.dll
@BINPATH@/nsldappr32v60.dll
@BINPATH@/nsldif32v60.dll
#else
@BINPATH@/@DLL_PREFIX@ldap60@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@ldif60@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@prldap60@DLL_SUFFIX@
#endif
; [Updater]
;

Просмотреть файл

@ -350,6 +350,11 @@ jsj3250.dll
@DIR_MACOS@@DLL_PREFIX@nssutil3@DLL_SUFFIX@
@DIR_MACOS@@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
#endif
#ifdef XP_WIN
nsldap32v60.dll
nsldappr32v60.dll
nsldif32v60.dll
#endif
@DLL_PREFIX@mozlcms@DLL_SUFFIX@
omni.jar
#ifdef XP_MACOSX