~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to mk-1st.awk

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: mk-1st.awk,v 1.65 2005/06/18 19:15:57 tom Exp $
 
1
# $Id: mk-1st.awk,v 1.68 2006/10/08 00:14:08 tom Exp $
2
2
##############################################################################
3
 
# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.                #
 
3
# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.                #
4
4
#                                                                            #
5
5
# Permission is hereby granted, free of charge, to any person obtaining a    #
6
6
# copy of this software and associated documentation files (the "Software"), #
31
31
#
32
32
# Generate list of objects for a given model library
33
33
# Variables:
34
 
#       name (library name, e.g., "ncurses", "panel", "forms", "menus")
35
 
#       traces ("all" or "DEBUG", to control whether tracing is compiled in)
36
 
#       MODEL (e.g., "DEBUG", uppercase; toupper is not portable)
37
 
#       model (directory into which we compile, e.g., "obj")
38
 
#       prefix (e.g., "lib", for Unix-style libraries)
39
 
#       suffix (e.g., "_g.a", for debug libraries)
40
 
#       subset ("none", "base", "base+ext_funcs" or "termlib")
41
 
#       ShlibVer ("rel", "abi" or "auto", to augment DoLinks variable)
 
34
#       name              (library name, e.g., "ncurses", "panel", "forms", "menus")
 
35
#       traces            ("all" or "DEBUG", to control whether tracing is compiled in)
 
36
#       MODEL             (e.g., "DEBUG", uppercase; toupper is not portable)
 
37
#       model             (directory into which we compile, e.g., "obj")
 
38
#       prefix            (e.g., "lib", for Unix-style libraries)
 
39
#       suffix            (e.g., "_g.a", for debug libraries)
 
40
#       subset            ("none", "base", "base+ext_funcs" or "termlib")
 
41
#       ShlibVer          ("rel", "abi" or "auto", to augment DoLinks variable)
42
42
#       ShlibVerInfix ("yes" or "no", determines location of version #)
43
 
#       DoLinks ("yes", "reverse" or "no", flag to add symbolic links)
44
 
#       rmSoLocs ("yes" or "no", flag to add extra clean target)
45
 
#       ldconfig (path for this tool, if used)
46
 
#       overwrite ("yes" or "no", flag to add link to libcurses.a
47
 
#       depend (optional dependencies for all objects, e.g, ncurses_cfg.h)
48
 
#       host (cross-compile host, if any)
 
43
#       DoLinks           ("yes", "reverse" or "no", flag to add symbolic links)
 
44
#       rmSoLocs          ("yes" or "no", flag to add extra clean target)
 
45
#       ldconfig          (path for this tool, if used)
 
46
#       overwrite         ("yes" or "no", flag to add link to libcurses.a
 
47
#       depend            (optional dependencies for all objects, e.g, ncurses_cfg.h)
 
48
#       host              (cross-compile host, if any)
49
49
#
50
50
# Notes:
51
51
#       CLIXs nawk does not like underscores in command-line variable names.
52
 
#       Mixed-case is ok.
 
52
#       Mixed-case variable names are ok.
53
53
#       HP/UX requires shared libraries to have executable permissions.
54
54
#
55
55
function symlink(src,dst) {
60
60
        }
61
61
function rmlink(directory, dst) {
62
62
                printf "\t-rm -f %s/%s\n", directory, dst
63
 
}
 
63
        }
64
64
function removelinks(directory) {
65
65
                rmlink(directory, end_name);
66
66
                if ( DoLinks == "reverse" ) {
79
79
                                }
80
80
                }
81
81
        }
 
82
function make_shlib(objs, shlib_list) {
 
83
                printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(%s) $(LDFLAGS)\n", objs, shlib_list
 
84
        }
82
85
function sharedlinks(directory) {
83
86
                if ( ShlibVer != "auto" && ShlibVer != "cygdll" ) {
84
87
                        printf "\tcd %s && (", directory
100
103
                        printf ")\n"
101
104
                }
102
105
        }
 
106
function shlib_rule(directory) {
 
107
                if ( ShlibVer == "cygdll" ) {
 
108
                                dst_libs = sprintf("%s/$(SHARED_LIB) %s/$(IMPORT_LIB)", directory, directory);
 
109
                } else {
 
110
                                dst_libs = sprintf("%s/%s", directory, end_name);
 
111
                }
 
112
                printf "%s : %s $(%s_OBJS)\n", dst_libs, directory, OBJS
 
113
                printf "\t@echo linking $@\n"
 
114
                print "\t-@rm -f %s", dst_libs;
 
115
                if ( subset == "termlib" || subset == "termlib+ext_tinfo" ) {
 
116
                                make_shlib(OBJS, "TINFO_LIST")
 
117
                } else {
 
118
                                make_shlib(OBJS, "SHLIB_LIST")
 
119
                }
 
120
                sharedlinks(directory)
 
121
        }
 
