]> git.lyx.org Git - lyx.git/blob - src/support/Makefile.am
Add autotools support for src/support/minizip stuff
[lyx.git] / src / support / Makefile.am
1 include $(top_srcdir)/config/common.am
2
3 CLEANFILES += $(BUILT_SOURCES)
4
5 EXTRA_DIST = Package.cpp.in pch.h \
6         os_cygwin.cpp os_unix.cpp os_win32.cpp os_win32.h
7
8 pkglib_LTLIBRARIES = liblyxsupport.la
9
10 liblyxsupport_la_LIBADD = $(LIBSHLWAPI) $(QT4_CORE_LIB) $(BOOST_SIGNALS)
11 liblyxsupport_la_LDFLAGS = $(QT4_CORE_LDFLAGS)
12
13 BUILT_SOURCES = $(PCH_FILE) Package.cpp
14
15 AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
16 AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES) -I$(srcdir)/minizip
17
18 # force the use of C++ compiler for minizip/*.c files, because
19 # gcc can not go through the included boost files.
20 liblyxsupport_la_CFLAGS = -x c++
21
22 liblyxsupport_la_SOURCES = \
23         FileMonitor.h \
24         FileMonitor.cpp \
25         RandomAccessList.h \
26         abort.cpp \
27         chdir.cpp \
28         convert.cpp \
29         convert.h \
30         copy.cpp \
31         copied_ptr.h \
32         cow_ptr.h \
33         debugstream.h \
34         docstream.cpp \
35         docstream.h \
36         docstring.cpp \
37         docstring.h \
38         environment.h \
39         environment.cpp \
40         ExceptionMessage.h \
41         FileFilterList.cpp \
42         FileFilterList.h \
43         FileName.cpp \
44         FileName.h \
45         filetools.cpp \
46         filetools.h \
47         Forkedcall.cpp \
48         Forkedcall.h \
49         ForkedCallQueue.cpp \
50         ForkedCallQueue.h \
51         ForkedcallsController.cpp \
52         ForkedcallsController.h \
53         fs_extras.cpp \
54         fs_extras.h \
55         getcwd.cpp \
56         gzstream.cpp \
57         gzstream.h \
58         kill.cpp \
59         limited_stack.h \
60         lstrings.cpp \
61         lstrings.h \
62         lyxalgo.h \
63         lyxlib.h \
64         lyxmanip.h \
65         lyxtime.cpp \
66         lyxtime.h \
67         lyxsum.cpp \
68         mkdir.cpp \
69         os.cpp \
70         os.h \
71         Path.cpp \
72         Path.h \
73         Package.cpp \
74         Package.h \
75         qstring_helpers.cpp \
76         qstring_helpers.h \
77         rename.cpp \
78         socktools.cpp \
79         socktools.h \
80         std_istream.h \
81         std_ostream.h \
82         Systemcall.cpp \
83         Systemcall.h \
84         tempname.cpp \
85         textutils.cpp \
86         textutils.h \
87         Translator.h \
88         Timeout.cpp \
89         Timeout.h \
90         types.h \
91         userinfo.cpp \
92         userinfo.h \
93         unicode.cpp \
94         unicode.h \
95         unlink.cpp \
96         minizip/crypt.h \
97         minizip/ioapi.c \
98         minizip/ioapi.h \
99         minizip/unzip.c \
100         minizip/unzip.h \
101         minizip/zip.c \
102         minizip/zip.h
103
104 # FIXME: the following two files are for windows only. I do not know
105 # how to add them conditionally. autotools are rarely used under windows 
106 # anyway.
107 #    minizip/iowin32.c
108 #    minizip/iowin32.h
109
110 Package.cpp: build_package
111
112 # Solaris sed does not like spaces bewteen the ;-delimited commands
113 build_package: Package.cpp.in
114         @rm -f tmp_package ;\
115         sed "s,@LYX_DIR@,$(LYX_ABS_INSTALLED_DATADIR),;\
116 s,@LOCALEDIR@,$(LYX_ABS_INSTALLED_LOCALEDIR),;\
117 s,@TOP_SRCDIR@,$(LYX_ABS_TOP_SRCDIR),;\
118 s,@PROGRAM_SUFFIX@,$(program_suffix)," \
119                 $(srcdir)/Package.cpp.in > tmp_package ;\
120         if cmp -s tmp_package Package.cpp ; then \
121                 rm -f tmp_package ;\
122         else \
123                 rm -f Package.cpp ;\
124                 mv tmp_package Package.cpp ;\
125         fi
126
127
128 ############################## Tests ##################################
129
130 EXTRA_DIST += tests/test_convert tests/test_filetools \
131         tests/test_lstrings tests/regfiles
132
133 TESTS = \
134         test_convert \
135         test_filetools \
136         test_lstrings
137
138 check_PROGRAMS = \
139         check_convert \
140         check_filetools \
141         check_lstrings
142
143 check_convert_LDADD = ../debug.o convert.o docstring.o lstrings.o unicode.o \
144         qstring_helpers.o $(BOOST_LIBS) $(QT4_CORE_LIB)
145 check_convert_LDFLAGS = $(QT4_CORE_LDFLAGS)
146 check_convert_SOURCES = \
147         tests/check_convert.cpp \
148         tests/boost.cpp
149
150 check_filetools_LDADD = ../debug.o libsupport.la $(BOOST_LIBS)
151 check_filetools_SOURCES = \
152         tests/check_filetools.cpp \
153         tests/boost.cpp
154
155 check_lstrings_LDADD = ../debug.o lstrings.o convert.o docstring.o unicode.o \
156         qstring_helpers.o $(QT4_CORE_LIB)
157 check_lstrings_LDFLAGS = $(QT4_CORE_LDFLAGS)
158 check_lstrings_SOURCES = \
159         tests/check_lstrings.cpp \
160         tests/boost.cpp
161
162 makeregfiles: ${check_PROGRAMS}
163         for all in ${check_PROGRAMS} ; do \
164                 ./$$all > ${srcdir}/regfiles/$$all ; \
165         done