git.fiddlerwoaroof.com
Browse code

CJPM-5222 make install target

Greg Wiley authored on 03/04/2017 20:41:13
Showing 3 changed files
... ...
@@ -1,5 +1,7 @@
1 1
 MODULEFLAGS = -fPIC -fno-stack-protector
2 2
 MODULEOBJS = dual_control.o
3
+MODULELIB = pam_dual_control.so
4
+
3 5
 
4 6
 .PHONY: all
5 7
 all: test dual_control.a
... ...
@@ -27,3 +29,8 @@ dual_control_test: dual_control_test.c $(MODULEOBJS)
27 29
 test: dual_control_test
28 30
 	@./dual_control_test > /dev/null
29 31
 
32
+.PHONY: install
33
+install: $(MODULEOBJS)
34
+	ld -x --shared -o @PAM_MODULE_DIRECTORY@/$(MODULELIB) $(MODULEOBJS)
35
+
36
+
... ...
@@ -587,6 +587,7 @@ PACKAGE_URL=''
587 587
 ac_unique_file="config.h.in"
588 588
 ac_subst_vars='LTLIBOBJS
589 589
 LIBOBJS
590
+PAM_MODULE_DIRECTORY
590 591
 OBJEXT
591 592
 EXEEXT
592 593
 ac_ct_CC
... ...
@@ -635,6 +636,7 @@ SHELL'
635 636
 ac_subst_files=''
636 637
 ac_user_opts='
637 638
 enable_option_checking
639
+with_pam_module_directory
638 640
 '
639 641
       ac_precious_vars='build_alias
640 642
 host_alias
... ...
@@ -1250,6 +1252,12 @@ if test -n "$ac_init_help"; then
1250 1252
    esac
1251 1253
   cat <<\_ACEOF
1252 1254
 
1255
+Optional Packages:
1256
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1257
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1258
+  --with-pam-module-directory=NAME
1259
+        Use NAME as installation directory for PAM modules
1260
+
1253 1261
 Some influential environment variables:
1254 1262
   CC          C compiler command
1255 1263
   CFLAGS      C compiler flags
... ...
@@ -2531,6 +2539,19 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
2531 2539
 
2532 2540
 # Checks for library functions.
2533 2541
 
2542
+# Implementation of the --with-pam-module-directory switch.
2543
+DEFAULT_PAM_MODULE_DIRECTORY="${libdir}/security"
2544
+
2545
+# Check whether --with-pam-module-directory was given.
2546
+if test "${with_pam_module_directory+set}" = set; then :
2547
+  withval=$with_pam_module_directory; PAM_MODULE_DIRECTORY="$withval"
2548
+else
2549
+  PAM_MODULE_DIRECTORY="$DEFAULT_PAM_MODULE_DIRECTORY"
2550
+fi
2551
+
2552
+
2553
+
2554
+
2534 2555
 ac_config_files="$ac_config_files Makefile"
2535 2556
 
2536 2557
 cat >confcache <<\_ACEOF
... ...
@@ -3805,3 +3826,33 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
3805 3826
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
3806 3827
 fi
3807 3828
 
3829
+
3830
+if test "$PAM_MODULE_DIRECTORY" = "$DEFAULT_PAM_MODULE_DIRECTORY"; then
3831
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
3832
+        **
3833
+        ** Warning: using default value ($DEFAULT_PAM_MODULE_DIRECTORY) as
3834
+        **          installation directory for PAM module; this is probably not
3835
+        **          what you want. Either use the configure flag
3836
+        **
3837
+        **                      --with-pam-module-directory=DIRECTORY
3838
+        **
3839
+        **          or copy the newly built pam_dual_control.so into the correct directory
3840
+        **          manually. Usually PAM modules are located in /lib/security or /lib64/security.
3841
+        **" >&5
3842
+$as_echo "$as_me: WARNING:
3843
+        **
3844
+        ** Warning: using default value ($DEFAULT_PAM_MODULE_DIRECTORY) as
3845
+        **          installation directory for PAM module; this is probably not
3846
+        **          what you want. Either use the configure flag
3847
+        **
3848
+        **                      --with-pam-module-directory=DIRECTORY
3849
+        **
3850
+        **          or copy the newly built pam_dual_control.so into the correct directory
3851
+        **          manually. Usually PAM modules are located in /lib/security or /lib64/security.
3852
+        **" >&2;}
3853
+else
3854
+    { $as_echo "$as_me:${as_lineno-$LINENO}: PAM module installation directory: $PAM_MODULE_DIRECTORY" >&5
3855
+$as_echo "$as_me: PAM module installation directory: $PAM_MODULE_DIRECTORY" >&6;}
3856
+fi
3857
+
3858
+
... ...
@@ -17,5 +17,33 @@ AC_PROG_CC
17 17
 
18 18
 # Checks for library functions.
19 19
 
20
+# Implementation of the --with-pam-module-directory switch.
21
+DEFAULT_PAM_MODULE_DIRECTORY="${libdir}/security"
22
+AC_ARG_WITH(pam-module-directory,
23
+    [  --with-pam-module-directory=NAME
24
+        Use NAME as installation directory for PAM modules ],
25
+    PAM_MODULE_DIRECTORY="$withval",
26
+    PAM_MODULE_DIRECTORY="$DEFAULT_PAM_MODULE_DIRECTORY")
27
+AC_SUBST(PAM_MODULE_DIRECTORY)
28
+
29
+
20 30
 AC_CONFIG_FILES([Makefile])
21 31
 AC_OUTPUT
32
+
33
+if test "$PAM_MODULE_DIRECTORY" = "$DEFAULT_PAM_MODULE_DIRECTORY"; then
34
+    AC_MSG_WARN([
35
+        **
36
+        ** Warning: using default value ($DEFAULT_PAM_MODULE_DIRECTORY) as
37
+        **          installation directory for PAM module; this is probably not
38
+        **          what you want. Either use the configure flag
39
+        **
40
+        **                      --with-pam-module-directory=DIRECTORY
41
+        **
42
+        **          or copy the newly built pam_dual_control.so into the correct directory
43
+        **          manually. Usually PAM modules are located in /lib/security or /lib64/security.
44
+        **])
45
+else
46
+    AC_MSG_NOTICE([PAM module installation directory: $PAM_MODULE_DIRECTORY])
47
+fi
48
+
49
+