122
function install_dll(directory,filename) {
 
123
                src_name = sprintf("../lib/%s", filename);
 
124
                dst_name = sprintf("$(DESTDIR)%s/%s", directory, filename);
 
125
                printf "\t@echo installing %s as %s\n", src_name, dst_name
 
126
                printf "\t-@rm -f %s\n", dst_name
 
127
                if ( directory == "$(bindir)" ) {
 
128
                        program = "$(INSTALL) -m 755";
 
129
                } else {
 
130
                        program = "$(INSTALL_LIB)";
 
131
                }
 
132
                printf "\t%s %s %s\n", program, src_name, dst_name
 
133
        }
103
134
BEGIN   {
104
135
                found = 0
105
136
                using = 0
200
231
                                        }
201
232
                                }
202
233
 
 
234
                                shlib_rule("../lib")
 
235
 
 
236
                                print  ""
 
237
                                print  "install \\"
 
238
                                print  "install.libs \\"
 
239
 
203
240
                                if ( ShlibVer == "cygdll" ) {
 
241
 
204
242
                                        dst_dirs = "$(DESTDIR)$(bindir) $(DESTDIR)$(libdir)";
205
 
                                        printf "$(SHARED_LIB) $(IMPORT_LIB) : $(%s_OBJS)\n", OBJS;
206
 
                                        print "\t-@rm -f $(SHARED_LIB) $(IMPORT_LIB)";
207
 
                                } else {
208
 
                                        dst_dirs = "$(DESTDIR)$(libdir)";
209
 
                                        printf "../lib/%s : $(%s_OBJS)\n", end_name, OBJS
210
 
                                        print "\t-@rm -f $@";
211
 
                                }
212
 
                                if ( subset == "termlib" || subset == "termlib+ext_tinfo" ) {
213
 
                                        printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(TINFO_LIST) $(LDFLAGS)\n", OBJS
214
 
                                } else {
215
 
                                        printf "\t$(MK_SHARED_LIB) $(%s_OBJS) $(SHLIB_LIST) $(LDFLAGS)\n", OBJS
216
 
                                }
217
 
                                sharedlinks("../lib")
218
 
 
219
 
                                print  ""
220
 
                                print  "install \\"
221
 
                                print  "install.libs \\"
222
 
                                printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs
223
 
 
224
 
                                if ( ShlibVer == "cygdll" ) {
225
 
 
226
 
                                        src_name = sprintf("../lib/%s", end_name);
227
 
                                        dst_name = sprintf("$(DESTDIR)$(bindir)/%s", end_name);
228
 
                                        printf "\t@echo installing %s as %s\n", src_name, dst_name
229
 
                                        printf "\t-@rm -f %s\n", dst_name
230
 
                                        printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name
231
 
 
232
 
                                        src_name = sprintf("../lib/%s", imp_name);
233
 
                                        dst_name = sprintf("$(DESTDIR)$(libdir)/%s", imp_name);
234
 
                                        printf "\t@echo installing %s as %s\n", src_name, dst_name
235
 
                                        printf "\t-@rm -f %s\n", dst_name
236
 
                                        printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name
237
 
 
238
 
                                } else {
239
 
 
240
 
                                        src_name = sprintf("../lib/%s", end_name);
241
 
                                        dst_name = sprintf("$(DESTDIR)$(libdir)/%s", end_name);
242
 
                                        printf "\t@echo installing %s as %s\n", src_name, dst_name
243
 
                                        printf "\t-@rm -f %s\n", dst_name
244
 
                                        printf "\t$(INSTALL_LIB) %s %s\n", src_name, dst_name
245
 
 
246
 
                                        sharedlinks("$(DESTDIR)$(libdir)")
247
 
 
 
243
                                        printf "install.%s :: %s $(LIBRARIES)\n", name, dst_dirs
 
244
                                        install_dll("$(bindir)",end_name);
 
245
                                        install_dll("$(libdir)",imp_name);
 
246
 
 
247
                                } else {
 
248
 
 
249
                                        lib_dir = "$(DESTDIR)$(libdir)";
 
250
                                        printf "install.%s :: %s/%s\n", name, lib_dir, end_name
 
251
                                        print ""
 
252
                                        shlib_rule(lib_dir)
248
253
                                }
249
254
 
250
255
                                if ( overwrite == "yes" && name == "ncurses" )
259
264
                                                printf "\tcd $(DESTDIR)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, end_name, ovr_name
260
265
                                        }
261
266
                                }
262
 
                                if ( ldconfig != "" ) {
 
267
                                if ( ldconfig != "" && ldconfig != ":" ) {
263
268
                                        printf "\t- test -z \"$(DESTDIR)\" && %s\n", ldconfig
264
269
                                }
265
270
                                print  ""