diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-10-31 02:17:29 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-10-31 02:01:44 +0000 |
commit | 3deece559159150a0710d8160f39583ba7f2e582 (patch) | |
tree | 861600d7060d1ca8764c26f7ecc2cb82a4a44bec /source4/build | |
parent | 9401189d5435632bcc6a177845ce03beaa804113 (diff) | |
download | samba-3deece559159150a0710d8160f39583ba7f2e582.tar.gz samba-3deece559159150a0710d8160f39583ba7f2e582.tar.bz2 samba-3deece559159150a0710d8160f39583ba7f2e582.zip |
s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/m4/ax_cflags_gcc_option.m4 | 109 | ||||
-rw-r--r-- | source4/build/m4/ax_cflags_irix_option.m4 | 174 | ||||
-rw-r--r-- | source4/build/m4/check_cc.m4 | 180 | ||||
-rw-r--r-- | source4/build/m4/check_doc.m4 | 1 | ||||
-rw-r--r-- | source4/build/m4/check_ld.m4 | 187 | ||||
-rw-r--r-- | source4/build/m4/check_path.m4 | 233 | ||||
-rw-r--r-- | source4/build/m4/env.m4 | 90 | ||||
-rw-r--r-- | source4/build/m4/public.m4 | 282 | ||||
-rwxr-xr-x | source4/build/make/lex_compile.sh | 60 | ||||
-rw-r--r-- | source4/build/make/python.mk | 51 | ||||
-rw-r--r-- | source4/build/make/rules.mk | 190 | ||||
-rw-r--r-- | source4/build/make/templates.mk | 143 | ||||
-rwxr-xr-x | source4/build/make/yacc_compile.sh | 45 | ||||
-rw-r--r-- | source4/build/smb_build/README.txt | 83 | ||||
-rw-r--r-- | source4/build/smb_build/TODO | 25 | ||||
-rw-r--r-- | source4/build/smb_build/config_mk.pm | 284 | ||||
-rwxr-xr-x | source4/build/smb_build/dot.pl | 63 | ||||
-rw-r--r-- | source4/build/smb_build/input.pm | 278 | ||||
-rw-r--r-- | source4/build/smb_build/main.pl | 105 | ||||
-rw-r--r-- | source4/build/smb_build/makefile.pm | 281 | ||||
-rw-r--r-- | source4/build/smb_build/output.pm | 172 | ||||
-rw-r--r-- | source4/build/smb_build/summary.pm | 87 |
22 files changed, 0 insertions, 3123 deletions
diff --git a/source4/build/m4/ax_cflags_gcc_option.m4 b/source4/build/m4/ax_cflags_gcc_option.m4 deleted file mode 100644 index ec01a000aa..0000000000 --- a/source4/build/m4/ax_cflags_gcc_option.m4 +++ /dev/null @@ -1,109 +0,0 @@ -dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]]) -dnl -dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like -dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds -dnl the optionflag to CFLAGS if it is understood. You can override -dnl the shellvar-default of CFLAGS of course. The order of arguments -dnl stems from the explicit macros like AX_CFLAGS_WARN_ALL. -dnl -dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or -dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options. -dnl However, if you use this macro in a few places, it would be great -dnl if you would make up a new function-macro and submit it to the -dnl ac-archive. -dnl -dnl - $1 option-to-check-for : required ("-option" as non-value) -dnl - $2 shell-variable-to-add-to : CFLAGS -dnl - $3 action-if-found : add value to shellvariable -dnl - $4 action-if-not-found : nothing -dnl -dnl note: in earlier versions, $1-$2 were swapped. We try to detect the -dnl situation and accept a $2=~/-/ as being the old option-to-check-for. -dnl -dnl also: there are other variants that emerged from the original macro -dnl variant which did just test an option to be possibly added. However, -dnl some compilers accept an option silently, or possibly for just -dnl another option that was not intended. Therefore, we have to do a -dnl generic test for a compiler family. For gcc we check "-pedantic" -dnl being accepted which is also understood by compilers who just want -dnl to be compatible with gcc even when not being made from gcc sources. -dnl -dnl see also: -dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION -dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION -dnl -dnl @, tested, experimental -dnl @version $Id: ax_cflags_gcc_option.m4,v 1.5 2003/11/29 08:13:25 guidod Exp $ -dnl @author Guido Draheim <guidod@gmx.de> -dnl http://ac-archive.sourceforge.net/C_Support/ax_cflags_gcc_option.m4 -dnl -AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl -AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl -AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_C - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) - m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - - -dnl ------------------------------------------------------------------------- - -AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl -AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl -AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_C - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) - m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - - -AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, -[AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])]) diff --git a/source4/build/m4/ax_cflags_irix_option.m4 b/source4/build/m4/ax_cflags_irix_option.m4 deleted file mode 100644 index f7fe2a19b0..0000000000 --- a/source4/build/m4/ax_cflags_irix_option.m4 +++ /dev/null @@ -1,174 +0,0 @@ -dnl @synopsis AX_CFLAGS_IRIX_OPTION (optionflag [,[shellvar][,[A][,[NA]]]) -dnl -dnl AX_CFLAGS_IRIX_OPTION(-go_for_it) would show a message as like -dnl "checking CFLAGS for irix/cc -go_for_it ... yes" and adds the -dnl optionflag to CFLAGS if it is understood. You can override the -dnl shellvar-default of CFLAGS of course. The order of arguments stems -dnl from the explicit macros like AX_CFLAGS_WARN_ALL. -dnl -dnl The cousin AX_CXXFLAGS_IRIX_OPTION would check for an option to add -dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C -dnl (since it is possible to use different compilers for C and C++). -dnl -dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or -dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options. -dnl However, if you use this macro in a few places, it would be great -dnl if you would make up a new function-macro and submit it to the -dnl ac-archive. -dnl -dnl - $1 option-to-check-for : required ("-option" as non-value) -dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case) -dnl - $3 action-if-found : add value to shellvariable -dnl - $4 action-if-not-found : nothing -dnl -dnl note: in earlier versions, $1-$2 were swapped. We try to detect the -dnl situation and accept a $2=~/-/ as being the old -dnl option-to-check-for. -dnl -dnl see also: AX_CFLAGS_GCC_OPTION for the widely used original -dnl variant. -dnl -dnl @category C -dnl @author Guido Draheim <guidod@gmx.de> -dnl @version 2005-01-21 -dnl @license GPLWithACException - -AC_DEFUN([AX_CFLAGS_IRIX_OPTION_OLD], [dnl -AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_irix_option_$2])dnl -AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for irix/cc m4_ifval($2,$2,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_C - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-fullwarn -use_readonly_const % m4_ifval($2,$2,-option)" dnl IRIX C - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) - m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - -dnl the only difference - the LANG selection... and the default FLAGS - -AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION_OLD], [dnl -AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_irix_option_$2])dnl -AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for irix/cc m4_ifval($2,$2,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_CXX - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-fullwarn -use_readonly_const % m4_ifval($2,$2,-option)" dnl IRIX C - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) - m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - -dnl -------------------------------------------------------------------------- - -AC_DEFUN([AX_CFLAGS_IRIX_OPTION_NEW], [dnl -AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_irix_option_$1])dnl -AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for irix/cc m4_ifval($1,$1,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_C - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-fullwarn -use_readonly_const % m4_ifval($1,$1,-option)" dnl IRIX C - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) - m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - -dnl the only difference - the LANG selection... and the default FLAGS - -AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION_NEW], [dnl -AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_irix_option_$1])dnl -AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for irix/cc m4_ifval($1,$1,-option)], -VAR,[VAR="no, unknown" - AC_LANG_SAVE - AC_LANG_CXX - ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-fullwarn -use_readonly_const % m4_ifval($1,$1,-option)" dnl IRIX C - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_TRY_COMPILE([],[return 0;], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done - FLAGS="$ac_save_[]FLAGS" - AC_LANG_RESTORE -]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_ifvaln($4,$4) ;; - *) m4_ifvaln($3,$3,[ - if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null - then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) - else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) - m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" - fi ]) ;; -esac -AS_VAR_POPDEF([VAR])dnl -AS_VAR_POPDEF([FLAGS])dnl -]) - -AC_DEFUN([AX_CFLAGS_IRIX_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, -[AX_CFLAGS_IRIX_OPTION_NEW($@)],[AX_CFLAGS_IRIX_OPTION_OLD($@)])]) - -AC_DEFUN([AX_CXXFLAGS_IRIX_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, -[AX_CXXFLAGS_IRIX_OPTION_NEW($@)],[AX_CXXFLAGS_IRIX_OPTION_OLD($@)])]) diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 deleted file mode 100644 index 8149a8ff55..0000000000 --- a/source4/build/m4/check_cc.m4 +++ /dev/null @@ -1,180 +0,0 @@ -dnl SMB Build Environment CC Checks -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl - -AC_LIBREPLACE_CC_CHECKS - -# -# Set the debug symbol option if we have -# --enable-*developer or --enable-debug -# and the compiler supports it -# -if test x$ac_cv_prog_cc_g = xyes -a x$debug = xyes; then - CFLAGS="${CFLAGS} -g" -fi - -dnl ########################################################################### -dnl _AC_LANG_COMPILER_SUNCC -dnl Check whether the compiler for the current language is really Sun compiler. -dnl ########################################################################### -m4_define([AC_LANG_COMPILER_SUNCC], -[AC_CACHE_CHECK([whether we are really using the Sun _AC_LANG compiler], - [ac_cv_[]_AC_LANG_ABBREV[]_compiler_suncc], -[_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __SUNPRO_C - choke me -#endif -]])], - [ac_compiler_suncc=yes], - [ac_compiler_suncc=no]) -ac_cv_[]_AC_LANG_ABBREV[]_compiler_suncc=$ac_compiler_suncc -])]) - -AC_LANG_COMPILER_SUNCC - -############################################ -# check if the compiler handles c99 struct initialization -LIBREPLACE_C99_STRUCT_INIT(samba_cv_c99_struct_initialization=yes, - samba_cv_c99_struct_initialization=no) - -if test x"$samba_cv_c99_struct_initialization" != x"yes"; then - AC_MSG_WARN([C compiler does not support c99 struct initialization!]) - AC_MSG_ERROR([Please Install gcc from http://gcc.gnu.org/]) -fi - -############################################ -# check if the compiler can handle negative enum values -# and don't truncate the values to INT_MAX -# a runtime test is needed here -AC_CACHE_CHECK([that the C compiler understands negative enum values],samba_cv_CC_NEGATIVE_ENUM_VALUES, [ - AC_TRY_RUN( -[ - #include <stdio.h> - enum negative_values { NEGATIVE_VALUE = 0xFFFFFFFF }; - int main(void) { - enum negative_values v1 = NEGATIVE_VALUE; - unsigned v2 = 0xFFFFFFFF; - if (v1 != v2) { - printf("v1=0x%08x v2=0x%08x\n", v1, v2); - return 1; - } - return 0; - } -], - samba_cv_CC_NEGATIVE_ENUM_VALUES=yes, - samba_cv_CC_NEGATIVE_ENUM_VALUES=no, - samba_cv_CC_NEGATIVE_ENUM_VALUES=yes)]) -if test x"$samba_cv_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then - AC_DEFINE(USE_UINT_ENUMS, 1, [Whether the compiler has uint enum support]) -fi - -AC_MSG_CHECKING([for test routines]) -AC_TRY_RUN([#include "${srcdir-.}/../tests/trivial.c"], - AC_MSG_RESULT(yes), - AC_MSG_ERROR([cant find test code. Aborting config]), - AC_MSG_WARN([cannot run when cross-compiling])) - -# -# Check if the compiler support ELF visibility for symbols -# - -visibility_attribute=no -VISIBILITY_CFLAGS="" -if test x"$GCC" = x"yes" ; then - AX_CFLAGS_GCC_OPTION([-fvisibility=hidden], VISIBILITY_CFLAGS) -fi - -if test -n "$VISIBILITY_CFLAGS"; then - AC_MSG_CHECKING([whether the C compiler supports the visibility attribute]) - OLD_CFLAGS="$CFLAGS" - - CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" - AC_TRY_LINK([ - void vis_foo1(void) {} - __attribute__((visibility("default"))) void vis_foo2(void) {} - ],[ - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_VISIBILITY_ATTR,1,[Whether the C compiler supports the visibility attribute]) - visibility_attribute=yes - ],[ - AC_MSG_RESULT(no) - ]) - CFLAGS="$OLD_CFLAGS" -fi -AC_SUBST(visibility_attribute) - -# -# Check if the compiler can handle the options we selected by -# --enable-*developer -# -DEVELOPER_CFLAGS="" -if test x$developer = xyes; then - OLD_CFLAGS="${CFLAGS}" - - CFLAGS="${CFLAGS} -D_SAMBA_DEVELOPER_DONNOT_USE_O2_" - DEVELOPER_CFLAGS="-DDEBUG_PASSWORD -DDEVELOPER" - if test x"$GCC" = x"yes" ; then - # - # warnings we want... - # - AX_CFLAGS_GCC_OPTION(-Wall, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wshadow, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Werror-implicit-function-declaration, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wstrict-prototypes, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wpointer-arith, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wcast-qual, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wcast-align, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wwrite-strings, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wmissing-format-attribute, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wformat=2, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wdeclaration-after-statement, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wunused-macros, DEVELOPER_CFLAGS) -# AX_CFLAGS_GCC_OPTION(-Wextra, DEVELOPER_CFLAGS) -# AX_CFLAGS_GCC_OPTION(-Wc++-compat, DEVELOPER_CFLAGS) -# AX_CFLAGS_GCC_OPTION(-Wmissing-prototypes, DEVELOPER_CFLAGS) -# AX_CFLAGS_GCC_OPTION(-Wmissing-declarations, DEVELOPER_CFLAGS) -# AX_CFLAGS_GCC_OPTION(-Wmissing-field-initializers, DEVELOPER_CFLAGS) - # - # warnings we don't want... - # - AX_CFLAGS_GCC_OPTION(-Wno-format-y2k, DEVELOPER_CFLAGS) - AX_CFLAGS_GCC_OPTION(-Wno-unused-parameter, DEVELOPER_CFLAGS) - # - # warnings we don't want just for some files e.g. swig bindings - # - AX_CFLAGS_GCC_OPTION(-Wno-cast-qual, CFLAG_NO_CAST_QUAL) - AC_SUBST(CFLAG_NO_CAST_QUAL) - AX_CFLAGS_GCC_OPTION(-Wno-unused-macros, CFLAG_NO_UNUSED_MACROS) - AC_SUBST(CFLAG_NO_UNUSED_MACROS) - elif test x"$ac_cv_c_compiler_suncc" != x"yes"; then - AX_CFLAGS_IRIX_OPTION(-fullwarn, DEVELOPER_CFLAGS) - fi - - CFLAGS="${OLD_CFLAGS}" -fi -if test -n "$DEVELOPER_CFLAGS"; then - OLD_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}" - AC_MSG_CHECKING([that the C compiler can use the DEVELOPER_CFLAGS]) - AC_TRY_COMPILE([],[], - AC_MSG_RESULT(yes), - DEVELOPER_CFLAGS=""; AC_MSG_RESULT(no)) - CFLAGS="${OLD_CFLAGS}" -fi - -# allow for --with-hostcc=gcc -AC_ARG_WITH(hostcc,[ --with-hostcc=compiler choose host compiler], -[HOSTCC=$withval], -[ -if test z"$cross_compiling" = "yes"; then - HOSTCC=cc -else - HOSTCC=$CC -fi -]) -AC_SUBST(HOSTCC) - -AC_PATH_PROG(GCOV,gcov) diff --git a/source4/build/m4/check_doc.m4 b/source4/build/m4/check_doc.m4 deleted file mode 100644 index 2aaf9596de..0000000000 --- a/source4/build/m4/check_doc.m4 +++ /dev/null @@ -1 +0,0 @@ -AC_PATH_PROG(XSLTPROC, xsltproc) diff --git a/source4/build/m4/check_ld.m4 b/source4/build/m4/check_ld.m4 deleted file mode 100644 index 48d6b333ef..0000000000 --- a/source4/build/m4/check_ld.m4 +++ /dev/null @@ -1,187 +0,0 @@ -dnl SMB Build Environment LD Checks -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004 -dnl Copyright (C) Jelmer Vernooij 2006 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl - -AC_PATH_PROG(PROG_LD,ld) -LD=${PROG_LD} -AC_PROG_LD_GNU -LD="" - -AC_SUBST(BLDSHARED) -AC_SUBST(LD) -AC_SUBST(SYS_LDFLAGS) -AC_SUBST(LDFLAGS) - -# Assume non-shared by default and override below -# these are the defaults, good for lots of systems -BLDSHARED="false" -LD="${CC}" -PICFLAG="" - -# allow for --with-hostld=gcc -AC_ARG_WITH(hostld,[ --with-hostld=linker choose host linker], -[HOSTLD=$withval], -[HOSTLD=$HOSTCC]) - -AC_MSG_CHECKING([whether to try to build shared libraries on $host_os]) - -# and these are for particular systems -case "$host_os" in - *linux*) - BLDSHARED="true" - SYS_LDFLAGS="-Wl,--export-dynamic" - ;; - *solaris*) - BLDSHARED="true" - if test "${GCC}" = "yes"; then - if test "${ac_cv_prog_gnu_ld}" = "yes"; then - SYS_LDFLAGS="-Wl,-E" - fi - fi - ;; - *sunos*) - BLDSHARED="true" - ;; - *netbsd* | *freebsd* | *dragonfly* ) - BLDSHARED="true" - SYS_LDFLAGS="-Wl,--export-dynamic" - ;; - *openbsd*) - BLDSHARED="true" - SYS_LDFLAGS="-Wl,-Bdynamic" - ;; - *irix*) - BLDSHARED="true" - ;; - *aix*) - BLDSHARED="true" - SYS_LDFLAGS="-Wl,-brtl,-bexpall,-bbigtoc" - ;; - *hpux*) - # Use special PIC flags for the native HP-UX compiler. - BLDSHARED="true" # I hope this is correct - if test "$host_cpu" = "ia64"; then - SYS_LDFLAGS="-Wl,-E,+b/usr/local/lib/hpux32:/usr/lib/hpux32" - else - SYS_LDFLAGS="-Wl,-E,+b/usr/local/lib:/usr/lib" - fi - ;; - *osf*) - BLDSHARED="true" - ;; - *unixware*) - BLDSHARED="true" - ;; - *darwin*) - BLDSHARED="true" - ;; -esac - -AC_MSG_RESULT($BLDSHARED) - -AC_MSG_CHECKING([LD]) -AC_MSG_RESULT([$LD]) -AC_MSG_CHECKING([LDFLAGS]) -AC_MSG_RESULT([$LDFLAGS]) -AC_MSG_CHECKING([SYS_LDFLAGS]) -AC_MSG_RESULT([$SYS_LDFLAGS]) - -AC_SUBST(HOSTLD) - -AC_LIBREPLACE_STLD -AC_LIBREPLACE_STLD_FLAGS - -AC_MSG_CHECKING([STLD]) -AC_MSG_RESULT([$STLD]) -AC_MSG_CHECKING([STLD_FLAGS]) -AC_MSG_RESULT([$STLD_FLAGS]) - -AC_LD_PICFLAG -AC_LD_EXPORT_DYNAMIC -AC_LD_SHLIBEXT -AC_LD_SONAMEFLAG -AC_LIBREPLACE_SHLD -AC_LIBREPLACE_SHLD_FLAGS -AC_LIBREPLACE_MDLD -AC_LIBREPLACE_MDLD_FLAGS -AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR - -####################################################### -# test whether building a shared library actually works -if test $BLDSHARED = true; then - - AC_MSG_CHECKING([SHLD]) - AC_MSG_RESULT([$SHLD]) - AC_MSG_CHECKING([SHLD_FLAGS]) - AC_MSG_RESULT([$SHLD_FLAGS]) - - AC_MSG_CHECKING([MDLD]) - AC_MSG_RESULT([$MDLD]) - AC_MSG_CHECKING([MDLD_FLAGS]) - AC_MSG_RESULT([$MDLD_FLAGS]) - - AC_MSG_CHECKING([SHLIBEXT]) - AC_MSG_RESULT([$SHLIBEXT]) - AC_MSG_CHECKING([SONAMEFLAG]) - AC_MSG_RESULT([$SONAMEFLAG]) - - AC_MSG_CHECKING([PICFLAG]) - AC_MSG_RESULT([$PICFLAG]) - - AC_CACHE_CHECK([whether building shared libraries actually works], - [ac_cv_shlib_works],[ - ac_cv_shlib_works=no - # try building a trivial shared library - # TODO: also test SONAMEFLAG - ${CC} ${CFLAGS} ${PICFLAG} -c ${srcdir-.}/../tests/shlib.c -o shlib.o && - ${SHLD} ${SHLD_FLAGS} -o shlib.${SHLIBEXT} shlib.o && - ac_cv_shlib_works=yes - rm -f shlib.${SHLIBEXT} shlib.o - ]) - AC_CACHE_CHECK([whether building shared modules actually works], - [ac_cv_shmod_works],[ - ac_cv_shmod_works=no - # try building a trivial shared library - ${CC} ${CFLAGS} ${PICFLAG} -c ${srcdir-.}/../tests/shlib.c -o shlib.o && - ${MDLD} ${MDLD_FLAGS} -o shlib.${SHLIBEXT} shlib.o && - ac_cv_shmod_works=yes - rm -f shlib.${SHLIBEXT} shlib.o - ]) - if test $ac_cv_shlib_works = no; then - AC_MSG_ERROR(unable to build shared libraries) - fi - if test $ac_cv_shmod_works = no; then - AC_MSG_ERROR(unable to build shared modules) - fi -fi - -AC_DEFINE_UNQUOTED(SHLIBEXT, "$SHLIBEXT", [Shared library extension]) - -AC_MSG_CHECKING([if we can link using the selected flags]) -AC_TRY_RUN([#include "${srcdir-.}/../tests/trivial.c"], - AC_MSG_RESULT(yes), - AC_MSG_ERROR([we cannot link with the selected cc and ld flags. Aborting configure]), - AC_MSG_WARN([cannot run when cross-compiling])) - - -USESHARED=false -AC_SUBST(USESHARED) - -AC_ARG_ENABLE(dso, -[ --enable-dso Enable using shared libraries internally (experimental)], -[],[enable_dso=no]) - -if test x"$enable_dso" = x"yes" -a x"$BLDSHARED" != x"true"; then - AC_MSG_ERROR([--enable-dso: no support for shared libraries]) -fi - -if test x"$enable_dso" != x"no"; then - USESHARED=$BLDSHARED -fi - -AC_MSG_CHECKING([if binaries will use shared libraries]) -AC_MSG_RESULT([$USESHARED]) diff --git a/source4/build/m4/check_path.m4 b/source4/build/m4/check_path.m4 deleted file mode 100644 index fb6b8aa804..0000000000 --- a/source4/build/m4/check_path.m4 +++ /dev/null @@ -1,233 +0,0 @@ -dnl SMB Build Environment Path Checks -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl - -AC_LIBREPLACE_LOCATION_CHECKS - -################################################# -# Directory handling stuff to support both the -# legacy SAMBA directories and FHS compliant -# ones... -AC_PREFIX_DEFAULT(/usr/local/samba) - -# Defaults and --without-fhs -logfilebase="${localstatedir}" -lockdir="${localstatedir}/locks" -piddir="${localstatedir}/run" -privatedir="\${prefix}/private" -modulesdir="\${prefix}/modules" -winbindd_socket_dir="${localstatedir}/run/winbindd" -winbindd_privileged_socket_dir="${localstatedir}/lib/winbindd_privileged" -ntp_signd_socket_dir="${localstatedir}/run/ntp_signd" - -AC_ARG_ENABLE(fhs, -[AS_HELP_STRING([--enable-fhs],[Use FHS-compliant paths (default=no)])], -[fhs=$enableval], -[fhs=no] -) - -if test x$fhs = xyes; then - lockdir="${localstatedir}/lib/samba" - piddir="${localstatedir}/run/samba" - logfilebase="${localstatedir}/log/samba" - privatedir="${localstatedir}/lib/samba/private" - sysconfdir="${sysconfdir}/samba" - modulesdir="${libdir}/samba" - datadir="${datadir}/samba" - includedir="${includedir}/samba-4.0" - ntp_signd_socket_dir="${localstatedir}/run/samba/ntp_signd" - winbindd_socket_dir="${localstatedir}/run/samba/winbindd" - winbindd_privileged_socket_dir="${localstatedir}/lib/samba/winbindd_privileged" -else - # Check to prevent installing directly under /usr without the FHS - AS_IF([test $prefix = /usr || test $prefix = /usr/local],[ - AC_MSG_ERROR([Don't install directly under "/usr" or "/usr/local" without using the FHS option (--enable-fhs). This could lead to file loss!]) - ]) -fi - -################################################# -# set modules directory location -AC_ARG_WITH(modulesdir, -[AS_HELP_STRING([--with-modulesdir=DIR],[Where to put dynamically loadable modules ($modulesdir)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-modulesdir called without argument - will use default]) - ;; - * ) - modulesdir="$withval" - ;; - esac]) - -################################################# -# set private directory location -AC_ARG_WITH(privatedir, -[AS_HELP_STRING([--with-privatedir=DIR],[Where to put sam.ldb and other private files containing key material ($ac_default_prefix/private)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-privatedir called without argument - will use default]) - ;; - * ) - privatedir="$withval" - ;; - esac]) - -################################################# -# set where the winbindd socket should be put -AC_ARG_WITH(winbindd-socket-dir, -[AS_HELP_STRING([--with-winbindd-socket-dir=DIR],[Where to put the winbindd socket ($winbindd_socket_dir)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-winbind-socketdir called without argument - will use default]) - ;; - * ) - winbindd_socket_dir="$withval" - ;; - esac]) - -################################################# -# set where the winbindd privileged socket should be put -AC_ARG_WITH(winbindd-privileged-socket-dir, -[AS_HELP_STRING([--with-winbindd-privileged-socket-dir=DIR],[Where to put the winbindd socket ($winbindd_privileged_socket_dir)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-winbind-privileged-socketdir called without argument - will use default]) - ;; - * ) - winbindd_privileged_socket_dir="$withval" - ;; - esac]) - -################################################# -# set where the NTP signing deamon socket should be put -AC_ARG_WITH(ntp-signd-socket-dir, -[AS_HELP_STRING([--with-ntp-signd-socket-dir=DIR],[Where to put the NTP signing deamon socket ($ac_default_prefix/run/ntp_signd)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-ntp-signd-socketdir called without argument - will use default]) - ;; - * ) - ntp_signd_socket_dir="$withval" - ;; - esac]) - -################################################# -# set lock directory location -AC_ARG_WITH(lockdir, -[AS_HELP_STRING([--with-lockdir=DIR],[Where to put lock files ($ac_default_prefix/var/locks)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-lockdir called without argument - will use default]) - ;; - * ) - lockdir="$withval" - ;; - esac]) - -################################################# -# set pid directory location -AC_ARG_WITH(piddir, -[AS_HELP_STRING([--with-piddir=DIR],[Where to put pid files ($ac_default_prefix/var/locks)])], -[ case "$withval" in - yes|no) - # - # Just in case anybody calls it without argument - # - AC_MSG_WARN([--with-piddir called without argument - will use default]) - ;; - * ) - piddir="$withval" - ;; - esac]) - -################################################# -# set log directory location -AC_ARG_WITH(logfilebase, -[AS_HELP_STRING([--with-logfilebase=DIR],[Where to put log files (\$(VARDIR))])], -[ case "$withval" in - yes|no) - # - # Just in case anybody does it - # - AC_MSG_WARN([--with-logfilebase called without argument - will use default]) - ;; - * ) - logfilebase="$withval" - ;; - esac]) - - -AC_SUBST(lockdir) -AC_SUBST(piddir) -AC_SUBST(logfilebase) -AC_SUBST(privatedir) -AC_SUBST(bindir) -AC_SUBST(sbindir) -AC_SUBST(winbindd_socket_dir) -AC_SUBST(winbindd_privileged_socket_dir) -AC_SUBST(ntp_signd_socket_dir) -AC_SUBST(modulesdir) - -################################################# -# set prefix for 'make test' -# this is needed to workarround the 108 char -# unix socket path limitation! -# -selftest_prefix="./st" -AC_SUBST(selftest_prefix) -AC_ARG_WITH(selftest-prefix, -[AS_HELP_STRING([--with-selftest-prefix=DIR],[The prefix where make test will be run ($selftest_prefix)])], -[ case "$withval" in - yes|no) - AC_MSG_WARN([--with-selftest-prefix called without argument - will use default]) - ;; - * ) - selftest_prefix="$withval" - ;; - esac]) - -debug=no -AC_ARG_ENABLE(debug, -[AS_HELP_STRING([--enable-debug],[Turn on compiler debugging information (default=no)])], - [if test x$enable_debug = xyes; then - debug=yes - fi]) - -developer=no -AC_SUBST(developer) -AC_ARG_ENABLE(developer, -[AS_HELP_STRING([--enable-developer],[Turn on developer warnings and debugging (default=no)])], - [if test x$enable_developer = xyes; then - debug=yes - developer=yes - fi]) - -dnl disable these external libs -AC_ARG_WITH(disable-ext-lib, -[AS_HELP_STRING([--with-disable-ext-lib=LIB],[Comma-seperated list of external libraries])], -[ if test $withval; then - for i in `echo $withval | sed -e's/,/ /g'` - do - eval SMB_$i=NO - done -fi ]) diff --git a/source4/build/m4/env.m4 b/source4/build/m4/env.m4 deleted file mode 100644 index 738ab8b1ae..0000000000 --- a/source4/build/m4/env.m4 +++ /dev/null @@ -1,90 +0,0 @@ -dnl SMB Build Environment Checks -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004 -dnl Copyright (C) Jelmer Vernooij 2005,2008 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl - -AC_SUBST(srcdir) -export srcdir; - -# we always set builddir to "." as that's nicer than -# having the absolute path of the current work directory -builddir=. -AC_SUBST(builddir) -export builddir; - -AC_SUBST(datarootdir) - -AC_SUBST(VPATH) -VPATH="\$(builddir):\$(srcdir)" - -SMB_VERSION_STRING=`cat ${srcdir}/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2` -echo "SAMBA VERSION: ${SMB_VERSION_STRING}" - -SAMBA_VERSION_GIT_COMMIT_FULLREV=`cat ${srcdir}/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_FULLREV' | cut -d ' ' -f3- | cut -d '"' -f2` -if test -n "${SAMBA_VERSION_GIT_COMMIT_FULLREV}";then - echo "BUILD COMMIT REVISION: ${SAMBA_VERSION_GIT_COMMIT_FULLREV}" -fi -SAMBA_VERSION_GIT_COMMIT_DATE=`cat ${srcdir}/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_DATE' | cut -d ' ' -f3-` -if test -n "${SAMBA_VERSION_GIT_COMMIT_DATE}";then - echo "BUILD COMMIT DATE: ${SAMBA_VERSION_GIT_COMMIT_DATE}" -fi -SAMBA_VERSION_GIT_COMMIT_TIME=`cat ${srcdir}/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_TIME' | cut -d ' ' -f3-` -if test -n "${SAMBA_VERSION_GIT_COMMIT_TIME}";then - echo "BUILD COMMIT TIME: ${SAMBA_VERSION_GIT_COMMIT_TIME}" - - # just to keep the build-farm gui happy for now... - echo "BUILD REVISION: ${SAMBA_VERSION_GIT_COMMIT_TIME}" -fi - -m4_include(build/m4/check_path.m4) -m4_include(../m4/check_perl.m4) - -AC_SAMBA_PERL([], [AC_MSG_ERROR([Please install perl from http://www.perl.com/])]) - -AC_PATH_PROG(YAPP, yapp, false) - -m4_include(build/m4/check_cc.m4) -m4_include(build/m4/check_ld.m4) -m4_include(../m4/check_make.m4) - -AC_SAMBA_GNU_MAKE([AC_MSG_RESULT(found)], [AC_MSG_ERROR([Unable to find GNU make])]) -AC_SAMBA_GNU_MAKE_VERSION() -GNU_MAKE_VERSION=$samba_cv_gnu_make_version -AC_SUBST(GNU_MAKE_VERSION) - -new_make=no -AC_MSG_CHECKING([for GNU make >= 3.81]) -if $PERL -e " \$_ = '$GNU_MAKE_VERSION'; s/@<:@^\d\.@:>@.*//g; exit (\$_ < 3.81);"; then - new_make=yes -fi -AC_MSG_RESULT($new_make) -automatic_dependencies=no -AX_CFLAGS_GCC_OPTION([-M -MT conftest.d -MF conftest.o], [], [ automatic_dependencies=$new_make ], []) -AC_MSG_CHECKING([Whether to use automatic dependencies]) -AC_ARG_ENABLE(automatic-dependencies, -[ --enable-automatic-dependencies Enable automatic dependencies], -[ automatic_dependencies=$enableval ], -[ automatic_dependencies=no ]) -AC_MSG_RESULT($automatic_dependencies) -AC_SUBST(automatic_dependencies) - -m4_include(build/m4/check_doc.m4) - -m4_include(../m4/check_python.m4) - -AC_SAMBA_PYTHON_DEVEL([ -SMB_EXT_LIB(EXT_LIB_PYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CFLAGS]) -SMB_ENABLE(EXT_LIB_PYTHON,YES) -SMB_ENABLE(LIBPYTHON,YES) -],[ -AC_MSG_ERROR([Python not found. Please install Python 2.x and its development headers/libraries.]) -]) - -AC_MSG_CHECKING(python library directory) -pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1, 0, '\\${prefix}')"` -AC_MSG_RESULT($pythondir) - -AC_SUBST(pythondir) diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 deleted file mode 100644 index c08e2e78bb..0000000000 --- a/source4/build/m4/public.m4 +++ /dev/null @@ -1,282 +0,0 @@ -dnl SMB Build System -dnl ---------------- -dnl Copyright (C) 2004 Stefan Metzmacher -dnl Copyright (C) 2004-2005 Jelmer Vernooij -dnl Published under the GPL -dnl -dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -dnl -dnl SMB_INCLUDED_LIB_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -dnl -dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) -dnl -dnl SMB_ENABLE(name,default_build) -dnl -dnl SMB_INCLUDE_MK(file) -dnl -dnl SMB_WRITE_MAKEVARS(file) -dnl -dnl SMB_WRITE_PERLVARS(file) -dnl -dnl ####################################################### -dnl ### And now the implementation ### -dnl ####################################################### - -dnl SMB_SUBSYSTEM(name,obj_files,required_subsystems,cflags) -AC_DEFUN([SMB_SUBSYSTEM], -[ -MAKE_SETTINGS="$MAKE_SETTINGS -$1_CFLAGS = $4 -$1_ENABLE = YES -$1_OBJ_FILES = $2 -" - -SMB_INFO_SUBSYSTEMS="$SMB_INFO_SUBSYSTEMS -################################### -# Start Subsystem $1 -@<:@SUBSYSTEM::$1@:>@ -PRIVATE_DEPENDENCIES = $3 -CFLAGS = \$($1_CFLAGS) -ENABLE = YES -# End Subsystem $1 -################################### -" -]) - -dnl SMB_BUILD_LIBRARY(name,obj_files,required_subsystems,cflags,ldflags,realname) -AC_DEFUN([SMB_BUILD_LIBRARY], -[ -MAKE_SETTINGS="$MAKE_SETTINGS -$1_CFLAGS = $4 -$1_LDFLAGS = $5 -n1_ENABLE = YES -$1_OBJ_FILES = $2 -" - -SMB_INFO_LIBRARIES="$SMB_INFO_LIBRARIES -################################### -# Start Library $1 -@<:@LIBRARY::$1@:>@ -PRIVATE_DEPENDENCIES = $3 -CFLAGS = \$($1_CFLAGS) -LDFLAGS = \$($1_LDFLAGS) -ENABLE = YES -ifelse([$6], [], [], [LIBRARY_REALNAME = $6]) -# End Library $1 -################################### -" -]) - -dnl SMB_EXT_LIB_FROM_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -AC_DEFUN([SMB_EXT_LIB_FROM_PKGCONFIG], -[ - dnl Figure out the correct variables and call SMB_EXT_LIB() - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://pkg-config.freedesktop.org/ to get pkg-config." - ac_cv_$1_found=no - else - SAMBA_PKG_CONFIG_MIN_VERSION="0.9.0" - if $PKG_CONFIG --atleast-pkgconfig-version $SAMBA_PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists '$2' ; then - AC_MSG_RESULT(yes) - - $1_CFLAGS="`$PKG_CONFIG --cflags '$2'`" - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $$1_CFLAGS" - AC_MSG_CHECKING([that the C compiler can use the $1_CFLAGS]) - AC_TRY_RUN([#include "${srcdir-.}/../tests/trivial.c"], - SMB_ENABLE($1, YES) - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no), - AC_MSG_WARN([cannot run when cross-compiling])) - CFLAGS="$OLD_CFLAGS" - - ac_cv_$1_libs_only_other="`$PKG_CONFIG --libs-only-other '$2'` `$PKG_CONFIG --libs-only-L '$2'`" - LIB_REMOVE_USR_LIB(ac_cv_$1_libs_only_other) - ac_cv_$1_includedir_only="`$PKG_CONFIG --cflags-only-I '$2'`" - CFLAGS_REMOVE_USR_INCLUDE(ac_cv_$1_includedir_only) - SMB_EXT_LIB($1, - [`$PKG_CONFIG --libs-only-l '$2'`], - [`$PKG_CONFIG --cflags-only-other '$2'`], - [$ac_cv_$1_includedir_only], - [$ac_cv_$1_libs_only_other]) - ac_cv_$1_found=yes - - else - AC_MSG_RESULT(no) - $PKG_CONFIG --errors-to-stdout --print-errors '$2' - ac_cv_$1_found=no - fi - else - echo "*** Your version of pkg-config is too old. You need version $SAMBA_PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://pkg-config.freedesktop.org/" - ac_cv_$1_found=no - fi - fi - if test x$ac_cv_$1_found = x"yes"; then - ifelse([$3], [], [echo -n ""], [$3]) - else - ifelse([$4], [], [ - SMB_EXT_LIB($1) - SMB_ENABLE($1, NO) - ], [$4]) - fi -]) - -dnl SMB_INCLUDED_LIB_PKGCONFIG(name,pkg-config name,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -AC_DEFUN([SMB_INCLUDED_LIB_PKGCONFIG], -[ - AC_ARG_ENABLE([external-]translit($1,`A-Z',`a-z'), - AS_HELP_STRING([--enable-external-]translit($1,`A-Z',`a-z'), [Use external $1 instead of built-in (default=ifelse([$5],[],auto,$5))]), [], [enableval=ifelse([$5],[],auto,$5)]) - - if test $enableval = yes -o $enableval = auto; then - SMB_EXT_LIB_FROM_PKGCONFIG([$1], [$2], [$3], [ - if test $enableval = yes; then - AC_MSG_ERROR([Unable to find external $1]) - fi - enableval=no - ]) - fi - if test $enableval = no; then - ifelse([$4], [], [ - SMB_EXT_LIB($1) - SMB_ENABLE($1, NO) - ], [$4]) - fi -]) - -dnl SMB_INCLUDE_MK(file) -AC_DEFUN([SMB_INCLUDE_MK], -[ -SMB_INFO_EXT_LIBS="$SMB_INFO_EXT_LIBS -mkinclude $1 -" -]) - -dnl -dnl SMB_EXT_LIB() just specifies the details of the library. -dnl Note: the library isn't enabled by default. -dnl You need to enable it with SMB_ENABLE(name) if configure -dnl find it should be used. E.g. it should not be enabled -dnl if the library is present, but the header file is missing. -dnl -dnl SMB_EXT_LIB(name,libs,cflags,cppflags,ldflags) -AC_DEFUN([SMB_EXT_LIB], -[ -MAKE_SETTINGS="$MAKE_SETTINGS -$1_LIBS = $2 -$1_CFLAGS = $3 -$1_CPPFLAGS = $4 -$1_LDFLAGS = $5 -" - -]) - -dnl SMB_ENABLE(name,default_build) -AC_DEFUN([SMB_ENABLE], -[ - MAKE_SETTINGS="$MAKE_SETTINGS -$1_ENABLE = $2 -" -SMB_INFO_ENABLES="$SMB_INFO_ENABLES -\$enabled{\"$1\"} = \"$2\";" -]) - -dnl SMB_MAKE_SETTINGS(text) -AC_DEFUN([SMB_MAKE_SETTINGS], -[ -MAKE_SETTINGS="$MAKE_SETTINGS -$1 -" -]) - -dnl SMB_WRITE_MAKEVARS(path, skip_vars) -AC_DEFUN([SMB_WRITE_MAKEVARS], -[ -echo "configure: creating $1" -cat >$1<<CEOF -# $1 - Autogenerated by configure, DO NOT EDIT! -$MAKE_SETTINGS -CEOF -skip_vars=" $2 " -for ac_var in $ac_subst_vars -do - eval ac_val=\$$ac_var - if echo "$skip_vars" | grep -v " $ac_var " >/dev/null 2>/dev/null; then - echo "$ac_var = $ac_val" >> $1 - fi -done -]) - -dnl SMB_WRITE_PERLVARS(path) -AC_DEFUN([SMB_WRITE_PERLVARS], -[ -echo "configure: creating $1" -cat >$1<<CEOF -# config.pm - Autogenerate by configure. DO NOT EDIT! - -package config; -require Exporter; -@ISA = qw(Exporter); -@EXPORT_OK = qw(%enabled %config); -use strict; - -use vars qw(%enabled %config); - -%config = ( -CEOF - -for ac_var in $ac_subst_vars -do - eval ac_val=\$$ac_var - # quote ' (\x27) inside '...' and make sure \ isn't eaten by shells, so use perl: - QAC_VAL=$ac_val QAC_VAR=$ac_var perl -e '$myval="$ENV{QAC_VAL}"; $myval =~ s/\x27/\\\x27/g ; print $ENV{QAC_VAR}." => \x27$myval\x27,\n"' >> $1 -done - -cat >>$1<<CEOF -); -$SMB_INFO_ENABLES -1; -CEOF -]) - -dnl SMB_BUILD_RUN(OUTPUT_FILE) -AC_DEFUN([SMB_BUILD_RUN], -[ -AC_OUTPUT_COMMANDS( -[ -test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && ( - cd $builddir; - # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD - # systems). - test -d heimdal || cp -R $srcdir/heimdal $builddir/ - test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/ - test -d build || builddir="$builddir" \ - srcdir="$srcdir" \ - $PERL ${srcdir}/script/buildtree.pl - ) - -$PERL -I${builddir} -I${builddir}/build \ - -I${srcdir} -I${srcdir}/build \ - ${srcdir}/build/smb_build/main.pl --output=$1 main.mk || exit $? -], -[ -srcdir="$srcdir" -builddir="$builddir" -PERL="$PERL" - -export PERL -export srcdir -export builddir -]) -]) diff --git a/source4/build/make/lex_compile.sh b/source4/build/make/lex_compile.sh deleted file mode 100755 index d05056d100..0000000000 --- a/source4/build/make/lex_compile.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -LEX="$1" -SRC="$2" -DEST="$3" -shift 3 -ARGS="$*" - -dir=`dirname $SRC` -file=`basename $SRC` -base=`basename $SRC .l` -if [ -z "$LEX" ]; then - # if $DEST is more recent than $SRC, we can just touch - # otherwise we touch but print out warnings - if [ -r $DEST ]; then - if [ x`find $SRC -newer $DEST -print` = x$SRC ]; then - echo "warning: lex not found - cannot generate $SRC => $DEST" >&2 - echo "warning: lex not found - only updating the timestamp of $DEST" >&2 - fi - touch $DEST; - exit; - fi - echo "error: lex not found - cannot generate $SRC => $DEST" >&2 - exit 1; -fi -# if $DEST is more recent than $SRC, we can just touch -if [ -r $DEST ]; then - if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then - touch $DEST; - exit; - fi -fi -TOP=`pwd` -echo "info: running $LEX $ARGS $file" -if cd $dir && $LEX $ARGS $file; then - if [ -r lex.yy.c ];then - # we must guarantee that config.h comes first - echo "info: move lex.yy.c to $base.c" - echo "#include \"config.h\"" > $base.c - sed -e "s|lex\.yy\.c|$DEST|" lex.yy.c >> $base.c - rm -f $base.yy.c - elif [ -r $base.yy.c ];then - # we must guarantee that config.h comes first - echo "info: move $base.yy.c to $base.c" - echo "#include \"config.h\"" > $base.c - sed -e "s|$base\.yy\.c|$DEST|" $base.yy.c >> $base.c - rm -f $base.yy.c - elif [ -r $base.c ];then - # we must guarantee that config.h comes first - echo "info: add #include \"config.h\" to $base.c" - mv $base.c $base.c.tmp - echo "#include \"config.h\"" > $base.c - sed -e "s|$base\.yy\.c|$DEST|" $base.c.tmp >> $base.c - rm -f $base.c.tmp - elif [ ! -r base.c ]; then - echo "$base.c nor $base.yy.c nor lex.yy.c generated." - exit 1 - fi -fi -cd $TOP diff --git a/source4/build/make/python.mk b/source4/build/make/python.mk deleted file mode 100644 index ea307da73d..0000000000 --- a/source4/build/make/python.mk +++ /dev/null @@ -1,51 +0,0 @@ -pythonbuilddir = bin/python - -installpython:: - mkdir -p $(DESTDIR)$(pythondir) - -# Install Python -# Arguments: Module path -define python_module_template - -installpython:: $$(pythonbuilddir)/$(1) ; - mkdir -p $$(DESTDIR)$$(pythondir)/$$(dir $(1)) - cp $$< $$(DESTDIR)$$(pythondir)/$(1) - -uninstallpython:: - rm -f $$(DESTDIR)$$(pythondir)/$(1) ; - -pythonmods:: $$(pythonbuilddir)/$(1) ; - -endef - -define python_py_module_template - -$$(pythonbuilddir)/$(1): $(2) ; - mkdir -p $$(@D) - cp $$< $$@ - -$(call python_module_template,$(1)) - -endef - -# Python C module -# Arguments: File name, dependencies, link list -define python_c_module_template - -$$(pythonbuilddir)/$(1): $(2) ; - @echo Linking $$@ - @mkdir -p $$(@D) - @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) - -$(call python_module_template,$(1)) -endef - -pythonmods:: - -clean:: - @echo "Removing python modules" - @rm -rf $(pythonbuilddir) - -bin/python/%.py: - mkdir -p $(@D) - cp $< $@ diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk deleted file mode 100644 index 30622cc89b..0000000000 --- a/source4/build/make/rules.mk +++ /dev/null @@ -1,190 +0,0 @@ -# Rules file for Samba 4 -# This relies on GNU make. -# -# Dependencies command -DEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.o) -MT $@ -MT : \ - $(CFLAGS) $(CPPFLAGS) $< -o $@ -# Dependencies for host objects -HDEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.ho) -MT $@ -MT : \ - $(HOSTCC_FLAGS) $(CPPFLAGS) $< -o $@ -# Dependencies for precompiled headers -PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \ - $(CFLAGS) $(CPPFLAGS) $< -o $@ - -# Run a static analysis checker -CHECK = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) $(CPPLAGS) -c $< -o $@ - -# Run the configured compiler -COMPILE = $(CC) $(CFLAGS) $(PICFLAG) \ - $(CPPFLAGS) \ - -c $< -o $@ - -# Run the compiler for the build host -HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) $(CPPFLAGS) -c $< -o $@ - -# Precompile headers -PCHCOMPILE = @$(CC) -Ilib/replace \ - $(CFLAGS) $(PICFLAG) $(CPPFLAGS) -c $< -o $@ - -# Partial linking -PARTLINK = @$(PROG_LD) -r - -make_utility_dir = $(srcdir)/build/make/ - -include/config.h: - @echo "include/config.h not present" - @echo "You need to rerun ./autogen.sh and ./configure" - @/bin/false - -pch:: - -clean:: clean_pch - @echo Removing objects - @-find . -name '*.o' -exec rm -f '{}' \; - @echo Removing hostcc objects - @-find . -name '*.ho' -exec rm -f '{}' \; - @echo Removing libraries - @-rm -f $(STATIC_LIBS) $(SHARED_LIBS) - @-rm -f bin/static/*.a $(shliboutputdir)/*.$(SHLIBEXT) bin/mergedobj/*.o - @echo Removing modules - @-rm -f bin/modules/*/*.$(SHLIBEXT) - @-rm -f bin/*_init_module.c - @echo Removing dummy targets - @-rm -f bin/.*_* - @echo Removing generated files - @-rm -f bin/*_init_module.c - @-rm -f librpc/gen_ndr/*.* - -distclean:: clean - -rm -f include/config.h include/config_tmp.h include/build.h - -rm -f data.mk - -rm -f config.status - -rm -f config.log config.cache - -rm -f config.pm config.mk - -rm -f $(PC_FILES) - -removebackup:: - -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~ - -realdistclean:: distclean removebackup - -rm -f include/config_tmp.h.in - -rm -f version.h - -rm -f configure - -rm -f $(MANPAGES) - -check:: test - -unused_macros: - $(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort - -# Create a static library -%.a: - @echo Linking $@ - @rm -f $@ - @mkdir -p $(@D) - @$(STLD) $(STLD_FLAGS) $@ $^ - -include $(make_utility_dir)/templates.mk - -############################################################################### -# File types -############################################################################### - -.SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .$(SHLIBEXT) .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho .idl .hd - -.c.d: - @echo "Generating dependencies for $<" - @$(DEPENDS) - -.c.hd: - @echo "Generating host-compiler dependencies for $<" - @$(HDEPENDS) - -include/includes.d: include/includes.h - @echo "Generating dependencies for $<" - @$(PCHDEPENDS) - -.c.o: - @if test -n "$(CC_CHECKER)"; then \ - echo "Checking $< with '$(CC_CHECKER)'"; \ - $(CHECK) ; \ - fi - @echo "Compiling $<" - @-mkdir -p `dirname $@` - @$(COMPILE) && exit 0 ; \ - echo "The following command failed:" 1>&2;\ - echo "$(subst ",\",$(COMPILE))" 1>&2 && exit 1 - - -.c.ho: - @echo "Compiling $< with host compiler" - @-mkdir -p `dirname $@` - @$(HCOMPILE) && exit 0;\ - echo "The following command failed:" 1>&2;\ - echo "$(subst ",\",$(HCOMPILE))" 1>&2;\ - $(HCOMPILE) >/dev/null 2>&1 - -.h.h.gch: - @echo "Precompiling $<" - @$(PCHCOMPILE) - -.y.c: - @echo "Building $< with $(YACC)" - @-$(make_utility_dir)/yacc_compile.sh "$(YACC)" "$<" "$@" - -.l.c: - @echo "Building $< with $(LEX)" - @-$(make_utility_dir)/lex_compile.sh "$(LEX)" "$<" "$@" - -%.a: - @echo Linking $@ - @rm -f $@ - @mkdir -p $(@D) - @$(STLD) $(STLD_FLAGS) $@ $^ - - -DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl - -.1.xml.1: - $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< - -.3.xml.3: - $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< - -.5.xml.5: - $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< - -.7.xml.7: - $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< - -.8.xml.8: - $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $< - -dist:: idl_full manpages configure distclean - -configure: - ./autogen.sh - -showflags:: - @echo 'Samba will be compiled with flags:' - @echo ' CPP = $(CPP)' - @echo ' CPPFLAGS = $(CPPFLAGS)' - @echo ' CC = $(CC)' - @echo ' CFLAGS = $(CFLAGS)' - @echo ' PICFLAG = $(PICFLAG)' - @echo ' BNLD = $(BNLD)' - @echo ' BNLD_FLAGS = $(BNLD_FLAGS)' - @echo ' STLD = $(STLD)' - @echo ' STLD_FLAGS = $(STLD_FLAGS)' - @echo ' SHLD = $(SHLD)' - @echo ' SHLD_FLAGS = $(SHLD_FLAGS)' - @echo ' MDLD = $(MDLD)' - @echo ' MDLD_FLAGS = $(MDLD_FLAGS)' - @echo ' SHLIBEXT = $(SHLIBEXT)' - -etags: - etags $(ETAGS_OPTIONS) `find $(base_srcdirs) -name "*.[ch]"` - -ctags: - ctags $(CTAGS_OPTIONS) `find $(base_srcdirs) -name "*.[ch]" | grep -v "_proto\.h"` - diff --git a/source4/build/make/templates.mk b/source4/build/make/templates.mk deleted file mode 100644 index 12a606c432..0000000000 --- a/source4/build/make/templates.mk +++ /dev/null @@ -1,143 +0,0 @@ -# Templates file for Samba 4 -# This relies on GNU make. -# -# © 2008 Jelmer Vernooij <jelmer@samba.org> -# -############################################################################### -# Templates -############################################################################### - -# Partially link -# Arguments: target object file, source object files -define partial_link_template -$(1): $(2) ; - @echo Partially linking $$@ - @mkdir -p $$(@D) - $$(PARTLINK) -o $$@ $$^ -endef - -# Link a binary -# Arguments: target file, depends, flags -define binary_link_template -$(1): $(2) ; - @echo Linking $$@ - @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) - -clean:: - @rm -f $(1) - -binaries:: $(1) - -endef - -# Link a host-machine binary -# Arguments: target file, depends, flags -define host_binary_link_template -$(1): $(2) ; - @echo Linking $$@ - @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) - -clean:: - rm -f $(1) - -binaries:: $(1) - -endef - -# Create a prototype header -# Arguments: header file, c files -define proto_header_template - -proto:: $(1) ; - -clean:: ; - rm -f $(1) - -$(1): $(2) ; - @echo "Creating $$@" - @$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --public=/dev/null --private=$$@ $$^ - -$($(2):.c=.o): $(1) ; - -endef - -# Shared module -# Arguments: Target, dependencies, objects -define shared_module_template - -$(1): $(2) ; - @echo Linking $$@ - @mkdir -p $$(@D) - @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) - -endef - -# Shared library -# Arguments: Target, dependencies, link flags, soname -define shared_library_template -$(1): $(2) - @echo Linking $$@ - @mkdir -p $$(@D) - @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \ - $(3) \ - $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4))) - -ifneq ($(notdir $(1)),$(notdir $(4))) -$(4): $(1) - @echo "Creating symbolic link for $$@" - @ln -fs $$(<F) $$@ -endif - -ifneq ($(notdir $(1)),$(notdir $(5))) -$(5): $(1) $(4) - @echo "Creating symbolic link for $$@" - @ln -fs $$(<F) $$@ -endif -endef - -# Shared alias -# Arguments: Target, subsystem name, alias name -define shared_module_alias_template -bin/modules/$(2)/$(3).$$(SHLIBEXT): $(1) - @ln -fs $$(<F) $$@ - -PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT) - -uninstallplugins:: - @-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT) -installplugins:: - @ln -fs $(notdir $(1)) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT) - -endef - -define shared_module_install_template -installplugins:: bin/modules/$(1)/$(2) - @echo Installing $(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2) - @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/ - @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2) -uninstallplugins:: - @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2) - @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2) - -endef - -# abspath for older makes -abspath = $(shell cd $(dir $(1)); pwd)/$(notdir $(1)) - -# Install a binary -# Arguments: path to binary to install -define binary_install_template -installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1)) installdirs - -uninstallbin:: - @echo "Removing $(notdir $(1))" - @rm -f $$(DESTDIR)$$(bindir)/$(notdir $(1)) -endef - -define sbinary_install_template -installsbin:: $$(DESTDIR)$$(sbindir)/$(notdir $(1)) installdirs - -uninstallsbin:: - @echo "Removing $(notdir $(1))" - @rm -f $$(DESTDIR)$$(sbindir)/$(notdir $(1)) -endef diff --git a/source4/build/make/yacc_compile.sh b/source4/build/make/yacc_compile.sh deleted file mode 100755 index ac4afea3f6..0000000000 --- a/source4/build/make/yacc_compile.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -YACC="$1" -SRC="$2" -DEST="$3" - -dir=`dirname $SRC` -file=`basename $SRC` -base=`basename $SRC .y` -if [ -z "$YACC" ]; then - # if $DEST is more recent than $SRC, we can just touch - # otherwise we touch but print out warnings - if [ -r $DEST ]; then - if [ x`find $SRC -newer $DEST -print` = x$SRC ]; then - echo "warning: yacc not found - cannot generate $SRC => $DEST" >&2 - echo "warning: yacc not found - only updating the timestamp of $DEST" >&2 - fi - touch $DEST; - exit; - fi - echo "error: yacc not found - cannot generate $SRC => $DEST" >&2 - exit 1; -fi -# if $DEST is more recent than $SRC, we can just touch -if [ -r $DEST ]; then - if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then - touch $DEST; - exit; - fi -fi -TOP=`pwd` -echo "info: running $YACC -d $file" -if cd $dir && $YACC -d $file; then - if [ -r y.tab.h -a -r y.tab.c ];then - echo "info: move y.tab.h to $base.h" - sed -e "/^#/!b" -e "s|y\.tab\.h|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.h > $base.h - echo "info: move y.tab.c to $base.c" - sed -e "s|y\.tab\.c|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.c > $base.c - rm -f y.tab.c y.tab.h - elif [ ! -r $base.h -a ! -r $base.c]; then - echo "$base.h nor $base.c generated." - exit 1 - fi -fi -cd $TOP diff --git a/source4/build/smb_build/README.txt b/source4/build/smb_build/README.txt deleted file mode 100644 index eac3905cce..0000000000 --- a/source4/build/smb_build/README.txt +++ /dev/null @@ -1,83 +0,0 @@ -The Samba Build System
-======================
-
-The build system basically has two main parts: the autoconf-generated
-shell scripts which check for availability of functions and libraries
-which is stored in the .m4 files and the information about the various
-subsystems which is stored in the .mk files.
-
-Object Types
-------------
-the build system knows about the following object types
-
-SUBSYSTEM:
- a SUBSYSTEM is basicly a collection of functions, which provide an
- an generic API for a specific problem (e.g. libldb provides an api
- for gneric ldb databases. libldb_plugin provides a generic api
- for calling ldb plugins, so 'libldb' and 'libldb_plugin' are subsystems)
-
-MODULE:
- a MODULE is a specify implementation of a API provided by a SUBSYSTEM.
- (e.g. 'libldb_tdb' and 'libldb_ldap' are implementations of the subsystem 'libldb' API,
- and 'libldb_plugin_timestamp' is a module of the 'libldb_plugin' subsystem)
-
-EXT_LIB:
- an EXT_LIB is an external library which is needed by a SUBSYSTEM, MODULE, BINARY or LIBRARY.
- (e.g. 'gtk' or 'KRB5')
-
-BINARY:
- a BINARY means a executable binary file.
- (e.g. 'smbtorture' or 'ldbedit')
- a BINARY typically has only commandline handling and basic
- functionality code in it and depends on the functions of
- SUBSYSTEM's (REQUIRED_SUBSYSTEMS).
-
-LIBRARY:
- a LIBRARY means a static and/or shared library,
- which depends on the used OS.
- (e.g. for libldb 'libldb.so', 'libldb.so.0' 'libldb.so.0.0.1'
- and libldb.a are created on linux)
- a LIBRARY typicly has only glue code in it and depends on
- SUBSYSTEM's (REQUIRED_SUBSYSTEMS).
-
-File summary:
--------------
-public.m4 - public M4 macros of the build system
-config_mk.pm - Support for reading .mk files
-dot.pm - Support for generating .dot files for analysis of dependencies
-input.pm - Input validation
-main.pm - Main
-makefile.pm - Makefile generation
-output.pm - Dependency calculation
-
-Layout
--------
-
-Toplevel file: configure.in
-- included by autogen.sh: aclocal.m4
- which includes the SMB_YXZ*() macros
-
-- default tests of the build system
- are in build/smb_build/check_*.m4
- (mostly compiler and basic C type and function
- checks)
-
-- subsystem specific stuff should be included by 'SMB_INCLUDE_M4()'
-
-
-Generating the configure file
--------------------------
-you need to rerun ./autogen.sh when 'configure.in' or any
-'.m4' file was modified, then you need to rerun configure.
-
-
-Generating config.status
------------------------------
-you need to run ./config.status (or 'configure') after a '.mk'
-file was changed.
-
-
-Examples
---------
-for now please take a look at the .m4 and .mk files
-you find in the source tree, they should be a good reference to start.
diff --git a/source4/build/smb_build/TODO b/source4/build/smb_build/TODO deleted file mode 100644 index adfe17d423..0000000000 --- a/source4/build/smb_build/TODO +++ /dev/null @@ -1,25 +0,0 @@ -- use pkg-config files in the buildsystem? -- let the build system implement some make functions($(patsubst),$(wildcard),...) and use our own implementations where `make' does not support them -- include extra_flags.txt using Makefile construction if - supported by current make -- fix shared module loading for selftest during builds without install -- remove recursive dependency between LIBSOCKET, LIBCLI_NBT and LIBCLI_RESOLVE -- clearer distinction between dcerpc and ndr. seperate interface tables? Maybe get rid of - NDR's table altogether and use dlopen/dlsym ? -- saner names for: - libcli.so.0.0.1 (rename to libsmb?) - libcli_cldap.so.0.0.1 (rename to libcldap?) - libcli_nbt.so.0.0.1 (rename to libnbt?) - libcli_wrepl.so.0.0.1 (rename to libwrepl?) -- generate headermap.txt - -set of test scripts that check the code: -- configure_check_unused.pl -- find_unused_macros.pl -- find_unused_makefilevars.pl -- find_unused_options.sh -- findstatic.pl -- minimal_includes.pl -- check dependencies based on #include lines ? -- check whether private headers are not used outside their own subsystem -- undocumented (no manpage) installed binaries diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm deleted file mode 100644 index 8c7d75221c..0000000000 --- a/source4/build/smb_build/config_mk.pm +++ /dev/null @@ -1,284 +0,0 @@ -# Samba Build System -# - config.mk parsing functions -# -# Copyright (C) Stefan (metze) Metzmacher 2004 -# Copyright (C) Jelmer Vernooij 2005 -# Released under the GNU GPL -# - -package smb_build::config_mk; -use smb_build::input; -use File::Basename; - -use strict; - -my $section_types = { - "EXT_LIB" => { - "LIBS" => "list", - "CFLAGS" => "list", - "CPPFLAGS" => "list", - "LDFLAGS" => "list", - }, - "PYTHON" => { - "LIBRARY_REALNAME" => "string", - "PRIVATE_DEPENDENCIES" => "list", - "PUBLIC_DEPENDENCIES" => "list", - "ENABLE" => "bool", - "LDFLAGS" => "list", - }, - "SUBSYSTEM" => { - "PRIVATE_DEPENDENCIES" => "list", - "PUBLIC_DEPENDENCIES" => "list", - - "ENABLE" => "bool", - - "CFLAGS" => "list", - "LDFLAGS" => "list", - "STANDARD_VISIBILITY" => "string", - "INIT_FUNCTION_SENTINEL" => "string" - }, - "MODULE" => { - "SUBSYSTEM" => "string", - - "INIT_FUNCTION" => "string", - - "PRIVATE_DEPENDENCIES" => "list", - - "ALIASES" => "list", - - "ENABLE" => "bool", - - "OUTPUT_TYPE" => "list", - - "CFLAGS" => "list" - }, - "BINARY" => { - - "PRIVATE_DEPENDENCIES" => "list", - - "ENABLE" => "bool", - - "INSTALLDIR" => "string", - "LDFLAGS" => "list", - "STANDARD_VISIBILITY" => "string", - - "USE_HOSTCC" => "bool" - }, - "LIBRARY" => { - "LIBRARY_REALNAME" => "string", - - "INIT_FUNCTION_TYPE" => "string", - "INIT_FUNCTION_SENTINEL" => "string", - "OUTPUT_TYPE" => "list", - - "PRIVATE_DEPENDENCIES" => "list", - "PUBLIC_DEPENDENCIES" => "list", - - "ENABLE" => "bool", - - "CFLAGS" => "list", - "LDFLAGS" => "list", - "STANDARD_VISIBILITY" => "string" - } -}; - -use vars qw(@parsed_files); - -@parsed_files = (); - -sub _read_config_file($$$) -{ - use Cwd; - - my ($srcdir, $builddir, $filename) = @_; - my @dirlist; - - # We need to change our working directory because config.mk files can - # give shell commands as the argument to "include". These shell - # commands can take arguments that are relative paths and we don't have - # a way of sensibly rewriting these. - my $cwd = getcwd; - chomp $cwd; - - if ($srcdir ne $builddir) { - # Push the builddir path on the front, so we prefer builddir - # to srcdir when the file exists in both. - @dirlist = ($builddir, $srcdir); - } else { - @dirlist = ($srcdir); - } - - foreach my $d (@dirlist) { - my @lines; - my $basedir; - - chdir $cwd; - chdir $d; - - # We need to catch the exception from open in the case where - # the filename is actually a shell pipeline. Why is this - # different to opening a regular file? Because this is perl! - eval { - open(CONFIG_MK, "./$filename"); - @lines = <CONFIG_MK>; - close(CONFIG_MK); - }; - - chdir $cwd; - next unless (@lines); - - # I blame abartlett for this crazy hack -- jpeach - if ($filename =~ /\|$/) { - $basedir = $builddir; - } else { - $basedir = dirname($filename); - push(@parsed_files, $filename); - } - $basedir =~ s!^($builddir|$srcdir)[/]!!; - return ($filename, $basedir, @lines); - } - - chdir $cwd; - return; -} - -########################################################### -# The parsing function which parses the file -# -# $result = _parse_config_mk($input, $srcdir, $builddir, $filename) -# -# $filename - the path of the config.mk file -# which should be parsed -sub run_config_mk($$$$) -{ - sub run_config_mk($$$$); - my ($input, $srcdir, $builddir, $filename) = @_; - my $result; - my $linenum = -1; - my $infragment = 0; - my $section = "GLOBAL"; - my $makefile = ""; - - my $basedir; - - my $parsing_file; - my @lines; - - $ENV{builddir} = $builddir; - $ENV{srcdir} = $srcdir; - - ($parsing_file, $basedir, @lines) = - _read_config_file($srcdir, $builddir, $filename); - - die ("$0: can't open '$filename'") - unless ($parsing_file and $basedir and @lines); - - my $line = ""; - my $prev = ""; - - # Emit a line that lets us match up final makefile output with the - # corresponding input files. The curlies are so you can match the - # BEGIN/END pairs in a text editor. - $makefile .= "# BEGIN{ $parsing_file\n"; - - foreach (@lines) { - $linenum++; - - # lines beginning with '#' are ignored - next if (/^\#.*$/); - - if (/^(.*)\\$/) { - $prev .= $1; - next; - } else { - $line = "$prev$_"; - $prev = ""; - } - - if ($line =~ /^\[([-a-zA-Z0-9_.:]+)\][\t ]*$/) - { - $section = $1; - $infragment = 0; - - $result->{$section}{EXISTS}{KEY} = "EXISTS"; - $result->{$section}{EXISTS}{VAL} = 1; - next; - } - - # include - if ($line =~ /^mkinclude (.*)$/) { - my $subfile= $1; - my $subdir = dirname($filename); - $subdir =~ s/^\.$//g; - $subdir =~ s/^\.\///g; - $subdir .= "/" if ($subdir ne ""); - $makefile .= "basedir := $subdir\n"; - $makefile .= run_config_mk($input, $srcdir, $builddir, $subdir.$subfile); - next; - } - - # empty line - if ($line =~ /^[ \t]*$/) { - $section = "GLOBAL"; - if ($infragment) { $makefile.="\n"; } - next; - } - - # global stuff is considered part of the makefile - if ($section eq "GLOBAL") { - if (!$infragment) { $makefile.="\n"; } - $makefile .= $line; - $infragment = 1; - next; - } - - # Assignment - if ($line =~ /^([a-zA-Z0-9_]+)[\t ]*=(.*)$/) { - $result->{$section}{$1}{VAL} = $2; - $result->{$section}{$1}{KEY} = $1; - - next; - } - - die("$parsing_file:$linenum: Bad line"); - } - - $makefile .= "# }END $parsing_file\n"; - - foreach my $section (keys %{$result}) { - my ($type, $name) = split(/::/, $section, 2); - - my $sectype = $section_types->{$type}; - if (not defined($sectype)) { - die($parsing_file.":[".$section."] unknown section type \"".$type."\"!"); - } - - $input->{$name}{NAME} = $name; - $input->{$name}{TYPE} = $type; - $input->{$name}{MK_FILE} = $parsing_file; - $input->{$name}{BASEDIR} = $basedir; - - foreach my $key (values %{$result->{$section}}) { - next if ($key->{KEY} eq "EXISTS"); - $key->{VAL} = smb_build::input::strtrim($key->{VAL}); - my $vartype = $sectype->{$key->{KEY}}; - if (not defined($vartype)) { - die($parsing_file.":[".$section."]: unknown attribute type \"$key->{KEY}\"!"); - } - if ($vartype eq "string") { - $input->{$name}{$key->{KEY}} = $key->{VAL}; - } elsif ($vartype eq "list") { - $input->{$name}{$key->{KEY}} = [smb_build::input::str2array($key->{VAL})]; - } elsif ($vartype eq "bool") { - if (($key->{VAL} ne "YES") and ($key->{VAL} ne "NO")) { - die("Invalid value for bool attribute $key->{KEY}: $key->{VAL} in section $section"); - } - $input->{$name}{$key->{KEY}} = $key->{VAL}; - } - } - } - - return $makefile; -} - -1; diff --git a/source4/build/smb_build/dot.pl b/source4/build/smb_build/dot.pl deleted file mode 100755 index b30c320c6e..0000000000 --- a/source4/build/smb_build/dot.pl +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/perl -# Samba4 Dependency Graph Generator -# (C) 2004-2005 Jelmer Vernooij <jelmer@samba.org> -# Published under the GNU GPL - -use strict; -use lib 'build'; -use smb_build::config_mk; - -my $subsys = shift @ARGV; - -sub contains($$) -{ - my ($haystack,$needle) = @_; - foreach (@$haystack) { - return 1 if ($_ eq $needle); - } - return 0; -} - -sub generate($$$) -{ - my ($depend,$only,$name) = @_; - my $res = "digraph $name {\n"; - - foreach my $part (values %{$depend}) { - next if (defined($only) and not contains($only,$part->{NAME})); - foreach my $elem (@{$part->{PUBLIC_DEPENDENCIES}}) { - $res .= "\t\"$part->{NAME}\" -> \"$elem\" [style=filled]; /* public */\n"; - } - foreach my $elem (@{$part->{PRIVATE_DEPENDENCIES}}) { - $res .= "\t\"$part->{NAME}\" -> \"$elem\" [style=dotted]; /* private */\n"; - } - } - - return $res . "}\n"; -} - -my $INPUT = {}; -smb_build::config_mk::run_config_mk($INPUT, '.', '.', "main.mk"); - -my $name = "samba4"; - -my $only; -if (defined($subsys)) { - my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, - "MERGED_OBJ", "SHARED_LIBRARY", "SHARED_LIBRARY"); - - die("No such subsystem $subsys") unless (defined($DEPEND->{$subsys})); - - $only = $DEPEND->{$subsys}->{UNIQUE_DEPENDENCIES_ALL}; - push (@$only, "$subsys"); - - $name = $subsys; -} - -my $fname = "$name-deps.dot"; -print __FILE__.": creating $fname\n"; -open DOTTY, ">$fname"; -print DOTTY generate($INPUT, $only, $name); -close DOTTY; - -1; diff --git a/source4/build/smb_build/input.pm b/source4/build/smb_build/input.pm deleted file mode 100644 index 27a00890b4..0000000000 --- a/source4/build/smb_build/input.pm +++ /dev/null @@ -1,278 +0,0 @@ -# Samba Build System -# - the input checking functions -# -# Copyright (C) Stefan (metze) Metzmacher 2004 -# Copyright (C) Jelmer Vernooij 2004 -# Released under the GNU GPL - -use strict; -package smb_build::input; -use File::Basename; - -sub strtrim($) -{ - $_ = shift; - s/^[\t\n ]*//g; - s/[\t\n ]*$//g; - return $_; -} - -sub str2array($) -{ - $_ = shift; - s/^[\t\n ]*//g; - s/[\t\n ]*$//g; - s/([\t\n ]+)/ /g; - - return () if (length($_)==0); - return split /[ \t\n]/; -} - -sub add_libreplace($) -{ - my ($part) = @_; - - return if ($part->{NAME} eq "LIBREPLACE"); - return if ($part->{NAME} eq "LIBREPLACE_HOSTCC"); - return if ($part->{NAME} eq "REPLACE_READDIR"); - - foreach my $n (@{$part->{PRIVATE_DEPENDENCIES}}) { - return if ($n eq "LIBREPLACE"); - return if ($n eq "LIBREPLACE_HOSTCC"); - } - foreach my $n (@{$part->{PUBLIC_DEPENDENCIES}}) { - return if ($n eq "LIBREPLACE"); - return if ($n eq "LIBREPLACE_HOSTCC"); - } - - if (defined($part->{USE_HOSTCC}) && $part->{USE_HOSTCC} eq "YES") { - unshift (@{$part->{PRIVATE_DEPENDENCIES}}, "LIBREPLACE_HOSTCC"); - } else { - unshift (@{$part->{PRIVATE_DEPENDENCIES}}, "LIBREPLACE"); - } -} - -sub check_subsystem($$$) -{ - my ($INPUT, $subsys, $default_ot) = @_; - return if ($subsys->{ENABLE} ne "YES"); - - unless (defined($subsys->{OUTPUT_TYPE})) { $subsys->{OUTPUT_TYPE} = $default_ot; } - unless (defined($subsys->{INIT_FUNCTION_TYPE})) { $subsys->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } - unless (defined($subsys->{INIT_FUNCTION_SENTINEL})) { $subsys->{INIT_FUNCTION_SENTINEL} = "NULL"; } -} - -sub check_module($$$) -{ - my ($INPUT, $mod, $default_ot) = @_; - - die("Module $mod->{NAME} does not have a SUBSYSTEM set") if not defined($mod->{SUBSYSTEM}); - - if (not exists($INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS})) { - $INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS} = []; - } - - if (!(defined($INPUT->{$mod->{SUBSYSTEM}}))) { - die("Unknown subsystem $mod->{SUBSYSTEM} for module $mod->{NAME}"); - } - - if ($INPUT->{$mod->{SUBSYSTEM}} eq "NO") { - warn("Disabling module $mod->{NAME} because subsystem $mod->{SUBSYSTEM} is disabled"); - $mod->{ENABLE} = "NO"; - return; - } - - return if ($mod->{ENABLE} ne "YES"); - - if (exists($INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTION_TYPE})) { - $mod->{INIT_FUNCTION_TYPE} = $INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTION_TYPE}; - } else { - $mod->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; - } - - unless (defined($mod->{INIT_FUNCTION_SENTINEL})) { $mod->{INIT_FUNCTION_SENTINEL} = "NULL"; } - - if (not defined($mod->{OUTPUT_TYPE})) { - if ((not defined($INPUT->{$mod->{SUBSYSTEM}})) or - (not defined($INPUT->{$mod->{SUBSYSTEM}}->{TYPE})) or - $INPUT->{$mod->{SUBSYSTEM}}->{TYPE} eq "EXT_LIB") { - $mod->{OUTPUT_TYPE} = ["SHARED_LIBRARY"]; - } else { - $mod->{OUTPUT_TYPE} = $default_ot; - } - } - - if (grep(/SHARED_LIBRARY/, @{$mod->{OUTPUT_TYPE}})) { - my $sane_subsystem = lc($mod->{SUBSYSTEM}); - $sane_subsystem =~ s/^lib//; - $mod->{INSTALLDIR} = "MODULESDIR/$sane_subsystem"; - push (@{$mod->{PUBLIC_DEPENDENCIES}}, $mod->{SUBSYSTEM}); - add_libreplace($mod); - } - if (grep(/MERGED_OBJ/, @{$mod->{OUTPUT_TYPE}}) and $mod->{TYPE} ne "PYTHON") { - push (@{$INPUT->{$mod->{SUBSYSTEM}}{INIT_FUNCTIONS}}, $mod->{INIT_FUNCTION}) if defined($mod->{INIT_FUNCTION}); - push (@{$INPUT->{$mod->{SUBSYSTEM}}{PRIVATE_DEPENDENCIES}}, $mod->{NAME}); - } -} - -sub check_library($$$) -{ - my ($INPUT, $lib, $default_ot) = @_; - - return if ($lib->{ENABLE} ne "YES"); - - unless (defined($lib->{OUTPUT_TYPE})) { $lib->{OUTPUT_TYPE} = $default_ot; } - - unless (defined($lib->{INIT_FUNCTION_TYPE})) { $lib->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } - unless (defined($lib->{INIT_FUNCTION_SENTINEL})) { $lib->{INIT_FUNCTION_SENTINEL} = "NULL"; } - unless (defined($lib->{INSTALLDIR})) { $lib->{INSTALLDIR} = "LIBDIR"; } - - add_libreplace($lib); -} - -sub check_python($$$) -{ - my ($INPUT, $python, $default_ot) = @_; - - return if ($INPUT->{LIBPYTHON}{ENABLE} ne "YES"); - - $python->{INSTALLDIR} = "PYTHONDIR"; - unless (defined($python->{CFLAGS})) { $python->{CFLAGS} = []; } - my $basename = $python->{NAME}; - $basename =~ s/^python_//g; - unless (defined($python->{LIBRARY_REALNAME})) { - $python->{LIBRARY_REALNAME} = "$basename.\$(SHLIBEXT)"; - } - $python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }"; - push (@{$python->{CFLAGS}}, "\$(EXT_LIB_PYTHON_CFLAGS)"); - - $python->{SUBSYSTEM} = "LIBPYTHON"; - - check_module($INPUT, $python, $default_ot); -} - -sub check_binary($$) -{ - my ($INPUT, $bin) = @_; - - return if ($bin->{ENABLE} ne "YES"); - - ($bin->{BINARY} = (lc $bin->{NAME})) if not defined($bin->{BINARY}); - unless (defined($bin->{INIT_FUNCTION_SENTINEL})) { $bin->{INIT_FUNCTION_SENTINEL} = "NULL"; } - unless (defined($bin->{INIT_FUNCTION_TYPE})) { $bin->{INIT_FUNCTION_TYPE} = "NTSTATUS (*) (void)"; } - - $bin->{OUTPUT_TYPE} = ["BINARY"]; - add_libreplace($bin); -} - -sub add_implicit($$) -{ - my ($INPUT, $n) = @_; - - $INPUT->{$n}->{TYPE} = "MAKE_RULE"; - $INPUT->{$n}->{NAME} = $n; - $INPUT->{$n}->{OUTPUT_TYPE} = undef; - $INPUT->{$n}->{LIBS} = ["\$(".uc($n)."_LIBS)"]; - $INPUT->{$n}->{LDFLAGS} = ["\$(".uc($n)."_LDFLAGS)"]; - $INPUT->{$n}->{CFLAGS} = ["\$(".uc($n)."_CFLAGS)"]; - $INPUT->{$n}->{CPPFLAGS} = ["\$(".uc($n)."_CPPFLAGS)"]; - $INPUT->{$n}->{ENABLE} = "YES"; -} - -sub calc_unique_deps($$$$$$$$) -{ - sub calc_unique_deps($$$$$$$$); - my ($name, $INPUT, $deps, $udeps, $withlibs, $forward, $pubonly, $busy) = @_; - - foreach my $n (@$deps) { - add_implicit($INPUT, $n) unless (defined($INPUT->{$n}) and defined($INPUT->{$n}->{TYPE})); - my $dep = $INPUT->{$n}; - if (grep (/^$n$/, @$busy)) { - next if (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ"); - die("Recursive dependency: $n, list: " . join(',', @$busy)); - } - next if (grep /^$n$/, @$udeps); - - push (@{$udeps}, $n) if $forward; - - if (defined ($dep->{OUTPUT_TYPE}) && - ($withlibs or - (@{$dep->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ") or - (@{$dep->{OUTPUT_TYPE}}[0] eq "STATIC_LIBRARY"))) { - push (@$busy, $n); - calc_unique_deps($n, $INPUT, $dep->{PUBLIC_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy); - calc_unique_deps($n, $INPUT, $dep->{PRIVATE_DEPENDENCIES}, $udeps, $withlibs, $forward, $pubonly, $busy) unless $pubonly; - pop (@$busy); - } - - unshift (@{$udeps}, $n) unless $forward; - } -} - -sub check($$$$$) -{ - my ($INPUT, $enabled, $subsys_ot, $lib_ot, $module_ot) = @_; - - foreach my $part (values %$INPUT) { - if (defined($enabled->{$part->{NAME}})) { - $part->{ENABLE} = $enabled->{$part->{NAME}}; - next; - } - - unless(defined($part->{ENABLE})) { - if ($part->{TYPE} eq "EXT_LIB") { - $part->{ENABLE} = "NO"; - } else { - $part->{ENABLE} = "YES"; - } - } - } - - foreach my $part (values %$INPUT) { - $part->{LINK_FLAGS} = []; - $part->{FULL_OBJ_LIST} = ["\$($part->{NAME}_OBJ_FILES)"]; - - if ($part->{TYPE} eq "SUBSYSTEM") { - check_subsystem($INPUT, $part, $subsys_ot); - } elsif ($part->{TYPE} eq "MODULE") { - check_module($INPUT, $part, $module_ot); - } elsif ($part->{TYPE} eq "LIBRARY") { - check_library($INPUT, $part, $lib_ot); - } elsif ($part->{TYPE} eq "BINARY") { - check_binary($INPUT, $part); - } elsif ($part->{TYPE} eq "PYTHON") { - check_python($INPUT, $part, $module_ot); - } elsif ($part->{TYPE} eq "EXT_LIB") { - } else { - die("Unknown type $part->{TYPE}"); - } - } - - foreach my $part (values %$INPUT) { - if (defined($part->{INIT_FUNCTIONS})) { - push (@{$part->{LINK_FLAGS}}, "\$(DYNEXP)"); - } - } - - foreach my $part (values %$INPUT) { - $part->{UNIQUE_DEPENDENCIES_LINK} = []; - calc_unique_deps($part->{NAME}, $INPUT, $part->{PUBLIC_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_LINK}, 0, 0, 0, []); - calc_unique_deps($part->{NAME}, $INPUT, $part->{PRIVATE_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_LINK}, 0, 0, 0, []); - } - - foreach my $part (values %$INPUT) { - $part->{UNIQUE_DEPENDENCIES_COMPILE} = []; - calc_unique_deps($part->{NAME}, $INPUT, $part->{PUBLIC_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_COMPILE}, 1, 1, 1, []); - calc_unique_deps($part->{NAME}, $INPUT, $part->{PRIVATE_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_COMPILE}, 1, 1, 1, []); - } - - foreach my $part (values %$INPUT) { - $part->{UNIQUE_DEPENDENCIES_ALL} = []; - calc_unique_deps($part->{NAME}, $INPUT, $part->{PUBLIC_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_ALL}, 1, 0, 0, []); - calc_unique_deps($part->{NAME}, $INPUT, $part->{PRIVATE_DEPENDENCIES}, $part->{UNIQUE_DEPENDENCIES_ALL}, 1, 0, 0, []); - } - - return $INPUT; -} - -1; diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl deleted file mode 100644 index fbea269300..0000000000 --- a/source4/build/smb_build/main.pl +++ /dev/null @@ -1,105 +0,0 @@ -# Samba Build System -# - the main program -# -# Copyright (C) Stefan (metze) Metzmacher 2004 -# Copyright (C) Jelmer Vernooij 2005 -# Released under the GNU GPL - -use smb_build::makefile; -use smb_build::input; -use smb_build::config_mk; -use smb_build::output; -use smb_build::summary; -use smb_build::config; -use Getopt::Long; -use strict; - -my $output_file = "data.mk"; - -my $result = GetOptions ( - 'output=s' => \$output_file); - -if (not $result) { - exit(1); -} - -my $input_file = shift @ARGV; - -my $INPUT = {}; -my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, $input_file); - -my $subsys_output_type = ["MERGED_OBJ"]; - -my $library_output_type; -my $useshared = (defined($ENV{USESHARED})?$ENV{USESHARED}:$config::config{USESHARED}); - -if ($useshared eq "true") { - $library_output_type = ["SHARED_LIBRARY", "MERGED_OBJ"]; -} else { - $library_output_type = ["MERGED_OBJ"]; - push (@$library_output_type, "SHARED_LIBRARY") if - ($config::config{BLDSHARED} eq "true") -} - -my $module_output_type; -if ($useshared eq "true") { - #$module_output_type = ["SHARED_LIBRARY"]; - $module_output_type = ["MERGED_OBJ"]; -} else { - $module_output_type = ["MERGED_OBJ"]; -} - -my $DEPEND = smb_build::input::check($INPUT, \%config::enabled, - $subsys_output_type, - $library_output_type, - $module_output_type); -my $OUTPUT = output::create_output($DEPEND, \%config::config); -my $mkenv = new smb_build::makefile(\%config::config, $mkfile); - -my $shared_libs_used = 0; -foreach my $key (values %$OUTPUT) { - next if ($key->{ENABLE} ne "YES"); - push(@{$mkenv->{all_objs}}, "\$($key->{NAME}_OBJ_FILES)"); -} - -foreach my $key (values %$OUTPUT) { - next unless defined $key->{OUTPUT_TYPE}; - - $mkenv->StaticLibraryPrimitives($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->MergedObj($key) if grep(/MERGED_OBJ/, @{$key->{OUTPUT_TYPE}}); - $mkenv->SharedLibraryPrimitives($key) if ($key->{TYPE} eq "LIBRARY") and - grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - if ($key->{TYPE} eq "LIBRARY" and - ${$key->{OUTPUT_TYPE}}[0] eq "SHARED_LIBRARY") { - $shared_libs_used = 1; - } - if ($key->{TYPE} eq "MODULE" and @{$key->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ" and defined($key->{INIT_FUNCTION})) { - $mkenv->output("$key->{SUBSYSTEM}_INIT_FUNCTIONS +=$key->{INIT_FUNCTION},\n"); - } - $mkenv->CFlags($key); -} - -foreach my $key (values %$OUTPUT) { - next unless defined $key->{OUTPUT_TYPE}; - - $mkenv->Integrated($key) if grep(/INTEGRATED/, @{$key->{OUTPUT_TYPE}}); -} - -foreach my $key (values %$OUTPUT) { - next unless defined $key->{OUTPUT_TYPE}; - $mkenv->StaticLibrary($key) if grep(/STATIC_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - - $mkenv->SharedLibrary($key) if ($key->{TYPE} eq "LIBRARY") and - grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->SharedModule($key) if ($key->{TYPE} eq "MODULE" and - grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}})); - $mkenv->PythonModule($key) if ($key->{TYPE} eq "PYTHON"); - $mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}}); - $mkenv->InitFunctions($key) if defined($key->{INIT_FUNCTIONS}); -} - -$mkenv->write($output_file); - -summary::show($OUTPUT, \%config::config); - -1; diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm deleted file mode 100644 index 3a6f4b7d4f..0000000000 --- a/source4/build/smb_build/makefile.pm +++ /dev/null @@ -1,281 +0,0 @@ -# Samba Build System -# - create output for Makefile -# -# Copyright (C) Stefan (metze) Metzmacher 2004 -# Copyright (C) Jelmer Vernooij 2005 -# Released under the GNU GPL - -package smb_build::makefile; -use smb_build::output; -use File::Basename; -use strict; - -use Cwd 'abs_path'; - -sub new($$$) -{ - my ($myname, $config, $mkfile) = @_; - my $self = {}; - - bless($self, $myname); - - $self->_set_config($config); - - $self->{output} = ""; - - $self->output("################################################\n"); - $self->output("# Autogenerated by source4/build/smb_build/makefile.pm #\n"); - $self->output("################################################\n"); - $self->output("\n"); - $self->output($mkfile); - - return $self; -} - -sub _set_config($$) -{ - my ($self, $config) = @_; - - $self->{config} = $config; - - if (not defined($self->{config}->{srcdir})) { - $self->{config}->{srcdir} = '.'; - } - - if (not defined($self->{config}->{builddir})) { - $self->{config}->{builddir} = '.'; - } - - if ($self->{config}->{prefix} eq "NONE") { - $self->{config}->{prefix} = $self->{config}->{ac_default_prefix}; - } - - if ($self->{config}->{exec_prefix} eq "NONE") { - $self->{config}->{exec_prefix} = $self->{config}->{prefix}; - } -} - -sub output($$) -{ - my ($self, $text) = @_; - - $self->{output} .= $text; -} - -sub _prepare_mk_files($) -{ - my $self = shift; - my @tmp = (); - - foreach (@smb_build::config_mk::parsed_files) { - s/ .*$//g; - push (@tmp, $_); - } - - $self->output("MK_FILES = " . array2oneperline(\@tmp) . "\n"); -} - -sub array2oneperline($) -{ - my $array = shift; - my $output = ""; - - foreach (@$array) { - next unless defined($_); - - $output .= " \\\n\t\t$_"; - } - - return $output; -} - -sub _prepare_list($$$) -{ - my ($self,$ctx,$var) = @_; - my @tmparr = (); - - push(@tmparr, @{$ctx->{$var}}) if defined($ctx->{$var}); - - my $tmplist = array2oneperline(\@tmparr); - return if ($tmplist eq ""); - - $self->output("$ctx->{NAME}_$var =$tmplist\n"); -} - -sub PythonModule($$) -{ - my ($self,$ctx) = @_; - - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - $self->_prepare_list($ctx, "DEPEND_LIST"); - $self->_prepare_list($ctx, "LINK_FLAGS"); - - $self->output("\$(eval \$(call python_c_module_template,$ctx->{LIBRARY_REALNAME},\$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST), \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS)))\n"); -} - -sub SharedModule($$) -{ - my ($self,$ctx) = @_; - - my $sane_subsystem = lc($ctx->{SUBSYSTEM}); - $sane_subsystem =~ s/^lib//; - - $self->output("PLUGINS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n"); - $self->output("\$(eval \$(call shared_module_install_template,$sane_subsystem,$ctx->{LIBRARY_REALNAME}))\n"); - - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - $self->_prepare_list($ctx, "DEPEND_LIST"); - $self->_prepare_list($ctx, "LINK_FLAGS"); - - if (defined($ctx->{INIT_FUNCTION}) and $ctx->{INIT_FUNCTION_TYPE} =~ /\(\*\)/ and not ($ctx->{INIT_FUNCTION} =~ /\(/)) { - $self->output("\$($ctx->{NAME}_OBJ_FILES): CFLAGS+=-D$ctx->{INIT_FUNCTION}=samba_init_module\n"); - } - - $self->output("\$(eval \$(call shared_module_template,$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}, \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST), \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS)))\n"); - - - if (defined($ctx->{ALIASES})) { - $self->output("\$(eval \$(foreach alias,". join(' ', @{$ctx->{ALIASES}}) . ",\$(call shared_module_alias_template,$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME},$sane_subsystem,\$(alias))))\n"); - } -} - -sub StaticLibraryPrimitives($$) -{ - my ($self,$ctx) = @_; - - $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); -} - -sub SharedLibraryPrimitives($$) -{ - my ($self,$ctx) = @_; - - if (not grep(/STATIC_LIBRARY/, @{$ctx->{OUTPUT_TYPE}})) { - $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - } -} - -sub SharedLibrary($$) -{ - my ($self,$ctx) = @_; - - $self->output("SHARED_LIBS += $ctx->{RESULT_SHARED_LIBRARY}\n"); - - $self->_prepare_list($ctx, "DEPEND_LIST"); - $self->_prepare_list($ctx, "LINK_FLAGS"); - - $self->output("\$(eval \$(call shared_library_template,$ctx->{RESULT_SHARED_LIBRARY}, \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST), \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS),$ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME},$ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}))\n"); -} - -sub MergedObj($$) -{ - my ($self, $ctx) = @_; - - $self->output("\$(call partial_link_template, $ctx->{OUTPUT}, \$($ctx->{NAME}_OBJ_FILES))\n"); -} - -sub InitFunctions($$) -{ - my ($self, $ctx) = @_; - $self->output("\$($ctx->{NAME}_OBJ_FILES): CFLAGS+=-DSTATIC_$ctx->{NAME}_MODULES=\"\$($ctx->{NAME}_INIT_FUNCTIONS)$ctx->{INIT_FUNCTION_SENTINEL}\"\n"); -} - -sub StaticLibrary($$) -{ - my ($self,$ctx) = @_; - - $self->output("STATIC_LIBS += $ctx->{RESULT_STATIC_LIBRARY}\n") if ($ctx->{TYPE} eq "LIBRARY"); - $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); - $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); -} - -sub Binary($$) -{ - my ($self,$ctx) = @_; - - unless (defined($ctx->{INSTALLDIR})) { - } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { - $self->output("\$(eval \$(call sbinary_install_template,$ctx->{RESULT_BINARY}))\n"); - } elsif ($ctx->{INSTALLDIR} eq "BINDIR") { - $self->output("\$(eval \$(call binary_install_template,$ctx->{RESULT_BINARY}))\n"); - } - - $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - $self->_prepare_list($ctx, "DEPEND_LIST"); - $self->_prepare_list($ctx, "LINK_FLAGS"); - - if (defined($ctx->{USE_HOSTCC}) && $ctx->{USE_HOSTCC} eq "YES") { -$self->output("\$(eval \$(call host_binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS)))\n"); - } else { -$self->output("\$(eval \$(call binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS)))\n"); - } -} - -sub write($$) -{ - my ($self, $file) = @_; - - $self->_prepare_mk_files(); - - $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n"); - - open(MAKEFILE,">$file") || die ("Can't open $file\n"); - print MAKEFILE $self->{output}; - close(MAKEFILE); - - print __FILE__.": creating $file\n"; -} - -my $sort_available = eval "use sort 'stable'; return 1;"; -$sort_available = 0 unless defined($sort_available); - -sub by_path { - return 1 if($a =~ m#^\-I/#); - return -1 if($b =~ m#^\-I/#); - return 0; -} - -sub CFlags($$) -{ - my ($self, $key) = @_; - - my $srcdir = $self->{config}->{srcdir}; - my $builddir = $self->{config}->{builddir}; - - my $src_ne_build = ($srcdir ne $builddir) ? 1 : 0; - - return unless defined ($key->{FINAL_CFLAGS}); - return unless (@{$key->{FINAL_CFLAGS}} > 0); - - my @sorted_cflags = @{$key->{FINAL_CFLAGS}}; - if ($sort_available) { - @sorted_cflags = sort by_path @{$key->{FINAL_CFLAGS}}; - } - - # Rewrite CFLAGS so that both the source and the build - # directories are in the path. - my @cflags = (); - foreach my $flag (@sorted_cflags) { - if($src_ne_build) { - if($flag =~ m#^-I([^/].*$)#) { - my $dir = $1; - if ($dir =~ /^\$\(/) { - push (@cflags, $flag); - next; - } - $dir =~ s#^\$\((?:src|build)dir\)/?##; - push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir"); - next; - } - } - push(@cflags, $flag); - } - - my $cflags = join(' ', @cflags); - - $self->output("\$(patsubst %.ho,%.d,\$($key->{NAME}_OBJ_FILES:.o=.d)) \$($key->{NAME}_OBJ_FILES): CFLAGS+= $cflags\n"); -} - -1; diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm deleted file mode 100644 index aada681ef4..0000000000 --- a/source4/build/smb_build/output.pm +++ /dev/null @@ -1,172 +0,0 @@ -# SMB Build System -# - the output generating functions -# -# Copyright (C) Stefan (metze) Metzmacher 2004 -# Copyright (C) Jelmer Vernooij 2004 -# Released under the GNU GPL - -package output; -use strict; - -sub generate_shared_library($) -{ - my $lib = shift; - my $link_name; - my $lib_name; - - $lib->{DEPEND_LIST} = []; - - $link_name = lc($lib->{NAME}); - $lib_name = $link_name; - - if ($lib->{TYPE} eq "LIBRARY") { - $link_name = $lib->{NAME}; - $link_name =~ s/^LIB//; - $link_name = lc($link_name); - $lib_name = "lib$link_name"; - } - - if ($lib->{TYPE} eq "PYTHON") { - $lib->{SHAREDDIR} = "bin/python"; - } elsif (defined($lib->{LIBRARY_REALNAME})) { - $lib->{BASEDIR} =~ s/^\.\///g; - $lib->{SHAREDDIR} = $lib->{BASEDIR}; - } else { - if ($lib->{TYPE} eq "MODULE") { - my $sane_subsystem = lc($lib->{SUBSYSTEM}); - $sane_subsystem =~ s/^lib//; - $lib->{SHAREDDIR} = "bin/modules/$sane_subsystem"; - $lib->{LIBRARY_REALNAME} = $link_name; - $lib->{LIBRARY_REALNAME} =~ s/^$sane_subsystem\_//g; - $lib->{LIBRARY_REALNAME}.= ".\$(SHLIBEXT)"; - } else { - $lib->{SHAREDDIR} = "\$(shliboutputdir)"; - $lib->{LIBRARY_REALNAME} = "$lib_name.\$(SHLIBEXT)"; - } - } - - $lib->{LIBRARY_DEBUGNAME} = $lib->{LIBRARY_REALNAME}; - - $lib->{LIBRARY_SONAME} = "\$(if \$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME})"; - $lib->{LIBRARY_REALNAME} = "\$(if \$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME})"; - - $lib->{RESULT_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; - $lib->{OUTPUT_SHARED_LIBRARY} = "-l$link_name"; - $lib->{TARGET_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_DEBUGNAME}"; -} - -sub generate_merged_obj($) -{ - my $lib = shift; - - my $link_name = $lib->{NAME}; - $link_name =~ s/^LIB//; - - $lib->{MERGED_OBJNAME} = lc($link_name).".o"; - $lib->{RESULT_MERGED_OBJ} = $lib->{OUTPUT_MERGED_OBJ} = "bin/mergedobj/$lib->{MERGED_OBJNAME}"; - $lib->{TARGET_MERGED_OBJ} = $lib->{RESULT_MERGED_OBJ}; -} - -sub generate_static_library($) -{ - my $lib = shift; - my $link_name; - - $lib->{DEPEND_LIST} = []; - - $link_name = $lib->{NAME}; - $link_name =~ s/^LIB//; - - $lib->{LIBRARY_NAME} = "lib".lc($link_name).".a"; - - $lib->{RESULT_STATIC_LIBRARY} = "bin/static/$lib->{LIBRARY_NAME}"; - $lib->{TARGET_STATIC_LIBRARY} = $lib->{RESULT_STATIC_LIBRARY}; - $lib->{STATICDIR} = 'bin/static'; - $lib->{OUTPUT_STATIC_LIBRARY} = "-l".lc($link_name); -} - -sub generate_binary($) -{ - my $bin = shift; - - $bin->{DEPEND_LIST} = []; - push(@{$bin->{LINK_FLAGS}}, "\$($bin->{NAME}\_FULL_OBJ_LIST)"); - - $bin->{DEBUGDIR} = "bin"; - $bin->{RESULT_BINARY} = $bin->{OUTPUT_BINARY} = "$bin->{DEBUGDIR}/$bin->{NAME}"; - $bin->{TARGET_BINARY} = $bin->{RESULT_BINARY}; - $bin->{BINARY} = $bin->{NAME}; -} - -sub merge_array($$) -{ - # $dest is a reference to an array - # $src is an array - my ($dest, $src) = @_; - - return unless defined($src); - return unless ($#{$src} >= 0); - - foreach my $line (@{$src}) { - next if (grep /^$line$/, @{$$dest}); - push(@{$$dest}, $line); - } -} - -sub create_output($$) -{ - my ($depend, $config) = @_; - my $part; - - foreach $part (values %{$depend}) { - next unless(defined($part->{OUTPUT_TYPE})); - - generate_binary($part) if grep(/BINARY/, @{$part->{OUTPUT_TYPE}}); - generate_shared_library($part) if grep(/SHARED_LIBRARY/, @{$part->{OUTPUT_TYPE}}); - generate_static_library($part) if grep(/STATIC_LIBRARY/, @{$part->{OUTPUT_TYPE}}); - generate_merged_obj($part) if grep(/MERGED_OBJ/, @{$part->{OUTPUT_TYPE}}); - $part->{OUTPUT} = $part->{"OUTPUT_" . @{$part->{OUTPUT_TYPE}}[0]}; - $part->{TARGET} = $part->{"TARGET_" . @{$part->{OUTPUT_TYPE}}[0]}; - } - - foreach $part (values %{$depend}) { - next if not defined($part->{OUTPUT_TYPE}); - - merge_array(\$part->{FINAL_CFLAGS}, $part->{CPPFLAGS}); - merge_array(\$part->{FINAL_CFLAGS}, $part->{CFLAGS}); - - foreach (@{$part->{UNIQUE_DEPENDENCIES_ALL}}) { - my $elem = $depend->{$_}; - next if $elem == $part; - - merge_array(\$part->{FINAL_CFLAGS}, $elem->{CPPFLAGS}); - merge_array(\$part->{FINAL_CFLAGS}, $elem->{CFLAGS}); - } - - # Always import the link options of the unique dependencies - foreach (@{$part->{UNIQUE_DEPENDENCIES_LINK}}) { - my $elem = $depend->{$_}; - next if $elem == $part; - - push(@{$part->{LINK_FLAGS}}, @{$elem->{LIBS}}) if defined($elem->{LIBS}); - push(@{$part->{LINK_FLAGS}}, @{$elem->{LDFLAGS}}) if defined($elem->{LDFLAGS}); - if (defined($elem->{OUTPUT_TYPE}) and @{$elem->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ") { - push (@{$part->{FULL_OBJ_LIST}}, $elem->{TARGET}); - } else { - push(@{$part->{LINK_FLAGS}}, "\$($elem->{NAME}_OUTPUT)") if defined($elem->{OUTPUT}); - push(@{$part->{DEPEND_LIST}}, $elem->{TARGET}) if (defined($elem->{TARGET})); - } - } - } - - foreach $part (values %{$depend}) { - if (defined($part->{STANDARD_VISIBILITY}) and ($part->{STANDARD_VISIBILITY} ne "default") and - ($config->{visibility_attribute} eq "yes")) { - push(@{$part->{FINAL_CFLAGS}}, "-fvisibility=$part->{STANDARD_VISIBILITY}"); - } - } - - return $depend; -} - -1; diff --git a/source4/build/smb_build/summary.pm b/source4/build/smb_build/summary.pm deleted file mode 100644 index 09f5ff83ce..0000000000 --- a/source4/build/smb_build/summary.pm +++ /dev/null @@ -1,87 +0,0 @@ -# Samba Build System -# - write out summary -# -# Copyright (C) Jelmer Vernooij 2006 -# Released under the GNU GPL - -package summary; -use smb_build::config; -use strict; - -sub enabled($) -{ - my ($val) = @_; - - return (defined($val) && $val =~ m/yes|true/i); -} - -sub showitem($$$) -{ - my ($output,$desc,$items) = @_; - - my @need = (); - - foreach (@$items) { - push (@need, $_) if (enabled($config::enable{$_})); - } - - print "Support for $desc: "; - if ($#need >= 0) { - print "no (install " . join(',',@need) . ")\n"; - } else { - print "yes\n"; - } -} - -sub showisexternal($$$) -{ - my ($output, $desc, $name) = @_; - print "Using external $desc: "; - if ($output->{$name}->{TYPE} eq "SUBSYSTEM" or - $output->{$name}->{TYPE} eq "LIBRARY") { - print "no"; - } else { - print "yes"; - } - print "\n"; -} - -sub show($$) -{ - my ($output,$config) = @_; - - print "Summary:\n\n"; - showitem($output, "SSL in SWAT and LDAP", ["GNUTLS"]); - showitem($output, "threads in server (see --with-pthread)", ["PTHREAD"]); - showitem($output, "intelligent command line editing", ["READLINE"]); - showitem($output, "changing process titles (see --with-setproctitle)", ["SETPROCTITLE"]); - showitem($output, "using extended attributes", ["XATTR"]); - showitem($output, "using libblkid", ["BLKID"]); - showitem($output, "using iconv", ["ICONV"]); - showitem($output, "using pam", ["PAM"]); - showitem($output, "python bindings", ["LIBPYTHON"]); - showisexternal($output, "popt", "LIBPOPT"); - showisexternal($output, "talloc", "LIBTALLOC"); - showisexternal($output, "tdb", "LIBTDB"); - showisexternal($output, "tevent", "LIBTEVENT"); - showisexternal($output, "ldb", "LIBLDB"); - showisexternal($output, "heimdal", "HEIMDAL_KRB5"); - print "Developer mode: ".(enabled($config->{developer})?"yes":"no")."\n"; - print "Automatic dependencies: ". - (enabled($config->{automatic_dependencies}) - ? "yes" : "no (install GNU make >= 3.81 and see --enable-automatic-dependencies)") . - "\n"; - - print "Building shared libraries: " . - (enabled($config->{BLDSHARED}) - ? "yes" : "no (not supported on this system)") . - "\n"; - print "Using shared libraries internally: " . - (enabled($config->{USESHARED}) - ? "yes" : "no (specify --enable-dso)") . - "\n"; - - print "\n"; -} - -1; |